aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-09 13:40:03 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-09 13:40:03 +0000
commit83189750c7699dd1ef65cb3260f07b4c3fde7c1e (patch)
treed364989bd0a17aaff2004abada319876416ff508
parent5f3e897514364d9baab1159ed04f25cbdb6f224f (diff)
downloadrpmdrake-83189750c7699dd1ef65cb3260f07b4c3fde7c1e.tar
rpmdrake-83189750c7699dd1ef65cb3260f07b4c3fde7c1e.tar.gz
rpmdrake-83189750c7699dd1ef65cb3260f07b4c3fde7c1e.tar.bz2
rpmdrake-83189750c7699dd1ef65cb3260f07b4c3fde7c1e.tar.xz
rpmdrake-83189750c7699dd1ef65cb3260f07b4c3fde7c1e.zip
Only load packdrake when needed
-rwxr-xr-xrpmdrake12
-rw-r--r--rpmdrake.pm1
2 files changed, 9 insertions, 4 deletions
diff --git a/rpmdrake b/rpmdrake
index bcd6bb22..5ecbc4c1 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -290,10 +290,11 @@ sub extract_header {
} else {
my ($p, $medium) = ($pkg->{pkg}, pkg2medium($pkg->{pkg}, $urpm));
my $hdlist = "$urpm->{statedir}/$medium->{hdlist}";
- if (-r $hdlist) { #- packdrake segfaults when giving a missing file :(
+ if (-r $hdlist) {
standalone::explanations("Extracting header of " . $p->header_filename . " from $hdlist");
my $packer;
- eval { $packer = new packdrake($hdlist, quiet => 1) } or log::l("Warning, hdlist seems corrupted :-("), goto header_non_available;
+ eval { require packdrake; $packer = new packdrake($hdlist, quiet => 1) }
+ or log::l("Warning, hdlist seems corrupted :-("), goto header_non_available;
my $headersdir = chomp_(`mktemp -d /tmp/rpmdrake.XXXXXX`);
-d $headersdir or die "Could not create temporary directory";
$packer->extract_archive($headersdir, $p->header_filename);
@@ -352,7 +353,12 @@ sub do_search($$$$$$$) {
} else {
my @hdlists = map { my $h = "$urpm->{statedir}/$_->{hdlist}";
if_(!$_->{ignore} && ($MODE ne 'update' || $_->{update}) && -r $h, $h) } @{$urpm->{media}};
- my $total_size = sum(map { my $pack; eval { $pack = new packdrake($_, quiet => 1) } ? $pack->{toc_f_count} : 0 } @hdlists);
+ my $total_size = sum(
+ map {
+ my $pack;
+ eval { require packdrake; $pack = new packdrake($_, quiet => 1) } ? $pack->{toc_f_count} : 0;
+ } @hdlists
+ );
my $searchstop;
my $searchw = ugtk2->new(N("Rpmdrake"), grab => 1, transient => $w->{rwindow});
gtkadd($searchw->{window}, gtkpack__(Gtk2::VBox->new(0, 5),
diff --git a/rpmdrake.pm b/rpmdrake.pm
index cb6e5438..683fa5fc 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -30,7 +30,6 @@ use MDK::Common::System;
use urpm;
use URPM;
use URPM::Resolve;
-use packdrake;
use strict;
use log;
use c;