################################################################################
import pg, sys, time
-import utils, database, logging
import apt_pkg
+import daklib.utils, daklib.database, daklib.logging
################################################################################
################################################################################
-import errno, os, re, sys
-import utils
+import errno, os, pg, re, sys
import apt_pkg, apt_inst
-import pg, database
+import daklib.database, daklib.utils
################################################################################
new_files_id = daklib.database.get_files_id(new_filename, file_size, file_md5sum, dsc_location_id)
if new_files_id == None:
daklib.utils.copy(old_filename, Cnf["Dir::Pool"] + new_filename)
- new_files_id = database.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id)
+ new_files_id = daklib.database.set_files_id(new_filename, file_size, file_md5sum, dsc_location_id)
projectB.query("UPDATE dsc_files SET file = %s WHERE source = %s AND file = %s" % (new_files_id, source_id, orig_tar_id))
# Install the files into the pool
if suite not in Cnf.ValueList("Dinstall::QueueBuildSuites"):
continue
now_date = time.strftime("%Y-%m-%d %H:%M")
- suite_id = database.get_suite_id(suite)
+ suite_id = daklib.database.get_suite_id(suite)
dest_dir = Cnf["Dir::QueueBuild"]
if Cnf.FindB("Dinstall::SecurityQueueBuild"):
dest_dir = os.path.join(dest_dir, suite)
if not ql:
daklib.utils.fubar("[INTERNAL ERROR] couldn't find '%s' (%s) in source table." % (package, version))
source_id = ql[0][0]
- suite_id = database.get_suite_id('proposed-updates')
+ suite_id = daklib.database.get_suite_id('proposed-updates')
projectB.query("DELETE FROM src_associations WHERE suite = '%s' AND source = '%s'" % (suite_id, source_id))
- suite_id = database.get_suite_id('stable')
+ suite_id = daklib.database.get_suite_id('stable')
projectB.query("INSERT INTO src_associations (suite, source) VALUES ('%s', '%s')" % (suite_id, source_id))
# Add the binaries to stable (and remove it/them from proposed-updates)
q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND (a.arch_string = '%s' OR a.arch_string = 'all') AND b.architecture = a.id" % (package, version, architecture))
ql = q.getresult()
if not ql:
- suite_id = database.get_suite_id('proposed-updates')
+ suite_id = daklib.database.get_suite_id('proposed-updates')
que = "SELECT b.version FROM binaries b JOIN bin_associations ba ON (b.id = ba.bin) JOIN suite su ON (ba.suite = su.id) WHERE b.package = '%s' AND (ba.suite = '%s')" % (package, suite_id)
q = projectB.query(que)
break
if not binNMU:
binary_id = ql[0][0]
- suite_id = database.get_suite_id('proposed-updates')
+ suite_id = daklib.database.get_suite_id('proposed-updates')
projectB.query("DELETE FROM bin_associations WHERE suite = '%s' AND bin = '%s'" % (suite_id, binary_id))
- suite_id = database.get_suite_id('stable')
+ suite_id = daklib.database.get_suite_id('stable')
projectB.query("INSERT INTO bin_associations (suite, bin) VALUES ('%s', '%s')" % (suite_id, binary_id))
else:
del files[file]
new[pkg]["othercomponents"] = f["othercomponents"]
for suite in changes["suite"].keys():
- suite_id = database.get_suite_id(suite)
+ suite_id = daklib.database.get_suite_id(suite)
for pkg in new.keys():
- component_id = database.get_component_id(new[pkg]["component"])
- type_id = database.get_override_type_id(new[pkg]["type"])
+ component_id = daklib.database.get_component_id(new[pkg]["component"])
+ type_id = daklib.database.get_override_type_id(new[pkg]["type"])
q = projectB.query("SELECT package FROM override WHERE package = '%s' AND suite = %s AND component = %s AND type = %s" % (pkg, suite_id, component_id, type_id))
ql = q.getresult()
if ql:
section = new[pkg]["section"]
priority = new[pkg]["priority"]
type = new[pkg]["type"]
- new[pkg]["section id"] = database.get_section_id(section)
- new[pkg]["priority id"] = database.get_priority_id(new[pkg]["priority"])
+ new[pkg]["section id"] = daklib.database.get_section_id(section)
+ new[pkg]["priority id"] = daklib.database.get_priority_id(new[pkg]["priority"])
# Sanity checks
if (section == "debian-installer" and type != "udeb") or \
(section != "debian-installer" and type == "udeb"):
daklib.utils.fubar("invalid type (%s) for new. Dazed, confused and sure as heck not continuing." % (type))
# Validate the override type
- type_id = database.get_override_type_id(type)
+ type_id = daklib.database.get_override_type_id(type)
if type_id == -1:
daklib.utils.fubar("invalid type (%s) for new. Say wha?" % (type))
projectB.query("BEGIN WORK")
for suite in changes["suite"].keys():
- suite_id = database.get_suite_id(suite)
+ suite_id = daklib.database.get_suite_id(suite)
for pkg in new.keys():
- component_id = database.get_component_id(new[pkg]["component"])
- type_id = database.get_override_type_id(new[pkg]["type"])
+ component_id = daklib.database.get_component_id(new[pkg]["component"])
+ type_id = daklib.database.get_override_type_id(new[pkg]["type"])
priority_id = new[pkg]["priority id"]
section_id = new[pkg]["section id"]
projectB.query("INSERT INTO override (suite, component, type, package, priority, section, maintainer) VALUES (%s, %s, %s, '%s', %s, %s, '')" % (suite_id, component_id, type_id, pkg, priority_id, section_id))
changes["suite"][override] = 1
# Validate suites
for suite in changes["suite"].keys():
- suite_id = database.get_suite_id(suite)
+ suite_id = daklib.database.get_suite_id(suite)
if suite_id == -1:
daklib.utils.fubar("%s has invalid suite '%s' (possibly overriden). say wha?" % (changes, suite))
break
if queue:
print "%s for %s\n%s%s" % (
- daklib.queue.upper(), ", ".join(changes["distribution"].keys()),
+ queue.upper(), ", ".join(changes["distribution"].keys()),
reject_message, summary),
queuekey = queue[0].upper()
if queuekey in "RQSA":
daklib.utils.fubar("need at least one .changes filename as an argument.")
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
- database.init(Cnf, projectB)
+ daklib.database.init(Cnf, projectB)
Upload = daklib.queue.Upload(Cnf)
Logger = Upload.Logger = daklib.logging.Logger(Cnf, "reject-proposed-updates")
os.close(reject_fd)
# Remove the packages from proposed-updates
- suite_id = database.get_suite_id('proposed-updates')
+ suite_id = daklib.database.get_suite_id('proposed-updates')
projectB.query("BEGIN WORK")
# Remove files from proposed-updates suite
usage()
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
- database.init(Cnf, projectB)
+ daklib.database.init(Cnf, projectB)
# Sanity check options
if not arguments:
suites_list = daklib.utils.join_with_commas_and(suites)
if not Options["No-Action"]:
for suite in suites:
- suite_id = database.get_suite_id(suite)
+ suite_id = daklib.database.get_suite_id(suite)
if suite_id != -1:
suite_ids_list.append(suite_id)
if suite == "stable":
maintainer_list = []
for maintainer_id in maintainers.keys():
- maintainer_list.append(database.get_maintainer(maintainer_id))
+ maintainer_list.append(daklib.database.get_maintainer(maintainer_id))
summary = ""
removals = d.keys()
removals.sort()
logfile.write("----------------------------------------------\n")
logfile.flush()
- dsc_type_id = database.get_override_type_id('dsc')
- deb_type_id = database.get_override_type_id('deb')
+ dsc_type_id = daklib.database.get_override_type_id('dsc')
+ deb_type_id = daklib.database.get_override_type_id('deb')
# Do the actual deletion
print "Deleting...",
projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]))
- database.init(Cnf, projectB)
+ daklib.database.init(Cnf, projectB)
find_dislocated_stable(Cnf, projectB)