X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontents.py;h=76effc1d91306069203f498cd4169488c3643862;hb=d8056122484c9767c601f66587e6c6d955bd6420;hp=ee904b2a2467e4f0d100e03e5dca3396e3587b14;hpb=40970b8f6af57da3b1a65237e7bc6af7ba77ec73;p=dak.git diff --git a/dak/contents.py b/dak/contents.py index ee904b2a..76effc1d 100755 --- a/dak/contents.py +++ b/dak/contents.py @@ -70,6 +70,9 @@ OPTIONS for generate -s, --suite={stable,testing,unstable,...} only operate on specified suite names + -c, --component={main,contrib,non-free} + only operate on specified components + -f, --force write Contents files for suites marked as untouchable, too @@ -81,15 +84,15 @@ OPTIONS for scan-source and scan-binary ################################################################################ -def write_all(cnf, suite_names = [], force = None): - Logger = daklog.Logger(cnf.Cnf, 'contents generate') - ContentsWriter.write_all(Logger, suite_names, force) +def write_all(cnf, suite_names = [], component_names = [], force = None): + Logger = daklog.Logger('contents generate') + ContentsWriter.write_all(Logger, suite_names, component_names, force) Logger.close() ################################################################################ def binary_scan_all(cnf, limit): - Logger = daklog.Logger(cnf.Cnf, 'contents scan-binary') + Logger = daklog.Logger('contents scan-binary') result = BinaryContentsScanner.scan_all(limit) processed = '%(processed)d packages processed' % result remaining = '%(remaining)d packages remaining' % result @@ -99,7 +102,7 @@ def binary_scan_all(cnf, limit): ################################################################################ def source_scan_all(cnf, limit): - Logger = daklog.Logger(cnf.Cnf, 'contents scan-source') + Logger = daklog.Logger('contents scan-source') result = SourceContentsScanner.scan_all(limit) processed = '%(processed)d packages processed' % result remaining = '%(remaining)d packages remaining' % result @@ -112,12 +115,14 @@ def main(): cnf = Config() cnf['Contents::Options::Help'] = '' cnf['Contents::Options::Suite'] = '' + cnf['Contents::Options::Component'] = '' cnf['Contents::Options::Limit'] = '' cnf['Contents::Options::Force'] = '' - arguments = [('h', "help", 'Contents::Options::Help'), - ('s', "suite", 'Contents::Options::Suite', "HasArg"), - ('l', "limit", 'Contents::Options::Limit', "HasArg"), - ('f', "force", 'Contents::Options::Force'), + arguments = [('h', "help", 'Contents::Options::Help'), + ('s', "suite", 'Contents::Options::Suite', "HasArg"), + ('c', "component", 'Contents::Options::Component', "HasArg"), + ('l', "limit", 'Contents::Options::Limit', "HasArg"), + ('f', "force", 'Contents::Options::Force'), ] args = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv) options = cnf.SubTree('Contents::Options') @@ -137,12 +142,13 @@ def main(): binary_scan_all(cnf, limit) return - suite_names = utils.split_args(options['Suite']) + suite_names = utils.split_args(options['Suite']) + component_names = utils.split_args(options['Component']) force = bool(options['Force']) if args[0] == 'generate': - write_all(cnf, suite_names, force) + write_all(cnf, suite_names, component_names, force) return usage()