- Fix expand option not to fail if files are missing since socket activation

service files are not shipped in the sdist
This commit is contained in:
Scott Kitterman
2020-01-04 01:47:24 -05:00
parent def89db250
commit a8bf7104bc
2 changed files with 28 additions and 21 deletions
+4
View File
@@ -1,3 +1,7 @@
1.2.1
- Fix expand option not to fail if files are missing since socket activation
service files are not shipped in the sdist
1.2.0 2020-01-03 1.2.0 2020-01-03
- Add support for SigningTable, KeyTable, and KeyTableEd25519 (LP: #1797397) - Add support for SigningTable, KeyTable, and KeyTableEd25519 (LP: #1797397)
- Add support for specifying MinimumKeyBits for RSA signatures - Add support for specifying MinimumKeyBits for RSA signatures
+24 -21
View File
@@ -53,29 +53,32 @@ class FileMacroExpand(distutils.cmd.Command):
'system/dkimpy-milter.service', 'system/dkimpy-milter', \ 'system/dkimpy-milter.service', 'system/dkimpy-milter', \
'system/dkimpy-milter.openrc', \ 'system/dkimpy-milter.openrc', \
'system/socket-activation/dkimpy-milter.service', \ 'system/socket-activation/dkimpy-milter.service', \
'system/socket-activation/dkimpy-milter.socket',] 'system/socket-activation/dkimpy-milter.socket', ]
for infile in files: for infile in files:
outfile = '' outfile = ''
filein = open(infile + '.in') try:
for line in filein: filein = open(infile + '.in')
for function in ["@SYSCONFDIR@", "@CONFDIR@", "@SBINDIR@", "@BINDIR@", "@RUNSTATEDIR@"]: for line in filein:
splitline = line.split(function) for function in ["@SYSCONFDIR@", "@CONFDIR@", "@SBINDIR@", "@BINDIR@", "@RUNSTATEDIR@"]:
if len(splitline) > 1: splitline = line.split(function)
if function == "@SYSCONFDIR@": if len(splitline) > 1:
line = splitline[0] + self.sysconfigdir + splitline[1] if function == "@SYSCONFDIR@":
elif function == "@CONFDIR@": line = splitline[0] + self.sysconfigdir + splitline[1]
line = splitline[0] + self.configdir + splitline[1] elif function == "@CONFDIR@":
elif function == "@SBINDIR@": line = splitline[0] + self.configdir + splitline[1]
line = splitline[0] + self.sbindir + splitline[1] elif function == "@SBINDIR@":
elif function == "@BINDIR@": line = splitline[0] + self.sbindir + splitline[1]
line = splitline[0] + self.bindir + splitline[1] elif function == "@BINDIR@":
elif function == "@RUNSTATEDIR@": line = splitline[0] + self.bindir + splitline[1]
line = splitline[0] + self.rundir + splitline[1] elif function == "@RUNSTATEDIR@":
outfile += line line = splitline[0] + self.rundir + splitline[1]
out = open(infile, 'w') outfile += line
for line in outfile: out = open(infile, 'w')
out.write(line) for line in outfile:
out.close() out.write(line)
out.close()
except FileNotFoundError as x:
pass
kw = {} # Work-around for lack of 'or' requires in setuptools. kw = {} # Work-around for lack of 'or' requires in setuptools.
try: try: