X11rdp: Simplify if constructs

Directly use exit value instead of evaluating $?
This commit is contained in:
Philipp Hahn 2013-01-25 10:24:42 +01:00
parent eb3253fafc
commit a29c011e02

View File

@ -111,8 +111,8 @@ extract_it()
fi fi
# download file # download file
download_file $mod_file if ! download_file $mod_file
if [ $? -ne 0 ]; then then
echo "" echo ""
echo "failed to download $mod_file - aborting build" echo "failed to download $mod_file - aborting build"
echo "" echo ""
@ -123,8 +123,8 @@ extract_it()
# if pkg has not yet been extracted, do so now # if pkg has not yet been extracted, do so now
if [ ! -d $mod_name ]; then if [ ! -d $mod_name ]; then
echo $mod_file | grep -q tar.bz2 if echo $mod_file | grep -q tar.bz2
if [ $? -eq 0 ]; then then
tar xjf ../downloads/$mod_file > /dev/null 2>&1 tar xjf ../downloads/$mod_file > /dev/null 2>&1
else else
tar xzf ../downloads/$mod_file > /dev/null 2>&1 tar xzf ../downloads/$mod_file > /dev/null 2>&1
@ -143,8 +143,8 @@ extract_it()
fi fi
# now configure # now configure
echo "executing ./configure --prefix=$PREFIX_DIR $mod_args" echo "executing ./configure --prefix=$PREFIX_DIR $mod_args"
./configure --prefix=$PREFIX_DIR $mod_args if ! ./configure --prefix=$PREFIX_DIR $mod_args
if [ $? -ne 0 ]; then then
echo "configuration failed for module $mn" echo "configuration failed for module $mn"
exit 1 exit 1
fi fi
@ -172,8 +172,8 @@ make_it()
echo "*** processing module $mod_name ($count of $num_modules) ***" echo "*** processing module $mod_name ($count of $num_modules) ***"
echo "" echo ""
extract_it $mod_file $mod_name "$mod_args" if ! extract_it $mod_file $mod_name "$mod_args"
if [ $? -ne 0 ]; then then
echo "" echo ""
echo "extract failed for module $mod_name" echo "extract failed for module $mod_name"
echo "" echo ""
@ -182,8 +182,8 @@ make_it()
# make module # make module
if [ ! -e cookies/$mod_name.made ]; then if [ ! -e cookies/$mod_name.made ]; then
(cd build_dir/$mod_name ; make) if ! (cd build_dir/$mod_name ; make)
if [ $? -ne 0 ]; then then
echo "" echo ""
echo "make failed for module $mod_name" echo "make failed for module $mod_name"
echo "" echo ""
@ -193,8 +193,8 @@ make_it()
fi fi
# install module # install module
(cd build_dir/$mod_name ; make install) if ! (cd build_dir/$mod_name ; make install)
if [ $? -ne 0 ]; then then
echo "" echo ""
echo "make install failed for module $mod_name" echo "make install failed for module $mod_name"
echo "" echo ""
@ -251,8 +251,8 @@ fi
if ! test -d $PREFIX_DIR; then if ! test -d $PREFIX_DIR; then
echo "dir does not exit, creating [$PREFIX_DIR]" echo "dir does not exit, creating [$PREFIX_DIR]"
mkdir $PREFIX_DIR if ! mkdir $PREFIX_DIR
if ! test $? -eq 0; then then
echo "mkdir failed [$PREFIX_DIR]" echo "mkdir failed [$PREFIX_DIR]"
exit 0 exit 0
fi fi
@ -267,8 +267,8 @@ export CFLAGS="-I$PREFIX_DIR/include -fPIC -O2"
# prefix dir must exist... # prefix dir must exist...
if [ ! -d $PREFIX_DIR ]; then if [ ! -d $PREFIX_DIR ]; then
mkdir -p $PREFIX_DIR if ! mkdir -p $PREFIX_DIR
if [ $? -ne 0 ]; then then
echo "$PREFIX_DIR does not exist; failed to create it - cannot continue" echo "$PREFIX_DIR does not exist; failed to create it - cannot continue"
exit 1 exit 1
fi fi
@ -282,8 +282,8 @@ fi
# create a downloads dir # create a downloads dir
if [ ! -d downloads ]; then if [ ! -d downloads ]; then
mkdir downloads if ! mkdir downloads
if [ $? -ne 0 ]; then then
echo "error creating downloads directory" echo "error creating downloads directory"
exit 1 exit 1
fi fi
@ -291,8 +291,8 @@ fi
# this is where we do the actual build # this is where we do the actual build
if [ ! -d build_dir ]; then if [ ! -d build_dir ]; then
mkdir build_dir if ! mkdir build_dir
if [ $? -ne 0 ]; then then
echo "error creating build_dir directory" echo "error creating build_dir directory"
exit 1 exit 1
fi fi
@ -300,8 +300,8 @@ fi
# this is where we store cookie files # this is where we store cookie files
if [ ! -d cookies ]; then if [ ! -d cookies ]; then
mkdir cookies if ! mkdir cookies
if [ $? -ne 0 ]; then then
echo "error creating cookies directory" echo "error creating cookies directory"
exit 1 exit 1
fi fi
@ -320,8 +320,8 @@ X11RDPBASE=$PREFIX_DIR
export X11RDPBASE export X11RDPBASE
cd rdp cd rdp
make if ! make
if [ $? -ne 0 ]; then then
echo "error building rdp" echo "error building rdp"
exit 1 exit 1
fi fi