summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2015-01-19 09:42:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2015-01-19 09:42:07 +0000
commitdd2abff04c0b6f5e4bba892696a48ec884753a8e (patch)
tree97d7e7c9ac0d973a5b2b532d1f5ff336bc62c138
parent6160d50edfe9ba91da8f71e98eba61be2fd23d9e (diff)
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.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Signature.pm18
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 <espie@openbsd.org>
#
@@ -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 <espie@openbsd.org>
#
@@ -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++;