BTS

Issue801

Title grml-debootstrap parameter handling
Priority feature Status resolved
Superseder Nosy List mika, suntong
Assigned To mika Topics

Created on 2010-01-15.16:47:36 by suntong, last changed 2011-06-13.03:11:32 by mru.

Messages
msg3849 (view) Author: mru Date: 2011-06-13.02:50:03
Hi Tong,
I'm closing this issue for now as i assume that the issue is resolved. 
If the issue is still present please provide a simple commandline to test 
everything.

Thanks
msg3236 (view) Author: suntong Date: 2010-06-25.14:37:39
On Fri, Jun 25, 2010 at 5:39 AM, Michael Prokop <bts@bts.grml.org> wrote:

>
> > The revert is absolutely necessary. However, the changes in
>
> >
> http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769
>
> > is a over kill. I.e., only the revert in config file is all it take to
> > restore the normal grml-debootstrap behaviour. Or, to make it clear,
> state
> > that package installation and pre-seeding are enabled by default in the
> > default config file. This way, power users can still benefit from the
> > flexibility.
>
> Sounds reasonable (as long as it doesn't change existing behaviour ;))
>
> > Sorry for responding late, mika. would you take care of it please?
>
> Tong, care to provide a patch which does what you'd like to see?
>

The changes at above url,
http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769

is called 'Revert "Updated grml-debootstrap parameter handling"', which
reverts the patches that I sent. What we need to do is just to revert this
revert, but leave out the change to "config". I.e., all the files,
cmdlineopts.clp, grml-debootstrap and grml-debootstrap.8.txt  need to be
reverted (except config).

I don't know how you did the revert the first time, but I think this second
time revert should not be too much different.

Could you take care of rest now, mika?

This will fix the problem of specifying --packages=xxx will not work as
well.

Thanks
msg3234 (view) Author: mika Date: 2010-06-25.09:41:22
* Tong Sun wrote in grml's BTS on 20100610 / 05:21:

> > only the revert in config file is all it take to restore the normal
> > grml-debootstrap behaviour.

> Moreover, I think the change to cmdlineopts.clp
> (in
> http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769
> )
> might be the reason for the bug that I'm troubleshooting for:

> % grml-debootstrap --verbose --confdir=$gdcd --target $os_mnt --hostname
> $gdhn --nodebootstrap --debconf --packages=$ttf

> [ . . . ]
>    Executing stage kernel
> Writing extended state information... Done
> Get:1 http://security.debian.org testing/updates Release.gpg [835B]
> Get:2 http://security.debian.org testing/updates Release
> [44.6kB]

> [ . . . ]
>    Executing stage packages
>    Executing stage extrapackages

> I.e., I specified --packages=xxx but the packages are still not installed --
> this is the first time grml-debootstrap invoked on the debootstrap'd OS.
> I.e., stage file is not the cause.

> The reason is that, handling normal parameter and handling optional
> parameter have entirely different approach in .clp file. Merely change
> getopt option won't work.

Is there any chance you'd provide a patch for that?

regards,
-mika-
msg3233 (view) Author: mika Date: 2010-06-25.09:39:48
* Tong Sun wrote in grml's BTS on 20100610 / 05:00:

> > Therefore I reverted the patch and implemented --no-packages in version
> > 0.34 instead.

> The revert is absolutely necessary. However, the changes in

> http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769

> is a over kill. I.e., only the revert in config file is all it take to
> restore the normal grml-debootstrap behaviour. Or, to make it clear, state
> that package installation and pre-seeding are enabled by default in the
> default config file. This way, power users can still benefit from the
> flexibility.

Sounds reasonable (as long as it doesn't change existing behaviour ;))

> Sorry for responding late, mika. would you take care of it please?

Tong, care to provide a patch which does what you'd like to see?

regards,
-mika-
msg3219 (view) Author: suntong Date: 2010-06-10.03:27:33
> The reason is that, handling normal parameter and handling optional
> parameter have entirely different approach in .clp file. 

Forgot to mention, In my specified configuration file, I have:

# install packages defined in /etc/debootstrap/packages?
PACKAGES=
msg3218 (view) Author: suntong Date: 2010-06-10.03:21:13
On Wed, Jun 9, 2010 at 11:00 PM, Tong Sun <suntong001@gmail.com> wrote:

> only the revert in config file is all it take to restore the normal
> grml-debootstrap behaviour.


Moreover, I think the change to cmdlineopts.clp
(in
http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769
)
might be the reason for the bug that I'm troubleshooting for:

% grml-debootstrap --verbose --confdir=$gdcd --target $os_mnt --hostname
$gdhn --nodebootstrap --debconf --packages=$ttf

[ . . . ]
   Executing stage kernel
Writing extended state information... Done
Get:1 http://security.debian.org testing/updates Release.gpg [835B]
Get:2 http://security.debian.org testing/updates Release
[44.6kB]

[ . . . ]
   Executing stage packages
   Executing stage extrapackages

I.e., I specified --packages=xxx but the packages are still not installed --
this is the first time grml-debootstrap invoked on the debootstrap'd OS.
I.e., stage file is not the cause.

The reason is that, handling normal parameter and handling optional
parameter have entirely different approach in .clp file. Merely change
getopt option won't work.

Thanks
msg3216 (view) Author: suntong Date: 2010-06-10.03:00:44
On Mon, Feb 22, 2010 at 7:18 PM, Michael Prokop <bts@bts.grml.org> wrote:

>
> Sorry, I've to revert this change. This change actually *breaks* the way
> grml-
> debootstrap is used. *Not* installing /etc/debootstrap/packages by default
> is a
> no-go because it for examples doesn't install grub anymore even though grub
> ist
> needed.


Absolutely agree. I didn't know its impact on grml-debootstrap normal usage.


> Therefore I reverted the patch and implemented --no-packages in version
> 0.34 instead.
>

The revert is absolutely necessary. However, the changes in

http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=7cc268e168259a681c0244f9d73a28b7dc4d3769

is a over kill. I.e., only the revert in config file is all it take to
restore the normal grml-debootstrap behaviour. Or, to make it clear, state
that package installation and pre-seeding are enabled by default in the
default config file. This way, power users can still benefit from the
flexibility.

Sorry for responding late, mika. would you take care of it please?

Thanks
msg2914 (view) Author: mika Date: 2010-02-22.23:18:36
Hi,

Sorry, I've to revert this change. This change actually *breaks* the way grml-
debootstrap is used. *Not* installing /etc/debootstrap/packages by default is a 
no-go because it for examples doesn't install grub anymore even though grub ist 
needed. Therefore I reverted the patch and implemented --no-packages in version 
0.34 instead. If you think there's a problem with the current code please feel 
free to reopen the bugreport, closing it for now though.

regards,
-mika-
msg2878 (view) Author: mru Date: 2010-01-30.15:46:43
Committed.
msg2855 (view) Author: suntong1 Date: 2010-01-16.20:57:05
[issue801] grml-debootstrap parameter handling, fix code

[issue801] grml-debootstrap parameter handling, fix doc
---
 cmdlineopts.clp        |    2 +-
 config                 |    4 +-
 grml-debootstrap       |    8 +++---
 grml-debootstrap.8.txt |   58 +++++++++++++++++++++++++++++++++---------------
 4 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/cmdlineopts.clp b/cmdlineopts.clp
index dd88afb..cefb76f 100644
--- a/cmdlineopts.clp
+++ b/cmdlineopts.clp
@@ -12,7 +12,7 @@
 # should be handled in the main script, where it belongs.
 ################################################################################
 
-CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
+CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-scripts:,scripts::,pre-scripts::,debconf::,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
     $CMDLINE_OPTS -- "$@"`
diff --git a/config b/config
index bd75618..a0cdb11 100644
--- a/config
+++ b/config
@@ -113,10 +113,10 @@ DEBIAN_FRONTEND='noninteractive'
 # STAGES='/var/cache/grml-debootstrap'
 
 # install packages defined in /etc/debootstrap/packages?
-PACKAGES='yes'
+PACKAGES=#'yes'
 
 # pre-seed packages using /etc/debootstrap/debconf-selections (if exist)?
-DEBCONF='yes'
+DEBCONF=#'yes'
 
 # execute scripts from /etc/debootstrap/chroot-scripts/ inside the chroot?
 CHROOT_SCRIPTS='yes'
diff --git a/grml-debootstrap b/grml-debootstrap
index 5ca15e8..7edc29b 100755
--- a/grml-debootstrap
+++ b/grml-debootstrap
@@ -57,15 +57,15 @@ Configuration options:
                              /etc/debootstrap/config
   -d, --confdir <path>     Place of config files for debootstrap, defaults
                              to /etc/debootstrap
-      --packages <file>    Install packages defined in specified list file.
-      --debconf <file>     Pre-seed packages using specified pre-seed db file.
+      --packages[=<file>]  Install packages defined in specified list file.
+      --debconf[=<file>]   Pre-seed packages using specified pre-seed db file.
       --keep_src_list      Do not overwrite user provided apt sources.list.
       --hostname <name>    Hostname of Debian system.
       --password <pwd>     Use specified password as password for user root.
       --bootappend <line>  Add specified appendline to kernel whilst booting.
       --chroot-scripts <d> Execute chroot scripts from specified directory.
-      --pre-scripts <dir>  Execute scripts from specified directory (before chroot-scripts).
-      --scripts <dir>      Execute scripts from specified directory (after chroot-scripts).
+      --pre-scripts[=<d>]  Execute scripts from specified directory (before chroot-scripts).
+      --scripts[=<dir>]    Execute scripts from specified directory (after chroot-scripts).
 
 Other options:
 
diff --git a/grml-debootstrap.8.txt b/grml-debootstrap.8.txt
index b9e0349..bbfa605 100644
--- a/grml-debootstrap.8.txt
+++ b/grml-debootstrap.8.txt
@@ -56,10 +56,12 @@ Options and environment variables
 
     Place of configuration files for debootstrap, defaults to /etc/debootstrap.
 
-*--debconf* <_file_>::
+*--debconf*[=<_file_>]::
 
-    Use specified file for preseeding Debian packages instead of using
-    the default <confdir>/debconf-selections.
+    When using *--debconf* without the optional '=<_file_>' parameter, it
+    enables preseeding Debian packages using the default
+    '<confdir>/debconf-selections' file. If the optional parameter is given,
+    use the specified file for preseeding Debian packages instead.
 
 *--debopt* <_params_>::
 
@@ -114,10 +116,13 @@ Options and environment variables
     Note: this option has no effect if option -t is given and represents a
     directory.
 
-*--packages* <_file_>::
+*--packages*[=<_file_>]::
 
-    Use specified file as list for packages that should be installed instead of
-    the default package list file <confdir>/packages.
+    When using *--packages* without the optional '=<_file_>' parameter, it
+    enables installing the packages defined in the default package list
+    '<confdir>/packages' file. If the optional parameter is given, the
+    specified list file is used as list for packages that should be
+    installed instead.
 
 *--password* <_password_>::
 
@@ -131,20 +136,25 @@ Options and environment variables
     squeeze (note: requires current version of debootstrap) and sid.
     Corresponding with configuration variable RELEASE.
 
-*--pre-scripts* <_directory_>::
+*--pre-scripts*[=<_directory_>]::
 
-    Execute scripts from specified directory before executing the chroot
-    script. This allows customisation of the system before the chroot has
-    been set up.  The environment variable $MNTPOINT is available inside the
-    scripts for direct access of the chroot.
-    Default directory: /etc/debootstrap/pre-scripts/
+    When using *--pre-scripts* without the optional '=<_directory_>'
+    parameter, it enables executing scripts from the default
+    '<confdir>/pre-scripts/' directory before executing the chroot script.
+    If the optional parameter is given, execute scripts from the specified
+    directory instead. This allows customization of the system before the
+    chroot has been set up.  The environment variable $MNTPOINT is available
+    inside the scripts for direct access of the chroot.
 
-*--scripts* <_directory_>::
+*--scripts*[=<_directory_>]::
 
-    Execute scripts from specified directory. This allows customisation of
-    the system after the chroot has been set up. The environment variable
-    $MNTPOINT is available inside the scripts for direct access of the chroot.
-    Default directory: /etc/debootstrap/scripts/
+    When using *--scripts* without the optional '=<_directory_>' parameter,
+    it enables executing scripts from the default '<confdir>/scripts/'
+    directory after the chroot has been set up.  If the optional parameter is
+    given, execute scripts from the specified directory instead. This allows
+    customisation of the system after the chroot has been set up. The
+    environment variable $MNTPOINT is available inside the scripts for
+    direct access of the chroot.  
 
 *-t*, *--target* <_target_>::
     Target partition (/dev/...) or directory (anything else without /dev at the
@@ -158,9 +168,21 @@ Options and environment variables
 *-V*, *--version*::
     Show version of program and exit.
 
-WARNING: the commandline parsing of grml-debootstrap does not validate the provided
+TIP: The long options may be abbreviated, as long as the abbreviation is not
+ambiguous. Eg. '--k' will be the same as '--keep_src_list', and '--pac' be
+'--packages'.
+
+[WARNING]
+=====================================================================
+
+- To specify the optional parameter for switches that accept them, the
+optional argument must be written directly after the long option name,
+separated by `=' (without space).
+
+- the commandline parsing of grml-debootstrap does not validate the provided
 arguments for the commandline options. Please be careful and check docs and
 /etc/debootstrap/config for further information.
+=====================================================================
 
 Usage examples
 ---------------
-- 
1.6.5
msg2853 (view) Author: mru Date: 2010-01-16.01:29:19
On Friday 15 January 2010 22:48:52 Tong Sun wrote:

> what do you mean by "not used/executed"?

Sorry my fault. Did not have a detailed look.

> I still think --packages or --debconf without the optional parameters is
> useful. It normally takes me more than 3 iterations to use
>  grml-debootstrap, not every time I need to install extra packages and
>  pre-seed packages. I believe such request is not uncommon.

I understand it now. Could you please provide one patch incl. modifications to 
cmdlineopts.clp, grml-debootstrap, config and grml-debootstrap.8.txt? If it is 
too much i will do it on my own, but it could take some time.

Ulrich
msg2852 (view) Author: suntong Date: 2010-01-15.21:53:08
I tried to remove the 3 "unnamed" "uploaded" files. But when removing them, I get

 Invalid request
msg2851 (view) Author: suntong Date: 2010-01-15.21:48:52
On Fri, Jan 15, 2010 at 4:32 PM, Tong Sun <suntong001@gmail.com> wrote:

e.g. you set DEBOOTSTRAP_OPT in the config file, but it is
>> not used/executed. From my point of view a little bit problematic.
>>
>
> I'll take a look at it.
>

what do you mean by "not used/executed"?

$ grep -E 'DEBOOTSTRAP_OPT|_opt_debopt' *
cmdlineopts.clp:    shift; _opt_debopt="$1"
config:# DEBOOTSTRAP_OPT='--include=debconf-utils,locales,pciutils
--exclude=nano,tasksel,tasksel-data,iptables'
grml-debootstrap:[ "$_opt_debopt" ]              &&
DEBOOTSTRAP_OPT=$_opt_debop
grml-debootstrap:     einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for
release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
grml-debootstrap:        $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT
$RELEASE $MNTPOINT $MIRROR
grml-debootstrap:        $DEBOOTSTRAP $ARCHCMD $KEYRING $DEBOOTSTRAP_OPT
$RELEASE $MNTPOINT $ISO

It get set in cmdlineopts.clp, and get passed all the way to $DEBOOTSTRAP.
Any questions?

ps,

I still think --packages or --debconf without the optional parameters is
useful. It normally takes me more than 3 iterations to use grml-debootstrap,
not every time I need to install extra packages and pre-seed packages. I
believe such request is not uncommon.

pps,

I was talking about --debconf, not--debopt

cheers
msg2850 (view) Author: suntong Date: 2010-01-15.21:33:04
On Fri, Jan 15, 2010 at 4:07 PM, Ulrich Dangel <bts@bts.grml.org> wrote:

>
> Ulrich Dangel <mru@grml.org> added the comment:
>
> On Friday 15 January 2010 17:47:36 Tong Sun wrote:
>
> Hi,
>
> > Referring to "Remove duplicate : in getopt definition."
> >
> http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=30d47e014a7ce7a0f48e
> > 21a8d27420ba28fe8082
> >
> > When grml-debootstrap parameter handling was first fully implemented, the
> > "duplicated" : in getopt definition worked follows.
> >
> > - they are switches with *optional* parameters
>
> Hm? From grml-debootstrap usage():
>
>      --debopt <params>  Extra parameters passed to the debootstrap command.
>      --packages <file>    Install packages defined in specified list file.
>
> For me, it seems that they must have a parameter.
>

You are right. Now it seems so, but not when grml-debootstrap parameter
handling was first fully implemented. The man page is my 3rd step in fixing
it.


> And at least after a short look it seems that the
> $_opt_{debopt,packages}_set
> variables are not really needed.
>

Yes, unless we keep the optional parameters feature.


>  > - their corresponding configuration variable values are set to off in
> > /etc/debootstrap/config
> > - this means that the --packages, --debconf features are off by default
> >  unless turned on on the commandline, using  --packages, or --debconf
> >  (without the optional parameters)
>
> I honestly do not see the usecase for that feature. IMHO it is also a
> little
> bit problematic,


because the following? see my comments below.


> e.g. you set DEBOOTSTRAP_OPT in the config file, but it is
> not used/executed. From my point of view a little bit problematic.
>

I'll take a look at it.


>  > - if optional parameters are giving on the commandline, eg
> > --debconf=/some/file/else.conf, the given file is used (eg, as the
> pre-seed
> >  db file) instead of the default one.
> >
> > This gives the maximum flexibility. I hope you can agree with it as well.
>
> The problem with your solution is that it does not work as expected if you
> use
> extra parameters, e.g.:
>
> $ grep :: cmdlineopts.clp
>
> CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-
> scripts:,scripts:,pre-
>
> scripts:,debconf::,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
> $ . ./cmdlineopts.clp --package 445 --bootappend append
> $ echo $_opt_packages
>
> $ echo $_opt_bootappend
>
> # now as one parameter
> $ ./cmdlineopts.clp --package=445 --bootappend append
> $ echo $_opt_packages
> 445
> $ echo $_opt_bootappend
> append
>

Yes, that's exactly the expected behaviour, and why
$_opt_{debopt,packages}_set is necessary.

From 'man getopt'

,-----
| A long option normally begins with `--' followed by the long
| option name.  If the option has a required argument, it may be
| written directly after the long option name, separated by `=', or
| as the next argument (ie. separated by whitespace on the command
| line).  If the option has an optional argument, it must be
| written directly after the long option name, separated by `=', if
| present (if you add the `=' but nothing behind it, it is
| interpreted as if no argument was present; this is a slight bug,
| see the BUGS).
`-----

cheers
msg2849 (view) Author: mru Date: 2010-01-15.21:07:46
On Friday 15 January 2010 17:47:36 Tong Sun wrote:

Hi,

> Referring to "Remove duplicate : in getopt definition."
> http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=30d47e014a7ce7a0f48e
> 21a8d27420ba28fe8082
> 
> When grml-debootstrap parameter handling was first fully implemented, the
> "duplicated" : in getopt definition worked follows.
> 
> - they are switches with *optional* parameters

Hm? From grml-debootstrap usage():

      --debopt <params>  Extra parameters passed to the debootstrap command.
      --packages <file>    Install packages defined in specified list file.   

For me, it seems that they must have a parameter.

And at least after a short look it seems that the $_opt_{debopt,packages}_set 
variables are not really needed.

> - their corresponding configuration variable values are set to off in
> /etc/debootstrap/config
> - this means that the --packages, --debconf features are off by default
>  unless turned on on the commandline, using  --packages, or --debconf
>  (without the optional parameters)

I honestly do not see the usecase for that feature. IMHO it is also a little 
bit problematic, e.g. you set DEBOOTSTRAP_OPT in the config file, but it is 
not used/executed. From my point of view a little bit problematic.

> - if optional parameters are giving on the commandline, eg
> --debconf=/some/file/else.conf, the given file is used (eg, as the pre-seed
>  db file) instead of the default one.
> 
> This gives the maximum flexibility. I hope you can agree with it as well.

The problem with your solution is that it does not work as expected if you use 
extra parameters, e.g.:

$ grep :: cmdlineopts.clp 
CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-
scripts:,scripts:,pre-
scripts:,debconf::,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
$ . ./cmdlineopts.clp --package 445 --bootappend append
$ echo $_opt_packages

$ echo $_opt_bootappend

# now as one parameter
$ ./cmdlineopts.clp --package=445 --bootappend append
$ echo $_opt_packages
445
$ echo $_opt_bootappend
append

You can test it yourself, there is a unit test available in the tests 
directory, just change into the tests directory and execute run_tests.sh 
You must have installed the shunit2 debian package or modify the unit test to 
use a local shunit2 package. 

Ulrich
msg2848 (view) Author: suntong Date: 2010-01-15.20:48:35
On Fri, Jan 15, 2010 at 11:47 AM, Tong Sun <bts@bts.grml.org> wrote:

>
> When grml-debootstrap parameter handling was first fully implemented, the
> "duplicated" : in getopt definition worked follows.
>

should read "worked *as* follows".

Besides that, Long options may be  abbreviated, as long as the abbreviation
is not ambiguous. Eg. '--k' will be the same as '--keep_src_list', and
'--pac' be '--packages'.
msg2838 (view) Author: suntong1 Date: 2010-01-15.19:51:01
---
 config |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/config b/config
index bd75618..a0cdb11 100644
--- a/config
+++ b/config
@@ -113,10 +113,10 @@ DEBIAN_FRONTEND='noninteractive'
 # STAGES='/var/cache/grml-debootstrap'
 
 # install packages defined in /etc/debootstrap/packages?
-PACKAGES='yes'
+PACKAGES=#'yes'
 
 # pre-seed packages using /etc/debootstrap/debconf-selections (if exist)?
-DEBCONF='yes'
+DEBCONF=#'yes'
 
 # execute scripts from /etc/debootstrap/chroot-scripts/ inside the chroot?
 CHROOT_SCRIPTS='yes'
-- 
1.6.5
msg2837 (view) Author: suntong1 Date: 2010-01-15.19:48:26
---
 cmdlineopts.clp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cmdlineopts.clp b/cmdlineopts.clp
index dd88afb..6de1782 100644
--- a/cmdlineopts.clp
+++ b/cmdlineopts.clp
@@ -12,7 +12,7 @@
 # should be handled in the main script, where it belongs.
 ################################################################################
 
-CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages:,chroot-scripts:,scripts:,pre-scripts:,debconf:,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
+CMDLINE_OPTS=mirror:,iso:,release:,target:,mntpoint:,debopt:,interactive,nodebootstrap,config:,confdir:,packages::,chroot-scripts:,scripts:,pre-scripts:,debconf::,keep_src_list,hostname:,password:,bootappend:,grub:,arch:,insecure,verbose,help,version
 
 _opt_temp=`getopt --name grml-debootstrap -o +m:i:r:t:p:c:d:vhV --long \
     $CMDLINE_OPTS -- "$@"`
-- 
1.6.5
msg2835 (view) Author: suntong Date: 2010-01-15.16:47:35
Referring to "Remove duplicate : in getopt definition."
http://git.grml.org/?p=grml-debootstrap.git;a=commit;h=30d47e014a7ce7a0f48e21a8d27420ba28fe8082

When grml-debootstrap parameter handling was first fully implemented, the 
"duplicated" : in getopt definition worked follows.

- they are switches with *optional* parameters
- their corresponding configuration variable values are set to off in
/etc/debootstrap/config
- this means that the --packages, --debconf features are off by default unless
turned on on the commandline, using  --packages, or --debconf (without the
optional parameters)
- if optional parameters are giving on the commandline, eg
--debconf=/some/file/else.conf, the given file is used (eg, as the pre-seed db
file) instead of the default one.

This gives the maximum flexibility. I hope you can agree with it as well. 

thanks
History
Date User Action Args
2011-06-13 03:11:32mrusetstatus: done-cbb -> resolved
nosy: mika, suntong
2011-06-13 02:50:04mrusetstatus: chatting -> done-cbb
nosy: mika, suntong
messages: + msg3849
2010-06-25 14:38:29suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-25 14:37:40suntongsetfiles: + unnamed
nosy: mika, suntong
messages: + msg3236
2010-06-25 09:41:24mikasetnosy: mika, suntong
messages: + msg3234
2010-06-25 09:39:49mikasetnosy: mika, suntong
messages: + msg3233
2010-06-10 03:27:33suntongsetnosy: mika, suntong
messages: + msg3219
2010-06-10 03:22:07suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-10 03:21:14suntongsetfiles: + unnamed
nosy: mika, suntong
messages: + msg3218
2010-06-10 03:03:35suntongsetstatus: wont-fix -> chatting
nosy: mika, suntong
2010-06-10 03:01:16suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-10 03:01:09suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-10 03:00:59suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-10 03:00:46suntongsetfiles: - unnamed
nosy: mika, suntong
2010-06-10 03:00:45suntongsetfiles: + unnamed
nosy: mika, suntong
messages: + msg3216
2010-02-22 23:18:37mikasetpriority: bug -> feature
status: fixed-in-git -> wont-fix
messages: + msg2914
nosy: + mika
assignedto: mika
2010-01-30 15:46:45mrusetstatus: chatting -> fixed-in-git
messages: + msg2878
2010-01-16 20:57:10suntong1setmessages: + msg2855
2010-01-16 01:29:24mrusetmessages: + msg2853
2010-01-15 21:53:08suntongsetmessages: + msg2852
2010-01-15 21:48:52suntongsetfiles: + unnamed
messages: + msg2851
2010-01-15 21:33:04suntongsetfiles: + unnamed
messages: + msg2850
2010-01-15 21:07:47mrusetmessages: + msg2849
2010-01-15 20:48:35suntongsetfiles: + unnamed
messages: + msg2848
title: grml-debootstrap parameter handling, fix step 2 -> grml-debootstrap parameter handling
2010-01-15 19:51:01suntong1setmessages: + msg2838
title: grml-debootstrap parameter handling, fix step 1 -> grml-debootstrap parameter handling, fix step 2
2010-01-15 19:48:26suntong1setstatus: unread -> chatting
messages: + msg2837
title: grml-debootstrap parameter handling -> grml-debootstrap parameter handling, fix step 1
2010-01-15 16:47:36suntongcreate