summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2011-02-17 11:40:34 -0700
committerJesse Keating <jkeating@redhat.com>2011-02-17 11:40:34 -0700
commit13e0132532847d082b34acf63f3e77d554d7c6f6 (patch)
treeb28c336bb33326df693e745adb1487ae81af33d6
parentd9bcb58385f9bb03f6ceb2390b29f25d5951fe8c (diff)
downloadfedora-packager-13e0132532847d082b34acf63f3e77d554d7c6f6.zip
fedora-packager-13e0132532847d082b34acf63f3e77d554d7c6f6.tar.gz
fedora-packager-13e0132532847d082b34acf63f3e77d554d7c6f6.tar.xz
Clarify and make more exact the branch regex
This also catches only top level Fedora branches, without the trailing /master
-rw-r--r--src/pyfedpkg/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 17ac668..0ef21bf 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1058,8 +1058,9 @@ class PackageModule:
# Create a list of "fedoras"
fedoras = []
- # Create a regex to find f## branches. Works until Fedora 100
- branchre = re.compile('f\d\d')
+ # Create a regex to find branches that exactly match f##. Should not
+ # catch branches such as f14-foobar
+ branchre = 'f\d\d$'
# Find the repo refs
for ref in self.repo.refs:
@@ -1067,7 +1068,7 @@ class PackageModule:
if type(ref) == git.refs.RemoteReference:
# grab the top level name
branch = ref.name.split('/')[1]
- if branchre.match(branch):
+ if re.match(branchre, branch):
# Add it to the fedoras
fedoras.append(branch)
if fedoras: