summaryrefslogtreecommitdiffstats
path: root/RPM4
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4')
-rw-r--r--RPM4/src/RPM4.xs1
-rw-r--r--RPM4/t/04spec.t5
-rw-r--r--RPM4/t/test-source.spec37
3 files changed, 42 insertions, 1 deletions
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index 057617d..8fa3bff 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -2886,6 +2886,7 @@ Spec_sources(spec, is = 0)
PPCODE:
for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) {
if (is && !(srcPtr->flags & is))
+ continue;
XPUSHs(sv_2mortal(newSVpv(srcPtr->source, 0)));
}
diff --git a/RPM4/t/04spec.t b/RPM4/t/04spec.t
index 2fbbb04..555ec59 100644
--- a/RPM4/t/04spec.t
+++ b/RPM4/t/04spec.t
@@ -1,7 +1,7 @@
# $Id$
use strict;
-use Test::More tests => 24;
+use Test::More tests => 27;
use FindBin qw($Bin);
use File::Temp qw(tempdir);
use RPM4;
@@ -61,3 +61,6 @@ my ($bh) = $spec->binheader();
ok(defined($bh), "Can get binary header from spec");
ok($bh->queryformat("%{NAME}") eq "test-rpm", "can querying header give by spec");
+ok($spec = RPM4::Spec->new("$Bin/test-source.spec", force => 1), "can load spec");
+is(($spec->sources)[0], 'source.tar.gz', "can list source");
+is(($spec->sources_url)[0], 'http://rpm4.zarb.org/source.tar.gz', "can list source with url");
diff --git a/RPM4/t/test-source.spec b/RPM4/t/test-source.spec
new file mode 100644
index 0000000..3f87f82
--- /dev/null
+++ b/RPM4/t/test-source.spec
@@ -0,0 +1,37 @@
+# $Id: test-rpm.spec 109 2006-06-21 14:47:24Z nanardon $
+Summary: test rpm for perl-URPM test suite
+BuildArch: noarch
+Name: test-rpm
+Version: 1.0
+Release: 1mdk
+License: GPL
+Group: Application/Development
+BuildRoot: %{_tmppath}/%{name}-root
+Url: http://rpm4.zarb.org/
+Source: http://rpm4.zarb.org/source.tar.gz
+
+%description
+test rpm
+
+%prep
+
+%build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%_sysconfdir
+
+date >> $RPM_BUILD_ROOT%_sysconfdir/%name
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%config(noreplace) %_sysconfdir/%name
+
+%changelog
+* Thu Apr 22 2004 Olivier Thauvin <thauvin@aerov.jussieu.fr> 1-1mdk
+- initial build
+
+