summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2008-10-20 10:25:17 +0000
committerMarc Espie <espie@cvs.openbsd.org>2008-10-20 10:25:17 +0000
commiteaebd8142928ba1b0d5fe3a62f964c99fd875888 (patch)
tree7455dca1904b029f68651be5c0285017b8e3a085 /usr.sbin/pkg_add
parent782d0d3eb7b8f71c782a07fbb33aefe93a000d53 (diff)
Say goodbye to local $_
lexical scoping is so much neater (courtesy of perl 5.10)
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Error.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Mtree.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocator.pm16
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageName.pm13
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageRepository.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm24
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgConfig.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgSpec.pm14
-rw-r--r--usr.sbin/pkg_add/OpenBSD/RequiredBy.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/SharedLibs.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Subst.pm6
-rw-r--r--usr.sbin/pkg_add/pkg_info6
-rw-r--r--usr.sbin/pkg_add/pkg_mklocatedb4
16 files changed, 60 insertions, 67 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 7aa4d2f1caf..7d3711f1220 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.84 2008/10/06 09:36:17 espie Exp $
+# $OpenBSD: Add.pm,v 1.85 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -585,7 +585,7 @@ sub install
my $destdir = $state->{destdir};
# go append to /etc/shells if needed
open(my $shells, '<', $destdir.OpenBSD::Paths->shells) or return;
- local $_;
+ my $_;
while(<$shells>) {
s/^\#.*//o;
return if $_ =~ m/^\Q$fullname\E\s*$/;
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index d21971afd64..e7a9552cfe4 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.77 2008/10/06 09:36:17 espie Exp $
+# $OpenBSD: Delete.pm,v 1.78 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -560,7 +560,7 @@ sub delete
my $fullname = $self->fullname;
my @l=();
if (open(my $shells, '<', $destdir.OpenBSD::Paths->shells)) {
- local $_;
+ my $_;
while(<$shells>) {
push(@l, $_);
s/^\#.*//o;
diff --git a/usr.sbin/pkg_add/OpenBSD/Error.pm b/usr.sbin/pkg_add/OpenBSD/Error.pm
index e1073fdcf96..1dd0ffb8ec4 100644
--- a/usr.sbin/pkg_add/OpenBSD/Error.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Error.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Error.pm,v 1.14 2008/09/29 17:46:59 simon Exp $
+# $OpenBSD: Error.pm,v 1.15 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2004 Marc Espie <espie@openbsd.org>
#
@@ -199,7 +199,7 @@ sub system
{
my $state = shift;
if (open(my $grab, "-|", @_)) {
- local $_;
+ my $_;
while (<$grab>) {
$state->print($_);
}
@@ -240,7 +240,7 @@ sub dienow
my ($error, $handler) = @_;
if ($error) {
if ($error =~ m/^(Expected:\s+)?(.*?)(?:\s+at\s+(.*)\s+line\s+(\d+)\.?)?$/o) {
- local $_ = $2;
+ my $_ = $2;
$FileName = $3;
$Line = $4;
$FullMessage = $error;
diff --git a/usr.sbin/pkg_add/OpenBSD/Mtree.pm b/usr.sbin/pkg_add/OpenBSD/Mtree.pm
index 7fe29ebeb15..ba287b95547 100644
--- a/usr.sbin/pkg_add/OpenBSD/Mtree.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Mtree.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Mtree.pm,v 1.5 2008/06/20 14:31:38 espie Exp $
+# $OpenBSD: Mtree.pm,v 1.6 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2004-2005 Marc Espie <espie@openbsd.org>
#
@@ -26,7 +26,7 @@ use File::Spec;
sub parse_fh
{
my ($mtree, $basedir, $fh) = @_;
- local $_;
+ my $_;
while(<$fh>) {
chomp;
s/^\s*//o;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
index 3fbe2ba8478..c69c041778c 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocator.pm,v 1.75 2008/06/18 12:24:58 espie Exp $
+# $OpenBSD: PackageLocator.pm,v 1.76 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -40,13 +40,16 @@ if (defined $ENV{PKG_PATH}) {
$pkgpath->add(OpenBSD::PackageRepository->new("./"));
}
+# rebuild PKG_PATH
+#$ENV{PKG_PATH} = $pkgpath->print_without_src;
+
sub path_parse
{
use File::Basename;
use OpenBSD::Paths;
my $pkg_db = $ENV{"PKG_DBDIR"} || OpenBSD::Paths->pkgdb;
- my ($pkgname, $path) = fileparse($_);
+ my ($pkgname, $path) = fileparse(shift);
my $repo;
if ($path eq $pkg_db.'/') {
@@ -60,9 +63,7 @@ sub path_parse
sub find
{
- my $class = shift;
- local $_ = shift;
- my $arch = shift;
+ my ($class, $_, $arch) = @_;
if ($_ eq '-') {
my $repository = OpenBSD::PackageRepository::Local::Pipe->_new('./');
@@ -88,10 +89,7 @@ sub find
sub grabPlist
{
- my $class = shift;
- local $_ = shift;
- my $arch = shift;
- my $code = shift;
+ my ($class, $_, $arch, $code) = @_;
if ($_ eq '-') {
my $repository = OpenBSD::PackageRepository::Local::Pipe->_new('./');
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageName.pm b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
index aa3ef67eb1f..d4ec0668d42 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageName.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageName.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageName.pm,v 1.31 2007/08/23 09:09:16 espie Exp $
+# $OpenBSD: PackageName.pm,v 1.32 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -31,7 +31,7 @@ sub url2pkgname($)
# see packages-specs(7)
sub splitname
{
- local $_ = shift;
+ my $_ = shift;
if (/^(.*?)\-(\d.*)$/o) {
my $stem = $1;
my $rest = $2;
@@ -44,8 +44,7 @@ sub splitname
sub from_string
{
- my $class = shift;
- local $_ = shift;
+ my ($class, $_) = @_;
if (/^(.*?)\-(\d.*)$/o) {
my $stem = $1;
my $rest = $2;
@@ -66,7 +65,7 @@ sub from_string
sub splitstem
{
- local $_ = shift;
+ my $_ = shift;
if (/^(.*?)\-\d/o) {
return $1;
} else {
@@ -76,7 +75,7 @@ sub splitstem
sub is_stem
{
- local $_ = shift;
+ my $_ = shift;
if (m/\-\d/o || $_ eq '-') {
return 0;
} else {
@@ -86,7 +85,7 @@ sub is_stem
sub splitp
{
- local $_ = shift;
+ my $_ = shift;
if (/^(.*\-\d[^-]*)p(\d+)(.*)$/o) {
return ($1.$3, $2);
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
index e4ef299c719..728dbc5351d 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageRepository.pm,v 1.58 2008/07/04 10:47:13 espie Exp $
+# $OpenBSD: PackageRepository.pm,v 1.59 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -96,7 +96,7 @@ sub parse_fullurl
sub parse
{
my ($class, $ref) = @_;
- local $_ = $$ref;
+ my $_ = $$ref;
return undef if $_ eq '';
if (m/^ftp\:/io) {
@@ -622,7 +622,7 @@ sub parse_problems
if (defined $object) {
$url = $object->url;
}
- local $_;
+ my $_;
my $notyet = 1;
while(<$fh>) {
next if m/^(?:200|220|221|226|229|230|227|250|331|500|150)[\s\-]/o;
@@ -679,7 +679,7 @@ sub get_http_list
my $fullname = $self->url;
my $l = [];
- local $_;
+ my $_;
open(my $fh, '-|', OpenBSD::Paths->ftp." -o - $fullname 2>$error")
or return;
while(<$fh>) {
@@ -727,7 +727,7 @@ sub _list
{
my ($self, $cmd) = @_;
my $l =[];
- local $_;
+ my $_;
open(my $fh, '-|', "$cmd") or return;
while(<$fh>) {
chomp;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 31bc5b3247e..8a6c007d6b7 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.149 2008/10/06 09:36:17 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.150 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -1104,7 +1104,7 @@ our @ISA=qw(OpenBSD::PackingElement::Action);
sub expand
{
my ($self, $state) = @_;
- local $_ = $self->{name};
+ my $_ = $self->{name};
if (m/\%F/o) {
die "Bad expand" unless defined $state->{lastfile};
s/\%F/$state->{lastfile}->{name}/g;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index aa86d7ed84b..72088ed1697 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingList.pm,v 1.84 2008/10/06 09:36:17 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.85 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -114,7 +114,7 @@ sub read
sub defaultCode
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
&$cont($_);
}
@@ -123,7 +123,7 @@ sub defaultCode
sub SharedItemsOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
next unless m/^\@(?:cwd|dir|fontdir|mandir|newuser|newgroup|name)\b/o || m/^\@(?:sample|extra)\b.*\/$/o || m/^[^\@].*\/$/o;
&$cont($_);
@@ -138,7 +138,7 @@ sub DirrmOnly
sub LibraryOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
next unless m/^\@(?:cwd|lib|name)\b/o ||
m/^\@comment\s+subdir\=/o;
@@ -149,7 +149,7 @@ sub LibraryOnly
sub FilesOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
next unless m/^\@(?:cwd|name|info|man|file|lib|shell|sample|bin)\b/o || !m/^\@/o;
&$cont($_);
@@ -159,7 +159,7 @@ sub FilesOnly
sub PrelinkStuffOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
next unless m/^\@(?:cwd|bin|lib|name|depend|wantlib)\b/o ||
m/^\@comment\s+subdir\=/o;
@@ -170,7 +170,7 @@ sub PrelinkStuffOnly
sub DependOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
@@ -191,7 +191,7 @@ sub DependOnly
sub ExtraInfoOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
@@ -212,7 +212,7 @@ sub ExtraInfoOnly
sub UpdateInfoOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
@@ -233,7 +233,7 @@ sub UpdateInfoOnly
sub FatOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
@@ -248,7 +248,7 @@ sub FatOnly
sub ConflictOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
@@ -269,7 +269,7 @@ sub ConflictOnly
sub SharedStuffOnly
{
my ($fh, $cont) = @_;
- local $_;
+ my $_;
MAINLOOP:
while (<$fh>) {
if (m/^\@shared\b/o) {
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm b/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm
index 47019ef189f..7ec5d4dab12 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgConfig.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PkgConfig.pm,v 1.11 2007/11/17 18:31:31 steven Exp $
+# $OpenBSD: PkgConfig.pm,v 1.12 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2006 Marc Espie <espie@openbsd.org>
#
@@ -85,7 +85,7 @@ sub read_fh
{
my ($class, $fh, $name) = @_;
my $cfg = $class->new;
- local $_;
+ my $_;
$name = '' if !defined $name;
while (<$fh>) {
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
index c136064cb8a..d3218843446 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PkgSpec.pm,v 1.17 2008/10/04 09:39:00 espie Exp $
+# $OpenBSD: PkgSpec.pm,v 1.18 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -82,13 +82,12 @@ sub dewey_compare
sub check_version
{
my ($v, $spec) = @_;
- local $_;
# any version spec
return 1 if $spec eq '.*';
my @specs = split(/\,/o, $spec);
- for (grep /^\d/o, @specs) { # exact number: check match
+ for my $_ (grep /^\d/o, @specs) { # exact number: check match
return 1 if $v =~ /^$_$/;
return 1 if $v =~ /^${_}p\d+$/; # allows for recent patches
}
@@ -113,9 +112,8 @@ sub check_version
sub check_1flavor
{
my ($f, $spec) = @_;
- local $_;
- for (split /\-/o, $spec) {
+ for my $_ (split /\-/o, $spec) {
# must not be here
if (m/^\!(.*)$/o) {
return 0 if $f->{$1};
@@ -130,7 +128,6 @@ sub check_1flavor
sub check_flavor
{
my ($f, $spec) = @_;
- local $_;
# no flavor constraints
return 1 if $spec eq '';
@@ -139,7 +136,7 @@ sub check_flavor
my %f = map +($_, 1), split /\-/o, $f;
# check each flavor constraint
- for (split /\,/o, $spec) {
+ for my $_ (split /\,/o, $spec) {
if (check_1flavor(\%f, $_)) {
return 1;
}
@@ -150,7 +147,6 @@ sub check_flavor
sub subpattern_match
{
my ($p, $list) = @_;
- local $_;
# let's try really hard to find the stem and the flavors
unless ($p =~ m/^(.*?)\-((?:(?:\>|\>\=|\<|\<\=|\=)?\d|\*)[^-]*)(.*)$/) {
@@ -175,7 +171,7 @@ sub subpattern_match
my @result = ();
# Now, have to extract the version number, and the flavor...
- for (@l) {
+ for my $_ (@l) {
my ($stem, $v, $flavor);
if (m/^(.*?)\-(\d[^-]*)(.*)$/o) {
($stem, $v, $flavor) = ($1, $2, $3);
diff --git a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
index 78c56b1cf76..234461061b6 100644
--- a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
+++ b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: RequiredBy.pm,v 1.16 2007/06/04 14:40:39 espie Exp $
+# $OpenBSD: RequiredBy.pm,v 1.17 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -31,7 +31,7 @@ sub fill_entries
open(my $fh, '<', $self->{filename}) or
die "Problem opening required list: ",
$self->{filename}, ": $!";
- local $_;
+ my $_;
while(<$fh>) {
s/\s+$//o;
next if /^$/o;
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
index 72854ea06bb..a1ceab9d1fe 100644
--- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
+++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: SharedLibs.pm,v 1.31 2007/10/06 12:13:41 steven Exp $
+# $OpenBSD: SharedLibs.pm,v 1.32 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -49,7 +49,7 @@ sub init_path($)
}
open my $fh, "-|", @ldconfig, "-r";
if (defined $fh) {
- local $_;
+ my $_;
while (<$fh>) {
if (m/^\s*search directories:\s*(.*?)\s*$/o) {
for my $d (split(/\:/o, $1)) {
diff --git a/usr.sbin/pkg_add/OpenBSD/Subst.pm b/usr.sbin/pkg_add/OpenBSD/Subst.pm
index d64f794019d..732b7e47e3e 100644
--- a/usr.sbin/pkg_add/OpenBSD/Subst.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Subst.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Subst.pm,v 1.6 2008/06/09 12:00:48 espie Exp $
+# $OpenBSD: Subst.pm,v 1.7 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2008 Marc Espie <espie@openbsd.org>
#
@@ -61,7 +61,7 @@ sub parse_option
sub do
{
my $self = shift;
- local $_ = shift;
+ my $_ = shift;
return $_ unless m/\$/o; # optimization
while (my ($k, $v) = each %{$self->hash}) {
s/\$\{\Q$k\E\}/$v/g;
@@ -73,7 +73,7 @@ sub do
sub copy_fh2
{
my ($self, $src, $dest) = @_;
- local $_;
+ my $_;
while (<$src>) {
print $dest $self->do($_);
}
diff --git a/usr.sbin/pkg_add/pkg_info b/usr.sbin/pkg_add/pkg_info
index ef79a64a4ac..684a3dac127 100644
--- a/usr.sbin/pkg_add/pkg_info
+++ b/usr.sbin/pkg_add/pkg_info
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_info,v 1.68 2008/06/18 12:05:00 espie Exp $
+# $OpenBSD: pkg_info,v 1.69 2008/10/20 10:25:16 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -119,7 +119,7 @@ sub find_pkg
sub printfile
{
my $filename = shift;
- local $_;
+ my $_;
open my $fh, '<', $filename or return;
while(<$fh>) {
@@ -131,7 +131,7 @@ sub printfile
sub print_description
{
my $dir = shift;
- local $_;
+ my $_;
open my $fh, '<', $dir.DESC or return;
$_ = <$fh> unless -f $dir.COMMENT;
diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb
index 37863508218..a1cb69db062 100644
--- a/usr.sbin/pkg_add/pkg_mklocatedb
+++ b/usr.sbin/pkg_add/pkg_mklocatedb
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
-# $OpenBSD: pkg_mklocatedb,v 1.19 2008/10/10 04:35:31 steven Exp $
+# $OpenBSD: pkg_mklocatedb,v 1.20 2008/10/20 10:25:16 espie Exp $
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
@@ -146,7 +146,7 @@ if ($opt_p) {
my $plist = OpenBSD::PackingList->read($in,
sub {
my ($fh, $cont) = @_;
- local $_;
+ my $_;
while (<$fh>) {
return if m/^\=\=\=\> /o;
next unless m/^\@(?:cwd|name|info|man|file|lib|shell|comment\s+subdir\=)\b/o || !m/^\@/o;