Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKnkJ-00075Y-39 for pgsql-translators@arkaria.postgresql.org; Sun, 28 Apr 2019 17:37:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hKnkF-0005ej-6q for pgsql-translators@arkaria.postgresql.org; Sun, 28 Apr 2019 17:37:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKnkE-0005ec-OA for pgsql-translators@lists.postgresql.org; Sun, 28 Apr 2019 17:37:43 +0000 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hKnkB-0001NF-B3 for pgsql-translators@postgresql.org; Sun, 28 Apr 2019 17:37:41 +0000 Received: by mail-qk1-x742.google.com with SMTP id f125so4721754qke.6 for ; Sun, 28 Apr 2019 10:37:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=x/X0AYknQzecFdwg696QX8gtxb35n3H1vFaXCdnFjLM=; b=Gz8/tNat69nlvZgjdG6UYTBbfgG5KumDlL+Hwk6neJZd5u1NQM1q/iUsXsEKFDI2pp H+/pQRtVaZ3SxB6uTqr9DOk/hwWWuAtptWyWB4TpyLBwLiDTGMpQUXMucV+wLHIPgMm9 eIZO1NCE1ZknS4t9ol3zsl2co0XxVFK+wHj+zPcG05ekr9Vg0WwqpdfScAImwUlxG3ok PyblwGEDjzm+K/7E7qT2BcFruf4GmrlTyH3FzS5txeJZcCgyXK3kIwfBubSZ9P99FEXl ezbqmKgn9g46gcHHCZ7MiTGqBZYvHTIM/TQHzr/tg2kMWuV32lOVuczFqN2whlsCMoXD ahZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=x/X0AYknQzecFdwg696QX8gtxb35n3H1vFaXCdnFjLM=; b=CCmzipFV1pUv+wHFHekjWanp9WmWhhnpWPdxtQ3580/trBcAe2Ab7WBUVBl+9M+Tu2 /qZ7eTWoWxH9hH0gwjXVXotk5GrxKacnTFPoG7ksbt+FJDeyxBFGgDbjnbsxMCmCuXf0 1R2WU2y6fkcNIRVGDU1jnWcVV9a6Ur+fk5L5YWmyBEFf6+a9AbBVnSXKX5vy0sp2OjlW oazgWYgL1lJWgWyFrkfYOBG90hePIfzxsrCbgPWYPhT8Tbg7Q5nhFJu+zR6dhQaNWaKY E2IeudbrYfRJ0vyOtk0PorTCnKm+AtLVuwPKt5AxYOKgPRGnO2K9PYpiNnMJ18ZQLlLl I3nQ== X-Gm-Message-State: APjAAAW3K41+PDGwfqRO+GHyhegN0x0tC0L5k9q7p8XMYZ7Jum89DDih RJejZe8okns7zHOsgFS+EawkkA== X-Google-Smtp-Source: APXvYqyMJCzcSHWmwo1d5i1Nbk1NpacT96EoMh7833OpvMUEhyplfDDHSY7hXqIDO4sWumkf508/Mg== X-Received: by 2002:ae9:e406:: with SMTP id q6mr19432095qkc.227.1556473058378; Sun, 28 Apr 2019 10:37:38 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([191.119.64.14]) by smtp.gmail.com with ESMTPSA id 28sm3103206qtv.40.2019.04.28.10.37.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Apr 2019 10:37:37 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 5FFED123A1D; Sun, 28 Apr 2019 13:37:33 -0400 (-04) Date: Sun, 28 Apr 2019 13:37:33 -0400 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-translators@postgresql.org Subject: Re: branching time Message-ID: <20190428173733.GA12483@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <94cfe030-61d0-4b01-2d3a-603e7c326bf1@2ndquadrant.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2019-Apr-26, Peter Eisentraut wrote: > On 2019-04-26 20:14, Alvaro Herrera wrote: > > I think we need to write a filter program that compares MSGFILTER_MSGID > > to MSGFILTER_PREV_MSGID, and if the only difference is the leading "%s: " > > and the trailing "\n", then strip those thing from stdin and write that > > to stdout. > > I didn't do it that way, which explains the above problems. We can try > it a few more times. :) I wrote one today. I first tried doing it in bash, which is probably gonna give me nightmares tonight, so it ended up in Perl. It's below in case someone wants to give it a go. You run it like msgfilter -i somefile.po ./filter > somefile-2.po mv somefile-2.po somefile.po (or you can use "sponge"). It wasn't as successful as I expected, mostly because msgfilter is limited; it doesn't let you remove the "fuzzy" flag from the message when you get a match, so you need to revise the file afterwards each updated entry to remove the flag from each entry ... but of course there are fuzzies for other reasons, so it's very error-prone. Anyway, I think it's much faster than doing it all by hand. It took quite some time to figure out a correct filter, because it's not clear how the '\n' is represented in each place. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=filter #!/usr/bin/perl use warnings; if (not defined $ENV{MSGFILTER_PREV_MSGID}) { while (<>) { print $_; } exit; } my $first = 1; if (("%s: " . $ENV{MSGFILTER_MSGID} . "\n") eq $ENV{MSGFILTER_PREV_MSGID}) { while ($l = <>) { if ($first) { $l =~ s/^%s: (.*)/$1/; $first = 0; } $l =~ s/\n$// if eof(STDIN); print $l; } } else { while (<>) { print $_; } exit; } --wRRV7LY7NUeQGEoC--