Merge "Correction: if then statement code style."

This commit is contained in:
Jenkins 2014-07-10 07:38:49 +00:00 committed by Gerrit Code Review
commit 4e97def3d5
9 changed files with 15 additions and 21 deletions

View File

@ -370,12 +370,14 @@ Ramdisk elements support the following files in their element directories:
* udev.d : udev rules files that will be copied into the ramdisk.
### Whitespace Rules
### Element coding standard ###
- lines should not include trailing whitespace
- there should be no hard tabs in the file
- lines should not include trailing whitespace.
- there should be no hard tabs in the file.
- 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
----------------------------

View File

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

View File

@ -18,8 +18,7 @@ set -e
SCRIPTNAME=$(basename $0)
SCRIPT_HOME=$(dirname $0)
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]
then
if [ -d $SCRIPT_HOME/../share/diskimage-builder ]; then
export _PREFIX=$SCRIPT_HOME/../share/diskimage-builder
else
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
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]
then
if [ -f $TARGET_ROOT/sbin/initctl.REAL ]; then
sudo mv $TARGET_ROOT/sbin/initctl.REAL $TARGET_ROOT/sbin/initctl
fi

View File

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

View File

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

View File

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

View File

@ -275,8 +275,7 @@ function create_base () {
sudo touch $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
if [ -e /etc/resolv.conf ]
then
if [ -e /etc/resolv.conf ]; then
cat /etc/resolv.conf > $TMP_MOUNT_PATH/etc/resolv.conf
else
echo nameserver 8.8.8.8 > $TMP_MOUNT_PATH/etc/resolv.conf

View File

@ -35,7 +35,7 @@ function cleanup () {
function ensure_nbd () {
NBD=`which qemu-nbd` || true
if [ -z "$NBD" ]; then
if [ -z "$NBD" ]; then
echo "qemu-nbd is not found in your PATH"
echo "Please install it on your system"
exit 1