public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: dwz@sourceware.org, jakub@redhat.com
Subject: [committed] Remove leading whitespace in gnu-debugaltlink-name.sh output
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190313105831.GA14397@delia> (raw)

Hi,

Currently, gnu-debugaltlink-name.sh prints leading whitespace:
...
$ echo \""$(./testsuite/scripts/gnu-debugaltlink-name.sh 1)"\"
"  3"
...

Fix this by using sed to extract the name from the readelf output.

With that fixed, we add quotes to gnu-debugaltlink-name.sh calls to prevent
"unary operator expected" errors.

Thanks,
- Tom

Remove leading whitespace in gnu-debugaltlink-name.sh output

2019-03-13  Tom de Vries  <tdevries@suse.de>

	* testsuite/scripts/gnu-debugaltlink-name.sh: Remove leading whitespace.
	* testsuite/dwz.tests/eu-strip-unstrip-multifile.sh: Guard
	gnu-debugaltlink-name.sh call with quotes.
	* testsuite/dwz.tests/multifile-name.sh: Same.
	* testsuite/dwz.tests/multifile-relative.sh: Same.
	* testsuite/dwz.tests/multifile.sh: Same.

---
 testsuite/dwz.tests/eu-strip-unstrip-multifile.sh | 4 ++--
 testsuite/dwz.tests/multifile-name.sh             | 4 ++--
 testsuite/dwz.tests/multifile-relative.sh         | 4 ++--
 testsuite/dwz.tests/multifile.sh                  | 4 ++--
 testsuite/scripts/gnu-debugaltlink-name.sh        | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
index a49666f..ea76dcb 100755
--- a/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
+++ b/testsuite/dwz.tests/eu-strip-unstrip-multifile.sh
@@ -16,8 +16,8 @@ eu-unstrip 2.stripped 2.debug -o 2.unstripped
 smaller-than.sh 1.unstripped 1
 smaller-than.sh 2.unstripped 2
 
-[ $(gnu-debugaltlink-name.sh 1.unstripped) = "3" ]
-[ $(gnu-debugaltlink-name.sh 2.unstripped) = "3" ]
+[ "$(gnu-debugaltlink-name.sh 1.unstripped)" = "3" ]
+[ "$(gnu-debugaltlink-name.sh 2.unstripped)" = "3" ]
 
 ls=$(ls)
 ls=$(echo $ls)
diff --git a/testsuite/dwz.tests/multifile-name.sh b/testsuite/dwz.tests/multifile-name.sh
index 26d2ed3..ea4dcec 100755
--- a/testsuite/dwz.tests/multifile-name.sh
+++ b/testsuite/dwz.tests/multifile-name.sh
@@ -14,7 +14,7 @@ ls=$(ls)
 ls=$(echo $ls)
 [ "$ls" = "1 2 3" ]
 
-[ $(gnu-debugaltlink-name.sh 1) = "/xxx/yyy/3" ]
-[ $(gnu-debugaltlink-name.sh 2) = "/xxx/yyy/3" ]
+[ "$(gnu-debugaltlink-name.sh 1)" = "/xxx/yyy/3" ]
+[ "$(gnu-debugaltlink-name.sh 2)" = "/xxx/yyy/3" ]
 
 rm -f 1 2 3
diff --git a/testsuite/dwz.tests/multifile-relative.sh b/testsuite/dwz.tests/multifile-relative.sh
index 9b13d43..2fea507 100755
--- a/testsuite/dwz.tests/multifile-relative.sh
+++ b/testsuite/dwz.tests/multifile-relative.sh
@@ -14,7 +14,7 @@ ls=$(ls)
 ls=$(echo $ls)
 [ "$ls" = "1 2 3" ]
 
-[ $(gnu-debugaltlink-name.sh 1) = "3" ]
-[ $(gnu-debugaltlink-name.sh 2) = "3" ]
+[ "$(gnu-debugaltlink-name.sh 1)" = "3" ]
+[ "$(gnu-debugaltlink-name.sh 2)" = "3" ]
 
 rm -f 1 2 3
diff --git a/testsuite/dwz.tests/multifile.sh b/testsuite/dwz.tests/multifile.sh
index 5c54d0f..dde2a94 100755
--- a/testsuite/dwz.tests/multifile.sh
+++ b/testsuite/dwz.tests/multifile.sh
@@ -14,7 +14,7 @@ ls=$(ls)
 ls=$(echo $ls)
 [ "$ls" = "1 2 3" ]
 
-[ $(gnu-debugaltlink-name.sh 1) = "3" ]
-[ $(gnu-debugaltlink-name.sh 2) = "3" ]
+[ "$(gnu-debugaltlink-name.sh 1)" = "3" ]
+[ "$(gnu-debugaltlink-name.sh 2)" = "3" ]
 
 rm -f 1 2 3
diff --git a/testsuite/scripts/gnu-debugaltlink-name.sh b/testsuite/scripts/gnu-debugaltlink-name.sh
index d99a970..667c5fd 100755
--- a/testsuite/scripts/gnu-debugaltlink-name.sh
+++ b/testsuite/scripts/gnu-debugaltlink-name.sh
@@ -8,4 +8,4 @@ readelf \
     --string-dump=.gnu_debugaltlink \
     $1 \
     | grep -a '\[[ 	]*0\]' \
-    | awk '{$1="";$2=""; print;}'
+    | sed 's/.*0\]  //'

                 reply	other threads:[~2019-03-13 10:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190313105831.GA14397@delia \
    --to=tdevries@suse.de \
    --cc=dwz@sourceware.org \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).