X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=katie;h=ed35d8dcc8984db7189d4a7ea4d82725deecd973;hb=5144a464766f5c2ed592b5fa81e2943992f0c1fe;hp=98083dea5378c93eb507a2653fde8ea608d77811;hpb=997f4432f3c09863ff906a55f5205245352f56b5;p=dak.git diff --git a/katie b/katie index 98083dea..ed35d8dc 100755 --- a/katie +++ b/katie @@ -2,7 +2,7 @@ # Installs Debian packaes # Copyright (C) 2000 James Troup -# $Id: katie,v 1.13 2000-12-19 17:23:03 troup Exp $ +# $Id: katie,v 1.15 2000-12-20 08:15: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 @@ -460,7 +460,8 @@ def check_dsc (): # locations of an .orig.tar.gz. for dsc_file in dsc_files.keys(): if files.has_key(dsc_file): - actual_md5 = files[dsc_file]["md5sum"] + actual_md5 = files[dsc_file]["md5sum"]; + actual_size = int(files[dsc_file]["size"]); found = "%s in incoming" % (dsc_file) # Check the file does not already exist in the archive if not changes.has_key("stable upload"): @@ -474,6 +475,7 @@ def check_dsc (): if len(ql) > 0: old_file = ql[0][0] + ql[0][1]; actual_md5 = apt_pkg.md5sum(utils.open_file(old_file,"r")); + actual_size = os.stat(old_file)[stat.ST_SIZE]; found = old_file; suite_type = ql[0][2]; dsc_files[dsc_file]["files id"] = ql[0][3]; # need this for updating dsc_files in install() @@ -500,7 +502,9 @@ def check_dsc (): reject_message = reject_message + "Rejected: %s refers to %s, but I can't find it in Incoming." % (file, dsc_file); continue; if actual_md5 != dsc_files[dsc_file]["md5sum"]: - reject_message = reject_message + "Rejected: md5sum for %s doesn't match %s.\n" % (found, file) + reject_message = reject_message + "Rejected: md5sum for %s doesn't match %s.\n" % (found, file); + if actual_size != int(dsc_files[dsc_file]["size"]): + reject_message = reject_message + "Rejected: size for %s doesn't match %s.\n" % (found, file); if string.find(reject_message, "Rejected:") != -1: return 0 @@ -851,13 +855,15 @@ def reject (changes_filename, manual_reject_mail_filename): # Move the .changes files and it's contents into REJECT/ (if we can; errors are ignored) try: utils.move (changes_filename, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename)); - except cant_overwrite_exc: + except utils.cant_overwrite_exc: + sys.stderr.write("W: couldn't overwrite existing file '%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename)); pass; for file in files.keys(): - if os.access(file,os.R_OK) == 0: + if os.path.exists(file): try: utils.move (file, "%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], file)); - except cant_overwrite_exc: + except utils.cant_overwrite_exc: + sys.stderr.write("W: couldn't overwrite existing file '%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], file)); pass; # If this is not a manual rejection generate the .reason file and rejection mail message