show this help and exit
OPTIONS for generate
+ -a, --archive=ARCHIVE
+ only operate on suites in the specified archive
+
-s, --suite={stable,testing,unstable,...}
only operate on specified suite names
################################################################################
-def write_all(cnf, suite_names = [], component_names = [], force = None):
+def write_all(cnf, archive_names = [], suite_names = [], component_names = [], force = None):
Logger = daklog.Logger('contents generate')
- ContentsWriter.write_all(Logger, suite_names, component_names, force)
+ ContentsWriter.write_all(Logger, archive_names, suite_names, component_names, force)
Logger.close()
################################################################################
cnf['Contents::Options::Limit'] = ''
cnf['Contents::Options::Force'] = ''
arguments = [('h', "help", 'Contents::Options::Help'),
+ ('a', 'archive', 'Contents::Options::Archive', 'HasArg'),
('s', "suite", 'Contents::Options::Suite', "HasArg"),
('c', "component", 'Contents::Options::Component', "HasArg"),
('l', "limit", 'Contents::Options::Limit', "HasArg"),
binary_scan_all(cnf, limit)
return
+ archive_names = utils.split_args(options['Archive'])
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, component_names, force)
+ write_all(cnf, archive_names, suite_names, component_names, force)
return
usage()
class_.logger.log(result)
@classmethod
- def write_all(class_, logger, suite_names = [], component_names = [], force = False):
+ def write_all(class_, logger, archive_names = [], suite_names = [], component_names = [], force = False):
'''
Writes all Contents files for suites in list suite_names which defaults
to all 'touchable' suites if not specified explicitely. Untouchable
class_.logger = logger
session = DBConn().session()
suite_query = session.query(Suite)
+ if len(archive_names) > 0:
+ suite_query = suite_query.join(Suite.archive).filter(Archive.archive_name.in_(archive_names))
if len(suite_names) > 0:
suite_query = suite_query.filter(Suite.suite_name.in_(suite_names))
component_query = session.query(Component)