diff options
author | Will Woods <wwoods@redhat.com> | 2009-03-11 00:06:36 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2009-03-11 00:06:36 -0400 |
commit | e43efc12371fea883a8fb8658c9ded03c4b7fca0 (patch) | |
tree | 2f445e109f637eb9f6f4d444b45d5da533a1959a | |
parent | baccd06887bee04cf7b507ad0970d8df53aaaae2 (diff) | |
download | debuginfofs-e43efc12371fea883a8fb8658c9ded03c4b7fca0.tar.gz debuginfofs-e43efc12371fea883a8fb8658c9ded03c4b7fca0.tar.xz debuginfofs-e43efc12371fea883a8fb8658c9ded03c4b7fca0.zip |
add --keep-lib option (off by default) to save some disk space
-rwxr-xr-x | server/debuginfofs-mirror | 6 |
1 files changed, 6 insertions, 0 deletions
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: |