RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Olivier Thauvin Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 02-Dec-2007 02:01:25 Branch: HEAD Handle: 2007120201012401 Modified files: rpm/perl RPM_Spec.xs rpm/perl/RPM Spec.pm rpm/perl/t 00.pod.coverage.t 09.spec.t Log: - perl: end test and doc for RPM::Spec object Summary: Revision Changes Path 1.4 +39 -2 rpm/perl/RPM/Spec.pm 1.10 +0 -36 rpm/perl/RPM_Spec.xs 1.10 +0 -3 rpm/perl/t/00.pod.coverage.t 1.2 +16 -1 rpm/perl/t/09.spec.t ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/perl/RPM/Spec.pm ============================================================================ $ cvs diff -u -r1.3 -r1.4 Spec.pm --- rpm/perl/RPM/Spec.pm 12 Sep 2007 07:05:44 -0000 1.3 +++ rpm/perl/RPM/Spec.pm 2 Dec 2007 01:01:25 -0000 1.4 @@ -4,7 +4,6 @@ use Exporter; use RPM; - =head1 NAME RPM::Spec @@ -15,7 +14,7 @@ =head1 FUNCTIONS -E<61>new($specfile, %options) +=head2 new($specfile, %options) Create a new B<RPM::Spec> object over $specfile spec file. @@ -35,6 +34,44 @@ =back +=head2 srcheader + +Return a L<RPM::Header> object about the futur source rpm + +=head2 binheader + +Return an array of L<RPM::Header> object about futur binaries rpms + +=head2 srcrpm + +Return the full path where srcrpm will located after build + +=head2 binrpm + +Return an array containing path where binaries rpms will be located after +build + +=head2 check + +Perform build dependencies check, return undef if everythings is fine, or +a L<RPM::Problems> object containing list of issue. + +=head2 build( $flags ) + +Build rpms from the specfile. $flags is either an integer, either an array ref +of build step to perform. + +=head2 specfile + +Return the specfile location. + +=head2 sources + +Return an array listing sources included in the specfile. + +=head2 sources_url + +Return an array listing sources url included in the specfile. =cut # currently everything is in the XS code @@ . patch -p0 <<'@@ .' Index: rpm/perl/RPM_Spec.xs ============================================================================ $ cvs diff -u -r1.9 -r1.10 RPM_Spec.xs --- rpm/perl/RPM_Spec.xs 2 Dec 2007 00:21:29 -0000 1.9 +++ rpm/perl/RPM_Spec.xs 2 Dec 2007 01:01:24 -0000 1.10 @@ -218,39 +218,3 @@ XPUSHs(sv_2mortal(newSVpv(srcPtr->fullSource, 0))); } -void -icon(spec) - Spec spec - PREINIT: - Package pkg; - PPCODE: - /* TODO obsoletes ? - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - char * dest = NULL; - int len; - if (!pkg->icon) - continue; - len = strlen(pkg->icon->source); - dest = malloc(len); - memcpy(dest, pkg->icon->source, len); - XPUSHs(sv_2mortal(newSVpv(dest, len))); - } */ - -void -icon_url(spec) - Spec spec - PREINIT: - Package pkg; - /* TODO obsoletes ? - PPCODE: - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - char * dest = NULL; - int len; - if (!pkg->icon) - continue; - len = strlen(pkg->icon->fullSource); - dest = malloc(len); - memcpy(dest, pkg->icon->fullSource, len); - XPUSHs(sv_2mortal(newSVpv(dest, len))); - } */ - @@ . patch -p0 <<'@@ .' Index: rpm/perl/t/00.pod.coverage.t ============================================================================ $ cvs diff -u -r1.9 -r1.10 00.pod.coverage.t --- rpm/perl/t/00.pod.coverage.t 15 Aug 2007 20:35:28 -0000 1.9 +++ rpm/perl/t/00.pod.coverage.t 2 Dec 2007 01:01:25 -0000 1.10 @@ -14,8 +14,5 @@ pod_coverage_ok( "RPM::Problems", "RPM::Problems is covered" ); pod_coverage_ok( "RPM::Files", "RPM::Files is covered" ); pod_coverage_ok( "RPM::Dependencies", "RPM::Dependencies is covered" ); -SKIP: { - skip "File Spec under works", 1; pod_coverage_ok( "RPM::Spec", "RPM::Spec is covered" ); -} @@ . patch -p0 <<'@@ .' Index: rpm/perl/t/09.spec.t ============================================================================ $ cvs diff -u -r1.1 -r1.2 09.spec.t --- rpm/perl/t/09.spec.t 7 Aug 2007 00:09:59 -0000 1.1 +++ rpm/perl/t/09.spec.t 2 Dec 2007 01:01:25 -0000 1.2 @@ -1,6 +1,21 @@ #!/bin/env perl use strict; -use Test::More tests => 1; +use Test::More tests => 11; use_ok('RPM::Spec'); + +my $spec = RPM::Spec->new('test-rpm.spec'); +isa_ok($spec, 'RPM::Spec'); +my $srcheader = $spec->srcheader; +isa_ok($srcheader, 'RPM::Header'); +my @binheaders = $spec->binheader; +isa_ok($binheaders[0], 'RPM::Header'); +like($spec->srcrpm, '/^\/.*\/test-rpm-1.0-1.src.rpm$/', "can get srcrpm path"); +my @binrpm = $spec->binrpm; +like($binrpm[0], '/^\/.*\/test-rpm-1.0-1.noarch.rpm$/', "can get binrpm path"); +ok(!$spec->check, "Can perform check"); +ok(!$spec->build([ 'PREP' ]), "Can build the specfile"); +is($spec->specfile, 'test-rpm.spec', "can get specfile location"); +is($spec->sources, 'test-rpm.spec', "can get source list"); +is($spec->sources_url, 'test-rpm.spec', "can get source list"); @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org