From c7f4ce54151d794e7f67f2125e65709c35d0603b Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 9 Apr 2009 10:05:35 +0000 Subject: (get_file_and_size) fix crashing when using urpmi early to download stuff for network installs --- perl-install/install/http.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'perl-install/install/http.pm') diff --git a/perl-install/install/http.pm b/perl-install/install/http.pm index 91b27601c..72ff053fb 100644 --- a/perl-install/install/http.pm +++ b/perl-install/install/http.pm @@ -37,6 +37,11 @@ sub get_file_and_size { defined $host or return undef; my $urpm = $::o->{packages}; + if (!$urpm) { + require install::pkgs; + $urpm = install::pkgs::empty_packages($o->{keep_unrequested_dependencies}); + } + my $cachedir = $urpm->{cachedir} || '/root'; my $file = $url; $file =~ s!.*/!$cachedir/!; -- cgit v1.2.1