Correction: if then statement code style.

Corrected the if; then statement to follow bash convention.

Change-Id: Ia3f80520bb9446c4feb5ce36dccffa2b1c1d72c4
This commit is contained in:
AzherKhan 2014-07-01 02:27:41 -07:00
parent 5ee5aa5c89
commit d06a1caafb
9 changed files with 15 additions and 21 deletions

View File

@ -368,12 +368,14 @@ Ramdisk elements support the following files in their element directories:
* udev.d : udev rules files that will be copied into the ramdisk. * udev.d : udev rules files that will be copied into the ramdisk.
### Whitespace Rules ### Element coding standard ###
- lines should not include trailing whitespace - lines should not include trailing whitespace.
- there should be no hard tabs in the file - there should be no hard tabs in the file.
- indents are 4 spaces, and all indentation should be some multiple of - indents are 4 spaces, and all indentation should be some multiple of
them them.
- `do` and `then` keywords should be on the same line as the if, while or
for conditions.
Global image-build variables Global image-build variables
---------------------------- ----------------------------

View File

@ -26,8 +26,7 @@ export DIB_ENV=$(export | grep ' DIB_.*=')
SCRIPTNAME=$(basename $0) SCRIPTNAME=$(basename $0)
SCRIPT_HOME=$(dirname $0) SCRIPT_HOME=$(dirname $0)
if [ -d $SCRIPT_HOME/../share/diskimage-builder ] if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
then
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
else else
export _PREFIX=$SCRIPT_HOME/.. export _PREFIX=$SCRIPT_HOME/..

View File

@ -18,8 +18,7 @@ set -e
SCRIPTNAME=$(basename $0) SCRIPTNAME=$(basename $0)
SCRIPT_HOME=$(dirname $0) SCRIPT_HOME=$(dirname $0)
if [ -d $SCRIPT_HOME/../share/diskimage-builder ] if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
then
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
else else
export _PREFIX=$SCRIPT_HOME/.. export _PREFIX=$SCRIPT_HOME/..

View File

@ -7,8 +7,7 @@ set -o pipefail
sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon sudo mv $TARGET_ROOT/sbin/start-stop-daemon.REAL $TARGET_ROOT/sbin/start-stop-daemon
if [ -f $TARGET_ROOT/sbin/initctl.REAL ] if [ -f $TARGET_ROOT/sbin/initctl.REAL ]; then
then
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl
fi fi

View File

@ -14,8 +14,7 @@ echo "Warning: Fake start-stop-daemon called, doing nothing"
EOF EOF
sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon sudo chmod 755 $TARGET_ROOT/sbin/start-stop-daemon
if [ -f $TARGET_ROOT/sbin/initctl ] if [ -f $TARGET_ROOT/sbin/initctl ]; then
then
sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL sudo mv $TARGET_ROOT/sbin/initctl $TARGET_ROOT/sbin/initctl.REAL
sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF sudo dd of=$TARGET_ROOT/sbin/initctl <<EOF
#!/bin/sh #!/bin/sh

View File

@ -6,8 +6,7 @@ if [ -d /etc/first-boot.d ]; then
rc_local=/etc/rc.d/rc.local rc_local=/etc/rc.d/rc.local
FILE_EXISTED= FILE_EXISTED=
if [ -f $rc_local ] if [ -f $rc_local ]; then
then
FILE_EXISTED=1 FILE_EXISTED=1
mv $rc_local $rc_local.REAL mv $rc_local $rc_local.REAL
fi fi
@ -20,8 +19,7 @@ set -o xtrace
dib-first-boot dib-first-boot
EOF EOF
if [ $FILE_EXISTED ] if [ $FILE_EXISTED ]; then
then
echo "mv $rc_local.REAL $rc_local" >> $rc_local echo "mv $rc_local.REAL $rc_local" >> $rc_local
else else
echo "rm \$0" >> $rc_local echo "rm \$0" >> $rc_local

View File

@ -5,8 +5,7 @@ set -o pipefail
export DIB_RHSM_USER=${DIB_RHSM_USER:-} export DIB_RHSM_USER=${DIB_RHSM_USER:-}
if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] if [ -n "$DIB_RHSM_USER" ] && [ -n "$DIB_RHSM_PASSWORD" ] ; then
then
opts="--force" opts="--force"
if [[ -n "$DIB_SAT_KEY" ]]; then if [[ -n "$DIB_SAT_KEY" ]]; then
opts="$opts --activationkey ${DIB_SAT_KEY}" opts="$opts --activationkey ${DIB_SAT_KEY}"

View File

@ -275,8 +275,7 @@ function create_base () {
sudo touch $TMP_MOUNT_PATH/etc/resolv.conf sudo touch $TMP_MOUNT_PATH/etc/resolv.conf
sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf sudo chmod 777 $TMP_MOUNT_PATH/etc/resolv.conf
# use system configured resolv.conf if available to support internal proxy resolving # use system configured resolv.conf if available to support internal proxy resolving
if [ -e /etc/resolv.conf ] if [ -e /etc/resolv.conf ]; then
then
cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf
else else
echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf