summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-20 23:38:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-20 23:38:52 +0000
commit2cd5f5a133ed85af5bef04f3155974b0f9fea79f (patch)
treed391c5898385065b9b900419425af4fc49ebc1f4 /usr.sbin/pkg_add
parent4a53a7ff89bb41b5648438b05badb9503fda3669 (diff)
opendir can use my variables.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/pkg_add13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 1ea7c3d49c4..aa3fa773e13 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.123 2004/11/18 21:48:02 espie Exp $
+# $OpenBSD: pkg_add,v 1.124 2004/11/20 23:38:51 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -494,18 +494,17 @@ my $syst_avail;
sub add_system_libs
{
my ($destdir, $avail) = @_;
- for my $dir ("/usr/lib", "/usr/X11R6/lib") {
- local *DIR;
- opendir(DIR, $destdir.$dir);
- while (my $d = readdir(DIR)) {
+ for my $dirname ("/usr/lib", "/usr/X11R6/lib") {
+ opendir(my $dir, $destdir.$dirname);
+ while (my $d = readdir($dir)) {
next unless $d =~ m/^(.*\.so\.\d+)\.(\d+)$/;
my ($stem, $minor) = ($1, $2);
- $stem = "$dir/$stem";
+ $stem = "$dirname/$stem";
if (!defined $avail->{"$stem"} || $avail->{"$stem"}->[0] < $minor) {
$avail->{"$stem"} = [$minor, 'system'];
}
}
- closedir(DIR);
+ closedir($dir);
}
}