diff options
author | 2012-09-06 09:07:50 +0000 | |
---|---|---|
committer | 2012-09-06 09:07:50 +0000 | |
commit | 0cc88a49dc7467504d83006642723d6b71f97799 (patch) | |
tree | d95c765c9ff4e4f28aaa79bf5bd9eb6a2d794c4e | |
parent | YP is now supported. (diff) | |
download | wireguard-openbsd-0cc88a49dc7467504d83006642723d6b71f97799.tar.xz wireguard-openbsd-0cc88a49dc7467504d83006642723d6b71f97799.zip |
shorter display for trivial updatesets,
foo-0.0->foo-1.0
becomes
foo-0.0->1.0
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index d0b23360d42..7283ecf950a 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.69 2011/07/17 13:18:07 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.70 2012/09/06 09:07:50 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -342,6 +342,16 @@ sub print if ($self->kept > 0) { $result = "[".join('+', sort $self->kept_names)."]"; } + # XXX common case + if ($self->newer == 1 && $self->older == 1) { + my ($a, $b) = ($self->older_names, $self->newer_names); + my $stema = OpenBSD::PackageName::splitstem($a); + my ($stemb, @rest) = OpenBSD::PackageName::splitname($b); + if ($stema eq $stemb) { + return $result .$a."->".join('-', @rest); + } + } + if ($self->older > 0) { $result .= $self->SUPER::print."->"; } |