diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-06-06 10:56:22 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-06-06 10:56:22 +0000 |
commit | 83cd2085683762d985fbeb2474534b68820aec8a (patch) | |
tree | b447b7ecd62c3d900cc6235cbec8d511b8a1c531 /usr.sbin/pkg_add/OpenBSD | |
parent | 8c03bb8e06bf7582a1f69cb41d627696dae03cca (diff) |
augment reporting of bad problems so that it works with system libs.
reverse bogus minor check as well
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index 3b5a0d619d1..45bde1db1e6 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.26 2007/06/04 23:28:01 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.27 2007/06/06 10:56:21 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -186,21 +186,22 @@ sub entry_string sub why_is_this_bad { - my ($name, $d1, $d2, $M1, $M2, $m1, $m2, $pkgname) = @_; - if ($d1 ne $d2) { + my ($base, $name, $d1, $d2, $M1, $M2, $m1, $m2, $pkgname) = @_; + if ($d1 ne $d2 && !($pkgname eq 'system' && $d1 eq "$base/lib")) { return "bad directory"; } if ($M1 != $M2) { return "bad major"; } - if ($m1 < $m2) { - return "too small minor"; + if ($m1 > $m2) { + return "minor not large enough"; } return "$pkgname not reachable"; } sub report_problem { + my $base = $_[0]; my ($dir, $name) = normalize_dir_and_spec(@_); my ($stem, $major, $minor) = parse_spec($name); @@ -213,8 +214,9 @@ sub report_problem print "$name: ", entry_string($d, $M, $e->[0]), " (", - why_is_this_bad($name, $dir, $d, $major, - $M, $minor, $e->[0], $e->[1]), + why_is_this_bad($base, $name, $dir, + $d, $major, $M, $minor, + $e->[0], $e->[1]), ")\n"; } } |