print """Usage: dak rm [OPTIONS] PACKAGE[...]
Remove PACKAGE(s) from suite(s).
+ -A, --no-arch-all-rdeps Do not report breaking arch:all packages
+ or Build-Depends-Indep
-a, --architecture=ARCH only act on this architecture
-b, --binary PACKAGE are binary packages to remove
-B, --binary-only remove binaries only
################################################################################
-def reverse_depends_check(removals, suite, arches=None, session=None):
+def reverse_depends_check(removals, suite, arches=None, session=None, include_arch_all=True):
print "Checking reverse dependencies..."
- if utils.check_reverse_depends(removals, suite, arches, session):
+ if utils.check_reverse_depends(removals, suite, arches, session, include_arch_all=include_arch_all):
print "Dependency problem found."
if not Options["No-Action"]:
game_over()
cnf = Config()
Arguments = [('h',"help","Rm::Options::Help"),
+ ('A','no-arch-all-rdeps','Rm::Options::NoArchAllRdeps'),
('a',"architecture","Rm::Options::Architecture", "HasArg"),
('b',"binary", "Rm::Options::Binary"),
('B',"binary-only", "Rm::Options::Binary-Only"),
('S',"source-only", "Rm::Options::Source-Only"),
]
- for i in [ "architecture", "binary", "binary-only", "carbon-copy", "component",
+ for i in [ 'NoArchAllRdeps',
+ "architecture", "binary", "binary-only", "carbon-copy", "component",
"done", "help", "no-action", "partial", "rdep-check", "reason",
"source-only", "Do-Close" ]:
if not cnf.has_key("Rm::Options::%s" % (i)):
if Options["Rdep-Check"]:
arches = utils.split_args(Options["Architecture"])
- reverse_depends_check(removals, suites[0], arches, session)
+ include_arch_all = Options['NoArchAllRdeps'] == ''
+ reverse_depends_check(removals, suites[0], arches, session, include_arch_all=include_arch_all)
# If -n/--no-action, drop out here
if Options["No-Action"]:
################################################################################
-def check_reverse_depends(removals, suite, arches=None, session=None, cruft=False, quiet=False):
+def check_reverse_depends(removals, suite, arches=None, session=None, cruft=False, quiet=False, include_arch_all=True):
dbsuite = get_suite(suite, session)
overridesuite = dbsuite
if dbsuite.overridesuite is not None:
'metakey_d_id': metakey_d.key_id,
'metakey_p_id': metakey_p.key_id,
}
- for architecture in all_arches | set(['all']):
+ if include_arch_all:
+ rdep_architectures = all_arches | set(['all'])
+ else:
+ rdep_architectures = all_arches
+ for architecture in rdep_architectures:
deps = {}
sources = {}
virtual_packages = {}
all_broken = defaultdict(set)
metakey_bd = get_or_set_metadatakey("Build-Depends", session)
metakey_bdi = get_or_set_metadatakey("Build-Depends-Indep", session)
+ if include_arch_all:
+ metakey_ids = (metakey_bd.key_id, metakey_bdi.key_id)
+ else:
+ metakey_ids = (metakey_bd.key_id,)
+
params = {
'suite_id': dbsuite.suite_id,
- 'metakey_ids': (metakey_bd.key_id, metakey_bdi.key_id),
+ 'metakey_ids': metakey_ids,
}
statement = '''
SELECT s.source, string_agg(sm.value, ', ') as build_dep