[PATCH build 3/3] Remove superfluous braces around variables.

Trevor Woerner twoerner at gmail.com
Wed Sep 15 05:58:27 PDT 2010


From: Trevor Woerner <twoerner at gmail.com>

Remove the '{' and '}' braces around variable dereferences
which aren't necessary for shell parsing.

Signed-off-by: Trevor Woerner <twoerner at gmail.com>
---
 build.sh |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/build.sh b/build.sh
index 20aee43..acc5a02 100755
--- a/build.sh
+++ b/build.sh
@@ -37,14 +37,14 @@ setup_buildenv() {
 
     # Must create local aclocal dir or aclocal fails
     ACLOCAL_LOCALDIR="${DESTDIR}${PREFIX}/share/aclocal"
-    $SUDO mkdir -p ${ACLOCAL_LOCALDIR}
+    $SUDO mkdir -p $ACLOCAL_LOCALDIR
 
     # The following is required to make aclocal find our .m4 macros
     ACLOCAL=${ACLOCAL:="aclocal"}
-    export ACLOCAL="${ACLOCAL} -I ${ACLOCAL_LOCALDIR}"
+    export ACLOCAL="$ACLOCAL -I $ACLOCAL_LOCALDIR"
 
     # The following is required to make pkg-config find our .pc metadata files
-    export PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/share/pkgconfig:${DESTDIR}${PREFIX}/${LIBDIR}/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
+    export PKG_CONFIG_PATH=${DESTDIR}${PREFIX}/share/pkgconfig:${DESTDIR}${PREFIX}/$LIBDIR/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}
 
     # Set the library path so that locally built libs will be found by apps
     export LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/${LIBDIR}${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}
@@ -57,7 +57,7 @@ setup_buildenv() {
 
     # Set the default font path for xserver/xorg unless it's already set
     if [ -z "$FONTPATH" ]; then
-	export FONTPATH="${PREFIX}/${LIBDIR}/X11/fonts/misc/,${PREFIX}/${LIBDIR}/X11/fonts/Type1/,${PREFIX}/${LIBDIR}/X11/fonts/75dpi/,${PREFIX}/${LIBDIR}/X11/fonts/100dpi/,${PREFIX}/${LIBDIR}/X11/fonts/cyrillic/,${PREFIX}/${LIBDIR}/X11/fonts/TTF/"
+	export FONTPATH="$PREFIX/$LIBDIR/X11/fonts/misc/,${PREFIX}/$LIBDIR/X11/fonts/Type1/,${PREFIX}/$LIBDIR/X11/fonts/75dpi/,${PREFIX}/$LIBDIR/X11/fonts/100dpi/,${PREFIX}/$LIBDIR/X11/fonts/cyrillic/,${PREFIX}/$LIBDIR/X11/fonts/TTF/"
     fi
 
     # Create the log file directory
@@ -69,7 +69,7 @@ nonexistent_components=""
 clonefailed_components=""
 
 failed() {
-    if [ -n "${NOQUIT}" ]; then
+    if [ -n "$NOQUIT" ]; then
 	echo "***** $1 failed on $2/$3"
 	failed_components="$failed_components $2/$3"
     else
@@ -239,7 +239,7 @@ build() {
 	mkdir -p "$DIR_ARCH" || failed mkdir $1 $2
 	if cd "$DIR_ARCH" ; then :; else
 	    failed cd2 $1 $2
-	    cd ${old_pwd}
+	    cd $old_pwd
 	    return
 	fi
     fi
@@ -247,39 +247,39 @@ build() {
     # Special configure flags for certain modules
     MOD_SPECIFIC=
 
-    if [ "$1" = "lib" ] && [ "$2" = "libX11" ] && [ "${USE_XCB}" = "NO" ]; then
+    if [ "$1" = "lib" ] && [ "$2" = "libX11" ] && [ "$USE_XCB" = "NO" ]; then
 	MOD_SPECIFIC="--with-xcb=no"
     fi
 
     LIB_FLAGS=
     if [ -n "$LIBDIR" ]; then
-        LIB_FLAGS="--libdir=${PREFIX}/${LIBDIR}"
+        LIB_FLAGS="--libdir=$PREFIX/$LIBDIR"
     fi
 
     # Use "sh autogen.sh" since some scripts are not executable in CVS
     if [ -z "$NOAUTOGEN" ]; then
-        sh ${DIR_CONFIG}/${CONFCMD} --prefix=${PREFIX} ${LIB_FLAGS} \
-	    ${MOD_SPECIFIC} ${QUIET:+--quiet} \
-	    ${CACHE:+--cache-file=}${CACHE} ${CONFFLAGS} "$CONFCFLAGS" || \
-	    failed ${CONFCMD} $1 $2
+        sh $DIR_CONFIG/$CONFCMD --prefix=$PREFIX $LIB_FLAGS \
+	    $MOD_SPECIFIC ${QUIET:+--quiet} \
+	    ${CACHE:+--cache-file=}${CACHE} $CONFFLAGS "$CONFCFLAGS" || \
+	    failed $CONFCMD $1 $2
     fi
-    ${MAKE} $MAKEFLAGS || failed make $1 $2
+    $MAKE $MAKEFLAGS || failed make $1 $2
     if [ -n "$CHECK" ]; then
-        ${MAKE} $MAKEFLAGS check || failed check $1 $2
+        $MAKE $MAKEFLAGS check || failed check $1 $2
     fi
     if [ -n "$CLEAN" ]; then
-	${MAKE} $MAKEFLAGS clean || failed clean $1 $2
+	$MAKE $MAKEFLAGS clean || failed clean $1 $2
     fi
     if [ -n "$DIST" ]; then
-	${MAKE} $MAKEFLAGS dist || failed dist $1 $2
+	$MAKE $MAKEFLAGS dist || failed dist $1 $2
     fi
     if [ -n "$DISTCHECK" ]; then
-	${MAKE} $MAKEFLAGS distcheck || failed distcheck $1 $2
+	$MAKE $MAKEFLAGS distcheck || failed distcheck $1 $2
     fi
-    $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install || \
+    $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH $MAKE $MAKEFLAGS install || \
 	failed install $1 $2
 
-    cd ${old_pwd}
+    cd $old_pwd
 
     if [ -n "$BUILD_ONE" ]; then
 	echo "Single-component build complete"
@@ -323,7 +323,7 @@ build_proto() {
     build proto xf86driproto
     build proto xf86vidmodeproto
     build proto xineramaproto
-    if [ "${USE_XCB}" != "NO" ]; then
+    if [ "$USE_XCB" != "NO" ]; then
 	build xcb proto
     fi
 }
@@ -357,7 +357,7 @@ build_lib() {
     build lib libxtrans
     build lib libXau
     build lib libXdmcp
-    if [ "${USE_XCB}" != "NO" ]; then
+    if [ "$USE_XCB" != "NO" ]; then
         build xcb pthread-stubs
 	build xcb libxcb
         build xcb util
@@ -498,7 +498,7 @@ build_app() {
     build app xwd
     build app xwininfo
     build app xwud
-#    if [ "${USE_XCB}" != "NO" ]; then
+#    if [ "$USE_XCB" != "NO" ]; then
 #	build xcb demo
 #    fi
 }
@@ -829,7 +829,7 @@ do
     shift
 done
 
-if [ -z "${PREFIX}" ] && [ -z "$LISTONLY" ]; then
+if [ -z "$PREFIX" ] && [ -z "$LISTONLY" ]; then
     usage
     exit
 fi
-- 
1.7.3.rc1.4.g5879b6



More information about the xorg-devel mailing list