From 21497f8d0da9b9884ed879907cf223c401008393 Mon Sep 17 00:00:00 2001 From: nanardon Date: Fri, 20 Jul 2007 08:07:42 +0000 Subject: - fix spec->source ignoring everything git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@133 971eb68f-4bfb-0310-8326-d2484c010a4c --- RPM4/t/04spec.t | 5 ++++- RPM4/t/test-source.spec | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 RPM4/t/test-source.spec (limited to 'RPM4/t') 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 1-1mdk +- initial build + + -- cgit v1.2.1