X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fcontents.py;h=c2d04eb697dd683c176ebe6e1f4581887b43893a;hb=b36379705f3f2a52788ad19cf1da339c4edf339d;hp=ee904b2a2467e4f0d100e03e5dca3396e3587b14;hpb=2711accf0093a019afe9214cbb3e2b502076c444;p=dak.git diff --git a/dak/contents.py b/dak/contents.py index ee904b2a..c2d04eb6 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,9 +84,9 @@ OPTIONS for scan-source and scan-binary ################################################################################ -def write_all(cnf, suite_names = [], force = None): +def write_all(cnf, suite_names = [], component_names = [], force = None): Logger = daklog.Logger(cnf.Cnf, 'contents generate') - ContentsWriter.write_all(Logger, suite_names, force) + ContentsWriter.write_all(Logger, suite_names, component_names, force) Logger.close() ################################################################################ @@ -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()