GNU bug report logs - #8532
FAIL: cp/sparse-fiemap

Previous Next

Package: coreutils;

Reported by: dclarke <at> blastwave.org

Date: Thu, 21 Apr 2011 17:38:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 8532-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Alan Curry" <pacman-cu <at> kosh.dhis.org>
Cc: 8532-done <at> debbugs.gnu.org, dclarke <at> blastwave.org
Subject: Re: bug#8532: FAIL: cp/sparse-fiemap
Date: Fri, 22 Apr 2011 11:15:06 +0200
Alan Curry wrote:
> Jim Meyering writes:
>>
>> Dennis Clarke wrote:
>> > FAIL: cp/sparse-fiemap
>> ...
>> > + awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
>> > awk: cmd. line:1: /^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END
>> > {print ""}
>> > awk: cmd. line:1:                                     ^ syntax error
>> > + sed 's/ [a-z,][a-z,]*$//' ff1
>>
>> Thank you for the report.
>> What awk program and version are you using?
>> I.e., awk --version might help.
>> Also, what distribution are you using?
>
> I can't figure out what version he's using, but Mr. Kernighan's awk doesn't
> like that syntax either. Notice that if you changed the '<' to a '>' it would
> be an output redirection for the printf. Using the '<' as a comparison
> operator in the same position is awfully fragile.
>
> Parenthesizing the ternary expression makes it happy again.
>
>> BTW, that syntax works for me using the latest gawk with or without -W compat,
>> and with the mawk and nawk programs from debian unstable.
>
> apt-get install original-awk

Thanks.
This patch fixes it, and I've closed the ticket.

Alan, I'll wait for you to "ack" before pushing it,
since I've listed you as the author.

From 302cfcaeab531138d59e4835ef77020a750e71f9 Mon Sep 17 00:00:00 2001
From: Alan Curry <pacman-cu <at> kosh.dhis.org>
Date: Fri, 22 Apr 2011 11:08:50 +0200
Subject: [PATCH] tests: sparse-fiemap: adjust syntax to accommodate older awk

* tests/cp/sparse-fiemap: Parenthesize ternary expression used
as an argument to awk's printf.  Otherwise, gawk 3.0.1 and the
one from debian stable's original-awk would get a syntax error.
Reported by Dennis Clarke.

Copyright note: tiny change
---
 THANKS.in              |    1 +
 tests/cp/sparse-fiemap |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index bd8645f..342a52c 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -151,6 +151,7 @@ Deepak Goel                         deego <at> gnufans.org
 Denis Excoffier                     denis.excoffier <at> airbus.com
 Denis McKeon                        dmckeon <at> swcp.com
 Dennis Henriksen                    opus <at> flamingo.osrl.dk
+Dennis Clarke                       dclarke <at> blastwave.org
 Dennis Smit                         ds <at> nerds-incorporated.org
 Derek Clegg                         dclegg <at> next.com
 Dick Streefland                     dick_streefland <at> tasking.com
diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 1394060..64668ed 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -64,7 +64,7 @@ fi
 f()
 {
   sed 's/ [a-z,][a-z,]*$//' $@ \
-    | awk '/^ *[0-9]/ {printf "%d %d ", $2 ,NF < 5 ? $NF : $5 } END {print ""}'
+    | awk '/^ *[0-9]/ {printf "%d %d ", $2, (NF<5 ? $NF : $5) } END {print ""}'
 }

 for i in $(seq 1 2 21); do
--
1.7.5.rc3.291.g63e4e




This bug report was last modified 14 years and 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.