summaryrefslogtreecommitdiff
path: root/cleopatre/bundle_delivery.py
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/bundle_delivery.py')
-rwxr-xr-xcleopatre/bundle_delivery.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cleopatre/bundle_delivery.py b/cleopatre/bundle_delivery.py
index 0631cbb098..709a52404a 100755
--- a/cleopatre/bundle_delivery.py
+++ b/cleopatre/bundle_delivery.py
@@ -173,7 +173,7 @@ class Tag:
version: the version of a tag. e.g. (1, 2, 0) or (1, 1, 3, "tmp").
"""
- re_tagname = re.compile("(?P<project>av)" +
+ re_tagname = re.compile("(?P<project>[a-z]+(-[a-z]+)*)" +
"-(?P<version>\d+\.\d+\.\d+)" +
"-?(?P<extra>.*)")
@@ -340,14 +340,14 @@ class BundleDiff:
def _id_tag_or_file(self, bundle):
"""Identify whether what was provided is a tag name or a filename."""
- file = None
- # First, let's suppose it's a tag.
- tag = Tag.from_tagname(bundle)
- if tag is None:
- # Maybe the filename of a bundle, then?
- tag = Tag.from_filename(bundle)
- if tag:
- file = bundle
+ # First, let's suppose it's the filename of a bundle.
+ tag = Tag.from_filename(bundle)
+ if tag:
+ file = bundle
+ else:
+ # Maybe a tag, then?
+ tag = Tag.from_tagname(bundle)
+ file = None
return (tag, file)
def gen_diff_file(self, bundle1, bundle2):