RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Per Øyvind Karlsen Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 28-Feb-2010 04:19:37 Branch: rpm-5_2 Handle: 2010022803193601 Modified files: (Branch: rpm-5_2) rpm CHANGES rpm/python Makefile.am rpm/python/test test_rpm.py Log: python: make sure that we always use our own rpm build and macros. Summary: Revision Changes Path 1.2970.2.46 +2 -0 rpm/CHANGES 1.84.2.4 +2 -1 rpm/python/Makefile.am 1.1.2.5 +22 -5 rpm/python/test/test_rpm.py ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.2970.2.45 -r1.2970.2.46 CHANGES --- rpm/CHANGES 28 Feb 2010 01:20:10 -0000 1.2970.2.45 +++ rpm/CHANGES 28 Feb 2010 03:19:36 -0000 1.2970.2.46 @@ -1,4 +1,6 @@ 5.2.0 -> 5.2.1: + - proyvind: python: make sure that we always use our own rpm build and + macros. - proyvind: filetriggers: don't pass filename as argument to scripts, (all) filenames are passed through stdin already. - afb: permit building with js-1.7.0 (the only released version) @@ . patch -p0 <<'@@ .' Index: rpm/python/Makefile.am ============================================================================ $ cvs diff -u -r1.84.2.3 -r1.84.2.4 Makefile.am --- rpm/python/Makefile.am 25 Jul 2009 02:37:12 -0000 1.84.2.3 +++ rpm/python/Makefile.am 28 Feb 2010 03:19:36 -0000 1.84.2.4 @@ -62,5 +62,6 @@ # FIXME: using .libs/ is not really correct, but whatever check-local: - @export PYTHONPATH=$(PYTHONPATH):$(shell pwd):$(shell pwd)/.libs/ && \ + @export PYTHONPATH=$(PYTHONPATH):$(shell pwd):$(shell pwd)/.libs/ \ + TOP_BUILDDIR=$(abs_top_builddir) && \ cd test && python test_rpm.py @@ . patch -p0 <<'@@ .' Index: rpm/python/test/test_rpm.py ============================================================================ $ cvs diff -u -r1.1.2.4 -r1.1.2.5 test_rpm.py --- rpm/python/test/test_rpm.py 18 Nov 2009 22:20:59 -0000 1.1.2.4 +++ rpm/python/test/test_rpm.py 28 Feb 2010 03:19:37 -0000 1.1.2.5 @@ -21,8 +21,17 @@ self.topdir = "%s/tmp" % os.getcwdu() self.package = "%s/RPMS/noarch/simple-1.0-1-foo2009.1.noarch.rpm" % self.topdir - build = subprocess.Popen(["--define", "_topdir %s" % self.topdir, "-bb", "resources/simple.spec"], - executable="rpm", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) + top_builddir = os.getenv("TOP_BUILDDIR") + if top_builddir: + rpm_cmd = "%s/rpm" % top_builddir + args = ["--macros", "%s/macros" % top_builddir] + else: + rpm_cmd = "rpm" + args = [] + args.extend(["--define", "_topdir %s" % self.topdir, "-bb", "resources/simple.spec"]) + + build = subprocess.Popen(args, + executable=rpm_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) self.assertFalse(build.wait()) self.assertTrue(os.path.isfile(self.package)) @@ -72,7 +81,7 @@ # then again with distepoch self.assertEqual(rpm.labelCompare(yes, no), 1) self.assertEqual(rpm.labelCompare(no, yes), -1) - self.assertEqual(rpm.labelCompare(no, no), 0) + self.assertEqual(rpm.labelCompare(no, no), 0) class Test_upgrade(unittest.TestCase): @@ -85,16 +94,24 @@ ("%s/RPMS/noarch/simple-1.0-12-foo2009.1.noarch.rpm" % self.topdir, ("--define", "rsuffix 2")), ("%s/RPMS/noarch/simple2-1.0-12-foo2009.1.noarch.rpm" % self.topdir, ("--define", "nsuffix 2", "--define", "rsuffix 2"))) + top_builddir = os.getenv("TOP_BUILDDIR") + if top_builddir: + rpm_cmd = "%s/rpm" % top_builddir + args = ["--macros", "%s/macros" % top_builddir] + else: + rpm_cmd = "rpm" + args = [] + args.extend(["--define", "_topdir %s" % self.topdir, "-bb", "resources/simple.spec"]) + for pl in self.first, self.second: for p in pl: - args = ["--define", "_topdir %s" % self.topdir, "-bb", "resources/simple.spec"] if len(p) == 2: filename = p[0] args.extend(p[1]) else: filename = p build = subprocess.Popen(args, - executable="rpm", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) + executable=rpm_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) self.assertFalse(build.wait()) self.assertTrue(os.path.isfile(filename)) @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
