Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simark@simark.ca>,
	Joel Brobecker <brobecker@adacore.com>,
	Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCH 1/2] gdbsupport: Resolve shellcheck issues in create-version.sh script
Date: Fri, 27 Mar 2020 12:27:11 +0000	[thread overview]
Message-ID: <0784fb919936e8e5afa466c7597c37c574a44bb9.1585311874.git.andrew.burgess@embecosm.com> (raw)
In-Reply-To: <cover.1585311874.git.andrew.burgess@embecosm.com>
In-Reply-To: <cover.1585311874.git.andrew.burgess@embecosm.com>

Run shellcheck (version 0.4.7) on the create-version.sh script, and
resolve the issues it highlighter - they all seemed reasonable.

gdbsupport/ChangeLog:

	* create-version.sh: Resolve issues highlighted by shellcheck.
---
 gdbsupport/ChangeLog         |  4 ++++
 gdbsupport/create-version.sh | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/gdbsupport/create-version.sh b/gdbsupport/create-version.sh
index 81d6dbf8c1f..6135d219d94 100755
--- a/gdbsupport/create-version.sh
+++ b/gdbsupport/create-version.sh
@@ -27,12 +27,14 @@ host_alias="$2"
 target_alias="$3"
 output="$4"
 
-rm -f version.c-tmp $output version.tmp
-date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
-sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
-echo '#include "gdbsupport/version.h"' >> version.c-tmp
-echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
-echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
-echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
-mv version.c-tmp $output
+rm -f version.c-tmp "$output" version.tmp
+date=$(sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' "$srcdir/../bfd/version.h")
+sed -e "s/DATE/$date/" < "$srcdir/version.in" > version.tmp
+{
+    echo '#include "gdbsupport/version.h"'
+    echo 'const char version[] = "'"$(sed q version.tmp)"'";'
+    echo 'const char host_name[] = "'"$host_alias"'";'
+    echo 'const char target_name[] = "'"$target_alias"'";'
+} >> version.c-tmp
+mv version.c-tmp "$output"
 rm -f version.tmp
-- 
2.14.5



  parent reply	other threads:[~2020-03-27 12:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 11:48 [RFC] Add git sha information to the gdb version string Andrew Burgess
2020-03-26 14:55 ` Simon Marchi
2020-03-27 11:45   ` Andrew Burgess
2020-03-27 12:27   ` [PATCH 0/2] Adding git sha information to the " Andrew Burgess
2020-03-27 12:27   ` Andrew Burgess [this message]
2020-03-27 13:11     ` [PATCH 1/2] gdbsupport: Resolve shellcheck issues in create-version.sh script Simon Marchi
2020-03-27 13:57       ` Andrew Burgess
2020-03-27 12:27   ` [PATCH 2/2] Add git sha information to the gdb version string Andrew Burgess
2020-03-27 13:56     ` Simon Marchi
2020-03-27 15:28       ` Andrew Burgess
2020-03-27 15:42         ` Andreas Schwab
2020-03-27 16:18           ` Andrew Burgess
2020-03-27 15:48         ` Simon Marchi
2020-04-10  0:01     ` Joel Brobecker
2020-04-10  0:10       ` Joel Brobecker

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=0784fb919936e8e5afa466c7597c37c574a44bb9.1585311874.git.andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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