diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-11-24 16:31:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:28:30 -0500 |
commit | f98b34d0f20e2c105f0a31c12a549d0ec29b48bb (patch) | |
tree | 6fa0b2bf28547302dbc74b6e38b95f49a1306f20 /source4/script | |
parent | e984a98c106dea20535c5a0bb0810b2268a940cd (diff) | |
download | samba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.tar.gz samba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.tar.xz samba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.zip |
r19880: Eliminate duplicates in the output.
(This used to be commit 2a8c8e1f2de551f360271855f09d8ae6497fb326)
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/pkg-config | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/script/pkg-config b/source4/script/pkg-config index 72a458b8156..458cac6be2e 100755 --- a/source4/script/pkg-config +++ b/source4/script/pkg-config @@ -124,7 +124,21 @@ foreach my $pkg (@ARGV) push (@out, Cflags($pkg)) if ($opt_cflags); } +sub nub +{ + my @list = @_; + my @ret = (); + my %seen = (); + foreach (@list) { + next if (defined($seen{$_})); + push (@ret, $_); + $seen{$_} = 1; + } + return @ret; +} + if ($#out >= 0) { + @out = nub(@out); print join(' ', @out) . "\n"; } |