summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-12 17:37:42 +0000
committertv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-12 17:37:42 +0000
commit50925f87fea1bfe642357ed4459e531d59e9e5d0 (patch)
treefb8dbaee2fb38a44e22a91d2a2884020cccce90f
parentb0b46a26f18f30dadc0edcba91310c7d86ddb09f (diff)
downloadperl-RPM4-50925f87fea1bfe642357ed4459e531d59e9e5d0.tar
perl-RPM4-50925f87fea1bfe642357ed4459e531d59e9e5d0.tar.gz
perl-RPM4-50925f87fea1bfe642357ed4459e531d59e9e5d0.tar.bz2
perl-RPM4-50925f87fea1bfe642357ed4459e531d59e9e5d0.tar.xz
perl-RPM4-50925f87fea1bfe642357ed4459e531d59e9e5d0.zip
(fullname) alias nevr() on it, thus getting rid of deprecated pre-rpm-4.6 headerGetNEVR()
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@198 971eb68f-4bfb-0310-8326-d2484c010a4c
-rw-r--r--RPM4/src/RPM4.xs25
1 files changed, 14 insertions, 11 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index d155979..871f39f 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -1217,6 +1217,8 @@ Header_queryformat(h, query)
void
Header_fullname(h)
Header h
+ ALIAS:
+ nevr= 1
PREINIT:
I32 gimme = GIMME_V;
char *name;
@@ -1228,34 +1230,35 @@ Header_fullname(h)
name = get_name(h, RPMTAG_NAME);
version = get_name(h, RPMTAG_VERSION);
release = get_name(h, RPMTAG_RELEASE);
- arch = get_arch(h);
+ if (ix != 1)
+ arch = get_arch(h);
if (gimme == G_SCALAR) {
+ if (ix == 1) {
+ mXPUSHs(newSVpvf("%s-%s-%s", name, version, release));
+ } else {
mXPUSHs(newSVpvf("%s-%s-%s.%s",
name,
version,
release,
headerIsEntry(h, RPMTAG_SOURCERPM) ? arch : "src"
));
+ }
} else if (gimme == G_ARRAY) {
EXTEND(SP, 4);
PUSHs(sv_2mortal(newSVpv(name, 0)));
PUSHs(sv_2mortal(newSVpv(version, 0)));
PUSHs(sv_2mortal(newSVpv(release, 0)));
- if (!headerIsEntry(h, RPMTAG_SOURCERPM)) {
- PUSHs(sv_2mortal(newSVpv("src", 0)));
- } else {
- PUSHs(sv_2mortal(newSVpv(arch, 0)));
+ if (ix != 1) {
+ if (!headerIsEntry(h, RPMTAG_SOURCERPM)) {
+ PUSHs(sv_2mortal(newSVpv("src", 0)));
+ } else {
+ PUSHs(sv_2mortal(newSVpv(arch, 0)));
+ }
}
}
}
-void
-Header_nevr(header)
- Header header
- PPCODE:
- PUSHs(sv_2mortal(newSVpv(headerGetNEVR(header, NULL), 0)));
-
int
Header_issrc(h)
Header h