summaryrefslogtreecommitdiffstats
path: root/src/pyfedpkg
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2011-01-30 14:26:13 -0700
committerJesse Keating <jkeating@redhat.com>2011-01-30 14:31:52 -0700
commit74cffab0516897e2056c753f5cd39d696962328c (patch)
treee2176145cce6ed40da036094715c6c2f628e16db /src/pyfedpkg
parentdaf42e7a8a89b41decb1526ee158a6ee60795512 (diff)
downloadfedora-packager-74cffab0516897e2056c753f5cd39d696962328c.tar.gz
fedora-packager-74cffab0516897e2056c753f5cd39d696962328c.tar.xz
fedora-packager-74cffab0516897e2056c753f5cd39d696962328c.zip
If we don't have a remote branch, query koji (#619979)
This looks to see what tag 'dist-rawhide' will build into, which will tell us good info about the dist values.
Diffstat (limited to 'src/pyfedpkg')
-rw-r--r--src/pyfedpkg/__init__.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py
index 90c4582..7577823 100644
--- a/src/pyfedpkg/__init__.py
+++ b/src/pyfedpkg/__init__.py
@@ -1044,11 +1044,18 @@ class PackageModule:
if branchre.match(branch):
# Add it to the fedoras
fedoras.append(branch)
-
- # Sort the list
- fedoras.sort()
- # Start with the last item, strip the f, add 1, return it.
- return(int(fedoras[-1].strip('f')) + 1)
+ if fedoras:
+ # Sort the list
+ fedoras.sort()
+ # Start with the last item, strip the f, add 1, return it.
+ return(int(fedoras[-1].strip('f')) + 1)
+ else:
+ if not self.anonkojisession:
+ self.init_koji()
+ # We may not have Fedoras. Find out what rawhide target does.
+ rawhidetarget = self.kojisession.getBuildTarget('dist-rawhide')
+ desttag = rawhidetarget['dest_tag_name']
+ return desttag.strip('dist-f')
def _getlocalarch(self):
"""Get the local arch as defined by rpm"""