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

Andrey Chernov ache at nagual.pp.ru
Thu Apr 8 00:05:46 PDT 2004


On Wed, Apr 07, 2004 at 11:47:50PM -0700, Tim Kientzle wrote:
>  * 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.)

I do not suggest to use initial "-" for getopt() options, only for
getopt_long() short options. It means that on platforms without
getopt_long() args/options can't be intermixed or, alternatively, you can
include BSDL copy of getopt_long() from our libc with your program.

>  * 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.

This is NetBSD-sm, they try to mimic GNU getopt_long() which is right,
since it originates from there, but at some point they think they are
smarter than GNU (which leads to breaking some legal getopt_long()  
usage, f.e. gas becomes broken). How to deal with it, see above, i.e.
include our getopt_long().

> 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.

BTW, could you please implement -S, --sparse? It is very needed to 
backup/restore large (and mostly null-filled) databases. There can be 
cases, when you restore database without -S, it can lead to disk 
space overflow, since it created as sparse at physical level and occupes 
less space.

-- 
Andrey Chernov | http://ache.pp.ru/


More information about the cvs-src mailing list