[BusyBox] Is this a uclibc problem or a busybox problem?
Bernhard Fischer
rep.nop at aon.at
Sat Aug 27 19:40:19 UTC 2005
On Sat, Aug 27, 2005 at 04:13:24PM +0200, Bernhard Fischer wrote:
>On Sat, Aug 27, 2005 at 06:03:46AM -0500, Rob Landley wrote:
>>tar -chf - include --exclude .svn --exclude CVS $extra_exclude \
>> | tar -xf - -C /usr/
>>tar: CVS: No such file or directory
>
>busybox tar seems not to support '--exclude='
>>Thus my question: is this a busybox bug, a uClibc bug, or both?
The main problem is that --exclude= will trigger the --exclude-from=
argument. Does anyone know if there is a switch to force unambiguous
arguments (i.e. exact match opt_foo for '--foo' and opt_foobar for
'--foob' and warn about '--fo' being ambiguous)?
The (ugly and extremely error prone) quick alternative would be to
tar.c: (append_file_list_to_list): treat non-existing exclude-from
inputfile file as filename to add to the reject list.
which is attached (i wouldn't check that part in).
There's also a speeling fix in a comment and an adjustment to tar's
execl arguments (gcc complained about it) in there.
whatever.
-------------- next part --------------
Index: archival/tar.c
===================================================================
--- archival/tar.c (revision 11230)
+++ archival/tar.c (working copy)
@@ -479,7 +479,7 @@ static inline int writeTarFile(const int
close(gzipStatusPipe[0]);
fcntl(gzipStatusPipe[1], F_SETFD, FD_CLOEXEC); /* close on exec shows sucess */
- execl("/bin/gzip", "gzip", "-f", 0);
+ execl("/bin/gzip", "gzip", "-f", (char*)NULL);
vfork_exec_errno = errno;
close(gzipStatusPipe[1]);
@@ -558,14 +558,18 @@ static llist_t *append_file_list_to_list
llist_t *newlist = NULL;
while(cur) {
- src_stream = bb_xfopen(cur->data, "r");
+ if ((src_stream = fopen(cur->data, "r")) == NULL) {
+ newlist = llist_add_to(newlist, cur->data);
+ }
tmp = cur;
cur = cur->link;
free(tmp);
- while((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
- newlist = llist_add_to(newlist, line);
- }
- fclose(src_stream);
+ if (src_stream != NULL) {
+ while((line = bb_get_chomped_line_from_file(src_stream)) != NULL) {
+ newlist = llist_add_to(newlist, line);
+ }
+ fclose(src_stream);
+ }
}
return newlist;
}
@@ -870,7 +874,7 @@ int tar_main(int argc, char **argv)
{
while (get_header_ptr(tar_handle) == EXIT_SUCCESS);
- /* Ckeck that every file that should have been extracted was */
+ /* Check that every file that should have been extracted was */
while (tar_handle->accept) {
if (find_list_entry(tar_handle->reject, tar_handle->accept->data) == NULL) {
if (find_list_entry(tar_handle->passed, tar_handle->accept->data) == NULL) {
More information about the busybox
mailing list