commit 7d80e7eedd59f6e2615faae81662375f81b05540
Author: Leigh Scott <leigh123linux(a)googlemail.com>
Date: Fri Mar 29 14:05:50 2019 +0000
Fix --dist/--release option for 'master' %dist detection
koji_destname.patch | 40 ++++++++++++++++++++++++++++++++++++++++
rfpkg.spec | 7 ++++++-
2 files changed, 46 insertions(+), 1 deletion(-)
---
diff --git a/koji_destname.patch b/koji_destname.patch
new file mode 100644
index 0000000..2b86a5d
--- /dev/null
+++ b/koji_destname.patch
@@ -0,0 +1,40 @@
+--- a/src/rfpkg/__init__.py
++++ b/src/rfpkg/__init__.py
+@@ -228,6 +228,10 @@
+ 'default method: %s' % e)
+ super(Commands, self).load_user()
+
++ def _tag2version(self, dest_tag):
++ """ get the '26' part of 'f26-foo' string
"""
++ return dest_tag.split('-')[0].replace('f', '')
++
+ # New functionality
+ def _findmasterbranch(self):
+ """Find the right "rpmfusion" for
master"""
+@@ -235,11 +239,7 @@
+ # If we already have a koji session, just get data from the source
+ if self._kojisession:
+ rawhidetarget = self.kojisession.getBuildTarget('rawhide-free')
+- desttag = rawhidetarget['dest_tag_name']
+- desttag=desttag.split('-')
+- desttag.remove('free')
+- desttag=''.join(desttag)
+- return desttag.replace('f', '')
++ return self._tag2version(rawhidetarget['dest_tag_name'])
+ else:
+ # We may not have Fedoras. Find out what rawhide target does.
+ try:
+@@ -249,11 +249,7 @@
+ # We couldn't hit koji, bail.
+ raise pyrpkg.rpkgError('Unable to query koji to find rawhide \
+ target')
+- desttag = rawhidetarget['dest_tag_name']
+- desttag=desttag.split('-')
+- desttag.remove('free')
+- desttag=''.join(desttag)
+- return desttag.replace('f', '')
++ return self._tag2version(rawhidetarget['dest_tag_name'])
+
+ def _determine_runtime_env(self):
+ """Need to know what the runtime env is, so we can unset
anything
+
diff --git a/rfpkg.spec b/rfpkg.spec
index 2c66da4..ed01296 100644
--- a/rfpkg.spec
+++ b/rfpkg.spec
@@ -5,13 +5,14 @@
Name: rfpkg
Version: 1.25.6
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: RPM Fusion utility for working with dist-git
License: GPLv2+
Group: Applications/System
URL:
https://github.com/rpmfusion-infra/rfpkg
Source0: %url/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: py3.patch
+Patch1: koji_destname.patch
BuildArch: noarch
@@ -88,6 +89,7 @@ RPM Fusion utility for working with dist-git.
%if 0%{?fedora} > 29 || 0%{?rhel} > 8
%patch0 -p1
%endif
+%patch1 -p1
%build
%if %{with python2}
@@ -143,6 +145,9 @@ install -p -m 0644 rfpkg.1 $RPM_BUILD_ROOT%{_mandir}/man1
%changelog
+* Fri Mar 29 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.25.6-4
+- Fix --dist/--release option for 'master' %dist detection
+
* Tue Mar 26 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 1.25.6-3
- Fix python2 shebang in python3 build