[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] tar --exclude option does not work (but exists in
From:       Glenn McGrath <bug1 () iinet ! net ! au>
Date:       2003-12-24 7:18:49
[Download RAW message or body]

On Wed, 24 Dec 2003 05:04:02 +0900
Changwoo Ryu <cwryu@debian.org> wrote:

> Package: busybox
> Version: 1.0-pre5
> 
> I checked "Enable -X and --exclude options (exclude files)" from "make
> menuconfig".  After building, "busybox tar --help" displays --exclude
> option.  But that is not supported in real..
> 
>   $ ./busybox tar --help
>   BusyBox v1.00-pre5 (2003.12.23-19:52+0000) multi-call binary
>  
>   Usage: tar -[czxtvO] [--exclude FILE] [-X FILE][-f TARFILE] [-C DIR]
> [FILE(s)] ...
>   $ ./busybox tar -cv --exclude "Makefile*" -f test.tar applets
>   tar: unrecognized option `--exclude'
>   BusyBox v1.00-pre5 (2003.12.23-19:52+0000) multi-call binary
>  
>   Usage: tar -[czxtvO] [--exclude FILE] [-X FILE][-f TARFILE] [-C DIR]
> [FILE(s)] ...
>   $

yes, docs are incorrect, --exclude isnt supported, -X <file> should work
which is the --exclude-from <file> functionality, only short option is
supported.

attached is a patch which adds long options to tar which might be
usefull to some... im not sure about applying it to cvs, it adds a four
hundred bytes, maybe there should be a global configuration option to
enable long options ?

Ill look at fixing the tar docs in a couple of days.



Glenn

["tar_long_options.diff" (application/octet-stream)]

Index: ./archival/tar.c
===================================================================
RCS file: /var/cvs/busybox/archival/tar.c,v
retrieving revision 1.185
diff -u -b -B -w -p -u -r1.185 tar.c
--- ./archival/tar.c	21 Nov 2003 22:24:45 -0000	1.185
+++ ./archival/tar.c	24 Dec 2003 07:11:57 -0000
@@ -615,6 +615,24 @@ static const char tar_options[]="ctxjT:X
 #define TAR_OPT_KEEP_OLD	4096
 #define TAR_OPT_UNCOMPRESS	8192
 
+static const struct option tar_long_options[] = {
+	{ "create",			0,	NULL,	'c' },
+	{ "list",			0,	NULL,	't' },
+	{ "extract",		0,	NULL,	'x' },
+	{ "bzip2",			0,	NULL,	'j' },
+	{ "from-file",		1,	NULL,	'T' },
+	{ "exclude-from",	1,	NULL,	'X' },
+	{ "directory",		1,	NULL,	'C' },
+	{ "file",			1,	NULL,	'f'	},
+	{ "to-stdout",		0,	NULL,	'O' },
+	{ "same-permissions",	0,	NULL,	'p' },
+	{ "verbose",		0,	NULL,	'v' },
+	{ "gzip",			0,	NULL,	'z' },
+	{ "keep-old",		0,	NULL,	'k' },
+	{ "compress",		0,	NULL,	'Z' },
+	{ 0,                 0, 0, 0 }
+};
+
 int tar_main(int argc, char **argv)
 {
 	char (*get_header_ptr)(archive_handle_t *) = get_header_tar;
@@ -641,6 +659,7 @@ int tar_main(int argc, char **argv)
 	tar_handle->flags = ARCHIVE_CREATE_LEADING_DIRS | ARCHIVE_PRESERVE_DATE | \
ARCHIVE_EXTRACT_UNCONDITIONAL;  
 	bb_opt_complementaly = "c~tx:t~cx:x~ct:X*";
+	bb_applet_long_options = tar_long_options;
 	opt = bb_getopt_ulflags(argc, argv, tar_options,
 				NULL,   /* T: arg is ignored by default
 					    a list is an include list */



_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic