Commit 3ea6efe3 authored by Julien Muchembled's avatar Julien Muchembled

Fix install of OpenVPN hooks

This fixes a regression caused by commit
  8df410f7
parent 65cda477
...@@ -27,9 +27,13 @@ def copy_file(self, infile, outfile, *args, **kw): ...@@ -27,9 +27,13 @@ def copy_file(self, infile, outfile, *args, **kw):
if m and not self.dry_run: if m and not self.dry_run:
log.info("copying and adjusting %s -> %s", infile, outfile) log.info("copying and adjusting %s -> %s", infile, outfile)
executable = self.distribution.command_obj['build'].executable executable = self.distribution.command_obj['build'].executable
with open(outfile, "wb") as dst: patched = "#!%s%s\n" % (executable, m.group(1) or '')
dst.write("#!%s%s\n" % (executable, m.group(1) or '')) patched += src.read()
dst.write(src.read()) dst = os.open(outfile, os.O_CREAT | os.O_WRONLY | os.O_TRUNC)
try:
os.write(dst, patched)
finally:
os.close(dst)
return outfile, 1 return outfile, 1
cls, = self.__class__.__bases__ cls, = self.__class__.__bases__
return cls.copy_file(self, infile, outfile, *args, **kw) return cls.copy_file(self, infile, outfile, *args, **kw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment