r1800 - trunk/src/host/devirginator

werner at sita.openmoko.org werner at sita.openmoko.org
Thu Apr 19 01:03:25 CEST 2007


Author: werner
Date: 2007-04-19 01:03:22 +0200 (Thu, 19 Apr 2007)
New Revision: 1800

Modified:
   trunk/src/host/devirginator/setup.sh
Log:
Added command-line option "-c config_file" to load a specific configuration
file.



Modified: trunk/src/host/devirginator/setup.sh
===================================================================
--- trunk/src/host/devirginator/setup.sh	2007-04-18 17:59:24 UTC (rev 1799)
+++ trunk/src/host/devirginator/setup.sh	2007-04-18 23:03:22 UTC (rev 1800)
@@ -101,26 +101,31 @@
 
 usage()
 {
-    echo "usage: $0 [-t] [variable=value ...]" 1>&2
+    echo "usage: $0 [-c config_file] [-t] [variable=value ...]" 1>&2
     exit 1
 }
 
 
 tarball=false
+config=config
 
-for n in "$@"; do
-    case "$n" in
+while [ ! -z "$*" ]; do
+    case "$1" in
+	-c)	shift
+		[ ! -z "$1" ] || usage
+		config=$1;;
 	-t)	tarball=true;;
-	*=*)	eval "$n";;
+	*=*)	eval "$1";;
 	*)	usage;;
     esac
+    shift
 done
 
 
 # --- Read config file --------------------------------------------------------
 
 
-. config
+. $config
 
 
 # --- Post configuration ------------------------------------------------------





More information about the commitlog mailing list