aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-25 21:37:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-25 21:37:48 +0000
commita8e10ad067fbdf55f8cd4c423fd1958b6d1a243f (patch)
tree9c3d1e255bbbfd564aab519b3d5da3c4c9b362aa
parent52930d27a49b811c6aa28bbf9bd8c592497a665e (diff)
downloadperl-URPM-a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f.tar
perl-URPM-a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f.tar.gz
perl-URPM-a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f.tar.bz2
perl-URPM-a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f.tar.xz
perl-URPM-a8e10ad067fbdf55f8cd4c423fd1958b6d1a243f.zip
make ->filename work (again) on header
-rw-r--r--URPM.xs6
1 files changed, 6 insertions, 0 deletions
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