summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-08-11 07:57:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.com>2006-08-11 07:57:52 +0000
commit815e560840114d7c00db50192b825d27406df298 (patch)
treea0155870bf114b6343ed4002adcd811562a32280
parent446690cc92c337319cc6e385dcc0a7f12d5083ac (diff)
downloadurpmi-815e560840114d7c00db50192b825d27406df298.tar
urpmi-815e560840114d7c00db50192b825d27406df298.tar.gz
urpmi-815e560840114d7c00db50192b825d27406df298.tar.bz2
urpmi-815e560840114d7c00db50192b825d27406df298.tar.xz
urpmi-815e560840114d7c00db50192b825d27406df298.zip
Localize $_ before magical while(<$file>) loops
-rw-r--r--urpm.pm3
-rw-r--r--urpm/download.pm4
-rw-r--r--urpm/ldap.pm1
3 files changed, 8 insertions, 0 deletions
diff --git a/urpm.pm b/urpm.pm
index 9ff0ae63..6f34c998 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -244,6 +244,7 @@ sub read_config {
#- read MD5 sums (usually not in urpmi.cfg but in a separate file)
my $md5sum = $urpm->open_safe("<", "$urpm->{statedir}/MD5SUM");
if ($md5sum) {
+ local $_;
while (<$md5sum>) {
my ($md5sum, $file) = /(\S*)\s+(.*)/;
foreach (@{$urpm->{media}}) {
@@ -972,6 +973,7 @@ sub reconfig_urpmi {
#- the first line of reconfig.urpmi must be magic, to be sure it's not an error file
my $magic = <$fh>;
$magic =~ /^# this is an urpmi reconfiguration file/ or return undef;
+ local $_;
while (<$fh>) {
chomp;
s/^\s*//; s/#.*$//; s/\s*$//;
@@ -2497,6 +2499,7 @@ sub get_source_packages {
if ($listfile && -r $listfile) {
my $fh = $urpm->open_safe('<', $listfile);
if ($fh) {
+ local $_;
while (<$fh>) {
chomp;
if (my ($filename) = m|/([^/]*\.rpm)$|) {
diff --git a/urpm/download.pm b/urpm/download.pm
index 909bcb37..e8d92825 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -235,6 +235,7 @@ sub sync_wget {
) . " |";
my $wget_pid = open my($wget), $wget_command;
local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!).
+ local $_;
while (<$wget>) {
$buf .= $_;
if ($_ eq "\r" || $_ eq "\n") {
@@ -297,6 +298,7 @@ sub sync_curl {
}
if (@ftp_files) {
my ($cur_ftp_file, %ftp_files_info);
+ local $_;
eval { require Date::Manip };
@@ -376,6 +378,7 @@ sub sync_curl {
"--stderr", "-", # redirect everything to stdout
@all_files) . " |";
local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!).
+ local $_;
while (<$curl>) {
$buf .= $_;
if ($_ eq "\r" || $_ eq "\n") {
@@ -452,6 +455,7 @@ sub sync_rsync {
(defined $options->{'rsync-options'} ? split /\s+/, $options->{'rsync-options'} : ()),
"'$file' '$options->{dir}' |");
local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!).
+ local $_;
while (<$rsync>) {
$buf .= $_;
if ($_ eq "\r" || $_ eq "\n") {
diff --git a/urpm/ldap.pm b/urpm/ldap.pm
index 34a387d3..e734c883 100644
--- a/urpm/ldap.pm
+++ b/urpm/ldap.pm
@@ -125,6 +125,7 @@ sub get_ldap_config_file($) {
);
# TODO more verbose error ?
open my $conffh, $file or return;
+ local $_;
while (<$conffh>) {
s/#.*//;
s/^\s*//;