Skip to content

Commit

Permalink
esky.patch: preserve file mode when patching a file
Browse files Browse the repository at this point in the history
  • Loading branch information
rfk committed Apr 11, 2011
1 parent e069998 commit 335c7c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ v0.9.3

* Preliminary support for a "callback" argument to Esky.auto_update,
which is called with a dict of status info as update progresses.
* esky.patch: preserve file mode when patching a file.
* DefaultVersionFinder.open_url: ensure that f.size is always an int.

v0.9.2
Expand Down
3 changes: 3 additions & 0 deletions esky/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ def _check_begin_patch(self):
else:
self.infile = BytesIO("".encode("ascii"))
self.outfile = open(self.new_target,"wb")
if os.path.isfile(self.target):
mod = os.stat(self.target).st_mode
os.chmod(self.new_target,mod)

def _check_end_patch(self):
"""Finish patching the current file, if there is one.
Expand Down

0 comments on commit 335c7c9

Please sign in to comment.