From a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 25 Feb 2008 21:37:48 +0000 Subject: make ->filename work (again) on header --- URPM.xs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/URPM.xs b/URPM.xs index edbb151..8309408 100644 --- a/URPM.xs +++ b/URPM.xs @@ -2015,6 +2015,12 @@ Pkg_filename(pkg) memcpy(eon, savbuf, 4); } } else if (pkg->h) { + char *name = get_name(pkg->h, RPMTAG_NAME); + char *version = get_name(pkg->h, RPMTAG_VERSION); + char *release = get_name(pkg->h, RPMTAG_RELEASE); + char *arch = headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? get_name(pkg->h, RPMTAG_ARCH) : "src"; + + XPUSHs(sv_2mortal(newSVpvf("%s-%s-%s.%s.rpm", name, version, release, arch))); } # deprecated -- cgit v1.2.1