the default configuration file should always be /etc/debootstrap/config,
regardless whether --confdir=path is supplied or not.
However, if --confdir=path is supplied, everything should be based on it,
including the configuration file.
+ -c, --config=file Use specified configuration file, defaults to
+ /etc/debootstrap/config
-d, --confdir=path Place of config files for debootstrap, defaults to
/etc/debootstrap
-d, --confdir=path Place of config files for debootstrap, defaults to
/etc/debootstrap
- -c, --config=file Use specified configuration file, defaults to
- <confdir>/config
--packages[=f] Install packages defined in <confdir>/packages. Option
arg: alternative package list file.
--debconf[=f] Pre-seed packages using <confdir>/debconf-selections.
--packages[=f] Install packages defined in <confdir>/packages. Option
arg: alternative package list file.
--debconf[=f] Pre-seed packages using <confdir>/debconf-selections.
# source external command line parameter-processing script
. $prog_real.clp
# source external command line parameter-processing script
. $prog_real.clp
-# business-logic of command line parameter-processing
+# == business-logic of command line parameter-processing
+
+# source configuration file in <confdir> if supplied. {{{
+[ "$_opt_confdir" ] && {
+ CONFFILES=$_opt_confdir
+ if ! [ -r "$CONFFILES/config" ] ; then
+ eerror "Error: config file $CONFFILES/config not found."; eend 1; exit 1
+ fi
+ if ! . "$CONFFILES/config" ; then
+ eerror "Error reading config file $CONFFILES/config" ; eend 1 ; exit 1
+ fi
+}
+# }}}
+
[ "$_opt_mirror" ] && MIRROR=$_opt_mirror
[ "$_opt_iso" ] && ISO=$_opt_iso
[ "$_opt_release" ] && RELEASE=$_opt_release
[ "$_opt_mirror" ] && MIRROR=$_opt_mirror
[ "$_opt_iso" ] && ISO=$_opt_iso
[ "$_opt_release" ] && RELEASE=$_opt_release
[ "$_opt_mntpoint" ] && MNTPOINT=$_opt_mntpoint
[ "$_opt_debopt" ] && DEBOOTSTRAP_OPT=$_opt_debopt
[ "$_opt_interactive" ] && INTERACTIVE=1
[ "$_opt_mntpoint" ] && MNTPOINT=$_opt_mntpoint
[ "$_opt_debopt" ] && DEBOOTSTRAP_OPT=$_opt_debopt
[ "$_opt_interactive" ] && INTERACTIVE=1
-[ "$_opt_confdir" ] && CONFFILES=$_opt_confdir
[ "$_opt_config" ] && CONFIGFILE=$_opt_config
[ "$_opt_packages_set" ] && PACKAGES='yes'
[ "$_opt_debconf_set" ] && DEBCONF='yes'
[ "$_opt_config" ] && CONFIGFILE=$_opt_config
[ "$_opt_packages_set" ] && PACKAGES='yes'
[ "$_opt_debconf_set" ] && DEBCONF='yes'
-_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 \
+_opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:hv --long \
+ mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,config:,confdir:,packages::,debconf::,keep_src_list,hostname:,password:,bootappend:,groot:,grub:,help,version \
-- "$@"`
if [ $? != 0 ]; then
-- "$@"`
if [ $? != 0 ]; then
- eerror "Try `grml-debootstrap --help' for more information."; eend 1; exit 1
+ eerror "Try 'grml-debootstrap --help' for more information."; eend 1; exit 1
fi
eval set -- "$_opt_temp"
fi
eval set -- "$_opt_temp"
#
# == Configuration options
#
# == Configuration options
+ --config|-c) # Use specified configuration file, defaults to /etc/debootstr
+ shift; _opt_config="$1"
+ ;;
--confdir|-d) # Place of config files for debootstrap, defaults to /etc/debo
shift; _opt_confdir="$1"
;;
--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"
- ;;
--packages) # Install packages defined in <confdir>/packages. Option arg:
shift; _opt_packages="$1"
_opt_packages_set=T
--packages) # Install packages defined in <confdir>/packages. Option arg:
shift; _opt_packages="$1"
_opt_packages_set=T