]> git.decadent.org.uk Git - dak.git/blobdiff - dak/process_upload.py
auto-decruft: Disable short options for NVI
[dak.git] / dak / process_upload.py
index ca210c30a0c25f030cb485d3b2e678d26ad13d35..9eb23f00309c1d5d30c74bc074ef676b7239e774 100755 (executable)
@@ -243,7 +243,7 @@ def get_processed_upload(upload):
 
     pu.changes = open(upload.changes.path, 'r').read()
     pu.changes_filename = upload.changes.filename
-    pu.sourceful = upload.changes.source is not None
+    pu.sourceful = upload.changes.sourceful
     pu.source = control.get('Source')
     pu.version = control.get('Version')
     pu.architecture = control.get('Architecture')
@@ -260,6 +260,7 @@ def accept(directory, upload):
     cnf = Config()
 
     Logger.log(['ACCEPT', upload.changes.filename])
+    print "ACCEPT"
 
     upload.install()
 
@@ -299,6 +300,7 @@ def accept_to_new(directory, upload):
     cnf = Config()
 
     Logger.log(['ACCEPT-TO-NEW', upload.changes.filename])
+    print "ACCEPT-TO-NEW"
 
     upload.install_to_new()
     # TODO: tag bugs pending
@@ -318,6 +320,7 @@ def real_reject(directory, upload, reason=None, notify=True):
     cnf = Config()
 
     Logger.log(['REJECT', upload.changes.filename])
+    print "REJECT"
 
     fs = upload.transaction.fs
     rejectdir = cnf['Dir::Reject']
@@ -382,6 +385,9 @@ def action(directory, upload):
     print
     print "\n".join(package_info)
     print
+    if len(upload.warnings) > 0:
+        print "\n".join(upload.warnings)
+        print
 
     if len(upload.reject_reasons) > 0:
         print "Reason:"
@@ -457,6 +463,13 @@ def process_it(directory, changes, keyrings, session):
     with daklib.archive.ArchiveUpload(directory, changes, keyrings) as upload:
         processed = action(directory, upload)
         if processed and not Options['No-Action']:
+            session = DBConn().session()
+            history = SignatureHistory.from_signed_file(upload.changes)
+            if history.query(session) is None:
+                session.add(history)
+                session.commit()
+            session.close()
+
             unlink_if_exists(os.path.join(directory, changes.filename))
             for fn in changes.files:
                 unlink_if_exists(os.path.join(directory, fn))