Subject: bin/30167: NetBSD tar does not support GNU tar --no-recursion flag
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: J.T. Conklin <jtc@acorntoolworks.com>
List: netbsd-bugs
Date: 05/07/2005 20:51:01
>Number: 30167
>Category: bin
>Synopsis: NetBSD tar does not support GNU tar --no-recursion flag
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat May 07 20:51:01 +0000 2005
>Originator: J.T. Conklin
>Release: NetBSD 3.0_BETA
>Organization:
J.T. Conklin
>Environment:
System: NetBSD k8 3.0_BETA NetBSD 3.0_BETA (GENERIC) #0: Mon May 2 02:38:27 PDT 2005 jtc@k8:/home/jtc/netbsd/NetBSD-3/obj-amd64/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
NetBSD's tar does not support the --no-recursion option found in GNU
tar.
>How-To-Repeat:
>Fix:
The pax engine has support, all we need to do is to parse the argument
and set a flag.
Index: options.c
===================================================================
RCS file: /cvsroot/src/bin/pax/options.c,v
retrieving revision 1.83
diff -c -r1.83 options.c
*** options.c 10 Feb 2005 17:48:33 -0000 1.83
--- options.c 7 May 2005 20:39:45 -0000
***************
*** 746,751 ****
--- 746,753 ----
OPT_INSECURE },
{ "exclude", required_argument, 0,
OPT_EXCLUDE },
+ { "no-recursion", no_argument, 0,
+ OPT_NORECURSE },
#if !HAVE_NBTOOL_CONFIG_H
{ "chroot", no_argument, 0,
OPT_CHROOT },
***************
*** 787,794 ****
{ "verify", no_argument, 0, 'W' },
{ "block-compress", no_argument, 0,
OPT_BLOCK_COMPRESS },
- { "norecurse", no_argument, 0,
- OPT_NORECURSE },
#endif
{ 0, 0, 0, 0 },
};
--- 789,794 ----
***************
*** 1071,1076 ****
--- 1071,1079 ----
if (tar_gnutar_minus_minus_exclude(optarg) != 0)
tar_usage();
break;
+ case OPT_NORECURSE:
+ dflag = 1;
+ break;
#if !HAVE_NBTOOL_CONFIG_H
case OPT_CHROOT:
do_chroot = 1;
Index: tar.1
===================================================================
RCS file: /cvsroot/src/bin/pax/tar.1,v
retrieving revision 1.20
diff -c -r1.20 tar.1
*** tar.1 20 Oct 2004 23:48:01 -0000 1.20
--- tar.1 7 May 2005 20:39:46 -0000
***************
*** 264,269 ****
--- 264,273 ----
With this option, files that contain
.Sq ..
can be processed.
+ .It Fl -no-recursion
+ Cause files of type directory being copied or archived, or archive members of
+ type directory being extracted, to match only the directory file or archive
+ member and not the file hierarchy rooted at the directory.
.El
.Pp
The options
>Unformatted: