]> git.donarmstrong.com Git - dak.git/commitdiff
daklib/archive.py: handle byhand files without underscores
authorAnsgar Burchardt <ansgar@debian.org>
Tue, 4 Jun 2013 22:18:50 +0000 (00:18 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Tue, 4 Jun 2013 22:18:50 +0000 (00:18 +0200)
daklib/archive.py

index 81719a8731871ef2a4e24903328f518d80774f57..410e9cabd7eabbcdc2d2ac243ed45faf0edc088f 100644 (file)
@@ -1061,14 +1061,26 @@ class ArchiveUpload(object):
 
         remaining = []
         for f in byhand:
-            parts = f.filename.split('_', 2)
-            if len(parts) != 3:
-                print "W: unexpected byhand filename {0}. No automatic processing.".format(f.filename)
-                remaining.append(f)
-                continue
+            if '_' in f.filename:
+                parts = f.filename.split('_', 2)
+                if len(parts) != 3:
+                    print "W: unexpected byhand filename {0}. No automatic processing.".format(f.filename)
+                    remaining.append(f)
+                    continue
+
+                package, version, archext = parts
+                arch, ext = archext.split('.', 1)
+            else:
+                parts = f.filename.split('.')
+                if len(parts) < 2:
+                    print "W: unexpected byhand filename {0}. No automatic processing.".format(f.filename)
+                    remaining.append(f)
+                    continue
 
-            package, version, archext = parts
-            arch, ext = archext.split('.', 1)
+                package = parts[0]
+                version = '0'
+                arch = 'all'
+                ext = parts[-1]
 
             try:
                 rule = automatic_byhand_packages.subtree(package)