key = " ".join(split_line)
desired[key] = ""
- # Check to see which packages need removed and remove them
- for key in current.keys():
- if not desired.has_key(key):
- (package, version, architecture) = key.split()
- pkid = current[key]
- if architecture == "source":
- session.execute("""DELETE FROM src_associations WHERE id = :pkid""", {'pkid': pkid})
- else:
- session.execute("""DELETE FROM bin_associations WHERE id = :pkid""", {'pkid': pkid})
- Logger.log(["removed", key, pkid])
-
# Check to see which packages need added and add them
for key in sorted(desired.keys(), cmp=cmp_package_version):
if not current.has_key(key):
VALUES (:suiteid, :pkid)""", {'suiteid': suite_id, 'pkid': pkid})
Logger.log(["added", key, pkid])
+ # Check to see which packages need removed and remove them
+ for key in current.keys():
+ if not desired.has_key(key):
+ (package, version, architecture) = key.split()
+ pkid = current[key]
+ if architecture == "source":
+ session.execute("""DELETE FROM src_associations WHERE id = :pkid""", {'pkid': pkid})
+ else:
+ session.execute("""DELETE FROM bin_associations WHERE id = :pkid""", {'pkid': pkid})
+ Logger.log(["removed", key, pkid])
+
session.commit()
if britney:
try:
file_list = apt_pkg.ParseCommandLine(cnf.Cnf, Arguments, sys.argv);
- except SystemError, e:
+ except SystemError as e:
print "%s\n" % e
usage(1)
Options = cnf.SubTree("Control-Suite::Options")
utils.fubar("Can only perform one action at a time.")
action = i
+ # Safety/Sanity check
+ if action == "set" and (not suite.allowcsset):
+ if force:
+ utils.warn("Would not normally allow setting suite %s (allowsetcs is FALSE), but --force used" % (suite_name))
+ else:
+ utils.fubar("Will not reset suite %s due to its database configuration (allowsetcs is FALSE)" % (suite_name))
+
# Need an action...
if action == None:
utils.fubar("No action specified.")
- # Safety/Sanity check
- # XXX: This should be stored in the database
- if action == "set" and suite_name not in ["testing", "squeeze-updates"]:
- utils.fubar("Will not reset suite %s" % (suite_name))
-
britney = False
if action == "set" and cnf["Control-Suite::Options::Britney"]:
britney = True