Skip to content

Commit 048abab

Browse files
committed
Added build\helpers\genlists.py script to generate file lists for distriutive sections. Added lists of patterns for each section including unneeded.files, where all files which shouldn't go into installer belongs
1 parent 592fbb9 commit 048abab

File tree

10 files changed

+148
-3
lines changed

10 files changed

+148
-3
lines changed

build/helpers/genlists.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env python
2+
# -*- encoding: utf-8 -*-
3+
"""
4+
This script reads list of glob patterns from files, specified in the
5+
command-line and generates lists of files for each pattern
6+
"""
7+
import sys,fnmatch, os, os.path
8+
9+
filelist_name = sys.argv.pop(1)
10+
if os.path.isdir(filelist_name):
11+
# Generate filelist ourselves
12+
pwd = os.getcwd()
13+
os.chdir(filelist_name)
14+
filelist=set()
15+
for dirname,subdirlist,files in os.walk("."):
16+
dirname = dirname.replace("\\","/")
17+
for f in files:
18+
filelist.add(dirname+"/"+f)
19+
os.chdir(pwd)
20+
else:
21+
with open(filelist_name,"r") as f:
22+
filelist = set(map(lambda x:x.strip(),f.readlines()))
23+
24+
for module in sys.argv[1:]:
25+
modname = module[:module.find(".")]
26+
print >> sys.stderr,"Processing module ",modname
27+
with open(module,"r") as f:
28+
patterns = map(lambda x:x.strip(),f.readlines())
29+
for p in patterns:
30+
if p.startswith("./bin/") and not p.endswith(".dll"):
31+
patterns.append("./share/locale/*/LC_MESSAGES/"+p[6:p.rfind(".")]+"*.mo")
32+
found=set()
33+
for p in patterns:
34+
if p.startswith("#"):
35+
continue
36+
for f in filelist:
37+
if fnmatch.fnmatch(f,p):
38+
found.add(f)
39+
filelist -= found
40+
with open(modname+"_list.nsi","w") as out:
41+
curdir=""
42+
for f in sorted(found):
43+
filedir=os.path.dirname(f)
44+
if filedir !=curdir:
45+
print >>out,"SetOutDir ${INSTDIR}"+filedir[1:]
46+
curdir=filedir
47+
print >>out, "File ${PG_INS_SOURCE_DIR}"+f[1:]
48+
49+
# When all module files are processed:
50+
if len(filelist):
51+
print >>sys.stderr,"Following unprocessed files found:\n",", ".join(sorted(filelist))
52+
sys.exit(1)
53+
54+
55+
56+
57+

build/helpers/postgres_nsis_installer.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ IF "%ARCH%" == "X64" (
9797

9898

9999
CD /D %NSIS_RES_DIR% || GOTO :ERROR
100+
rem Genarate file lists
101+
%PYTHON64_PATH%/python %ROOT%/build/helpers/genlists.py client.files devel.files plperl.files plpython2.files plpython3.files unneeded.files server.files
102+
103+
rem generate installer itself
100104
makensis postgresql.nsi || GOTO :ERROR
101105

102106
GOTO :DONE

nsis/client.files

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
./bin/*.dll
2+
./bin/clusterdb.*
3+
./bin/createdb.*
4+
./bin/createuser.*
5+
./bin/dropdb.*
6+
./bin/dropuser.*
7+
./bin/pg_basebackup.*
8+
./bin/pgbench.*
9+
./bin/pg_dump.*
10+
./bin/pg_dumpall.*
11+
./bin/pg_isready.*
12+
./bin/pg_receivewal.*
13+
./bin/pg_recvlogical.*
14+
./bin/pg_restore.*
15+
./bin/psql.*
16+
./bin/reindexdb.*
17+
./bin/vacuumdb.*
18+
./bin/oid2name.*
19+
./bin/vacuumlo.*
20+
./bin/less.*
21+
./bin/lesskey.*
22+
./bin/openssl.*
23+
./share/psqlrc.sample
24+
./doc/postgresql-en.chm
25+
./doc/postgresql-ru.chm
26+
./share/locale/*/libpq*.mo
27+
./share/locale/*/pgscripts*.mo

nsis/devel.files

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
./include/*
2+
./lib/*.lib
3+
./bin/pg_config.*
4+
./bin/ecpg.*
5+
./symbols/*.pdb

nsis/plperl.files

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
./lib/*plperl.dll
2+
./share/extension/*plperl.*
3+
./share/locale/*/plperl-*.mo

nsis/plpython2.files

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
./lib/*plpython2.dll
2+
./share/extension/*plpython2u*
3+
./share/extension/*plpythonu*
4+
./share/locale/*/LC_MESSAGES/plpython-*.mo

nsis/plpython3.files

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# For future plpython3 builds.
2+
# This file should be processed before server.files and filelist
3+
# generated, but later ignored by installer. Thus plpython3 related
4+
# files wouldn't be included into installation
5+
./lib/*plpython3.dll
6+
./share/extension/*plpython3u*
7+

nsis/postgresql.nsi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Section "Client components" secClient
210210
MessageBox MB_OK|MB_ICONINFORMATION "pg_old_dir: $PG_OLD_DIR"
211211
;Call ChecExistInstall ;get port number for psql
212212

213-
!include clientlist.nsi
213+
!include client_list.nsi
214214
;SetOutPath "$INSTDIR\bin"
215215
;File /r ${PG_INS_SOURCE_DIR}\*.*
216216
;File /r ${PG_INS_SOURCE_DIR}\bin\*.*
@@ -298,7 +298,7 @@ Section $(PostgreSQLString) sec1
298298
${endif}
299299
${endif}
300300

301-
!include serverlist.nsi
301+
!include server_list.nsi
302302
;SetOutPath "$INSTDIR"
303303
;File /r ${PG_INS_SOURCE_DIR}\*.*
304304
;File /r ${PG_INS_SOURCE_DIR}\bin\*.*
@@ -2114,4 +2114,4 @@ Function .onSelChange
21142114
${endif}
21152115

21162116
${endif}
2117-
FunctionEnd
2117+
FunctionEnd

nsis/server.files

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# This file contains some quite broad catch-all wildcard patterns, so
2+
# it should be last of all modules
3+
./bin/initdb.*
4+
./bin/pg_archivecleanup.*
5+
./bin/pg_controldata.*
6+
./bin/pg_ctl.*
7+
./bin/pg_resetwal.*
8+
./bin/pg_rewind.*
9+
./bin/pg_test_fsync.*
10+
./bin/pg_test_timing.*
11+
./bin/pg_upgrade.*
12+
./bin/pg_waldump.*
13+
./bin/postgres.*
14+
./bin/postmaster.*
15+
./bin/pg_standby.*
16+
./bin/zic.*
17+
./doc/extension/*.example
18+
./doc/buildinfo.txt
19+
./lib/*.dll
20+
./share/extension/*
21+
./share/*.sample
22+
./share/*.sql
23+
./share/postgres.bki
24+
./share/*.description
25+
./share/*.shdescription
26+
./share/sql_features.txt
27+
./share/extension/plpgsql*
28+
./share/locale/*/LC_MESSAGES/plpgsql*
29+
./share/timezonesets/*
30+
./share/timezone/*
31+
./share/tsearch_data/*
32+

nsis/unneeded.files

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
./bin/pg_regress*.exe
2+
./bin/pg_isolation_regress.exe
3+
./bin/isolationtester.exe
4+
./doc/contrib/README*
5+
./doc/extension/README*
6+
./share/locale/*/LC_MESSAGES/pltcl-*.mo

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy