From b1d9523fee5a32295611da5f81d07ec28ee7cff9 Mon Sep 17 00:00:00 2001 From: espie Date: Mon, 19 Jan 2015 09:42:06 +0000 Subject: [PATCH] add a specialized version of version compares that should not update everything all the time, at the bequest of aja. (basically, we updated everything when runtime dependencies changed, even though we actually only care for wantlib, and hard dependencies, but those trigger bumps all over the tree) Experimental for now, turn on with -DSHORTENED. Likely to become the new default if nothing bad comes out of it. --- usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/Signature.pm | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index c3882b4563f..36e14c58269 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgAdd.pm,v 1.81 2015/01/12 18:27:33 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.82 2015/01/19 09:42:06 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -39,7 +39,7 @@ sub has_different_sig if (!defined $plist->{different_sig}) { my $n = OpenBSD::PackingList->from_installation($plist->pkgname)->signature; my $o = $plist->signature; - my $r = $n->compare($o); + my $r = $n->compare($o, $state->defines("SHORTENED")); $state->print("Comparing full signature for #1 \"#2\" vs. \"#3\":", $plist->pkgname, $o->string, $n->string) if $state->verbose >= 3; diff --git a/usr.sbin/pkg_add/OpenBSD/Signature.pm b/usr.sbin/pkg_add/OpenBSD/Signature.pm index dafa6232842..e4800a283a3 100644 --- a/usr.sbin/pkg_add/OpenBSD/Signature.pm +++ b/usr.sbin/pkg_add/OpenBSD/Signature.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Signature.pm,v 1.15 2014/02/09 19:22:19 espie Exp $ +# $OpenBSD: Signature.pm,v 1.16 2015/01/19 09:42:06 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -25,6 +25,10 @@ sub long_string return '@'.$self->to_string; } +sub always +{ + return 0; +} package OpenBSD::LibObject; sub long_string { @@ -32,6 +36,11 @@ sub long_string return $self->to_string; } +sub always +{ + return 1; +} + package OpenBSD::PackingElement; sub signature {} @@ -87,13 +96,13 @@ sub string sub compare { - my ($a, $b) = @_; - return $b->revert_compare($a); + my ($a, $b, $shortened) = @_; + return $b->revert_compare($a, $shortened); } sub revert_compare { - my ($b, $a) = @_; + my ($b, $a, $shortened) = @_; if ($a->{name} eq $b->{name}) { my $awins = 0; @@ -107,6 +116,7 @@ sub revert_compare next; } $done->{$k} = 1; + next if $shortened && !$v->always; my $r = $v->compare($b->{extra}{$k}); if ($r > 0) { $awins++; -- 2.20.1