X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=katie;h=1ee6352d2553547f3438394a0fd886684f2f8a68;hb=2cf57557d3fd5661a541428d258b4142d26bbc96;hp=1532a5e1725b9978ef142a4287d774be2acd6cd8;hpb=8e7b460758fb8a59697f2a95f1dc6279a676998f;p=dak.git diff --git a/katie b/katie index 1532a5e1..1ee6352d 100755 --- a/katie +++ b/katie @@ -2,7 +2,7 @@ # Installs Debian packaes # Copyright (C) 2000 James Troup -# $Id: katie,v 1.26 2001-01-31 03:36:36 troup Exp $ +# $Id: katie,v 1.27 2001-02-04 04:27:47 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 @@ -39,8 +39,6 @@ import utils, db_access ############################################################################### re_isanum = re.compile (r'^\d+$'); -re_isadeb = re.compile (r'.*\.u?deb$'); -re_issource = re.compile (r'(.+)_(.+?)\.(orig\.tar\.gz|diff\.gz|tar\.gz|dsc)'); re_changes = re.compile (r'changes$'); re_default_answer = re.compile(r"\[(.*)\]"); re_fdnic = re.compile("\n\n"); @@ -159,7 +157,10 @@ def in_override_p (package, component, suite, binary_type, file): def check_changes(filename): global reject_message, changes, files - # Parse the .changes field into a dictionary [FIXME - need to trap errors, pass on to reject_message etc.] + # Default in case we bail out + changes["maintainer822"] = Cnf["Dinstall::MyEmailAddress"]; + + # Parse the .changes field into a dictionary try: changes = utils.parse_changes(filename, 0) except utils.cant_open_exc: @@ -167,10 +168,9 @@ def check_changes(filename): return 0; except utils.changes_parse_error_exc, line: reject_message = "Rejected: error parsing changes file '%s', can't grok: %s.\n" % (filename, line) - changes["maintainer822"] = Cnf["Dinstall::MyEmailAddress"]; return 0; - # Parse the Files field from the .changes into another dictionary [FIXME need to trap errors as above] + # Parse the Files field from the .changes into another dictionary try: files = utils.build_file_list(changes, ""); except utils.changes_parse_error_exc, line: @@ -296,7 +296,7 @@ def check_files(): files[file]["byhand"] = 1; files[file]["type"] = "byhand"; # Checks for a binary package... - elif re_isadeb.match(file) != None: + elif utils.re_isadeb.match(file) != None: files[file]["type"] = "deb"; # Extract package information using dpkg-deb @@ -350,7 +350,7 @@ def check_files(): files[file]["source"] = files[file]["package"]; # Checks for a source package... else: - m = re_issource.match(file) + m = utils.re_issource.match(file) if m != None: files[file]["package"] = m.group(1) files[file]["version"] = m.group(2) @@ -941,7 +941,7 @@ def stable_install (changes_filename, summary, short_summary): for file in files.keys(): if files[file]["type"] == "deb": new_changelog.write("stable/%s/binary-%s/%s\n" % (files[file]["component"], files[file]["architecture"], file)); - elif re_issource.match(file) != None: + elif utils.re_issource.match(file) != None: new_changelog.write("stable/%s/source/%s\n" % (files[file]["component"], file)); else: new_changelog.write("%s\n" % (file)); @@ -984,8 +984,8 @@ 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 utils.cant_overwrite_exc: - sys.stderr.write("W: couldn't overwrite existing file '%s/REJECT/%s" % (Cnf["Dir::IncomingDir"], base_changes_filename)); + except: + sys.stderr.write("W: couldn't reject changes file '%s' [Got %s]" % (base_changes_filename, sys.exc_type)); pass; for file in files.keys(): if os.path.exists(file):