]> err.no Git - dak/commitdiff
Correctly match version part of source tarballs
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 4 Jun 2012 15:48:24 +0000 (17:48 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 14 Jun 2012 08:45:14 +0000 (10:45 +0200)
The version part must not be greedy in order to not include the .orig.tar.*
part.  Also add .debian.tar.* which I forgot earlier.

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
daklib/regexes.py

index 15b79a6368170e988b7fa8428f917359b4395907..3da3b298793f89e74ec621108034dadede600a40 100755 (executable)
@@ -141,7 +141,7 @@ re_includeinpdiff = re.compile(r"(Translation-[a-zA-Z_]+\.(?:bz2|xz))")
 re_file_safe = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_.:~+-]*$')
 
 # Prefix of binary and source filenames
-_re_file_prefix = '^(?P<package>[a-z0-9][a-z0-9.+-]+)_(?P<version>[A-Za-z0-9.:~+-]+)'
+_re_file_prefix = '^(?P<package>[a-z0-9][a-z0-9.+-]+)_(?P<version>[A-Za-z0-9.:~+-]+?)'
 
 # Match binary packages
 # Groups: package, version, architecture, type
@@ -153,7 +153,7 @@ re_file_dsc = re.compile(_re_file_prefix + r'\.dsc$')
 
 # Match other source files
 # Groups: package, version
-re_file_source = re.compile(_re_file_prefix + r'(?:(?:\.orig(?:-[a-zA-Z0-9-]+)?)?\.tar\.(?:bz2|gz|xz)|\.diff\.gz)$')
+re_file_source = re.compile(_re_file_prefix + r'(?:(?:\.orig(?:-[a-zA-Z0-9-]+)?|\.debian)?\.tar\.(?:bz2|gz|xz)|\.diff\.gz)$')
 
 # Match upstream tarball
 # Groups: package, version