Skip to contentSkip to conversation

Travis build fixes

PATCH New Petr Vorel 2 participants 7 messages Dec 17, 2020

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover Travis build fixes

Hi,

FYI only first commit is required to fix travis failures.

Kind regards,
Petr

Petr Vorel (2):
docparse/parse.sh: Fix parsing on dash docparse/parse.sh: Fix running with relative path

 docparse/parse.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.29.2
author
#1 lore raw

PATCH 1/2 docparse/parse.sh: Fix parsing on dash

bash keeps escape sequences (e.g. \t and \n) when using echo:

$ a="-v\tverbose output\n"; echo "$a"
-v\tverbose output\n
$

But dash interprets them (behaves like echo -e on bash):

$ a="-v\tverbose output\n"; echo -e "$a"
-e -v	verbose output

$

Using printf does not help, because it'd have to be separated with -- which cannot be used for printing variables.
Fortunately cat << EOF redirection is portable.
In the future we should probably avoid shell as much as possible.

Fixes 0962c9a37 ("syscalls/perf_event_open02: Use anonymous .options")
---
 docparse/parse.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
docparse/parse.sh +3 -1
index 4ae0c42b2..172eab702 100755
@@ -32,7 +32,9 @@ for test in `find testcases/ -name '*.c'`; do
 			echo ','
 		fi
 		first=
-		echo -n "$a"
+		cat <<EOF
+$a
+EOF
 	fi
 done
 
Signature · 1 line
2.29.2
#2 lore raw

PATCH 1/2 docparse/parse.sh: Fix parsing on dash

Hi!

Quoted 10 lines

bash keeps escape sequences (e.g. \t and \n) when using echo:

$ a="-v\tverbose output\n"; echo "$a"
-v\tverbose output\n
$

But dash interprets them (behaves like echo -e on bash):

$ a="-v\tverbose output\n"; echo -e "$a"
-e -v	verbose output

Can we remove the \t from the perf_event_open02.c as well please? I doubt that it will do any good when we pass the strings into asciidoc parser...

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#3 lore raw

PATCH 1/2 docparse/parse.sh: Fix parsing on dash

Quoted 7 lines

Hi!

Quoted 5 lines

bash keeps escape sequences (e.g. \t and \n) when using echo:

$ a="-v\tverbose output\n"; echo "$a"
-v\tverbose output\n
$
Quoted 6 lines
Quoted 4 lines

But dash interprets them (behaves like echo -e on bash):

$ a="-v\tverbose output\n"; echo -e "$a"
-e -v	verbose output

Thanks for both reviews!

Quoted 3 lines

Can we remove the \t from the perf_event_open02.c as well please? I doubt that it will do any good when we pass the strings into asciidoc parser...

Sure, I'll replace it with <tab>.

Kind regards,
Petr

author
#5 lore raw

PATCH 2/2 docparse/parse.sh: Fix running with relative path

In reply to Petr Vorel

that's not needed for build, but useful for debugging.

Running as ./parse.sh fails:
cat: ./../VERSION: No such file or directory

top_srcdir must be absolute path.

Fixes a069cd36b ("docparse: Add test documentation parser")
---
 docparse/parse.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docparse/parse.sh +1 -1
index 172eab702..79011bc10 100755
@@ -5,7 +5,7 @@
 set -e
 
 top_builddir=$PWD/..
-top_srcdir="$(dirname $0)/.."
+top_srcdir="$(cd $(dirname $0)/..; pwd)"
 
 cd $top_srcdir
 
Signature · 1 line
2.29.2
#6 lore raw

PATCH 2/2 docparse/parse.sh: Fix running with relative path

Hi!

Quoted 19 lines

that's not needed for build, but useful for debugging.

Running as ./parse.sh fails:
cat: ./../VERSION: No such file or directory

top_srcdir must be absolute path.

Fixes a069cd36b ("docparse: Add test documentation parser")
---
 docparse/parse.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docparse/parse.sh +0 -0
index 172eab702..79011bc10 100755

docparse/parse.sh line 10

Quoted 7 lines
docparse/parse.sh +1 -1
@@ -5,7 +5,7 @@
 set -e
 
 top_builddir=$PWD/..
-top_srcdir="$(dirname $0)/.."
+top_srcdir="$(cd $(dirname $0)/..; pwd)"
 
 cd $top_srcdir
Signature · 2 lines
Cyril Hrubis
[email protected]