demexp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Demexp-dev] Depencies of ocaml-gettext and other problems


From: GISQUET Christophe
Subject: Re: [Demexp-dev] Depencies of ocaml-gettext and other problems
Date: Wed, 13 Sep 2006 02:21:55 +0200
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

GISQUET Christophe a écrit :
po/fix-po-comments-for-ocaml-gettext). Well, I'm not that proficient in
sed. Could you provide a patch? If not, I'll try to see what I can do.

I need to think more about it (as I'm the one proposing), but I failed the experiment of directly reusing the RE as I thought would be possible.

When I fall short of Navy commandos for breakfast, I usually have sed scripts instead:
sed ':a; /^#:/N; s/\n#://; ta' <file>

Tested with success with sed 3.02 and 4.1.5.

Best regards,
--
Christophe GISQUET
--- fix-po-comments-for-ocaml-gettext.old       2006-09-13 02:18:15.079875200 
+0200
+++ fix-po-comments-for-ocaml-gettext   2006-09-13 02:18:27.097155200 +0200
@@ -1,11 +1 @@
-#!/usr/bin/perl
-
-# A temporary fix for ocaml-gettext: remove multiple contiguous #: lines
-
-$/ = '';
-while ( <> ) {
-    $_ =~ s/\#:([^\n]+)\n\#:/\#:$1/g; # remove 2 consecutive #: lines
-    $_ =~ s/\#:([^\n]+)\n\#:/\#:$1/g; # remove 3 consecutive #: lines
-    $_ =~ s/\#:([^\n]+)\n\#:/\#:$1/g; # remove 4 consecutive #: lines
-    print $_;
-}
+sed ':a; /^#:/N; s/\n#://; ta' $*

reply via email to

[Prev in Thread] Current Thread [Next in Thread]