#! /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>
#
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;
# 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>
#
return '@'.$self->to_string;
}
+sub always
+{
+ return 0;
+}
package OpenBSD::LibObject;
sub long_string
{
return $self->to_string;
}
+sub always
+{
+ return 1;
+}
+
package OpenBSD::PackingElement;
sub signature {}
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;
next;
}
$done->{$k} = 1;
+ next if $shortened && !$v->always;
my $r = $v->compare($b->{extra}{$k});
if ($r > 0) {
$awins++;