cvs commit: src/usr.sbin/pkg_install/lib file.c

Tim Kientzle tim at
Wed Apr 7 23:47:53 PDT 2004

Andrey Chernov wrote:
> On Wed, Apr 07, 2004 at 11:06:42PM -0700, Tim Kientzle wrote:
>>kientzle    2004/04/07 23:06:42 PDT
>>  FreeBSD src repository
>>  Modified files:
>>    usr.sbin/pkg_install/lib file.c 
>>  Log:
>>  When invoking tar, make sure the mode option (-x) is first.
> It looks like wrong place to fix. bsdtar should be fixed instead  ...

It certainly does no harm to re-order the arguments in
pkg_install.  Whether or not bsdtar should be modified
is a separate question.

 > ... to accept
> options/arguments intermixed in any order like GNU tar already does. I.e.  
> you should start your short options string for getopt_long() with "-",
> like in GNU tar.

I have reasons for diverging from GNU tar here, though
I could be convinced otherwise:

  * Requiring the mode option first improves error reporting,
    as there are many options that only make sense in certain
    modes.  (This also mimics SUSv2 "tar" specification that
    requires the mode letter to be first in the bundled option

  * Not all platforms have getopt_long(), and I intend for
    bsdtar to be usable on systems that only have getopt().
    The "-" extension is certainly not standard across getopt()
    implementations.  (bsdtar currently has a couple of
    long options with no short equivalent; I do intend to
    address that.)

  * According to the getopt_long man page, there is
    some disagreement about the handling of that leading
    "-" in the presence of POSIXLY_CORRECT.  I'd prefer
    to avoid such ambiguities where possible.

As I said, I could be convinced to do as you suggest, but I'm
pretty comfortable with the option parsing of bsdtar
as it stands.


More information about the cvs-src mailing list