From: idl0r Date: Fri, 2 Jul 2010 15:08:45 +0000 (-0000) Subject: ekeyword: Show "diff -U 0" to cover all changes. X-Git-Tag: gentoolkit-dev-0.2.7~11 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2505f0963174cde0d3a1d8c2b0fb31c616a2f7eb;p=gentoolkit.git ekeyword: Show "diff -U 0" to cover all changes. svn path=/trunk/gentoolkit-dev/; revision=785 --- diff --git a/ChangeLog b/ChangeLog index d9ff896..606d036 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2010-07-02: Christian Ruppert * imlate: Don't ignore package names without category. + * ekeyword: Show "diff -U 0" to cover all changes. 2010-05-17: Christian Ruppert * echangelog: Update copyright in other files too (except binaries and diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword index e38801d..d84034e 100755 --- a/src/ekeyword/ekeyword +++ b/src/ekeyword/ekeyword @@ -40,8 +40,6 @@ for my $f (@ARGV) { open O, ">$f.new" or die "Can't create $f.new: $!\n"; select O; - my $keys_before; - my $keys_after; while () { if (/^\s*KEYWORDS=/) { @@ -52,7 +50,6 @@ for my $f (@ARGV) { $_ = join " ", $_, $next; } (my $quoted = $_) =~ s/^.*?["'](.*?)["'].*/$1/s; - $keys_before = $quoted; # replace -* with -STAR for our convenience below $quoted =~ s/-\*/-STAR/; @@ -109,8 +106,6 @@ for my $f (@ARGV) { $sa cmp $sb; } split " ", $quoted; - $keys_after = $quoted; - # re-insert quoted to KEYWORDS s/(["']).*?["']/$1$quoted$1/; @@ -124,19 +119,8 @@ for my $f (@ARGV) { close O; select STDOUT; - if ($keys_before ne $keys_after) { - # This gives uniform output, but actually seems to make - # it harder to pick out differences, and doesn't work so - # well when adding/removing keywords - #$keys_before =~ s/(^| )/ /g; - #$keys_before =~ s/ ([-~])/$1/g; - #$keys_after =~ s/(^| )/ /g; - #$keys_after =~ s/ ([-~])/$1/g; - print " - $keys_before\n + $keys_after\n"; - #system "diff -U 0 $f $f.new | sed -n -r 's:^(.)[[:space:]]*KEYWORDS=\"(.*)\": \\1 \\2:p'"; - #system "diff -U 0 $f $f.new | sed -n '/KEYWORDS=/s:^: :p'"; - } - rename "$f.new", "$f" or die "Can't rename: $!\n"; + system("diff -U 0 ${f} ${f}.new"); + rename("$f.new", "$f") or die "Can't rename: $!\n"; $files++; }