summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageInfo.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
index ae99bf292bd..a62662b7632 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageInfo.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: PackageInfo.pm,v 1.5 2004/01/27 00:14:42 espie Exp $
+# $OpenBSD: PackageInfo.pm,v 1.6 2004/02/21 19:15:40 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -81,18 +81,26 @@ sub installed_packages()
{
if (!defined $list) {
$list = {};
+ my @bad=();
opendir(my $dir, $pkg_db) or die "Bad pkg_db: $!";
while (my $e = readdir($dir)) {
next if $e eq '.' or $e eq '..';
next unless -d "$pkg_db/$e";
+ if (! -r _) {
+ push(@bad, $e);
+ next;
+ }
if (-f "$pkg_db/$e/+CONTENTS") {
$list->{$e} = 1;
} else {
- print "Warning: $e is not really a package";
+ print "Warning: $e is not really a package\n";
}
}
close($dir);
+ if (@bad > 0) {
+ print "Warning: can't access information for ", join(", ", @bad), "\n";
+ }
}
return keys %$list;
}