diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2006-11-11 16:20:11 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2006-11-11 16:20:11 +0000 |
commit | bb0a708de84a17c3b253b21b8e03fbab6920cebf (patch) | |
tree | 57d13a6857385559bfb531f3bc710cdc8d8d11e3 /usr.sbin/pkg_add | |
parent | a63f5d6fcee098fee9301e73adab44fce551fc9e (diff) |
simpler/better progress print
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pkg_mklocatedb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/pkg_mklocatedb b/usr.sbin/pkg_add/pkg_mklocatedb index d2c95b97a95..6eb419e55a6 100644 --- a/usr.sbin/pkg_add/pkg_mklocatedb +++ b/usr.sbin/pkg_add/pkg_mklocatedb @@ -40,11 +40,14 @@ our ($opt_n, $opt_q, $opt_s, $opt_x, $opt_r, $opt_p, $opt_P); sub info { my $plist = shift; + my $r; if ($opt_P) { - return $plist->{extrainfo}->{subdir}; + $r = $plist->{extrainfo}->{subdir}; } else { - return $plist->pkgname(); + $r = $plist->pkgname(); } + print STDERR "$r\n" unless $opt_q; + return $r; } try { @@ -138,13 +141,11 @@ if ($opt_p) { elsif (@ARGV==0) { for my $pkgname (installed_packages()) { - print STDERR "$pkgname\n" unless $opt_q; my $plist = OpenBSD::PackingList->from_installation($pkgname); $plist->visit('print_name', $fh, info($plist)); } } else { for my $pkgname (@ARGV) { - print STDERR "$pkgname\n" unless $opt_q; my $plist = OpenBSD::PackageLocator->grabPlist($pkgname); next unless $plist; $plist->visit('print_name', $fh, info($plist)); |