From 8515c10794ff0ee9f44522ac5d6178057072ff38 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 8 May 2023 12:08:08 -0500 Subject: [PATCH] Add tar --one-file-system --- toys/posix/tar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toys/posix/tar.c b/toys/posix/tar.c index ea8edbf7..8c2ef15e 100644 --- a/toys/posix/tar.c +++ b/toys/posix/tar.c @@ -20,7 +20,7 @@ * No --no-null because the args infrastructure isn't ready. * Until args.c learns about no- toggles, --no-thingy always wins over --thingy -USE_TAR(NEWTOY(tar, "&(no-ignore-case)(ignore-case)(no-anchored)(anchored)(no-wildcards)(wildcards)(no-wildcards-match-slash)(wildcards-match-slash)(show-transformed-names)(selinux)(restrict)(full-time)(no-recursion)(null)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(sort);:(mode):(mtime):(group):(owner):(to-command):~(strip-components)(strip)#~(transform)(xform)*o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)P(absolute-names)m(touch)X(exclude-from)*T(files-from)*I(use-compress-program):C(directory):f(file):as[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN)) +USE_TAR(NEWTOY(tar, "&(one-file-system)(no-ignore-case)(ignore-case)(no-anchored)(anchored)(no-wildcards)(wildcards)(no-wildcards-match-slash)(wildcards-match-slash)(show-transformed-names)(selinux)(restrict)(full-time)(no-recursion)(null)(numeric-owner)(no-same-permissions)(overwrite)(exclude)*(sort);:(mode):(mtime):(group):(owner):(to-command):~(strip-components)(strip)#~(transform)(xform)*o(no-same-owner)p(same-permissions)k(keep-old)c(create)|h(dereference)x(extract)|t(list)|v(verbose)J(xz)j(bzip2)z(gzip)S(sparse)O(to-stdout)P(absolute-names)m(touch)X(exclude-from)*T(files-from)*I(use-compress-program):C(directory):f(file):as[!txc][!jzJa]", TOYFLAG_USR|TOYFLAG_BIN)) config TAR bool "tar" @@ -512,6 +512,8 @@ done: free(xfname); free(name); + if (FLAG(one_file_system) && node->parent + && node->parent->st.st_dev != node->st.st_dev) recurse = 0; return recurse*(DIRTREE_RECURSE|DIRTREE_SYMFOLLOW*FLAG(h)); } -- 2.39.2