import os
import sys
import apt_pkg
-import commands
from daklib.config import Config
from daklib.dbconn import *
Make microchanges or microqueries of the binary overrides
-h, --help show this help and exit
- -c, --check chech override compliance
+ -c, --check check override compliance
-d, --done=BUG# send priority/section change as closure to bug#
-n, --no-action don't do anything
-s, --suite specify the suite to use
arches -= set(["source", "all"])
for arch in arches:
for component in components:
- filename = "%s/dists/%s/%s/binary-%s/Packages.gz" % (cnf["Dir::Root"], suite, component, arch)
- (fd, temp_filename) = utils.temp_filename()
- (result, output) = commands.getstatusoutput("gunzip -c %s > %s" % (filename, temp_filename))
- if (result != 0):
- utils.fubar("Gunzip invocation failed!\n%s\n" % (output), result)
- filename = "%s/dists/%s/%s/debian-installer/binary-%s/Packages.gz" % (cnf["Dir::Root"], suite, component, arch)
- if os.path.exists(filename):
- (result, output) = commands.getstatusoutput("gunzip -c %s >> %s" % (filename, temp_filename))
- if (result != 0):
- utils.fubar("Gunzip invocation failed!\n%s\n" % (output), result)
- packages = utils.open_file(temp_filename)
- Packages = apt_pkg.ParseTagFile(packages)
+ Packages = utils.get_packages_from_ftp(cnf['Dir::Root'], suite, component, arch)
while Packages.Step():
package_name = Packages.Section.Find("Package")
dep_list = Packages.Section.Find("Depends")
for i in d:
if i[0] == package:
rdepends.add(package_name)
- os.unlink(temp_filename)
query = """SELECT o.package, p.level, p.priority
FROM override o
game_over()
- Logger = daklog.Logger(cnf.Cnf, "override")
+ Logger = daklog.Logger("override")
dsc_otype_id = get_override_type('dsc').overridetype_id
session.commit()
if Options.has_key("Done"):
+ if not cnf.has_key("Dinstall::BugServer"):
+ utils.warn("Asked to send Done message but Dinstall::BugServer is not configured")
+ Logger.close()
+ return
+
Subst = {}
Subst["__OVERRIDE_ADDRESS__"] = cnf["Dinstall::MyEmailAddress"]
Subst["__BUG_SERVER__"] = cnf["Dinstall::BugServer"]
Subst["__BCC__"] = "Bcc: " + ", ".join(bcc)
else:
Subst["__BCC__"] = "X-Filler: 42"
- Subst["__CC__"] = "Cc: " + package + "@" + cnf["Dinstall::PackagesServer"] + "\nX-DAK: dak override"
+ if cnf.has_key("Dinstall::PackagesServer"):
+ Subst["__CC__"] = "Cc: " + package + "@" + cnf["Dinstall::PackagesServer"] + "\nX-DAK: dak override"
+ else:
+ Subst["__CC__"] = "X-DAK: dak override"
Subst["__ADMIN_ADDRESS__"] = cnf["Dinstall::MyAdminAddress"]
Subst["__DISTRO__"] = cnf["Dinstall::MyDistribution"]
Subst["__WHOAMI__"] = utils.whoami()