summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-04 22:33:00 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-04 22:33:00 +0000
commite98659df06a17a5233e58e8f86aca993ade04e03 (patch)
treeb5e8cd292804a81180b24e78eabdd1745b32a58f /usr.sbin/pkg_add/OpenBSD
parent8297162e222ea8a6ec9503918dd2ab0caa993a96 (diff)
minor tweak, use one single print. Build character strings instead.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/SharedLibs.pm25
1 files changed, 13 insertions, 12 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm
index addaf3b31b8..3f50d7f0ff6 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.24 2007/06/04 21:51:35 espie Exp $
+# $OpenBSD: SharedLibs.pm,v 1.25 2007/06/04 22:32:59 espie Exp $
#
# Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org>
#
@@ -178,28 +178,25 @@ sub lookup_libspec
return @r;
}
-sub write_entry
+sub entry_string
{
my ($name, $d, $M, $m) = @_;
- print "$name: partial match in $d: major=$M, minor=$m ";
+ return "partial match in $d: major=$M, minor=$m";
}
sub why_is_this_bad
{
my ($name, $d1, $d2, $M1, $M2, $m1, $m2, $pkgname) = @_;
if ($d1 ne $d2) {
- print "(bad directory)\n";
- return;
+ return "bad directory";
}
if ($M1 != $M2) {
- print "(bad major)\n";
- return;
+ return "bad major";
}
if ($m1 < $m2) {
- print "(too small minor)\n";
- return;
+ return "too small minor";
}
- print "($pkgname not reachable)\n";
+ return "$pkgname not reachable";
}
sub report_problem
@@ -213,8 +210,12 @@ sub report_problem
while (my ($d, $v) = each %{$registered_libs->{$stem}}) {
while (my ($M, $w) = each %$v) {
for my $e (@$w) {
- write_entry($name, $d, $M, $e->[0]);
- why_is_this_bad($name, $dir, $d, $major, $M, $minor, $e->[0], $e->[1]);
+ print "$name: ",
+ entry_string($d, $M, $e->[0]),
+ " (",
+ why_is_this_bad($name, $dir, $d, $major,
+ $M, $minor, $e->[0], $e->[1]),
+ ")\n";
}
}
}