[BusyBox] Adding an option to tar
Glenn McGrath
bug1 at iinet.net.au
Fri Oct 15 01:16:49 UTC 2004
On Thu, 14 Oct 2004 16:45:21 -0700
"R. Weber" <rjweber at onz.com> wrote:
> Hello. I'm using busybox on a box that must integrate to an existing
> system. This system downloads files via ftp, and then untars them. The
> untar options are xzmf "filename". "m" is used to get rid of
> complaints about differing time stamps.
>
> Busybox tar doesn't support the m option. I could add tar separately,
> but tar is huge, at least by default. I'd like to add this option to
> busybox. Looking at the tar.c code, I'm lost as to how to go about
> this. I've added the line
>
> { "no-file-time", 0, NULL, 'm' },
>
> to the tar_long_options structure, which I thought would allow the m
> option, even though I haven't added any code for it yet, but the m
> option is still unrecognized. Is there a write-up somewhere that might
> bet me up to speed on changes to busybox, a design guideline, or
> something?
The tar_long_options arent always used.
The short options are somewhat complex in tar, but its required to add
add all the different options into bb_getopt_ulflags() which is what
does all the work sorting out the options.
The main documents we have regarding adding options are comments in the
code, many people find bb_getopt_ulflags hard to understand, its best to
learn it by looking at existing applets that use it.
Attached is a patch which adds the tar -m option, which you should be
able to follow to see how it works.
Although busybox has released 1.0, we are still in a feature freese, so
i wont commit this patch yet.
Busybox's 1.0 series will be just for bugfixes and a new "development"
branch will be added for new features. We need to move to subversion
before that happens. (it was mentioned on irc yesterday)
Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tar-m.patch
Type: text/x-patch
Size: 3264 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20041015/ed767c1b/attachment.bin
More information about the busybox
mailing list