# Installs Debian packaes
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: katie,v 1.19 2001-01-18 04:51:10 troup Exp $
+# $Id: katie,v 1.22 2001-01-23 20:27:35 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-d, --debug=VALUE debug
-k, --ack-new acknowledge new packages
-m, --manual-reject=MSG manual reject with `msg'
- -n, --dry-run don't do anything
+ -n, --no-action don't do anything
-p, --no-lock don't check lockfile !! for cron.daily only !!
-r, --no-version-check override version check
-u, --distribution=DIST override distribution to `dist'"""
(result, output) = commands.getstatusoutput("gpg --emulate-md-encode-bug --batch --no-options --no-default-keyring --always-trust --keyring=%s --keyring=%s < %s >/dev/null" % (Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"], filename))
if (result != 0):
- reject_message = "Rejected: GPG signature check failed on `%s'.\n%s\n" % (filename, output)
+ reject_message = "Rejected: GPG signature check failed on `%s'.\n%s\n" % (os.path.basename(filename), output)
return 0
return 1
# Map frozen to unstable if frozen doesn't exist
if changes["distribution"].has_key("frozen") and not Cnf.has_key("Suite::Frozen"):
del changes["distribution"]["frozen"]
+ changes["distribution"]["unstable"] = 1;
reject_message = reject_message + "Mapping frozen to unstable.\n"
# Map testing to unstable
if changes["distribution"].has_key("testing"):
del changes["distribution"]["testing"]
+ changes["distribution"]["unstable"] = 1;
reject_message = reject_message + "Mapping testing to unstable.\n"
# Ensure target distributions exist
if not Cnf.has_key("Suite::%s" % (i)):
reject_message = reject_message + "Rejected: Unknown distribution `%s'.\n" % (i)
+ # Ensure there _is_ a target distribution
+ if changes["distribution"].keys() == []:
+ reject_message = reject_message + "Rejected: huh? Distribution field is empty in changes file.\n";
+
# Map unreleased arches from stable to unstable
if changes["distribution"].has_key("stable"):
for i in changes["architecture"].keys():
if not Cnf.has_key("Suite::Stable::Architectures::%s" % (i)):
reject_message = reject_message + "Mapping stable to unstable for unreleased arch `%s'.\n" % (i)
del changes["distribution"]["stable"]
+ changes["distribution"]["unstable"] = 1;
# Map arches not being released from frozen to unstable
if changes["distribution"].has_key("frozen"):
if not Cnf.has_key("Suite::Frozen::Architectures::%s" % (i)):
reject_message = reject_message + "Mapping frozen to unstable for non-releasing arch `%s'.\n" % (i)
del changes["distribution"]["frozen"]
+ changes["distribution"]["unstable"] = 1;
# Handle uploads to stable
if changes["distribution"].has_key("stable"):
files[file]["type"] = "byhand";
# Checks for a binary package...
elif re_isadeb.match(file) != None:
+ files[file]["type"] = "deb";
+
# Extract package information using dpkg-deb
- control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(file,"r")))
+ try:
+ control = apt_pkg.ParseSection(apt_inst.debExtractControl(utils.open_file(file,"r")))
+ except:
+ reject_message = reject_message + "Rejected: %s: debExtractControl() raised %s.\n" % (file, sys.exc_type);
+ # Can't continue, none of the checks on control would work.
+ continue;
# Check for mandatory fields
if control.Find("Package") == None:
files[file]["dbtype"] = "deb";
else:
reject_message = reject_message + "Rejected: %s is neither a .deb or a .udeb.\n " % (file);
- files[file]["type"] = "deb";
files[file]["fullname"] = "%s_%s_%s.deb" % (control.Find("Package", ""), epochless_version, control.Find("Architecture", ""))
files[file]["source"] = control.Find("Source", "");
if files[file]["source"] == "":
else:
files[file]["byhand"] = 1;
files[file]["type"] = "byhand";
-
+
files[file]["oldfiles"] = {}
for suite in changes["distribution"].keys():
# Skip byhand
# Check the md5sum & size against existing files (if any)
location = Cnf["Dir::PoolDir"];
files[file]["location id"] = db_access.get_location_id (location, component, archive);
-
+
files[file]["pool name"] = utils.poolify (changes["source"], files[file]["component"]);
files_id = db_access.get_files_id(files[file]["pool name"] + file, files[file]["size"], files[file]["md5sum"], files[file]["location id"]);
if files_id == -1: