[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master 01/29] daklib/regexes.py: updates to support new source files



The regex re_issource is modified to recognize the new compression scheme
supported by the 3.0 source package formats. Also add the
the debian.tar file used by 3.0 (quilt) and 2.0 and the
.orig-component.tar for additional upstream tarballs.

Add a new regex re_is_orig_source to know if a file correspond
to some upstream source tarballs (where the version should not have a
debian revision).

Add new regexes re_source_ext and re_orig_source_ext to match only the
extension of source files. And reuse those in the definition of
re_is_orig_source and re_issource to avoid duplication.

Signed-off-by: Raphael Hertzog <hertzog@debian.org>
---
 daklib/regexes.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/daklib/regexes.py b/daklib/regexes.py
index d1f0d38..f18e2a4 100755
--- a/daklib/regexes.py
+++ b/daklib/regexes.py
@@ -42,7 +42,11 @@ re_arch_from_filename = re.compile(r"/binary-[^/]+/")
 re_extract_src_version = re.compile (r"(\S+)\s*\((.*)\)")
 re_isadeb = re.compile (r"(.+?)_(.+?)_(.+)\.u?deb$")
 
-re_issource = re.compile (r"(.+)_(.+?)\.(orig\.tar\.gz|diff\.gz|tar\.gz|dsc)$")
+orig_source_ext_re = r"orig(?:-.+)?\.tar\.(?:gz|bz2|lzma)"
+re_orig_source_ext = re.compile(orig_source_ext_re + "$")
+re_source_ext = re.compile("(" + orig_source_ext_re + r"|debian\.tar\.(?:gz|bz2|lzma)|diff\.gz|tar\.(?:gz|bz2|lzma)|dsc)$")
+re_issource = re.compile(r"(.+)_(.+?)\." + re_source_ext.pattern)
+re_is_orig_source = re.compile (r"(.+)_(.+?)\.orig(?:-.+)?\.tar\.(?:gz|bz2|lzma)$")
 
 re_single_line_field = re.compile(r"^(\S*?)\s*:\s*(.*)")
 re_multi_line_field = re.compile(r"^\s(.*)")
-- 
1.6.3.3



Reply to: