]> jfr.im git - irc/charybdis-ircd/charybdis.git/commitdiff
autogen.sh styling
authorjackal <redacted>
Mon, 15 Jan 2018 21:17:53 +0000 (23:17 +0200)
committerAaron Jones <redacted>
Tue, 6 Feb 2018 19:38:23 +0000 (19:38 +0000)
autogen.sh
librb/autogen.sh

index 215917e8d7ef81c2ef8e707373afb32f6d6ad9a2..c505f36c5aea80dea58817fd34bd4a3e46e2a30e 100755 (executable)
@@ -1,58 +1,59 @@
 #! /bin/sh
 
-TOP_DIR=$(dirname $0)
-LAST_DIR=$PWD
+TOP_DIR="$(dirname $0)"
+LAST_DIR="$PWD"
 
-if test ! -f $TOP_DIR/configure.ac ; then
-   echo "You must execute this script from the top level directory."
-   exit 1
+if test ! -f "${TOP_DIR}/configure.ac"; then
+       echo "You must execute this script from the top level directory."
+       exit 1
 fi
 
-AUTOCONF=${AUTOCONF:-autoconf}
-ACLOCAL=${ACLOCAL:-aclocal}
-AUTOMAKE=${AUTOMAKE:-automake}
-AUTOHEADER=${AUTOHEADER:-autoheader}
-LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
-SHTOOLIZE=${SHTOOLIZE:-shtoolize}
+AUTOCONF="${AUTOCONF:-autoconf}"
+ACLOCAL="${ACLOCAL:-aclocal}"
+AUTOMAKE="${AUTOMAKE:-automake}"
+AUTOHEADER="${AUTOHEADER:-autoheader}"
+LIBTOOLIZE="${LIBTOOLIZE:-libtoolize}"
+SHTOOLIZE="${SHTOOLIZE:-shtoolize}"
 
 run_or_die ()
 {
-   COMMAND=$1
+       COMMAND="$1"
 
-   # check for empty commands
-   if test -z "$COMMAND" ; then
-      echo "No command specified."
-      return 1
-   fi
+       # check for empty commands
+       if test -z "${COMMAND}"; then
+               echo "No command specified."
+               return 1
+       fi
 
-   shift;
+       shift
 
-   # print a message
-   echo "Running $COMMAND $@"
+       # print a message
+       echo "Running ${COMMAND} $@"
 
-   # run or die
-   $COMMAND $@ ;
-   result=$?
-   if test $result -ne 0 ; then
-      echo "$COMMAND failed. (exit code = $result)"
-      exit 1
-   fi
+       # run or die
+       "${COMMAND}" "$@"
+       result="$?"
 
-   return 0
+       if test "${result}" -ne 0; then
+               echo "${COMMAND} failed. (exit code = ${result})"
+               exit 1
+       fi
+
+       return 0
 }
 
-echo "Building librb autotools files."
+echo "Building librb autotools files"
 
-cd "$TOP_DIR"/librb
+cd "${TOP_DIR}"/librb
 sh autogen.sh
 
-echo "Building main autotools files."
+echo "Building main autotools files"
 
-cd "$LAST_DIR"
+cd "${LAST_DIR}"
 
-run_or_die $ACLOCAL -I m4
-run_or_die $LIBTOOLIZE --force --copy
-run_or_die $AUTOHEADER
-run_or_die $AUTOCONF
-run_or_die $AUTOMAKE --add-missing --copy
-run_or_die $SHTOOLIZE all
+run_or_die "${ACLOCAL}" -I m4
+run_or_die "${LIBTOOLIZE}" --force --copy
+run_or_die "${AUTOHEADER}"
+run_or_die "${AUTOCONF}"
+run_or_die "${AUTOMAKE}" --add-missing --copy --foreign
+run_or_die "${SHTOOLIZE}" all
index 0794bc4211d76b0975dd8eb32b7b9005a9887ea1..3cbbb51dd9121c87b97f08ce45e508ef78b1436b 100755 (executable)
@@ -1,50 +1,51 @@
 #! /bin/sh
 
-TOP_DIR=$(dirname $0)
+TOP_DIR="$(dirname $0)"
 
-if test ! -f $TOP_DIR/configure.ac ; then
-   echo "You must execute this script from the top level directory."
-   exit 1
+if test ! -f "${TOP_DIR}/configure.ac"; then
+       echo "You must execute this script from the top level directory."
+       exit 1
 fi
 
-AUTOCONF=${AUTOCONF:-autoconf}
-ACLOCAL=${ACLOCAL:-aclocal}
-AUTOMAKE=${AUTOMAKE:-automake}
-AUTOHEADER=${AUTOHEADER:-autoheader}
-LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
-SHTOOLIZE=${SHTOOLIZE:-shtoolize}
+AUTOCONF="${AUTOCONF:-autoconf}"
+ACLOCAL="${ACLOCAL:-aclocal}"
+AUTOMAKE="${AUTOMAKE:-automake}"
+AUTOHEADER="${AUTOHEADER:-autoheader}"
+LIBTOOLIZE="${LIBTOOLIZE:-libtoolize}"
+SHTOOLIZE="${SHTOOLIZE:-shtoolize}"
 
 run_or_die ()
 {
-   COMMAND=$1
+       COMMAND="$1"
 
-   # check for empty commands
-   if test -z "$COMMAND" ; then
-      echo "No command specified."
-      return 1
-   fi
+       # check for empty commands
+       if test -z "${COMMAND}"; then
+               echo "No command specified."
+               return 1
+       fi
 
-   shift;
+       shift
 
-   # print a message
-   echo "Running $COMMAND $@"
+       # print a message
+       echo "Running ${COMMAND} $@"
 
-   # run or die
-   $COMMAND $@ ;
-   result=$?
-   if test $result -ne 0 ; then
-      echo "$COMMAND failed. (exit code = $result)"
-      exit 1
-   fi
+       # run or die
+       "${COMMAND}" "$@"
+       result="$?"
 
-   return 0
+       if test "${result}" -ne 0; then
+               echo "${COMMAND} failed. (exit code = ${result})"
+               exit 1
+       fi
+
+       return 0
 }
 
-cd $TOP_DIR
+cd "${TOP_DIR}"
 
-run_or_die $ACLOCAL -I ../m4
-run_or_die $LIBTOOLIZE --force --copy
-run_or_die $AUTOHEADER
-run_or_die $AUTOCONF
-run_or_die $AUTOMAKE --add-missing --copy
-run_or_die $SHTOOLIZE all
+run_or_die "${ACLOCAL}" -I ../m4
+run_or_die "${LIBTOOLIZE}" --force --copy
+run_or_die "${AUTOHEADER}"
+run_or_die "${AUTOCONF}"
+run_or_die "${AUTOMAKE}" --add-missing --copy --foreign
+run_or_die "${SHTOOLIZE}" all