From c225d87acf5a4d5d8d36e6d8d13cc51053463b61 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Wed, 5 Jun 2013 00:18:50 +0200 Subject: [PATCH] daklib/archive.py: handle byhand files without underscores --- daklib/archive.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) 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) -- 2.39.5