From 50925f87fea1bfe642357ed4459e531d59e9e5d0 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 12 Jun 2012 17:37:42 +0000 Subject: (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 --- RPM4/src/RPM4.xs | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'RPM4/src') 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 -- cgit v1.2.1