Makefile.PL

CVS patchset: 4615
CVS date: 2001/03/11 08:55:55
This commit is contained in:
rjray 2001-03-11 08:55:55 +00:00
parent 0102f1b568
commit 9b59a8f22a
2 changed files with 30 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/bin/perl
# $Id: Makefile.PL,v 1.19 2001/03/08 06:12:32 rjray Exp $
# $Id: Makefile.PL,v 1.20 2001/03/11 08:55:55 rjray Exp $
use Config;
use ExtUtils::MakeMaker;
@ -213,6 +213,7 @@ Summary: Perl bindings to the rpmlib API
Name: SPEC_DISTNAME
Version: SPEC_VERSION
Release: SPEC_RELEASE
Epoch: 1
Vendor: Randy J. Ray
Copyright: Artistic
Group: Applications/CPAN

View File

@ -38,6 +38,15 @@ else
die "Not enough testable data in your RPM database, stopped";
}
$skip_kernel = 1;
if ($test_pack eq 'kernel')
{
$skip_kernel = 0;
@kernel_matches =
`rpm -qf /sbin/installkernel --queryformat "\%{NAME}\\n"`;
chomp(@kernel_matches);
}
tie %DB, "RPM::Database" or print "not ";
print "ok $count\n"; $count++;
@ -105,13 +114,26 @@ for (keys %$rpm) { delete $tmp_packs{$_} }
print "not " if (keys %tmp_packs);
print "ok $count\n"; $count++;
@matches = $rpm->find_by_file('/sbin/installkernel');
# There should be exactly one match:
print "not " unless (@matches == 1);
print "ok $count\n"; $count++;
#
# These two tests must be skipped if kernel is not an rpm package entry
#
if ($skip_kernel)
{
print "ok $count # Skipped: test data missing\n"; $count++;
print "ok $count # Skipped: test data missing\n"; $count++;
}
else
{
@matches = $rpm->find_by_file('/sbin/installkernel');
# There should be exactly one match:
print "not " unless (@matches == @kernel_matches);
print "ok $count\n"; $count++;
print "not " unless ($matches[0]->{name} eq 'kernel');
print "ok $count\n"; $count++;
$_ = $_->{name} for (@matches);
print "not " unless (join(':', sort @matches) eq
join(':', sort @kernel_matches));
print "ok $count\n"; $count++;
}
# There may be more than one package that depends on $test_pack
@matches = $rpm->find_what_requires($test_pack);