summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-08-07 15:50:59 +0000
committerFrancois Pons <fpons@mandriva.com>2002-08-07 15:50:59 +0000
commitf58ade683833799ea75b32d846d98444be28ccfe (patch)
tree6daa836064bb28a7aba1c342ba3ee67c5030d8ea
parent110ac81adba935786d4f751109190b799d8c15ac (diff)
downloaddrakx-f58ade683833799ea75b32d846d98444be28ccfe.tar
drakx-f58ade683833799ea75b32d846d98444be28ccfe.tar.gz
drakx-f58ade683833799ea75b32d846d98444be28ccfe.tar.bz2
drakx-f58ade683833799ea75b32d846d98444be28ccfe.tar.xz
drakx-f58ade683833799ea75b32d846d98444be28ccfe.zip
do not read package of ignored medium (contrib) to save memory.
-rw-r--r--perl-install/pkgs.pm25
1 files changed, 15 insertions, 10 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 1b400e88c..4144897f8 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -308,7 +308,7 @@ sub psUpdateHdlistsDeps {
chomp;
s/\s*#.*$//;
/^\s*$/ and next;
- m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
+ m/^\s*(?:noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
my ($hdlist, $rpmsdir, $descr) = ($1, $2, $3);
#- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used
@@ -341,11 +341,11 @@ sub psUsingHdlists {
chomp;
s/\s*#.*$//;
/^\s*$/ and next;
- m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
+ m/^\s*(noauto:)?(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file";
#- make sure the first medium is always selected!
#- by default select all image.
- psUsingHdlist($prefix, $method, $packages, $1, $medium, $2, $3, 1);
+ psUsingHdlist($prefix, $method, $packages, $2, $medium, $3, $4, !$1);
++$medium;
}
@@ -374,6 +374,7 @@ sub psUsingHdlist {
# min => $packages->{count},
# max => -1, #- will be updated after reading current hdlist.
selected => $selected, #- default value is only CD1, it is really the minimal.
+ ignored => !$selected, #- keep track of ignored medium by DrakX.
};
#- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used
@@ -398,15 +399,19 @@ sub psUsingHdlist {
$method eq 'cdrom' && $medium > 1 && !common::usingRamdisk() and return;
#- parse synthesis (if available) of directly hdlist (with packing).
- if (-s $newsf) {
- ($m->{start}, $m->{end}) = $packages->parse_synthesis($newsf);
- } elsif (-s $newf) {
- ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, 1);
+ if ($m->{ignored}) {
+ log::l("ignoring packages in $hdlist");
} else {
- die "fatal: no hdlist nor synthesis to read for $fakemedium";
+ if (-s $newsf) {
+ ($m->{start}, $m->{end}) = $packages->parse_synthesis($newsf);
+ } elsif (-s $newf) {
+ ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, 1);
+ } else {
+ die "fatal: no hdlist nor synthesis to read for $fakemedium";
+ }
+ $m->{start} > $m->{end} and die "fatal: nothing read in hdlist or synthesis for $fakemedium";
+ log::l("read " . ($m->{end} - $m->{start} + 1) . " packages in $hdlist");
}
- $m->{start} > $m->{end} and die "fatal: nothing read in hdlist or synthesis for $fakemedium";
- log::l("read " . ($m->{end} - $m->{start} + 1) . " packages in $hdlist");
$m;
}