Skip to content

Commit 581120b

Browse files
committed
USE_* variables: compare strings instead of integers
1 parent 98f408d commit 581120b

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

libexec/copy-from-target

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ if [ $# = 0 ] ; then
4646
exit 1
4747
fi
4848

49-
if [ "$USE_DOCKER" -eq 1 ]; then
49+
if [ "$USE_DOCKER" = "1" ]; then
5050
# Use tar, so that files are created with the correct owner on the host
5151
docker exec -u $TUSER gitian-target tar -C `dirname "$1"` -cf - `basename "$1"` | tar -C "$2" -xf -
52-
elif [ "$USE_LXC" -eq 1 ]; then
52+
elif [ "$USE_LXC" = "1" ]; then
5353
config-lxc
5454
sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -C `dirname "$1"` -cf - `basename "$1"` | tar -C "$2" -xf -
5555
else

libexec/copy-to-target

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ if [ $# = 0 ] ; then
4646
exit 1
4747
fi
4848

49-
if [ "$USE_DOCKER" -eq 1 ]; then
49+
if [ "$USE_DOCKER" = "1" ]; then
5050
docker exec -u $TUSER gitian-target mkdir -p "/home/$TUSER/$2"
5151
docker cp "$1" gitian-target:"/home/$TUSER/$2"
5252
docker exec -u root gitian-target chown -R $TUSER:$TUSER "/home/$TUSER/$2"
53-
elif [ "$USE_LXC" -eq 1 ]; then
53+
elif [ "$USE_LXC" = "1" ]; then
5454
config-lxc
5555
tar -C `dirname "$1"` -cf - `basename "$1"` | sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -i -u $TUSER tar -C "$2" -xf -
5656
else

libexec/gconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VM_SSH_PORT=2223
2-
if [ "$USE_LXC" -eq 1 ]; then
2+
if [ "$USE_LXC" = "1" ]; then
33
if [ -z "$LXC_EXECUTE" ]; then
44
ver=`lxc-start --version`
55
if dpkg --compare-versions $ver ge 1.0.0 ; then

libexec/make-clean-vm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ SUITE=xenial
55
ARCH=amd64
66

77
VMSW=KVM
8-
if [ "$USE_LXC" -eq 1 ]; then
8+
if [ "$USE_LXC" = "1" ]; then
99
VMSW=LXC
10-
elif [ "$USE_VBOX" -eq 1 ]; then
10+
elif [ "$USE_VBOX" = "1" ]; then
1111
VMSW=VBOX
12-
elif [ "$USE_DOCKER" -eq 1 ]; then
12+
elif [ "$USE_DOCKER" = "1" ]; then
1313
VMSW=DOCKER
1414
fi
1515

libexec/on-target

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ fi
4646
# exit 1
4747
#fi
4848

49-
if [ "$USE_DOCKER" -eq 1 ]; then
49+
if [ "$USE_DOCKER" = "1" ]; then
5050
docker exec -u $TUSER -i gitian-target $*
51-
elif [ "$USE_LXC" -eq 1 ]; then
51+
elif [ "$USE_LXC" = "1" ]; then
5252
config-lxc
5353
sudo $LXC_EXECUTE -n gitian -f var/lxc.config -- sudo -u $TUSER $ENV -i -- $*
5454
else

libexec/start-target

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ ARCH=qemu$1
66
SUFFIX=$2
77

88
VMSW=KVM
9-
if [ "$USE_LXC" -eq 1 ]; then
9+
if [ "$USE_LXC" = "1" ]; then
1010
VMSW=LXC
11-
elif [ "$USE_VBOX" -eq 1 ]; then
11+
elif [ "$USE_VBOX" = "1" ]; then
1212
VMSW=VBOX
13-
elif [ "$USE_DOCKER" -eq 1 ]; then
13+
elif [ "$USE_DOCKER" = "1" ]; then
1414
VMSW=DOCKER
1515
fi
1616

libexec/stop-target

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/sh
22

33
VMSW=KVM
4-
if [ "$USE_LXC" -eq 1 ]; then
4+
if [ "$USE_LXC" = "1" ]; then
55
VMSW=LXC
6-
elif [ "$USE_VBOX" -eq 1 ]; then
6+
elif [ "$USE_VBOX" = "1" ]; then
77
VMSW=VBOX
8-
elif [ "$USE_DOCKER" -eq 1 ]; then
8+
elif [ "$USE_DOCKER" = "1" ]; then
99
VMSW=DOCKER
1010
fi
1111

0 commit comments

Comments
 (0)