[pkg-fso-commits] [SCM] Various non-packaged files branch, master, updated. d01a461083d18e8fd08fae1ec658b2086a9b6cb5
Steffen Moeller
moeller at debian.org
Tue Mar 10 22:32:05 UTC 2009
The following commit has been merged in the master branch:
commit 6f16e6c66333cb5e5aab1bc2aef8bf724694cdc7
Author: Steffen Moeller <moeller at debian.org>
Date: Sun Mar 8 20:10:02 2009 +0100
Improved naming of variables
VERBOSE was a few times found in lower case, I also added its description in the help file.
A few variables of a very local character were renamed to receive the prefix "intern_" and become lowercase.
This should help distinguishing them from such that are expected to be controlled from the outside.
diff --git a/install.sh b/install.sh
index 126d0fb..878630c 100755
--- a/install.sh
+++ b/install.sh
@@ -71,6 +71,7 @@ fi
# general variables
VERSION=1.1
+VERBOSE=${VERBOSE:-}
TESTHOST=${TESTHOST:-www.debian.org}
RDATEHOST=${RDATEHOST:-ntp.fu-berlin.de}
WPA_SUPPLICANT_CONF=${WPA_SUPPLICANT_CONF:-/etc/wpa_supplicant/wpa_supplicant.conf}
@@ -142,8 +143,8 @@ five_seconds_to_quit () {
# since dash doesn't support 'read' -t and -n options, this script
# should be executed only by /bin/bash. However, all official
# Openmoko images use busybox, which doesn't provide /bin/bash
- read -t 5 -n 1 VAR || VAR=continue
- if [ "$VAR" != "continue" ]; then
+ read -t 5 -n 1 intern_var || intern_var=continue
+ if [ "$intern_var" != "continue" ]; then
echo "E: aborting on user request"
exit 1
fi
@@ -228,6 +229,7 @@ ENVIRONMENT
(set to '$SINGLE_PART')
TESTHOST name of machine that should be tested for availability
(set to '$TESTHOST')
+ VERBOSE increase amount of information that is forwarded to stdout
WPA_SUPPLICANT_CONF
local configuration which to transfer to neo
(set to '$WPA_SUPPLICANT_CONF')
@@ -393,7 +395,7 @@ __END__
for f in testing time partition format mount debian apt fso configuration kernel unmount
do
- if [ -n "$verbose" ]; then echo calling '$f'; fi
+ if [ -n "$VERBOSE" ]; then echo calling '$f'; fi
action_$f
done
cat <<__END__
@@ -425,12 +427,14 @@ action_testing () {
fi
echo " * microSD card device: $SD_DEVICE present"
- for BINARY in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS mkswap gunzip dd sed rdate; do
- if ! which $BINARY > /dev/null; then
- echo "E: Could not find $BINARY binary"
+ for intern_binary in wget ping fdisk mount umount mkfs.$SD_PART1_FS mkfs.$SD_PART2_FS mkswap gunzip dd sed rdate; do
+ if ! which $intern_binary > /dev/null; then
+ echo "E: Could not find $intern_binary binary"
exit 1
fi
- echo " * $BINARY installed"
+ if [ -n "$VERBOSE" ]; then
+ echo " * $intern_binary installed"
+ fi
done
if tar --help 2>&1 | grep "Usage: tar \-\[cxtvO\]" >/dev/null; then
@@ -590,7 +594,7 @@ EOSWAPCONF
if fdisk $SD_DEVICE < /tmp/argsToFdisk$$; then
echo "Partitioning was successful."
- if [ -n "$verbose" ]; then
+ if [ -n "$VERBOSE" ]; then
echo "The following partitions have been created:"
echo "pq" | fdisk $SD_DEVICE
fi
@@ -603,20 +607,20 @@ EOSWAPCONF
echo " * Waiting for partitions to appear"
- SLEEP_SECONDS=3
+ intern_sleep_seconds=3
if [ "$SINGLE_PART" = "true" ]; then
- DEVTEST="test -e ${SD_DEVICE}p1"
+ intern_devtest="test -e ${SD_DEVICE}p1"
else
- DEVTEST="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
+ intern_devtest="test -e ${SD_DEVICE}p1 -a -e ${SD_DEVICE}p2"
fi
- while ! $DEVTEST; do
- if [ "$SLEEP_SECONDS" = 15 ]; then
+ while ! $intern_devtest; do
+ if [ "$intern_sleep_seconds" = 15 ]; then
echo "E: Partitioning has failed, partitions have not been created"
exit 1
fi
sleep 3
- SLEEP_SECONDS=`expr $SLEEP_SECONDS + 3`
+ intern_sleep_seconds=$(( $intern_sleep_seconds + 3 ))
done
echo " * Partition table created"
}
@@ -656,16 +660,16 @@ action_mount () {
if [ -d "$INST_DIR" ]; then
mkdir -p "$INST_DIR";
intern_instdir_already_present=""
- elif [ -n "$verbose" ]; then
+ elif [ -n "$VERBOSE" ]; then
echo "Not creating directory '$INST_DIR', it is already existing."
intern_instdir_already_present="true"
fi
if [ "$SINGLE_PART" = "true" ]; then
- if [ -n "$verbose" ]; then echo "Preparing single ext2 device."; fi
+ if [ -n "$VERBOSE" ]; then echo "Preparing single ext2 device."; fi
mount -t auto ${SD_DEVICE}p1 "$INST_DIR"
mkdir -p "$INST_DIR/boot"
else
- if [ -n "$verbose" ]; then echo "Mounting root partition to '$INST_DIR'."; fi
+ if [ -n "$VERBOSE" ]; then echo "Mounting root partition to '$INST_DIR'."; fi
mount -t auto ${SD_DEVICE}p2 "$INST_DIR"
if [ "vfat" = "$SD_PART1_FS" ]; then
echo "You have a vfat boot filesystem. This is not mounted to /boot."
--
Various non-packaged files
More information about the pkg-fso-commits
mailing list