summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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"""