couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nsla...@apache.org
Subject svn commit: r668118 - in /incubator/couchdb/trunk: bin/couchdb.tpl.in bin/couchjs.tpl.in bootstrap
Date Mon, 16 Jun 2008 11:37:00 GMT
Author: nslater
Date: Mon Jun 16 04:37:00 2008
New Revision: 668118

URL: http://svn.apache.org/viewvc?rev=668118&view=rev
Log:
general shell script improvements

Modified:
    incubator/couchdb/trunk/bin/couchdb.tpl.in
    incubator/couchdb/trunk/bin/couchjs.tpl.in
    incubator/couchdb/trunk/bootstrap

Modified: incubator/couchdb/trunk/bin/couchdb.tpl.in
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bin/couchdb.tpl.in?rev=668118&r1=668117&r2=668118&view=diff
==============================================================================
--- incubator/couchdb/trunk/bin/couchdb.tpl.in (original)
+++ incubator/couchdb/trunk/bin/couchdb.tpl.in Mon Jun 16 04:37:00 2008
@@ -287,7 +287,7 @@
         display_error
     fi
     set -e
-    eval set -- "$options"
+    eval set -- $options
     while [ $# -gt 0 ]; do
         case "$1" in
             -h) shift; display_help; exit $SCRIPT_OK;;

Modified: incubator/couchdb/trunk/bin/couchjs.tpl.in
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bin/couchjs.tpl.in?rev=668118&r1=668117&r2=668118&view=diff
==============================================================================
--- incubator/couchdb/trunk/bin/couchjs.tpl.in (original)
+++ incubator/couchdb/trunk/bin/couchjs.tpl.in Mon Jun 16 04:37:00 2008
@@ -75,7 +75,7 @@
         display_error
     fi
     set -e
-    eval set -- "$options"
+    eval set -- $options
     while [ $# -gt 0 ]; do
         case "$1" in
             -h) shift; display_help; exit $SCRIPT_OK;;

Modified: incubator/couchdb/trunk/bootstrap
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/bootstrap?rev=668118&r1=668117&r2=668118&view=diff
==============================================================================
--- incubator/couchdb/trunk/bootstrap (original)
+++ incubator/couchdb/trunk/bootstrap Mon Jun 16 04:37:00 2008
@@ -32,27 +32,27 @@
 
 basename=`basename $0`
 
-extract_configuration_variable () {
+get () {
     variable_name=$1
     temporary_file=`mktemp`
     echo "changequote(\`[', \`]')" > $temporary_file
-    sed "s/m4_//" < $ACINCLUDE_IN_FILE >> $temporary_file
+    sed -e "s/m4_//" < $ACINCLUDE_IN_FILE >> $temporary_file
     echo $variable_name >> $temporary_file
-    if test -x `which m4 || true`; then
+    if test -x "`which m4 || true`"; then
         `which m4` $temporary_file | grep -v "^$"
     else
-        if test -x `which gm4 || true`; then
+        if test -x "`which gm4 || true`"; then
             `which gm4` $temporary_file | grep -v "^$"
+        else
+            echo unknown
         fi
     fi
     rm -f $temporary_file
 }
 
 display_version () {
-    package_name=`extract_configuration_variable LOCAL_PACKAGE_NAME`
-    version=`extract_configuration_variable LOCAL_VERSION`
     cat << EOF
-$basename - $package_name $version
+$basename - `get LOCAL_PACKAGE_NAME` `get LOCAL_VERSION_PRIMARY`
 
 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
 this file except in compliance with the License.  You may obtain a copy of the
@@ -68,7 +68,6 @@
 }
 
 display_help () {
-    bug_uri=`extract_configuration_variable LOCAL_BUG_URI`
     cat << EOF
 Usage: $basename [OPTION]...
 
@@ -83,9 +82,9 @@
 
 Environment variables:
 
-  REPOSITORY_REVISION  manual override for revision information
+  REVISION  manual override for revision information
 
-Report bugs at <$bug_uri>.
+Report bugs at <`get LOCAL_BUG_URI`>.
 EOF
 }
 
@@ -98,41 +97,14 @@
     exit $SCRIPT_ERROR
 }
 
