public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH 1/2] gdbsupport: Resolve shellcheck issues in create-version.sh script
Date: Fri, 27 Mar 2020 09:11:33 -0400	[thread overview]
Message-ID: <62636013-06cb-ec3e-132d-780c307f1fb5@simark.ca> (raw)
In-Reply-To: <0784fb919936e8e5afa466c7597c37c574a44bb9.1585311874.git.andrew.burgess@embecosm.com>

On 2020-03-27 8:27 a.m., Andrew Burgess wrote:
> 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
> 

Thanks, I think it's probably worth pushing this patch right away, it's an improvement
in its own right.

Simno

  reply	other threads:[~2020-03-27 13:11 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   ` [PATCH 1/2] gdbsupport: Resolve shellcheck issues in create-version.sh script Andrew Burgess
2020-03-27 13:11     ` Simon Marchi [this message]
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=62636013-06cb-ec3e-132d-780c307f1fb5@simark.ca \
    --to=simark@simark.ca \
    --cc=andrew.burgess@embecosm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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).