1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-02-03 17:11:32 +00:00

Make -l always have the SUSv2 meaning of "check links."

GNU tar changed -l to match SUSv2 a couple of years ago,
so bsdtar no longer needs to pander to this particular GNUism.

Thanks to: Debian maintainers
MFC after: 7 days
This commit is contained in:
Tim Kientzle 2008-01-22 07:23:44 +00:00
parent 8d4b16f8bb
commit 97f576d0a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=175558
2 changed files with 11 additions and 30 deletions

View File

@ -232,16 +232,9 @@ All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
.It Fl l
If
.Ev POSIXLY_CORRECT
is specified in the environment, this is a synonym for the
This is a synonym for the
.Fl -check-links
option.
Otherwise, an error will be displayed.
Users who desire behavior compatible with GNU tar should use
the
.Fl -one-file-system
option instead.
.It Fl m
(x mode only)
Do not extract modification time.
@ -422,11 +415,6 @@ The locale to use.
See
.Xr environ 7
for more information.
.It Ev POSIXLY_CORRECT
If this environment variable is defined, the
.Fl l
option will be interpreted in accordance with
.St -p1003.1-96 .
.It Ev TAPE
The default tape device.
The
@ -681,13 +669,16 @@ This is a complete re-implementation based on the
.Xr libarchive 3
library.
.Sh BUGS
POSIX and GNU violently disagree about the meaning of the
This program follows
.St -p1003.1-96
for the definition of the
.Fl l
option.
Because of the potential for disaster if someone expects
one behavior and gets the other, the
Note that GNU tar prior to version 1.15 treated
.Fl l
option is deliberately broken in this implementation.
as a synonym for the
.Fl -one-file-system
option.
.Pp
The
.Fl C Pa dir

View File

@ -391,19 +391,9 @@ main(int argc, char **argv)
case 'L': /* BSD convention */
bsdtar->symlink_mode = 'L';
break;
case 'l': /* SUSv2 and GNU conflict badly here */
if (getenv("POSIXLY_CORRECT") != NULL) {
/* User has asked for POSIX/SUS behavior. */
bsdtar->option_warn_links = 1;
} else {
fprintf(stderr,
"Error: -l has different behaviors in different tar programs.\n");
fprintf(stderr,
" For the GNU behavior, use --one-file-system instead.\n");
fprintf(stderr,
" For the POSIX behavior, use --check-links instead.\n");
usage(bsdtar);
}
case 'l': /* SUSv2 and GNU tar beginning with 1.16 */
/* GNU tar 1.13 used -l for --one-file-system */
bsdtar->option_warn_links = 1;
break;
case 'm': /* SUSv2 */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;