make-gnucash-potfiles

John Ralls jralls at ceridwen.us
Thu Aug 7 16:45:18 EDT 2014


On Aug 7, 2014, at 10:37 AM, Aaron Laws <dartme18 at gmail.com> wrote:

> I have GREP_OPTIONS="--color=always -n --directories=skip", so when I run
> make distcheck, it fails. make-gnucash-potfiles is expecting grep to *not*
> put out line numbers nor colors. If the response to this is "don't do
> that", then you can stop reading. However, if we're wanting this script to
> run reliably in the face of a customized environment, the following patch
> works:
> 
> 
> From 0a150b770f895df9420bd5133bc8ba3960580a28 Mon Sep 17 00:00:00 2001
> From: lmat <dartme18 at gmail.com>
> Date: Thu, 7 Aug 2014 13:35:17 -0400
> Subject: [PATCH] make-gnucash-potfiles is now more reliable
> 
> make-gnucash-potfiles relies on certain behaviour from grep. This patch
> helps ensure that grep behaves in the way we expect.
> ---
> Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index 35f4771..4a2e285 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -185,7 +185,7 @@ pot: Makefile po/POTFILES.in
> 
> 
> $(srcdir)/po/POTFILES.in: make-gnucash-potfiles .potfiles
> -    if test -w $(srcdir)/po/POTFILES.in ; then ./make-gnucash-potfiles >
> $(srcdir)/po/POTFILES.in ; fi
> +    if test -w $(srcdir)/po/POTFILES.in ; then GREP_OPTIONS="-o
> --color=auto" ./make-gnucash-potfiles > $(srcdir)/po/POTFILES.in ; fi
> 
> # Creation rules so that po/gnucash.pot can always be created for
> # make dist.
> -- 
> 1.9.1
> 
> 
> 
> 
> It's also possible to similarly patch make-gnucash-potfiles itself. If
> that's desired, I'll be happy to come up with a patch like that.

Please stop sending patches to the list. It seems silly to create a branch on your Github repo for something small like this, so use Bugzilla. You don’t even need to post anything here; all of the active devs get bug mail.

Aside from that, what happens if instead of setting GREP_OPTIONS to “-o —color=auto" you unset it entirely?

I do think that it would be better to modify make-gnucash-potfiles.in directly to not use grep. Shelling out to run grep on a file from perl is pretty perverse. At the same time the script can be improved so that it doesn’t keep changing the order of files and so generating extraneous change sets.

Regards,
John Ralls




More information about the gnucash-devel mailing list