-check_svn_environment () {
-    if test -x `which svn || true`; then
-        echo "Warning: Unable to find the svn command."
-        return $SCRIPT_ERROR
-    fi
-    if test -n "$REPOSITORY_REVISION"; then
-        return
-    fi
-    if test -n "`\`which svn\` info . 2> /dev/null`"; then
-       SVN_CHECKOUT_BOOLEAN="true"
-    fi
-    if test "$SVN_CHECKOUT_BOOLEAN" != "true"; then
-        echo "Warning: Unable to determine checkout information."
-    fi
-}
-
 generate_acinclude () {
-    release_code=`sed -e "s/\[//g" -e "s/\]//g" -e "s/(//g" -e "s/)//g" \
-        < $ACINCLUDE_IN_FILE | awk "/LOCAL_VERSION_STAGE, /{print \$2}"`
-    repository_boolean=false
-    if test -n "$REPOSITORY_REVISION" -o "$SVN_CHECKOUT_BOOLEAN" = "true"; then
-        repository_boolean=true
+    if test -z "$REVISION"; then
+        REVISION=`\`which svn\` info . 2> /dev/null | awk "/Revision:/{print \\$2}"`
     fi
-    if test -z "$release_code" -o "$repository_boolean" = "false"; then
+    if test -z "`get LOCAL_VERSION_STAGE`" -o -z "$REVISION"; then
         sed "s/%release%//" < $ACINCLUDE_IN_FILE > $ACINCLUDE_FILE
     else
-        if test "$SVN_CHECKOUT_BOOLEAN" = "true"; then
-            revision_number=`\`which svn\` info . | \
-                awk "/Revision:/{print \\$2}"`
-        fi
-        if test -n "$REPOSITORY_REVISION"; then
-            revision_number="$REPOSITORY_REVISION"
-        fi
-        sed "s/%release%/$revision_number/" \
-            < $ACINCLUDE_IN_FILE > $ACINCLUDE_FILE
+        sed "s/%release%/$REVISION/" < $ACINCLUDE_IN_FILE > $ACINCLUDE_FILE
     fi
 }
 
@@ -153,7 +125,7 @@
 }
 
 run_aclocal () {
-    if test -x `which aclocal || true`; then
+    if test -x "`which aclocal || true`"; then
         echo "Running aclocal"
         `which aclocal` -I m4
     else
@@ -163,11 +135,11 @@
 }
 
 run_libtoolize () {
-    if test -x `which libtoolize || true`; then
+    if test -x "`which libtoolize || true`"; then
         echo "Running libtoolize"
         `which libtoolize` -f -c
     else
-        if test -x `which glibtoolize || true`; then
+        if test -x "`which glibtoolize || true`"; then
             echo "Running glibtoolize"
             `which glibtoolize` -f -c
         else
@@ -178,7 +150,7 @@
 }
 
 run_autoheader () {
-    if test -x `which autoheader || true`; then
+    if test -x "`which autoheader || true`"; then
         echo "Running autoheader"
         `which autoheader` -f
     else
@@ -189,7 +161,7 @@
 
 run_automake () {
     AUTOMAKE_OPTION_COLLECTION=""
-    if test -x `which automake || true`; then
+    if test -x "`which automake || true`"; then
         echo "Running automake"
         `which automake` -f -c -a --gnits
     else
@@ -199,7 +171,7 @@
 }
 
 run_autoconf () {
-    if test -x `which autoconf || true`; then
+    if test -x "`which autoconf || true`"; then
         echo "Running autoconf"
         `which autoconf` -f
     else
@@ -229,7 +201,7 @@
         display_error
     fi
     set -e
-    eval set -- "$options"
+    eval set -- $options
     while [ $# -gt 0 ]; do
         case "$1" in
             -v) shift; display_version; exit $SCRIPT_OK;;
@@ -240,7 +212,6 @@
     done
     cd `dirname $0`
     process_file_collection
-    check_svn_environment || true
     generate_acinclude
     run_command_collection
 }



Mime
View raw message