From c1a20d66f13f41952f742d7cc555b2a7d9004cd4 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Sat, 28 Feb 2009 17:39:31 +0100 Subject: [PATCH] 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 --- daklib/regexes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daklib/regexes.py b/daklib/regexes.py index d1f0d381..f18e2a49 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(.*)") -- 2.39.5