summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-15 17:08:53 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-15 17:08:53 +0000
commit2dda5943253074f31ffcf811300365048bf4e6ce (patch)
tree1161c7969042a7331022373d04f13d498d3a2f67 /perl-install/pkgs.pm
parentfebcdcc30fe947ca4d9b8c12d728434299c8732b (diff)
downloaddrakx-2dda5943253074f31ffcf811300365048bf4e6ce.tar
drakx-2dda5943253074f31ffcf811300365048bf4e6ce.tar.gz
drakx-2dda5943253074f31ffcf811300365048bf4e6ce.tar.bz2
drakx-2dda5943253074f31ffcf811300365048bf4e6ce.tar.xz
drakx-2dda5943253074f31ffcf811300365048bf4e6ce.zip
Support media size check when copying every rpm on HD
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm17
1 files changed, 12 insertions, 5 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 595159efa..3a421368b 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -404,7 +404,7 @@ sub psUsingHdlists {
#- parse hdlists file.
my $medium_name = $o_initialmedium || 1;
- my @hdlists;
+ my (@hdlists, %mediumsize);
foreach (<$listf>) {
chomp;
s/\s*#.*$//;
@@ -416,16 +416,23 @@ sub psUsingHdlists {
#- in this hdlist is allowed
if (/^askmedia/) { $deselectionAllowed = 1; next }
my $cdsuppl = index($medium_name, 's') >= 0;
- m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die qq(invalid hdlist description "$_" in hdlists file);
- push @hdlists, [ $2, $medium_name, $3, $4, !$1,
+ my ($noauto, $hdlist, $rpmsdir, $descr, $size) = m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*([^(]*)(\(.+\))?$/
+ or die qq(invalid hdlist description "$_" in hdlists file);
+ $descr =~ s/\s+$//;
+ push @hdlists, [ $hdlist, $medium_name, $rpmsdir, $descr, !$noauto,
#- hdlist path, suppl CDs are mounted on /mnt/cdrom :
- $o_hdlistsprefix ? ($is_ftp ? "media/media_info/$2" : "$o_hdlistsprefix/media/media_info/$2") : undef,
+ $o_hdlistsprefix ? ($is_ftp ? "media/media_info/$hdlist" : "$o_hdlistsprefix/media/media_info/$hdlist") : undef,
];
+ if ($size) {
+ ($mediumsize{$hdlist}) = $size =~ /(\d+)/;
+ } else {
+ $mediumsize{$hdlist} = 0;
+ }
$cdsuppl ? ($medium_name = ($medium_name + 1) . 's') : ++$medium_name;
}
my $copy_rpms_on_disk = 0;
if ($deselectionAllowed && !defined $o_initialmedium) {
- (my $finalhdlists, $copy_rpms_on_disk) = $o->deselectFoundMedia(\@hdlists);
+ (my $finalhdlists, $copy_rpms_on_disk) = $o->deselectFoundMedia(\@hdlists, \%mediumsize);
@hdlists = @$finalhdlists;
}