diff options
author | Doug Freed <dwfreed@mtu.edu> | 2016-02-03 17:10:38 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-02-03 17:10:38 -0800 |
commit | 9a2f1b4a3ee83ba6259c2f0e4a6f2ea217cc22f7 (patch) | |
tree | 62b67ef8f16f9d94b0d1ecc975f34c817c6bb009 /thicken-manifests.py | |
parent | mastermirror-staging.sh: use commit time instead of author time. (diff) | |
download | mastermirror-scripts-9a2f1b4a3ee83ba6259c2f0e4a6f2ea217cc22f7.tar.gz mastermirror-scripts-9a2f1b4a3ee83ba6259c2f0e4a6f2ea217cc22f7.tar.bz2 mastermirror-scripts-9a2f1b4a3ee83ba6259c2f0e4a6f2ea217cc22f7.zip |
thicken-manifests: another tweak from dwfreed.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'thicken-manifests.py')
-rwxr-xr-x | thicken-manifests.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/thicken-manifests.py b/thicken-manifests.py index 070f00b..014a2ee 100755 --- a/thicken-manifests.py +++ b/thicken-manifests.py @@ -115,18 +115,24 @@ def maybe_thicken_manifest(pkg_dir): pass fetchlistdict = portage.FetchlistDict(pkg_dir, portage_settings, portage_portdbapi) - manifest = portage.manifest.Manifest(pkg_dir, fetchlist_dict=fetchlistdict, distdir=portage_settings['DISTDIR']) + # We use an empty dir so that we do not introduce any changes to + # existing DIST entries, or inject DIST entries that were otherwise + # missing. + manifest = portage.manifest.Manifest(pkg_dir, fetchlist_dict=fetchlistdict, distdir='/var/empty') try: manifest.create(assumeDistHashesAlways=True) except portage.exception.FileNotFound: logger.exception("%s is missing DIST entries!", pkg_dir) + # If any exception was triggered on the Manifest, it is NOT safe to write. + return + # If it changed, write it out if manifest.write(): if args.sign: try: gpg_sign(manifest.getFullname()) except: logger.exception("%s Exception thrown during GPG signing", pkg_dir) - # Always reset mtime on manifest + # Always reset mtime on manifest os.utime(manifest.getFullname(), (newest_mtime, newest_mtime)) |