From e43efc12371fea883a8fb8658c9ded03c4b7fca0 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 11 Mar 2009 00:06:36 -0400 Subject: add --keep-lib option (off by default) to save some disk space --- server/debuginfofs-mirror | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/debuginfofs-mirror b/server/debuginfofs-mirror index 4ad110f..9dbcac3 100755 --- a/server/debuginfofs-mirror +++ b/server/debuginfofs-mirror @@ -82,6 +82,8 @@ class DebuginfoFSDownloader(YumUtilBase): help="download RPMs but don't bother unpacking them") o.add_option("--keep-src", default=False, action="store_true", help="keep the contents of /usr/src/debug from each package") + o.add_option("--keep-lib", default=False, action="store_true", + help="keep the contents of /usr/lib/debug from each package") #o.add_option("--update-mtimes", default=False, action="store_true", # help="update the mtime of all files from the given repos") @@ -334,6 +336,7 @@ def main(): # Download, unpack, and hardlink debuginfo data excludepat=None if not opt.keep_src: + # Rather than extracting and then deleting, just don't extract it excludepat="*/usr/src/debug/*" for p in unpack_packages + download_packages: if p in download_packages: @@ -360,6 +363,9 @@ def main(): # Make hardlinks r = mkdebuginfolinks(targetdir, os.path.join(opt.exportdir,'build-id')) y.logger.info("Linked %3i debuginfo file%s" % (r, r != 1 and "s" or "")) + if not opt.keep_lib: + # TODO: it'd be good to nuke all of the extra dirs + shutil.rmtree(os.path.join(targetdir,"usr/lib/debug")) if __name__ == '__main__': try: -- cgit