]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/upload.py: Silently accept and discard .buildinfo files
authorNiels Thykier <niels@thykier.net>
Mon, 14 Dec 2015 20:46:28 +0000 (20:46 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 31 Dec 2015 11:31:23 +0000 (12:31 +0100)
Besides some very trivial validation of the filename, accept
.buildinfo files without really looking at them.

Signed-off-by: Niels Thykier <niels@thykier.net>
daklib/regexes.py
daklib/upload.py

index ae8fd91de66acf7cd39aedf6ce09f91cbf3ded22..8b548ce96259ee7d056439fe8d380869cccbc3cb 100644 (file)
@@ -141,6 +141,10 @@ re_file_source = re.compile(_re_file_prefix + r'(?:(?:\.orig(?:-[a-zA-Z0-9-]+)?|
 # Groups: package, version
 re_file_orig = re.compile(_re_file_prefix + r'\.orig(?:-[a-zA-Z0-9-]+)?(?:\.tar\.(?:bz2|gz|xz)|\.asc)')
 
+# Match buildinfo file
+# Groups: package, version, suffix
+re_file_buildinfo = re.compile(_re_file_prefix + r'_(?P<suffix>[a-zA-Z0-9+]+)\.buildinfo$')
+
 ######################################################################
 # Patterns matching fields                                           #
 ######################################################################
index b78d100fe55c5e59d48f03338a9ec11a9a0edff9..4c10f45f4e433e36bfd40a40fcff31673f2fc5b9 100644 (file)
@@ -374,6 +374,8 @@ class Changes(object):
         for f in self.files.itervalues():
             if re_file_dsc.match(f.filename) or re_file_source.match(f.filename) or re_file_binary.match(f.filename):
                 continue
+            if re_file_buildinfo.match(f.filename):
+                continue
             if f.section != 'byhand' and f.section[:4] != 'raw-':
                 raise InvalidChangesException("{0}: {1} looks like a byhand package, but is in section {2}".format(self.filename, f.filename, f.section))
             byhand.append(f)