From 60803f32f3341d8f7ac3f5f2362392b3a04ace2f Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Tue, 11 Dec 2012 07:32:50 -0500 Subject: [PATCH] Fix getting SRPMs for nosrc arch. --- src/pypungi/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index e21be16d..67aff859 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -684,10 +684,10 @@ class Pungi(pypungi.PungiBase): """Given a package object, get a package object for the corresponding source rpm. Requires yum still configured and a valid package object.""" - srpm = po.sourcerpm.split('.src.rpm')[0] - (sname, sver, srel) = srpm.rsplit('-', 2) + nvr, arch, _ = po.sourcerpm.rsplit(".", 2) + name, ver, rel = nvr.rsplit('-', 2) try: - srpmpo = self.ayum.pkgSack.searchNevra(name=sname, ver=sver, rel=srel, arch='src')[0] + srpmpo = self.ayum.pkgSack.searchNevra(name=name, ver=ver, rel=rel, arch='src')[0] return srpmpo except IndexError: print >> sys.stderr, "Error: Cannot find a source rpm for %s" % srpm