]> git.donarmstrong.com Git - dak.git/blobdiff - dak/process_upload.py
Initial pass at dak web server
[dak.git] / dak / process_upload.py
index bf5cda591d210c71ef735999b0a2643e11a04134..1518d262ad78bc42f221a1630f90804f5578ee1a 100755 (executable)
@@ -212,7 +212,7 @@ def try_or_reject(function):
         try:
             return function(directory, upload, *args, **kwargs)
         except (daklib.archive.ArchiveException, daklib.checks.Reject) as e:
-            reason = e
+            reason = unicode(e)
         except Exception as e:
             reason = "There was an uncaught exception when processing your upload:\n{0}\nAny original reject reason follows below.".format(traceback.format_exc())
 
@@ -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')
@@ -251,6 +251,8 @@ def get_processed_upload(upload):
 
     pu.program = "process-upload"
 
+    pu.warnings = upload.warnings
+
     return pu
 
 @try_or_reject
@@ -258,6 +260,7 @@ def accept(directory, upload):
     cnf = Config()
 
     Logger.log(['ACCEPT', upload.changes.filename])
+    print "ACCEPT"
 
     upload.install()
 
@@ -297,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
@@ -316,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']
@@ -380,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:"