Skip to content

Commit

Permalink
gdbsupport: Resolve shellcheck issues in create-version.sh script
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
T-J-Teru committed Mar 27, 2020
1 parent 1fafefd commit 8f2dae6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions gdbsupport/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-03-27 Andrew Burgess <[email protected]>

* create-version.sh: Resolve issues highlighted by shellcheck.

2020-03-20 Simon Marchi <[email protected]>

* config.in: Re-generate.
Expand Down
18 changes: 10 additions & 8 deletions gdbsupport/create-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8f2dae6

Please sign in to comment.