• moving a to a: in getopt (was Re: apt-listchanges: changelogs for tglas

    From Thorsten Glaser@21:1/5 to root on Sat Jun 27 19:30:01 2020
    On Sat, 27 Jun 2020, root wrote:

    dpkg (1.20.0) experimental; urgency=medium

    [ Guillem Jover ]
    * perl: Switch Getopt::Long from bundling to bundling_values. This means
    the few scripts using Getopt::Long will stop accepting options in the
    form «-ab» for «-a -b», which is not future-proof, as it does not allow
    these options to get new arguments without making them ambiguous.

    You shouldn’t do that for two reasons:

    1. It breaks existing users that use the short form.

    2. For your example, if -a were to ever gain an argument, the existing
    -b is silently used as the argument and not parsed as option any
    more breaking everything horribly.

    For this reason any existing option MUST NOT get an argument later.

    bye,
    //mirabilos
    --
    «MyISAM tables -will- get corrupted eventually. This is a fact of life. » “mysql is about as much database as ms access” – “MSSQL at least descends
    from a database” “it's a rebranded SyBase” “MySQL however was born from a
    flatfile and went downhill from there” – “at least jetDB doesn’t claim to
    be a database” (#nosec) ‣‣‣ Please let MySQL and MariaDB finally die!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Guillem Jover@21:1/5 to Thorsten Glaser on Sat Aug 1 22:20:01 2020
    Hi!

    On Sat, 2020-06-27 at 19:11:38 +0200, Thorsten Glaser wrote:
    On Sat, 27 Jun 2020, root wrote:
    dpkg (1.20.0) experimental; urgency=medium

    [ Guillem Jover ]
    * perl: Switch Getopt::Long from bundling to bundling_values. This means
    the few scripts using Getopt::Long will stop accepting options in the
    form «-ab» for «-a -b», which is not future-proof, as it does not allow
    these options to get new arguments without making them ambiguous.

    You shouldn’t do that for two reasons:

    1. It breaks existing users that use the short form.

    That use the bundled short form, true.

    2. For your example, if -a were to ever gain an argument, the existing
    -b is silently used as the argument and not parsed as option any
    more breaking everything horribly.

    This should not be a problem, as long as at least a whole release has
    passed before considering adding any such arguments to these options,
    which TBH I don't see happening in the near future anyway.

    For this reason any existing option MUST NOT get an argument later.

    This is currently restricted to only 4 perl scripts that use
    Getopt::Long (that is dpkg-checkbuilddeps, dpkg-mergechangelogs, dpkg-scanpackages and dpkg-scansources). The rest have an open coded
    argument parsing implementations, which do not accept option bundling
    (but do accept argument bundling).

    The plan is to switch every perl script to use Getopt::Long, using the
    same format for consistency, and I'd rather not make the bulk of the
    scripts more loose in that sense.

    There are also a few options that take no arguments, where other
    options are accepted:

    dpkg-checkbuilddeps (-A -B -I)
    dpkg-scansources (-n)
    dpkg-scanpackages (-m)

    So it does not look that bad to me TBH.

    Thanks,
    Guillem

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)