* morituri/common/encode.py:
Before moving the newly tagged file to overwrite the original one, copy over mode.
This commit is contained in:
@@ -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>
|
2010-04-14 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* morituri/common/program.py:
|
* morituri/common/program.py:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from morituri.common import common, task, checksum
|
from morituri.common import common, task, checksum
|
||||||
@@ -487,6 +488,8 @@ class SafeRetagTask(task.MultiSeparateTask):
|
|||||||
self.debug('comparing checksums %08x and %08x' % (c1, c2))
|
self.debug('comparing checksums %08x and %08x' % (c1, c2))
|
||||||
if c1 == c2:
|
if c1 == c2:
|
||||||
# data is fine, so we can now move
|
# 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)
|
self.debug('moving temporary file to %r' % self._path)
|
||||||
os.rename(self._tmppath, self._path)
|
os.rename(self._tmppath, self._path)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user