also don't emit the same string twice.

This commit is contained in:
espie 2011-11-17 23:14:43 +00:00
parent 440e182e81
commit 599f0be88c

View File

@ -1,5 +1,5 @@
#! /usr/bin/perl
# $OpenBSD: resolve-lib,v 1.3 2011/11/15 20:02:38 espie Exp $
# $OpenBSD: resolve-lib,v 1.4 2011/11/17 23:14:43 espie Exp $
#
# Copyright (c) 2001-2010 Marc Espie <espie@openbsd.org>
#
@ -33,6 +33,7 @@ use OpenBSD::Paths;
my $LOCALBASE = $ENV{LOCALBASE} // '/usr/local';
my $error = 0;
my ($noshared, $needed, $silent) = @_;
my $emited = {};
sub solve_spec
{
@ -51,7 +52,11 @@ sub solve_spec
unless $silent;
$error = 1;
} else {
print $spec->key, $r->version, "\n" unless $silent;
my $string = $spec->key.$r->version;
unless ($emited->{$string}) {
$emited->{$string} = 1;
print $string, "\n" unless $silent;
}
}
}