an alternative suggestion for "tar" and user/group names

Natanael Copa natanael.copa at gmail.com
Thu Apr 20 21:52:00 UTC 2006


On Thu, 20 Apr 2006 14:05:41 -0400 (EDT)
"Robert P. J. Day" <rpjday at mindspring.com> wrote:

> 
>   it occurs to me that there's an alternative for tar in terms of this
> whole UID/GID/names thing.  as it stands, tar currently displays the
> numeric UID and GID from the tar header info, and natanael's patch
> would change that bahaviour to display the user and group names
> instead.  but that means that choice has to be made at configuration
> time and is undoable at run time -- you're stuck with it.
> 
>   natanael, why not flip that around?  make tar display the user and
> group names *by default*, and add the code and a config menu entry to
> allow the user to display the UID and GID instead via a run-time
> option, just as GNU tar does with "--numeric-owner"?  (in short, you
> really are "enabling support" to display the numeric IDs if you so
> choose.)

If you don't have a compile time option for it you don't have the possibility to make the code smaller by disabling it. Remember that size matter here.

>   that way, the user has a choice *at run time* as to whether to see
> the names or the numeric IDs.  it's more informative and it's GNU
> compatible.  thoughts?

The idea of "enabling" code is that it is small by default. If thats not good enough, you add the things you need.

I also thought that if the patch break things for you (like you scripts that depends on the current tar behavior or something unexpected) you could just disable it and you would have the exact code you had before. Kind of a roll-back backdoor.

> 
> rday
> 
> p.s.  this raises one issue that i was thinking about earlier.  with
> GNU tar, that "numeric ID" option is available *only* via a long
> option.  what do you do with something like that if someone chooses
> not to support long options with "tar"?  do you just make up a short
> option for it?  or what?

Can you check if --numeric-owner is a gnu extension or not? I think its your turn to read the sources and manuals this time. ;-)

-- 
Natanael Copa



More information about the busybox mailing list