summaryrefslogtreecommitdiffstats
path: root/usr.bin/tar
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-09-09 00:07:18 +0000
committerkientzle <kientzle@FreeBSD.org>2007-09-09 00:07:18 +0000
commit8fc160dac01fee84ee885f1358e4dffb7e772df5 (patch)
treefd444f3c6dab452c2b71ee9b942c07cf5b3da206 /usr.bin/tar
parente896f7fb011d3e474a79fd783439b16f1fe95be2 (diff)
downloadFreeBSD-src-8fc160dac01fee84ee885f1358e4dffb7e772df5.zip
FreeBSD-src-8fc160dac01fee84ee885f1358e4dffb7e772df5.tar.gz
Add --posix as a synonym for --format=pax, for GNU
tar compatibility. Approved by: re (bmah)
Diffstat (limited to 'usr.bin/tar')
-rw-r--r--usr.bin/tar/bsdtar.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.bin/tar/bsdtar.c b/usr.bin/tar/bsdtar.c
index 03c6418..d20a5cf 100644
--- a/usr.bin/tar/bsdtar.c
+++ b/usr.bin/tar/bsdtar.c
@@ -143,6 +143,7 @@ enum {
OPTION_NO_SAME_PERMISSIONS,
OPTION_NULL,
OPTION_ONE_FILE_SYSTEM,
+ OPTION_POSIX,
OPTION_STRIP_COMPONENTS,
OPTION_TOTALS,
OPTION_USE_COMPRESS_PROGRAM,
@@ -194,6 +195,7 @@ static const struct option tar_longopts[] = {
{ "no-same-permissions",no_argument, NULL, OPTION_NO_SAME_PERMISSIONS },
{ "null", no_argument, NULL, OPTION_NULL },
{ "one-file-system", no_argument, NULL, OPTION_ONE_FILE_SYSTEM },
+ { "posix", no_argument, NULL, OPTION_POSIX },
{ "preserve-permissions", no_argument, NULL, 'p' },
{ "read-full-blocks", no_argument, NULL, 'B' },
{ "same-permissions", no_argument, NULL, 'p' },
@@ -481,6 +483,9 @@ main(int argc, char **argv)
bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
break;
+ case OPTION_POSIX: /* GNU tar */
+ bsdtar->create_format = "pax";
+ break;
case 'r': /* SUSv2 */
set_mode(bsdtar, opt);
break;
OpenPOWER on IntegriCloud