GNU tar-1.22 handles 'o' as no-same-owner only on extract, on create, 'o' would be --old-archive.
Signed-off-by: Bernhard Reutner-Fischer <[email protected]> --- archival/tar.c | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/archival/tar.c b/archival/tar.c index bd8e5dc..05f841b 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -744,9 +744,10 @@ enum { OPT_BASEDIR = 1 << 2, // C OPT_TARNAME = 1 << 3, // f OPT_2STDOUT = 1 << 4, // O - OPT_P = 1 << 5, // p - OPT_VERBOSE = 1 << 6, // v - OPT_KEEP_OLD = 1 << 7, // k + OPT_NOPRESERVE_OWNER = 1 << 5, // no-same-owner + OPT_P = 1 << 6, // p + OPT_VERBOSE = 1 << 7, // v + OPT_KEEP_OLD = 1 << 8, // k OPT_CREATE = IF_FEATURE_TAR_CREATE( (1 << OPTBIT_CREATE )) + 0, // c OPT_DEREFERENCE = IF_FEATURE_TAR_CREATE( (1 << OPTBIT_DEREFERENCE )) + 0, // h OPT_BZIP2 = IF_FEATURE_SEAMLESS_BZ2( (1 << OPTBIT_BZIP2 )) + 0, // j @@ -756,7 +757,7 @@ enum { OPT_GZIP = IF_FEATURE_SEAMLESS_GZ( (1 << OPTBIT_GZIP )) + 0, // z OPT_COMPRESS = IF_FEATURE_SEAMLESS_Z( (1 << OPTBIT_COMPRESS )) + 0, // Z OPT_NUMERIC_OWNER = 1 << OPTBIT_NUMERIC_OWNER, - OPT_NOPRESERVE_OWNER = 1 << OPTBIT_NOPRESERVE_OWNER , // no-same-owner + OPT_NOPRESERVE_PERM = 1 << OPTBIT_NOPRESERVE_PERM, // no-same-permissions }; #if ENABLE_FEATURE_TAR_LONG_OPTIONS @@ -766,6 +767,10 @@ static const char tar_longopts[] ALIGN1 = "directory\0" Required_argument "C" "file\0" Required_argument "f" "to-stdout\0" No_argument "O" + /* do not restore owner */ + /* GNU tar handles 'o' as no-same-owner only on extract, + on create, 'o' is --old-archive. */ + "no-same-owner\0" No_argument "o" "same-permissions\0" No_argument "p" "verbose\0" No_argument "v" "keep-old\0" No_argument "k" @@ -791,15 +796,13 @@ static const char tar_longopts[] ALIGN1 = # endif /* use numeric uid/gid from tar header, not textual */ "numeric-owner\0" No_argument "\xfc" - /* do not restore owner */ - "no-same-owner\0" No_argument "\xfd" /* do not restore mode */ - "no-same-permissions\0" No_argument "\xfe" + "no-same-permissions\0" No_argument "\xfd" /* --exclude takes next bit position in option mask, */ /* therefore we have to either put it _after_ --no-same-perm */ - /* or add OPT[BIT]_EXCLUDE before OPT[BIT]_NOPRESERVE_OWNER */ + /* or add OPT[BIT]_EXCLUDE before OPT[BIT]_NOPRESERVE_PERM */ # if ENABLE_FEATURE_TAR_FROM - "exclude\0" Required_argument "\xff" + "exclude\0" Required_argument "\xfe" # endif ; #endif @@ -842,7 +845,7 @@ int tar_main(int argc UNUSED_PARAM, char **argv) applet_long_options = tar_longopts; #endif opt = getopt32(argv, - "txC:f:Opvk" + "txC:f:Oopvk" IF_FEATURE_TAR_CREATE( "ch" ) IF_FEATURE_SEAMLESS_BZ2( "j" ) IF_FEATURE_SEAMLESS_LZMA("a" ) -- 1.6.3.3 _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
