X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_unchecked.py;h=26b2ae55612ff85306641d89d90268218cac9f90;hb=603d8ace7d4f942c999c29556bde38ec2516b9a8;hp=07e4592b54aa26c1eaeab774ee242d72ed5d0cf2;hpb=fdf3c42445b4f11f4cd71634dd2b57cb7d7a4f36;p=dak.git diff --git a/dak/process_unchecked.py b/dak/process_unchecked.py index 07e4592b..26b2ae55 100755 --- a/dak/process_unchecked.py +++ b/dak/process_unchecked.py @@ -91,10 +91,11 @@ def init(): ('h',"help","Dinstall::Options::Help"), ('n',"no-action","Dinstall::Options::No-Action"), ('p',"no-lock", "Dinstall::Options::No-Lock"), - ('s',"no-mail", "Dinstall::Options::No-Mail")] + ('s',"no-mail", "Dinstall::Options::No-Mail"), + ('d',"directory", "Dinstall::Options::Directory", "HasArg")] for i in ["automatic", "help", "no-action", "no-lock", "no-mail", - "override-distribution", "version"]: + "override-distribution", "version", "directory"]: Cnf["Dinstall::Options::%s" % (i)] = "" changes_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv) @@ -103,6 +104,15 @@ def init(): if Options["Help"]: usage() + # If we have a directory flag, use it to find our files + if Cnf["Dinstall::Options::Directory"] != "": + # Note that we clobber the list of files we were given in this case + # so warn if the user has done both + if len(changes_files) > 0: + utils.warn("Directory provided so ignoring files given on command line") + + changes_files = utils.get_changes_files(Cnf["Dinstall::Options::Directory"]) + Upload = queue.Upload(Cnf) changes = Upload.pkg.changes @@ -209,6 +219,9 @@ def check_changes(): except ParseChangesError, line: reject("%s: parse error, can't grok: %s." % (filename, line)) return 0 + except ChangesUnicodeError: + reject("%s: changes file not proper utf-8" % (filename)) + return 0 # Parse the Files field from the .changes into another dictionary try: @@ -697,6 +710,9 @@ def check_dsc(): reject("%s: parse error, can't grok: %s." % (dsc_filename, line)) except InvalidDscError, line: reject("%s: syntax error on line %s." % (dsc_filename, line)) + except ChangesUnicodeError: + reject("%s: dsc file not proper utf-8." % (dsc_filename)) + # Build up the file list of files mentioned by the .dsc try: dsc_files.update(utils.build_file_list(dsc, is_a_dsc=1))