[PATCH 1/2] mock-with-analysis: do not hard-wire rpm top directory

Kamil Dudka kdudka at redhat.com
Mon Feb 18 15:51:42 UTC 2013


---
 mock-with-analysis |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mock-with-analysis b/mock-with-analysis
index 9964c45..9390fb0 100755
--- a/mock-with-analysis
+++ b/mock-with-analysis
@@ -96,9 +96,12 @@ def setup_chroot(mockcfg, srpmpath):
         mockcfg.cmd(['--install', 'cppcheck'])
         mockcfg.cmd(['--install', 'clang-analyzer'])
 
+        # Read the rpm top directory (e.g. /home/david/rpmbuild)
+        rpmtopdir = Popen(["rpm", "--eval", "%{_topdir}"], stdout=PIPE).communicate()[0].rstrip()
+
         # Install the pre-built gcc-python-plugin (from the firehose branch):
         mockcfg.cmd(['--install',
-                      '/home/david/rpmbuild/RPMS/x86_64/gcc-python2-plugin-0.11.firehose-1.fc17.x86_64.rpm'])
+                      rpmtopdir + '/RPMS/x86_64/gcc-python2-plugin-0.11.firehose-1.fc17.x86_64.rpm'])
 
         # Copy up latest version of the libcpychecker code from a working copy
         # overriding the copy from the pre-built plugin:
@@ -113,7 +116,7 @@ def setup_chroot(mockcfg, srpmpath):
         # FIXME: package these and get them into Fedora:
         mockcfg.cmd(['--install', '../firehose/dist/firehose-0.0.1-1.noarch.rpm'])
         mockcfg.cmd(['--install', '../gccinvocation/dist/gccinvocation-0.0.1-1.noarch.rpm'])
-        mockcfg.cmd(['--install', '/home/david/rpmbuild/RPMS/x86_64/python-subprocess32-3.2.3-1.fc17.x86_64.rpm'])
+        mockcfg.cmd(['--install', rpmtopdir + '/RPMS/x86_64/python-subprocess32-3.2.3-1.fc17.x86_64.rpm'])
         # ^^^ review request for python-subprocess32:
         #        https://bugzilla.redhat.com/show_bug.cgi?id=910891
 
-- 
1.7.1



More information about the firehose-devel mailing list