* morituri/common/encode.py:

Before moving the newly tagged file to overwrite the original
	  one, copy over mode.
This commit is contained in:
Thomas Vander Stichele
2010-04-14 21:44:09 +00:00
parent db58d6da05
commit 3361edbee2
2 changed files with 9 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
2010-04-14 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/encode.py:
Before moving the newly tagged file to overwrite the original
one, copy over mode.
2010-04-14 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/program.py:

View File

@@ -22,6 +22,7 @@
import math
import os
import shutil
import tempfile
from morituri.common import common, task, checksum
@@ -487,6 +488,8 @@ class SafeRetagTask(task.MultiSeparateTask):
self.debug('comparing checksums %08x and %08x' % (c1, c2))
if c1 == c2:
# data is fine, so we can now move
# but first, copy original mode to our temporary file
shutil.copymode(self._path, self._tmppath)
self.debug('moving temporary file to %r' % self._path)
os.rename(self._tmppath, self._path)
else: