]> git.decadent.org.uk Git - dak.git/commitdiff
process_unchecked: better support for autobyhand handling (gives script
authorAnthony Towns <aj@azure.humbug.org.au>
Wed, 5 Dec 2007 07:26:02 +0000 (07:26 +0000)
committerAnthony Towns <aj@azure.humbug.org.au>
Wed, 5 Dec 2007 07:26:02 +0000 (07:26 +0000)
full .changes file, will leave as BYHAND if script fails)

dak/process_unchecked.py

index c4ebd99472e9d820746a25ff5483a20a99addc80..412ad64aa9088f5f30be8a64401d7a82d526651f 100755 (executable)
@@ -421,7 +421,7 @@ def check_files():
             files[file]["type"] = "unreadable"
             continue
         # If it's byhand skip remaining checks
-        if files[file]["section"] == "byhand" or files[file]["section"] == "raw-installer":
+        if files[file]["section"] == "byhand" or files[file]["section"][4:] == "raw-":
             files[file]["byhand"] = 1
             files[file]["type"] = "byhand"
         # Checks for a binary package...
@@ -1339,23 +1339,32 @@ def is_autobyhand ():
     return any_auto and all_auto
 
 def do_autobyhand (summary, short_summary):
-    print "Accepting AUTOBYHAND."
+    print "Attempting AUTOBYHAND."
+    byhandleft = 0
     for file in files.keys():
-       byhandfile = file
+        byhandfile = file
+        if not files[file].has_key("byhand"):
+            continue
         if not files[file].has_key("byhand-script"):
-           # problem!
-           pass
-       else:
-           os.system("ls -l %s" % byhandfile)
-            result = os.system("%s %s %s %s" % (
-               files[file]["byhand-script"], byhandfile, 
-               changes["version"], files[file]["byhand-arch"]))
-           if result != 0:
-               print "error?"
-       os.unlink(byhandfile)
-       del files[file]
-
-    accept(summary, short_summary)
+            byhandleft = 1
+            continue
+
+        os.system("ls -l %s" % byhandfile)
+        result = os.system("%s %s %s %s %s" % (
+                files[file]["byhand-script"], byhandfile, 
+                changes["version"], files[file]["byhand-arch"],
+                os.path.abspath(pkg.changes_file)))
+        if result == 0:
+            os.unlink(byhandfile)
+            del files[file]
+        else:
+            print "Error processing %s, left as byhand." % (file)
+            byhandleft = 1
+
+    if byhandleft:
+        do_byhand(summary, short_summary)
+    else:
+        accept(summary, short_summary)
 
 ################################################################################