This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 44bd3f3def622e724a90e7786a1f7e16986e0034 (commit)
from 7c3d2f03fb46a25c107466f710d2e746ec2df99c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 44bd3f3def622e724a90e7786a1f7e16986e0034
Author: bogglez <bo...@pr...>
Date: Fri Mar 10 21:44:51 2017 +0100
bin2o: shellcheck, error on missing env vars
-----------------------------------------------------------------------
Summary of changes:
utils/bin2o/bin2o | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/utils/bin2o/bin2o b/utils/bin2o/bin2o
index 0216f61..af5e3de 100755
--- a/utils/bin2o/bin2o
+++ b/utils/bin2o/bin2o
@@ -5,34 +5,43 @@
# (c)2000 Dan Potter
if [ $# != 3 ]; then
- echo usage: $0 \<input file\> \<symbol\> \<output file\>
+ echo "usage: $0 \<input file\> \<symbol\> \<output file\>"
exit 0
fi
+for i in KOS_ARCH KOS_AS KOS_ASFLAGS KOS_LD; do
+ if [ -z "$(eval "echo \"\$$i\"")" ]; then
+ echo "Environment variable $i is undefined."
+ error=1
+ fi
+done
+
+if [ -n "$error" ]; then
+ exit 1
+fi
+
TMPFILE1=/tmp/script$$.ld
TMPFILE2=/tmp/obja$$.o
TMPFILE3=/tmp/objb$$.o
# Gotta do a different binary target here depending on the target
-if [ $KOS_ARCH = "dreamcast" ]; then
- echo ".section .rodata; .align 2; " | $KOS_AS $KOS_AFLAGS -o $TMPFILE3
+if [ "$KOS_ARCH" = dreamcast ]; then
+ echo ".section .rodata; .align 2; " | "$KOS_AS" $KOS_AFLAGS -o "$TMPFILE3"
if [ $? -ne 0 ]; then exit 1; fi
- echo "SECTIONS { .rodata : { _$2 = .; *(.data); _$2_end = .; } }" > $TMPFILE1
- $KOS_LD --no-warn-mismatch --format binary --oformat elf32-shl $1 --format elf32-shl $TMPFILE3 -o $TMPFILE2 -r -EL -T $TMPFILE1
+ echo "SECTIONS { .rodata : { _$2 = .; *(.data); _$2_end = .; } }" > "$TMPFILE1"
+ "$KOS_LD" --no-warn-mismatch --format binary --oformat elf32-shl "$1" --format elf32-shl "$TMPFILE3" -o "$TMPFILE2" -r -EL -T "$TMPFILE1"
if [ $? -ne 0 ]; then exit 1; fi
- $KOS_OBJCOPY --set-section-flags .rodata=alloc,load,data,readonly $TMPFILE2 $3
+ "$KOS_OBJCOPY" --set-section-flags .rodata=alloc,load,data,readonly "$TMPFILE2" "$3"
if [ $? -ne 0 ]; then exit 1; fi
- rm -f $TMPFILE1 $TMPFILE2 $TMPFILE3
-fi
+ rm -f "$TMPFILE1" "$TMPFILE2" "$TMPFILE3"
-if [ $KOS_ARCH = "gba" ]; then
+elif [ "$KOS_ARCH" = gba ]; then
echo "SECTIONS { .rodata : { $2 = .; *(.data); $2_end = .; } }" > /tmp/script.ld
- $KOS_LD --no-warn-mismatch --format binary --oformat elf32-littlearm $1 -o $3 -r -EL -T /tmp/script.ld
-fi
+ "$KOS_LD" --no-warn-mismatch --format binary --oformat elf32-littlearm "$1" -o "$3" -r -EL -T /tmp/script.ld
-if [ $KOS_ARCH = "ps2" ]; then
+elif [ "$KOS_ARCH" = ps2 ]; then
echo "OUTPUT_ARCH(mips:5900) SECTIONS { .rodata : { _$2 = .; *(.data); _$2_end = .; } }" > /tmp/script.ld
- $KOS_LD --no-warn-mismatch --format binary --oformat elf64-littlemips -mips3 $1 -o $3 -r -EL -T /tmp/script.ld
+ "$KOS_LD" --no-warn-mismatch --format binary --oformat elf64-littlemips -mips3 "$1" -o "$3" -r -EL -T /tmp/script.ld
fi
rm -f /tmp/script.ld
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|