summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2000-11-14 15:31:59 +0000
committerFrancois Pons <fpons@mandriva.com>2000-11-14 15:31:59 +0000
commit949a885497d3d05e4dc0dc20e52ecb758d9b677c (patch)
tree0e7a20d9c3694bc4c392ea420607b7cbacdf3814 /perl-install/pkgs.pm
parent01975efac2cb7e05fbe05ec3733ae904669a1e94 (diff)
downloaddrakx-backup-do-not-use-949a885497d3d05e4dc0dc20e52ecb758d9b677c.tar
drakx-backup-do-not-use-949a885497d3d05e4dc0dc20e52ecb758d9b677c.tar.gz
drakx-backup-do-not-use-949a885497d3d05e4dc0dc20e52ecb758d9b677c.tar.bz2
drakx-backup-do-not-use-949a885497d3d05e4dc0dc20e52ecb758d9b677c.tar.xz
drakx-backup-do-not-use-949a885497d3d05e4dc0dc20e52ecb758d9b677c.zip
removed foreach (<... which are eating memory
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm32
1 files changed, 19 insertions, 13 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index bc6abcef0..916c0448d 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -394,7 +394,8 @@ sub psUpdateHdlistsDeps {
#- parse hdlist.list file.
my $medium = 1;
- foreach (<$listf>) {
+ local $_;
+ while (<$listf>) {
chomp;
s/\s*#.*$//;
/^\s*$/ and next;
@@ -425,7 +426,8 @@ sub psUsingHdlists {
#- parse hdlist.list file.
my $medium = 1;
- foreach (<$listf>) {
+ local $_;
+ while (<$listf>) {
chomp;
s/\s*#.*$//;
/^\s*$/ and next;
@@ -474,8 +476,9 @@ sub psUsingHdlist {
#- extract filename from archive, this take advantage of verifying
#- the archive too.
- open F, "packdrake $newf |";
- foreach (<F>) {
+ local *F; open F, "packdrake $newf |";
+ local $_;
+ while (<F>) {
chomp;
/^[dlf]\s+/ or next;
if (/^f\s+\d+\s+(.*)/) {
@@ -521,7 +524,8 @@ sub getOtherDeps($$) {
#- this version of getDeps is customized for handling errors more easily and
#- convert reference by name to deps id including closure computation.
- foreach (<$f>) {
+ local $_;
+ while (<$f>) {
my ($name, $version, $release, $size, $deps) = /^(\S*)-([^-\s]+)-([^-\s]+)\s+(\d+)\s+(.*)/;
my $pkg = $packages->[0]{$name};
@@ -566,9 +570,9 @@ sub getDeps($) {
#- cross reference to be resolved on id (think of loop requires)
#- provides should be updated after base flag has been set to save
#- memory.
- local *F;
- open F, "$prefix/var/lib/urpmi/depslist.ordered" or die "cann't find dependancies list";
- foreach (<F>) {
+ local *F; open F, "$prefix/var/lib/urpmi/depslist.ordered" or die "can't find dependancies list";
+ local $_;
+ while (<F>) {
my ($name, $version, $release, $sizeDeps) = /^(\S*)-([^-\s]+)-([^-\s]+)\s+(.*)/;
my $pkg = $packages->[0]{$name};
@@ -624,9 +628,9 @@ sub readCompss {
#- this is necessary for urpmi.
install_any::getAndSaveFile('Mandrake/base/compss', "$prefix/var/lib/urpmi/compss");
- local *F;
- open F, "$prefix/var/lib/urpmi/compss" or die "can't find compss";
- foreach (<F>) {
+ local *F; open F, "$prefix/var/lib/urpmi/compss" or die "can't find compss";
+ local $_;
+ while (<F>) {
/^\s*$/ || /^#/ and next;
s/#.*//;
@@ -646,7 +650,8 @@ sub readCompssList {
my $f = install_any::getFile('Mandrake/base/compssList') or die "can't find compssList";
my @levels = split ' ', <$f>;
- foreach (<$f>) {
+ local $_;
+ while (<$f>) {
/^\s*$/ || /^#/ and next;
my ($name, @values) = split;
my $p = packageByName($packages, $name) or log::l("unknown entry $name (in compssList)"), next;
@@ -679,7 +684,8 @@ sub readCompssUsers {
};
my $file = 'Mandrake/base/compssUsers';
my $f = $meta_class && install_any::getFile("$file.$meta_class") || install_any::getFile($file) or die "can't find $file";
- foreach (<$f>) {
+ local $_;
+ while (<$f>) {
/^\s*$/ || /^#/ and next;
s/#.*//;