From 5f7a129c6c1d3a7b2782272260b98f4a1de992a6 Mon Sep 17 00:00:00 2001 From: nanardon Date: Sun, 22 Jul 2007 00:23:50 +0000 Subject: - fix #7: installsrpms return one value in scalar context git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@140 971eb68f-4bfb-0310-8326-d2484c010a4c --- RPM4/src/RPM4.xs | 2 ++ RPM4/t/04spec.t | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'RPM4') diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index bbbe741..bc430c2 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -475,12 +475,14 @@ void _installsrpms(rpmts ts, char * filename) { const char * specfile = NULL; const char * cookies = NULL; dSP; + I32 gimme = GIMME_V; if (rpmInstallSource( ts, filename, &specfile, &cookies) == 0) { XPUSHs(sv_2mortal(newSVpv(specfile, 0))); + if (gimme == G_ARRAY) XPUSHs(sv_2mortal(newSVpv(cookies, 0))); } PUTBACK; diff --git a/RPM4/t/04spec.t b/RPM4/t/04spec.t index 555ec59..d63cf33 100644 --- a/RPM4/t/04spec.t +++ b/RPM4/t/04spec.t @@ -1,7 +1,7 @@ # $Id$ use strict; -use Test::More tests => 27; +use Test::More tests => 28; use FindBin qw($Bin); use File::Temp qw(tempdir); use RPM4; @@ -21,6 +21,7 @@ RPM4::add_macro("_gpg_name RPM4 test key"); RPM4::add_macro("_gpg_path $Bin/gnupg"); ok((RPM4::installsrpm("$Bin/test-rpm-1.0-1mdk.src.rpm"))[0] =~ m/test-rpm\.spec$/, "installsrpms works"); +like(RPM4::installsrpm("$Bin/test-rpm-1.0-1mdk.src.rpm"), '/test-rpm\.spec$/', "installsrpms works"); ok(!RPM4::installsrpm("$Bin/test-rpm-1.0-1mdk.noarch.rpm"), "installsrpms works"); my $spec; -- cgit v1.2.1