# Installs Debian packaes
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: katie,v 1.1.1.1 2000-11-24 00:20:08 troup Exp $
+# $Id: katie,v 1.5 2000-11-30 04:19:30 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
def check_signature (filename):
global reject_message
- (result, output) = commands.getstatusoutput("gpg --emulate-md-encode-bug --batch --no-options --no-default-keyring --always-trust --load-extension rsaref --keyring=%s --keyring=%s < %s >/dev/null" % (Cnf["Dinstall::PGPKeyring"], Cnf["Dinstall::GPGKeyring"], filename))
+ (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)
return 0
def in_override_p (package, component, suite):
global overrides;
+ # Avoid <undef> on unknown distributions
+ if db_access.get_suite_id(suite) == -1:
+ return None;
+
# FIXME: nasty non-US speficic hack
if string.lower(component[:7]) == "non-us/":
component = component[7:];
if re_isanum.match (i) == None:
reject_message = reject_message + "Rejected: `%s' from Closes field isn't a number.\n" % (i)
-
# 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"]
else:
reject_message = reject_message + "Rejected"
reject_message = reject_message + ": %s Old version `%s' >= new version `%s'.\n" % (file, oldfile["version"], files[file]["version"])
+ # Check for existing copies of the file
+ q = projectB.query("SELECT b.id FROM binaries b, architecture a WHERE b.package = '%s' AND b.version = '%s' AND a.arch_string = '%s' AND a.id = b.architecture" % (files[file]["package"], files[file]["version"], files[file]["architecture"]))
+ if q.getresult() != []:
+ reject_message = reject_message + "Rejected: can not overwrite existing copy of '%s' already in the archive.\n" % (file)
+
# Find any old .dsc files
elif files[file]["type"] == "dsc":
q = projectB.query("SELECT s.id, s.version, f.filename, l.path, c.name FROM source s, src_associations sa, suite su, location l, component c, files f WHERE s.source = '%s' AND su.suite_name = '%s' AND sa.source = s.id AND sa.suite = su.id AND f.location = l.id AND l.component = c.id AND f.id = s.file"
if files.has_key(dsc_file):
actual_md5 = files[dsc_file]["md5sum"]
found = "%s in incoming" % (dsc_file)
+ # Check the file does not already exist in the archive
+ q = projectB.query("SELECT f.id FROM files f, location l WHERE f.filename ~ '/%s' AND l.id = f.location" % (dsc_file));
+ if q.getresult() != []:
+ reject_message = reject_message + "Rejected: can not overwrite existing copy of '%s' already in the archive.\n" % (dsc_file)
elif dsc_file[-12:] == ".orig.tar.gz":
# Check in Incoming
# See comment above process_it() for explanation...
continue;
if actual_md5 != dsc_files[dsc_file]["md5sum"]:
reject_message = reject_message + "Rejected: md5sum for %s doesn't match %s.\n" % (found, file)
-
+
if string.find(reject_message, "Rejected:") != -1:
return 0
else:
# Copy the .changes file across for suite which need it.
for suite in changes["distribution"].keys():
- if Cnf.has_key("Suties::%s::CopyChanges" % (suite)):
- destination = Cnf["Dir::RootDir"] + Cnf["Suite::%s::CopyChanges" % (suite)] + os.path.basename(changes_filename)
- copy_file (changes_filename, destination)
+ if Cnf.has_key("Suite::%s::CopyChanges" % (suite)):
+ utils.copy (changes_filename, Cnf["Dir::RootDir"] + Cnf["Suite::%s::CopyChanges" % (suite)]);
# If the .orig.tar.gz is in a legacy directory we need to poolify
# it, so that apt-get source (and anything else that goes by the
summary = ""
for dist in changes["distribution"].keys():
- list = Cnf["Suite::%s::Announce" % (dist)]
- if lists_done.has_key(list):
+ list = Cnf.Find("Suite::%s::Announce" % (dist))
+ if list == None or lists_done.has_key(list):
continue
lists_done[list] = 1
summary = summary + "Announcing to %s\n" % (list)