[entropy.tools] tarinfo.utime() is buggy and when used, it screws files mtime

The inaccuracy has been measured and is > 10 seconds. Probably a tarinfo
bug somewhere, but I don't care. There is no need to (re)set mtime on
extracted files because they already hold right and original values.
This commit is contained in:
Fabio Erculiani
2010-11-26 14:56:41 +01:00
parent f2e60e6b8f
commit 9efbab85bf

View File

@@ -1822,12 +1822,20 @@ def uncompress_tarball(filepath, extract_path = None, catch_empty = False):
try:
tar.chown(tarinfo, epath)
fix_uid_gid(tarinfo, epath)
tar.utime(tarinfo, epath)
# mode = tarinfo.mode
# xorg-server /usr/bin/X symlink of /usr/bin/Xorg
# which is setuid. Symlinks don't need chmod. PERIOD!
if not os.path.islink(epath):
tar.chmod(tarinfo, epath)
# no longer touch utime using Tarinfo, behaviour seems
# buggy and introduces an unwanted delay on some conditions.
# match /bin/tar behaviour to not fuck touch mtime/atime at all
# I wonder who are the idiots who didn't even test how
# tar.utime behaves. Or perhaps it's just me that I've found
# a new bug. Issue is, packages are prepared on PC A, and
# mtime is checked on PC B.
# tar.utime(tarinfo, epath)
except tarfile.ExtractError:
if tar.errorlevel > 1:
raise