[packages/pyp2rpm] do not assume we're on fedora
glen
glen at pld-linux.org
Sun Mar 17 02:21:52 CET 2013
commit 86badbede143960b5b5318bb6d47cd7ef1be482d
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Mar 17 03:21:03 2013 +0200
do not assume we're on fedora
rpmdev-packager is fedora tool, we don't have it and it's wrong to call
it unconditionally
no-rpmdev-packager.patch | 21 +++++++++++++++++++++
pyp2rpm.spec | 2 ++
2 files changed, 23 insertions(+)
---
diff --git a/pyp2rpm.spec b/pyp2rpm.spec
index d7bf7dc..aa4ffa3 100644
--- a/pyp2rpm.spec
+++ b/pyp2rpm.spec
@@ -16,6 +16,7 @@ Source0: http://pypi.python.org/packages/source/p/pyp2rpm/%{name}-%{version}.tar
Source1: %{name}-%{version}-tests.tgz
# Source1-md5: d6ffe3cd0acb10af01c99a77e6bd51f3
Patch0: default-savepath.patch
+Patch1: no-rpmdev-packager.patch
URL: https://pypi.python.org/pypi/pyp2rpm
BuildRequires: python-flexmock >= 0.9.3
BuildRequires: python-pytest
@@ -38,6 +39,7 @@ information though).
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
# Remove bundled egg-info
rm -r %{name}.egg-info
diff --git a/no-rpmdev-packager.patch b/no-rpmdev-packager.patch
new file mode 100644
index 0000000..f0e313f
--- /dev/null
+++ b/no-rpmdev-packager.patch
@@ -0,0 +1,21 @@
+--- pyp2rpm-1.0.1/pyp2rpm/package_data.py~ 2012-11-26 15:22:18.000000000 +0200
++++ pyp2rpm-1.0.1/pyp2rpm/package_data.py 2013-03-17 03:19:21.866958954 +0200
+@@ -1,6 +1,7 @@
+ import subprocess
+ import time
+ import locale
++import os
+
+ from pyp2rpm import version
+
+@@ -50,7 +51,9 @@
+ def changelog_date_packager(self):
+ """Returns part of the changelog entry, containing date and packager.
+ """
+- packager = subprocess.Popen('rpmdev-packager', stdout = subprocess.PIPE).communicate()[0].strip()
++ packager = 'unknown'
++ if os.has_key('USER'):
++ packager = os.environ['USER']
+ date_str = time.strftime('%a %b %d %Y', time.gmtime())
+ encoding = locale.getpreferredencoding()
+ return '{0} {1}'.format(date_str, packager.decode(encoding))
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/pyp2rpm.git/commitdiff/86badbede143960b5b5318bb6d47cd7ef1be482d
More information about the pld-cvs-commit
mailing list