[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Fix $m4dirs count
From: |
Eric Blake |
Subject: |
Re: [PATCH] Fix $m4dirs count |
Date: |
Sat, 14 Nov 2009 06:47:15 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Robert Millan on 11/9/2009 2:00 PM:
>> This is wrong, since 'echo -n' is not portable. It should use printf
>> instead,
>> or find some other portable way to count $m4dirs.
>
> Hi,
>
> In that case, please use printf. It should work too.
I was waiting for Bruno to reply, but your patch looks safe (with printf)
and gnulib-tool already uses printf. So I'm pushing:
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkr+tOMACgkQ84KuGfSFAYCOswCgnYCtjj2M8HSq8L0/fmycdBTz
9voAnR5LStPnExXRJojQXWi7rK/R7wfM
=Q2j1
-----END PGP SIGNATURE-----
>From fb1b608caaa3de195f3d97356e95a165ef5517da Mon Sep 17 00:00:00 2001
From: Robert Millan <address@hidden>
Date: Sat, 14 Nov 2009 06:45:02 -0700
Subject: [PATCH] gnulib-tool: correctly detect absence of m4 directories
$m4dirs is incorrectly counting. In my particular case
(correct value: 0, detected value: 1), this resulted in gnulib-tool
silently exitting with no visible error (and no job done).
* gnulib-tool: Avoid extra newline on data passed to wc -l.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 5 +++++
gnulib-tool | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c821d8d..5fbff63 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-14 Robert Millan <address@hidden> (tiny change)
+
+ gnulib-tool: correctly detect absence of m4 directories
+ * gnulib-tool: Avoid extra newline on data passed to wc -l.
+
2009-11-14 Jim Meyering <address@hidden>
maint.mk: Prohibit inclusion of "xalloc.h" without use.
diff --git a/gnulib-tool b/gnulib-tool
index 397f442..aafd345 100755
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -4500,7 +4500,7 @@ case $mode in
sedexpr2='s,^[^/]*$,.,'
sedexpr3='s,/[^/]*$,,'
m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e
"$sedexpr3" | LC_ALL=C sort -u`
- m4dirs_count=`echo "$m4dirs" | wc -l`
+ m4dirs_count=`printf %s "$m4dirs" | wc -l`
fi
fi
if test $m4dirs_count = 0; then
--
1.6.5.rc1