From: Ansgar Burchardt Date: Tue, 4 Jun 2013 22:18:50 +0000 (+0200) Subject: daklib/archive.py: handle byhand files without underscores X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=c225d87acf5a4d5d8d36e6d8d13cc51053463b61;p=dak.git daklib/archive.py: handle byhand files without underscores --- diff --git a/daklib/archive.py b/daklib/archive.py index 81719a87..410e9cab 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -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)