Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 242905 Details for
Bug 258877
low disk space on osprey /mnt/distfiles
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
script that lists distfiles not referenced by SRC_URI for all whitelists
distfiles-whitelist-analysis.py (text/plain), 1.91 KB, created by
Zac Medico
on 2010-08-14 10:19:56 UTC
(
hide
)
Description:
script that lists distfiles not referenced by SRC_URI for all whitelists
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2010-08-14 10:19:56 UTC
Size:
1.91 KB
patch
obsolete
>#!/usr/bin/env python > >import optparse >import os >import sys > >import portage > >def get_src_uri_set(): > distfiles = set() > portdb = portage.portdb > for cp in portdb.cp_all(): > for cpv in portdb.cp_list(cp): > distfiles.update(portdb.getFetchMap(cpv)) > return distfiles > >def get_whitelists(whitelist_dir): > whilelists = {} > for whitelist_name in os.listdir(whitelist_dir): > if whitelist_name[:1] == '.': > continue > p = os.path.join(whitelist_dir, whitelist_name) > if not os.path.isfile(p): > continue > contents = set() > for line in open(p, 'r'): > filename = line.strip() > if not filename or filename[:1] == "#": > continue > contents.add(filename) > if contents: > whilelists[whitelist_name] = contents > return whilelists > >def distfile_whilelist_analysis(whitelist_dir): > src_uri_set = get_src_uri_set() > whitelists = get_whitelists(whitelist_dir) > for whitelist_name in sorted(whitelists): > whilelist_only = set() > for filename in whitelists[whitelist_name]: > if filename not in src_uri_set: > whilelist_only.add(filename) > if whilelist_only: > sys.stdout.write("%s\t" % whitelist_name) > sys.stdout.write("\t".join(sorted(whilelist_only))) > sys.stdout.write("\n") > return os.EX_OK > >if __name__ == "__main__": > description = "Generate a list of files that are ONLY " + \ > "present because they are whitelisted (and not " + \ > "pulled in by anything in the current tree), and " + \ > "which whitelist they are in." > usage = "usage: %s PORTDIR WHITELIST_DIR" % \ > os.path.basename(sys.argv[0]) > parser = optparse.OptionParser(description=description, usage=usage) > options, args = parser.parse_args() > if len(args) != 2: > parser.error('expected 2 args, got %d' % len(args)) > for x in args: > if not os.path.isdir(x): > parser.error("%s is not a directory" % x) > portdir, whitelist_dir = args > os.environ['PORTDIR'] = portdir > os.environ['PORTDIR_OVERLAY'] = '' > retval = distfile_whilelist_analysis(whitelist_dir) > sys.exit(retval)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 258877
:
242741
| 242905 |
242909