aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.pm
diff options
context:
space:
mode:
Diffstat (limited to 'rpmtools.pm')
-rw-r--r--rpmtools.pm33
1 files changed, 20 insertions, 13 deletions
diff --git a/rpmtools.pm b/rpmtools.pm
index a67b3bf..c525888 100644
--- a/rpmtools.pm
+++ b/rpmtools.pm
@@ -113,23 +113,30 @@ sub read_hdlists {
my ($params, @hdlists) = @_;
my @names;
- local (*I, *O); pipe I, O;
- if (my $pid = fork()) {
- close O;
+ foreach my $hdlist (@hdlists) {
+ local (*I, *O); pipe I, O;
+ if (my $pid = fork()) {
+ close O;
- push @names, rpmtools::_parse_(fileno *I, $params->{flags}, $params->{info}, $params->{provides});
+ push @names, rpmtools::_parse_(fileno *I, $params->{flags}, $params->{info}, $params->{provides});
- close I;
- waitpid $pid, 0;
- } else {
- close I;
- open STDOUT, ">&O" or die "unable to redirect output";
+ close I;
+ waitpid $pid, 0;
+ } else {
+ close I;
+ open STDIN, "<$hdlist" or die "unable to open archive $hdlist";
+ open STDOUT, ">&O" or die "unable to redirect output";
+ open STDERR, ">/dev/null" or die "unable to open /dev/null";
+
+ require packdrake;
+ my $packer = new packdrake;
- require packdrake;
- packdrake::cat_archive(@hdlists);
+ $packer->read_toc_trailer($_);
- close O;
- exit 0;
+ exec (($ENV{LD_LOADER} ? ($ENV{LD_LOADER}) : ()), split " ", $packer->{uncompress});
+
+ die "unable to cat the archive with $packer->{uncompress}";
+ }
}
@names;
}