aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2004-01-18 02:30:15 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2004-01-18 02:30:15 +0000
commit0967d22b425b12ce95c32b763e5a9fe6825e98e8 (patch)
tree2c282a14502f4b64c45682eb29cea654d13e2ae1
parent9f77adb5311cc98c42945c24189c9935dde6ae11 (diff)
downloadrpmtools-0967d22b425b12ce95c32b763e5a9fe6825e98e8.tar
rpmtools-0967d22b425b12ce95c32b763e5a9fe6825e98e8.tar.gz
rpmtools-0967d22b425b12ce95c32b763e5a9fe6825e98e8.tar.bz2
rpmtools-0967d22b425b12ce95c32b763e5a9fe6825e98e8.tar.xz
rpmtools-0967d22b425b12ce95c32b763e5a9fe6825e98e8.zip
- Don't put wrong rpm in list file when using dontdie
-rw-r--r--genhdlist26
1 files changed, 21 insertions, 5 deletions
diff --git a/genhdlist b/genhdlist
index 3ac8080..37fdca2 100644
--- a/genhdlist
+++ b/genhdlist
@@ -67,6 +67,7 @@ rmtree($tmpdir) unless $noclean;
mkpath($tmpdir);
my @rpms;
+my %rpmslist;
sub wanted {
if (-f $_ && $_ =~ /^.*\.rpm$/ ) {
push(@rpms, $File::Find::name);
@@ -77,13 +78,28 @@ sub wanted {
open(LIST, "> list$suffix") or die "can't create list file: $!";
foreach my $dir (@dir) {
print "parsing $dir\n" unless $nooutput;
- @rpms=();
+ @rpms = ();
+ %rpmslist = ();
File::Find::find({wanted => \&wanted}, $dir);
- $urpm->parse_rpms_build_headers(dir => $tmpdir,
+ $urpm->parse_rpms_build_headers(
+ dir => $tmpdir,
rpms => \@rpms,
- dontdie => $dontdie,
- silent => $nooutput);
- foreach my $rpm (@rpms) { print LIST "$rpm\n" };
+ dontdie => $dontdie,
+ silent => $nooutput,
+ callback => sub {
+ my ($urpm, $id, %options) = @_;
+
+ # This code need a fix in perl-URPM
+ # print LIST "$options{file}\n";
+ $rpmslist{scalar($urpm->{depslist}[$id]->fullname).".rpm"} = 1;
+ $urpm->{depslist}[$id]->pack_header;
+ },
+ );
+ # This code will become useless... see above
+ foreach my $rpm (@rpms) {
+ $rpmslist{($rpm =~ m!.*/(.*)$!)[0]} or next;
+ print LIST "$rpm\n";
+ }
}
close(LIST);