From 7b27df1c011a7f3cf074fa77578419125fd1eed4 Mon Sep 17 00:00:00 2001 From: "jkeating@dhcp83-49.boston.redhat.com" <> Date: Sat, 9 Dec 2006 21:31:00 -0500 Subject: [PATCH] Get the specific srpm used to build the binary --- pypungi/gather.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pypungi/gather.py b/pypungi/gather.py index 585aaa39..83dfdc12 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -106,7 +106,7 @@ class Gather(yum.YumBase): for po in self.polist: - srpm = po.returnSimple('sourcerpm').rsplit('-', 2)[0] + srpm = po.returnSimple('sourcerpm').strip('.src.rpm') if not srpm in self.srpmlist: self.srpmlist.append(srpm) @@ -178,10 +178,9 @@ class Gather(yum.YumBase): self.doSackSetup(archlist=['src']) for srpm in self.srpmlist: + (sname, sver, srel) = srpm.rstrip('-', 2) try: - matches = self.pkgSack.searchNevra(name=srpm) - mysack = yum.packageSack.ListPackageSack(matches) - srpmpo = mysack.returnNewestByNameArch()[0] + srpmpo = self.pkgSack.searchNevra(name=sname, ver=sver, rel=srel)[0] if not srpmpo in srpmpolist: srpmpolist.append(srpmpo) except IndexError: