From: Ken Raeburn Date: Fri, 31 Mar 2006 01:23:55 +0000 (+0000) Subject: * depfix.pl (uniquify): Sort dependencies, so little tweaks to include orders X-Git-Tag: krb5-1.5-alpha1~130 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3509d03f75fa60408bad2109ca17425e20cad539;p=krb5.git * depfix.pl (uniquify): Sort dependencies, so little tweaks to include orders don't change lots of makefiles. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17810 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/ChangeLog b/src/util/ChangeLog index 2659162f2..0b81219d4 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,8 @@ +2006-03-30 Ken Raeburn + + * depfix.pl (uniquify): Sort dependencies, so little tweaks to + include orders don't change lots of makefiles. + 2006-03-11 Ken Raeburn * reconf: Put autoconf.stmp into include directory. diff --git a/src/util/depfix.pl b/src/util/depfix.pl index c4c233c67..7bfc5e400 100644 --- a/src/util/depfix.pl +++ b/src/util/depfix.pl @@ -168,18 +168,24 @@ sub uniquify { # "gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)" # -- will sometimes emit duplicate header file names. local($_) = @_; + my(@sides) = split ": ", $_; + my($lhs) = ""; + if ($#sides == 1) { + $lhs = $sides[0] . ": "; + $_ = $sides[1]; + } my(@words) = split " ", $_; my($w); my($result) = ""; my(%seen); undef %seen; - foreach $w (@words) { + foreach $w (sort { $a cmp $b; } @words) { next if defined($seen{$w}); $seen{$w} = 1; if ($result ne "") { $result .= " "; } $result .= $w; } - return $result . " "; + return $lhs . $result . " "; } sub split_lines {