for Issue555
[grml-debootstrap.git] / grml-debootstrap.clp
index 3dec6d9..4e43b4a 100644 (file)
@@ -7,15 +7,25 @@
 # grml
 #
 # @Author:  Tong SUN
 # grml
 #
 # @Author:  Tong SUN
-# @Release: $Revision: $, under the BSD license
+# @Release: $Revision: 1.2 $, under the BSD license
 # @HomeURL: http://xpt.sourceforge.net/
 #
 
 # @HomeURL: http://xpt.sourceforge.net/
 #
 
+# @WARNING: Do NOT modify this file without prior contacting the author.
+# This script is use for the command line *logic* processing. It should be
+# as dumb as possible. I.e., it should NOT be more complicated than
+# copy-paste-and-rename from existing code. All *business-logic* processing
+# should be handled in the main script, where it belongs.
 
 
-eval set -- `getopt \
-  -o +m:i:r:t:p:c:hv --long \
-    mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,config:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
+
+
+_opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:d:c:hv --long \
+    mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,confdir:,config:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
   -- "$@"`
   -- "$@"`
+if [ $? != 0 ]; then
+  eerror "Try `grml-debootstrap --help' for more information."; eend 1; exit 1
+fi
+eval set -- "$_opt_temp"
 
 while :; do
   case "$1" in
 
 while :; do
   case "$1" in
@@ -45,14 +55,17 @@ while :; do
   #
 
   # == Configuration options
   #
 
   # == Configuration options
-  --config|-c)         # Use specified configuration file, defaults to /etc/debootstr
+  --confdir|-d)        # Place of config files for debootstrap, defaults to /etc/debo
+    shift; _opt_confdir="$1"
+    ;;
+  --config|-c)         # Use specified configuration file, defaults to <confdir>/conf
     shift; _opt_config="$1"
     ;;
     shift; _opt_config="$1"
     ;;
-  --packages)          # Install packages defined in /etc/debootstrap/packages. Optio
+  --packages)          # Install packages defined in <confdir>/packages. Option arg:
     shift; _opt_packages="$1"
     _opt_packages_set=T
     ;;
     shift; _opt_packages="$1"
     _opt_packages_set=T
     ;;
-  --debconf)           # Pre-seed packages using /etc/debootstrap/debconf-selections.
+  --debconf)           # Pre-seed packages using <confdir>/debconf-selections. Option
     shift; _opt_debconf="$1"
     _opt_debconf_set=T
     ;;
     shift; _opt_debconf="$1"
     _opt_debconf_set=T
     ;;
@@ -94,29 +107,4 @@ while :; do
 done
 
 
 done
 
 
-[ "$_opt_debug" ] && {
-  echo "[grml-debootstrap] debug: _opt_mirror=$_opt_mirror"
-  echo "[grml-debootstrap] debug: _opt_iso=$_opt_iso"
-  echo "[grml-debootstrap] debug: _opt_release=$_opt_release"
-  echo "[grml-debootstrap] debug: _opt_target=$_opt_target"
-  echo "[grml-debootstrap] debug: _opt_mntpoint=$_opt_mntpoint"
-  echo "[grml-debootstrap] debug: _opt_debopt=$_opt_debopt"
-  echo "[grml-debootstrap] debug: _opt_interactive=$_opt_interactive"
-  echo "[grml-debootstrap] debug: _opt_config=$_opt_config"
-  echo "[grml-debootstrap] debug: _opt_packages=$_opt_packages"
-  echo "[grml-debootstrap] debug: _opt_debconf=$_opt_debconf"
-  echo "[grml-debootstrap] debug: _opt_keep_src_list=$_opt_keep_src_list"
-  echo "[grml-debootstrap] debug: _opt_hostname=$_opt_hostname"
-  echo "[grml-debootstrap] debug: _opt_password=$_opt_password"
-  echo "[grml-debootstrap] debug: _opt_bootappend=$_opt_bootappend"
-  echo "[grml-debootstrap] debug: _opt_groot=$_opt_groot"
-  echo "[grml-debootstrap] debug: _opt_grub=$_opt_grub"
-  echo "[grml-debootstrap] debug: _opt_help=$_opt_help"
-  echo "[grml-debootstrap] debug: _opt_version=$_opt_version"
-}
-
-if [ "$_opt_check_failed" ]; then
-  eerror "Not all mandatory options are set."; eend 1 ; exit 1
-fi
-
 # End
 # End