From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SM9Yl-00010F-Ro for garchives@archives.gentoo.org; Mon, 23 Apr 2012 03:03:28 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 15CBEE06B4; Mon, 23 Apr 2012 03:02:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DA5A0E0527 for ; Mon, 23 Apr 2012 03:02:45 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4C6A81B410D for ; Mon, 23 Apr 2012 03:02:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B0022E542D for ; Mon, 23 Apr 2012 03:02:42 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: <1335147849.430f15ddbd8405d7e82a332cbd9c242405923800.idl0r@gentoo> Subject: [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/ekeyword/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: src/ekeyword/ekeyword X-VCS-Directories: src/ekeyword/ X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 430f15ddbd8405d7e82a332cbd9c242405923800 X-VCS-Branch: gentoolkit-dev Date: Mon, 23 Apr 2012 03:02:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 27f6a0ee-5b03-4367-a427-bb7cc6b33cb1 X-Archives-Hash: dd740eccc5d51bc7c95cde3aa9b33e51 commit: 430f15ddbd8405d7e82a332cbd9c242405923800 Author: Christian Ruppert gentoo org> AuthorDate: Mon Apr 23 02:24:09 2012 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Mon Apr 23 02:24:09 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoolkit.gi= t;a=3Dcommit;h=3D430f15dd More cleanup --- src/ekeyword/ekeyword | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ekeyword/ekeyword b/src/ekeyword/ekeyword index 0c68773..5f94fc6 100755 --- a/src/ekeyword/ekeyword +++ b/src/ekeyword/ekeyword @@ -112,7 +112,6 @@ for my $f (@ARGV) { =20 open(my $fh_in, "<", $f) or die "Can't read $f: $!\n"; open(my $fh_out, ">", "${f}.new") or die "Can't create ${f}.new: ${!}\n= "; - select($fh_out); =20 my $count =3D 0; while(<$fh_in>) { @@ -121,10 +120,10 @@ for my $f (@ARGV) { seek($fh_in, 0, 0); =20 while (<$fh_in>) { - if (/^\s*KEYWORDS=3D/) { + if (m/^\s*KEYWORDS=3D/) { =20 # extract the quoted section from KEYWORDS - while (not /^\s*KEYWORDS=3D["'].*?["']/) { + while (not m/^\s*KEYWORDS=3D["'].*?["']/) { chomp; my $next =3D <$fh_in>; $_ =3D join " ", $_, $next; @@ -134,7 +133,7 @@ for my $f (@ARGV) { if($count > 1 && length($quoted) eq 0) { # Skip empty KEYWORDS variables in case they occur more than # once, bug 321475. - print $_; + print $fh_out $_; next; } =20 @@ -218,15 +217,15 @@ for my $f (@ARGV) { # re-insert quoted to KEYWORDS s/(["']).*?["']/$1$quoted$1/; =20 - print $_ or die "Can't write $f.new: $!\n"; + print $fh_out $_ or die "Can't write $f.new: $!\n"; } else { - print, next; + print $fh_out $_; + next; } } =20 close($fh_in); close($fh_out); - select STDOUT; =20 system("diff -U 0 ${f} ${f}.new"); rename("$f.new", "$f") or die "Can't rename: $!\n";