make_makefiles: Avoid duplicate .gitignore entries.

This commit is contained in:
Alexandre Julliard 2007-04-26 16:42:15 +02:00
parent ba17c25e62
commit 74bd17e998
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -442,7 +442,6 @@ dlls/rpcrt4/librpcrt4.def
dlls/rpcrt4/tests/*.ok
dlls/rpcrt4/tests/rpcrt4_crosstest.exe
dlls/rpcrt4/tests/server.h
dlls/rpcrt4/tests/server.h
dlls/rpcrt4/tests/server_c.c
dlls/rpcrt4/tests/server_s.c
dlls/rpcrt4/tests/testlist.c

View File

@ -625,11 +625,13 @@ sub update_gitignore(@)
# prepend a slash to paths that don't have one
@ignores = map { $_ =~ s/^([^\/]+)$/\/$1/; $_; } @ignores;
push @ignores, @_;
# get rid of duplicates
my %ignores = ();
foreach my $i (@ignores, @_) { $ignores{$i} = 1; }
replace_in_file( ".gitignore", undef, undef,
"# Automatically generated by make_makefiles; DO NOT EDIT!!\n",
join("\n", sort @ignores), "\n" );
join("\n", sort keys %ignores), "\n" );
}