Diff of the two buildlogs: -- --- b1/build.log 2025-03-13 01:10:15.619895754 +0000 +++ b2/build.log 2025-03-13 01:12:20.442280895 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Mar 12 12:59:40 -12 2025 -I: pbuilder-time-stamp: 1741827580 +I: Current time: Wed Apr 15 21:33:17 +14 2026 +I: pbuilder-time-stamp: 1776238397 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -30,52 +30,84 @@ dpkg-source: info: applying tar-1.35-revert-fix-savannah-bug-633567.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/1140625/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/D01_modify_environment starting +debug: Running on ionos15-amd64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Apr 15 07:33 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=20 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='5478fa2e3a5d4a7394c9c9a7f969650a' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='1140625' - PS1='# ' - PS2='> ' + INVOCATION_ID=5474ef946ca2401ca0e6ca77f96eda66 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=1342568 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.OKRH9VMf/pbuilderrc_3rpd --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.OKRH9VMf/b1 --logfile b1/build.log tar_1.35+dfsg-3.1.dsc' - SUDO_GID='111' - SUDO_UID='106' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://46.16.76.132:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.OKRH9VMf/pbuilderrc_55PT --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.OKRH9VMf/b2 --logfile b2/build.log tar_1.35+dfsg-3.1.dsc' + SUDO_GID=111 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://213.165.73.152:3128 I: uname -a - Linux ionos11-amd64 6.1.0-31-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.12.12+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.12-1~bpo12+1 (2025-02-23) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Mar 4 11:20 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/1140625/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Mar 4 2025 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -167,7 +199,7 @@ Get: 38 http://deb.debian.org/debian trixie/main amd64 libpcre2-dev amd64 10.45-1 [853 kB] Get: 39 http://deb.debian.org/debian trixie/main amd64 libsepol-dev amd64 3.8-1 [372 kB] Get: 40 http://deb.debian.org/debian trixie/main amd64 libselinux1-dev amd64 3.8-4 [169 kB] -Fetched 23.9 MB in 1s (46.5 MB/s) +Fetched 23.9 MB in 0s (142 MB/s) Preconfiguring packages ... Selecting previously unselected package sensible-utils. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19801 files and directories currently installed.) @@ -343,7 +375,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/tar-1.35+dfsg/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../tar_1.35+dfsg-3.1_source.changes +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/tar-1.35+dfsg/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../tar_1.35+dfsg-3.1_source.changes dpkg-buildpackage: info: source package tar dpkg-buildpackage: info: source version 1.35+dfsg-3.1 dpkg-buildpackage: info: source distribution unstable @@ -383,8 +419,8 @@ checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking xargs -n works... yes -checking whether UID '1111' is supported by ustar format... yes -checking whether GID '1111' is supported by ustar format... yes +checking whether UID '2222' is supported by ustar format... yes +checking whether GID '2222' is supported by ustar format... yes checking how to create a ustar tar archive... gnutar checking for gcc... gcc checking whether the C compiler works... yes @@ -1037,7 +1073,7 @@ config.status: executing tests/atconfig commands make[1]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg' dh_auto_build - make -j20 + make -j42 make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' make all-recursive make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' @@ -1094,9 +1130,6 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./ctype.in.h > ctype.h-t -mv alloca.h-t alloca.h -mv configmake.h-t configmake.h -mv ctype.h-t ctype.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_DIRENT_H''@|1|g' \ @@ -1143,8 +1176,6 @@ -e 's|@''REPLACE_ERROR_AT_LINE''@|0|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ ./error.in.h > error.h-t -mv dirent.h-t dirent.h -mv error.h-t error.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1177,18 +1208,19 @@ -e 's|@''NEXT_GETOPT_H''@||g' \ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ ./getopt.in.h > getopt.h-t +mv alloca.h-t alloca.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_SYS_CDEFS_H''@|1|g' \ ./getopt-cdefs.in.h > getopt-cdefs.h-t -mv fcntl.h-t fcntl.h -mv getopt.h-t getopt.h -mv getopt-cdefs.h-t getopt-cdefs.h +mv configmake.h-t configmake.h /usr/bin/mkdir -p 'malloc' /usr/bin/mkdir -p 'malloc' +/usr/bin/mkdir -p 'malloc' +mv ctype.h-t ctype.h +mv error.h-t error.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e '/libc_hidden_proto/d' \ ./malloc/dynarray.h > malloc/dynarray.gl.h-t -/usr/bin/mkdir -p 'malloc' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|||g' \ -e 's|__attribute_maybe_unused__|_GL_ATTRIBUTE_MAYBE_UNUSED|g' \ @@ -1197,14 +1229,14 @@ -e 's|__glibc_likely|_GL_LIKELY|g' \ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t -mv malloc/dynarray.gl.h-t malloc/dynarray.gl.h +mv getopt.h-t getopt.h +mv getopt-cdefs.h-t getopt-cdefs.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ -e 's|__glibc_likely|_GL_LIKELY|g' \ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ -e '/libc_hidden_proto/d' \ ./malloc/scratch_buffer.h > malloc/scratch_buffer.gl.h-t -mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's/@''HAVE_INTTYPES_H''@/1/g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1234,7 +1266,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./inttypes.in.h > inttypes.h-t -mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h +mv fcntl.h-t fcntl.h +mv dirent.h-t dirent.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_LANGINFO_H''@|1|g' \ @@ -1253,6 +1286,7 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./langinfo.in.h > langinfo.h-t +mv malloc/dynarray.gl.h-t malloc/dynarray.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1260,9 +1294,8 @@ -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_LIMITS_H''@||g' \ ./limits.in.h > limits.h-t -mv inttypes.h-t inttypes.h -mv langinfo.h-t langinfo.h -mv limits.h-t limits.h +mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h +mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1316,7 +1349,7 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./signal.in.h > signal.h-t -mv locale.h-t locale.h +mv limits.h-t limits.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_SELINUX_SELINUX_H''@/1/g' \ @@ -1325,7 +1358,7 @@ -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_SELINUX_SELINUX_H''@||g' \ ./se-selinux.in.h > selinux/selinux.h-t -mv signal.h-t signal.h +mv langinfo.h-t langinfo.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1336,8 +1369,7 @@ -e 's|@''HAVE_WCHAR_T''@|1|g' \ -e 's|@''REPLACE_NULL''@|0|g' \ ./stddef.in.h > stddef.h-t -mv selinux/selinux.h-t selinux/selinux.h -mv stddef.h-t stddef.h +mv inttypes.h-t inttypes.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1609,6 +1641,9 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > stdlib.h-t +mv locale.h-t locale.h +mv selinux/selinux.h-t selinux/selinux.h +mv stddef.h-t stddef.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1725,9 +1760,9 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./strings.in.h > strings.h-t +mv signal.h-t signal.h /usr/bin/mkdir -p 'sys' /usr/bin/mkdir -p 'sys' -mv strings.h-t strings.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1742,9 +1777,7 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_random.in.h > sys/random.h-t -mv stdio.h-t stdio.h -mv string.h-t string.h -mv stdlib.h-t stdlib.h +/usr/bin/mkdir -p 'sys' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1802,10 +1835,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_stat.in.h > sys/stat.h-t -mv sys/random.h-t sys/random.h -/usr/bin/mkdir -p 'sys' -/usr/bin/mkdir -p 'sys' -mv sys/stat.h-t sys/stat.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_SYS_TIME_H''@/1/g' \ @@ -1823,16 +1852,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_time.in.h > sys/time.h-t -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ - -e 's|@''GUARD_PREFIX''@|GL|g' \ - -e 's|@''INCLUDE_NEXT''@|include_next|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ - -e 's|@''PRAGMA_COLUMNS''@||g' \ - -e 's|@''NEXT_SYS_TYPES_H''@||g' \ - -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \ - -e 's|@''WINDOWS_STAT_INODES''@|0|g' \ - ./sys_types.in.h > sys/types.h-t -mv sys/time.h-t sys/time.h +/usr/bin/mkdir -p 'sys' +mv strings.h-t strings.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1880,7 +1901,15 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./time.in.h > time.h-t -mv sys/types.h-t sys/types.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|include_next|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ + -e 's|@''PRAGMA_COLUMNS''@||g' \ + -e 's|@''NEXT_SYS_TYPES_H''@||g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|0|g' \ + ./sys_types.in.h > sys/types.h-t sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_UCHAR_H''@/1/g' \ @@ -1929,13 +1958,12 @@ -e 's|@''REPLACE_MBRTOC32''@|1|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ ./uchar.in.h > uchar.h-t +mv sys/random.h-t sys/random.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNICASE_EMPTY_PREFIX_CONTEXT_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNICASE_EMPTY_SUFFIX_CONTEXT_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ ./unicase.in.h > unicase.h-t -mv time.h-t time.h -mv unicase.h-t unicase.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNICTYPE_CATEGORY_L_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2071,7 +2099,7 @@ -e 's/@''GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNICTYPE_PROPERTY_REGIONAL_INDICATOR_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ > unictype.h-t -mv uchar.h-t uchar.h +mv sys/time.h-t sys/time.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNINORM_NFD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2079,6 +2107,7 @@ -e 's/@''GNULIB_UNINORM_NFKD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNINORM_NFKC_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ ./uninorm.in.h > uninorm.h-t +mv sys/types.h-t sys/types.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_UNISTD_H''@|1|g' \ @@ -2276,11 +2305,9 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > unistd.h-t +mv unicase.h-t unicase.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w unitypes.h-t' ./unitypes.in.h -mv uninorm.h-t uninorm.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.h -mv unitypes.h-t unitypes.h -mv uniwidth.h-t uniwidth.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_UTIME_H''@/1/g' \ @@ -2296,6 +2323,9 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./utime.in.h > utime.h-t +mv uninorm.h-t uninorm.h +mv unitypes.h-t unitypes.h +mv uniwidth.h-t uniwidth.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -2419,6 +2449,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > wchar.h-t +mv sys/stat.h-t sys/stat.h +mv time.h-t time.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_WCTYPE_H''@/1/g' \ @@ -2448,11 +2480,15 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./wctype.in.h > wctype.h-t +mv uchar.h-t uchar.h +mv string.h-t string.h mv utime.h-t utime.h -mv unictype.h-t unictype.h -mv unistd.h-t unistd.h mv wctype.h-t wctype.h +mv stdio.h-t stdio.h +mv stdlib.h-t stdlib.h mv wchar.h-t wchar.h +mv unistd.h-t unistd.h +mv unictype.h-t unictype.h make all-recursive make[4]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/gnu' make[5]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/gnu' @@ -2704,7 +2740,7 @@ make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' cp tests/testsuite debian/testsuite.orig dh_auto_test - make -j20 check "TESTSUITEFLAGS=-j20 --verbose" VERBOSE=1 + make -j42 check "TESTSUITEFLAGS=-j42 --verbose" VERBOSE=1 make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' Making check in doc make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/doc' @@ -2750,15 +2786,15 @@ gcc -DHAVE_CONFIG_H -I. -I.. -I../gnu -I../gnu -I../gnu -I../lib -DLOCALEDIR=\"/usr/share/locale\" -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -c -o argcv.o argcv.c gcc -DHAVE_CONFIG_H -I. -I.. -I../gnu -I../gnu -I../gnu -I../lib -DLOCALEDIR=\"/usr/share/locale\" -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -c -o checkseekhole.o checkseekhole.c gcc -DHAVE_CONFIG_H -I. -I.. -I../gnu -I../gnu -I../gnu -I../lib -DLOCALEDIR=\"/usr/share/locale\" -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -c -o ckmtime.o ckmtime.c -gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -Wl,-z,relro -o ckmtime ckmtime.o ../gnu/libgnu.a -lacl -lselinux -lacl gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -Wl,-z,relro -o checkseekhole checkseekhole.o ../gnu/libgnu.a -lacl -lselinux -lacl +gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -Wl,-z,relro -o ckmtime ckmtime.o ../gnu/libgnu.a -lacl -lselinux -lacl gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/tar-1.35+dfsg=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Wno-analyzer-null-argument -Wl,-z,relro -o genfile genfile.o argcv.o ../gnu/libgnu.a -lacl -lselinux -lacl make[4]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/tests' make check-local make[4]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/tests' -/bin/bash '/build/reproducible-path/tar-1.35+dfsg/build-aux/missing' autom4te --language=autotest -I . testsuite.at -o testsuite.tmp +/bin/sh '/build/reproducible-path/tar-1.35+dfsg/build-aux/missing' autom4te --language=autotest -I . testsuite.at -o testsuite.tmp mv testsuite.tmp testsuite -/bin/bash ./testsuite -j20 --verbose +/bin/sh ./testsuite -j42 --verbose ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## @@ -2775,46 +2811,15 @@ - - - - - - - 1. version.at:19: testing tar version ... ./version.at:21: tar --version | sed 1q -7. opcomp02.at:21: testing occurrence compatibility ... -./opcomp02.at:24: -tar --occurrence=1 -tf test.tar - -15. dot-compat.at:16: testing dot action (compatibility syntax) ... -./dot-compat.at:18: -mkdir t -cd t -for i in 0 1 2 3 4 5 6 7 8 9 -do - genfile --length 10240 --file $i -done -TAR_OPTIONS=-Hgnu -export TAR_OPTIONS - -tar --checkpoint=.2 -c -f ../a.tar . - - -12. defaults.at:16: testing checkpoint defaults ... -./defaults.at:18: -mkdir t -cd t -for i in 0 1 2 3 4 5 6 7 8 9 -do - genfile --length 10240 --file $i -done -TAR_OPTIONS=-Hgnu -export TAR_OPTIONS -tar --checkpoint -c -f ../a.tar . +3. options.at:24: testing mixing options ... +./options.at:27: +echo > file1 +TAR_OPTIONS=--numeric-owner tar chof archive file1 +tar tf archive 2. pipe.at:29: testing decompressing from stdin ... ./pipe.at:33: @@ -2840,78 +2845,53 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) -18. testsuite.at:243: testing compress: bzip2 ... -./testsuite.at:243: -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -unset TAR_OPTIONS +4. options02.at:26: testing interspersed options ... +./options02.at:29: +echo > file1 +tar c file1 -f archive +tar tf archive -touch empty -set -e -: create with --bzip2 -tar --bzip2 -cf k.tar.bz2 empty -tar tf k.tar.bz2 +5. options03.at:21: testing TAR_OPTIONS with string arguments ... +./options03.at:31: +echo dir/bar > exclude.list +mkdir dir +genfile --file=dir/foo +genfile --file=dir/bar +TAR_OPTIONS=--exclude-from=exclude.list tar cf arc.tar dir +tar tf arc.tar -echo testing .bz2 -tar -acf k2.tar.bz2 empty -cat k2.tar.bz2 | bzip2 -d > k.bz2.tar -tar tf k.bz2.tar +6. opcomp01.at:21: testing occurrence compatibility ... +./opcomp01.at:24: +tar --occurrence=1 -cf test.tar . -echo testing .tbz2 -tar -acf k2.tar.tbz2 empty -cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar -tar tf k.tbz2.tar +7. opcomp02.at:21: testing occurrence compatibility ... +./opcomp02.at:24: +tar --occurrence=1 -tf test.tar -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.bz2 -test -f empty -13. interval.at:16: testing checkpoint interval ... -./interval.at:18: -mkdir t -cd t -for i in 0 1 2 3 4 5 6 7 8 9 -do - genfile --length 10240 --file $i -done -TAR_OPTIONS=-Hgnu -export TAR_OPTIONS +8. opcomp03.at:21: testing --verify compatibility ... +./opcomp03.at:24: +tar -tWf test.tar . -tar --checkpoint=2 -c -f ../a.tar . +9. opcomp04.at:21: testing compress option compatibility ... +./opcomp04.at:24: -3. options.at:24: testing mixing options ... -./options.at:27: -echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 -tar tf archive +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --file file +tar czf test.tar file +genfile --file newfile +tar rzf test.tar newfile 10. opcomp05.at:21: testing --pax-option compatibility ... ./opcomp05.at:24: tar -Hgnu -cf test.tar --pax-option user:=root . -6. opcomp01.at:21: testing occurrence compatibility ... -./opcomp01.at:24: -tar --occurrence=1 -cf test.tar . - -5. options03.at:21: testing TAR_OPTIONS with string arguments ... -./options03.at:31: -echo dir/bar > exclude.list -mkdir dir -genfile --file=dir/foo -genfile --file=dir/bar -TAR_OPTIONS=--exclude-from=exclude.list tar cf arc.tar dir -tar tf arc.tar - -4. options02.at:26: testing interspersed options ... -./options02.at:29: -echo > file1 -tar c file1 -f archive -tar tf archive 11. opcomp06.at:21: testing --pax-option compatibility ... ./opcomp06.at:24: @@ -2942,6 +2922,39 @@ genfile --file file tar -cf test.tar --acls -Hgnu file + + +12. defaults.at:16: testing checkpoint defaults ... +./defaults.at:18: +mkdir t +cd t +for i in 0 1 2 3 4 5 6 7 8 9 +do + genfile --length 10240 --file $i +done +TAR_OPTIONS=-Hgnu +export TAR_OPTIONS + +tar --checkpoint -c -f ../a.tar . + + + + +1. version.at:19: 13. interval.at:16: testing checkpoint interval ... +./interval.at:18: +mkdir t +cd t +for i in 0 1 2 3 4 5 6 7 8 9 +do + genfile --length 10240 --file $i +done +TAR_OPTIONS=-Hgnu +export TAR_OPTIONS + +tar --checkpoint=2 -c -f ../a.tar . + + + ok 14. dot.at:16: testing dot action ... ./dot.at:18: mkdir t @@ -2956,9 +2969,6 @@ tar --checkpoint-action=dot -c -f ../a.tar . -8. opcomp03.at:21: testing --verify compatibility ... -./opcomp03.at:24: -tar -tWf test.tar . 17. testsuite.at:242: testing compress: gzip ... ./testsuite.at:242: @@ -2990,15 +3000,7 @@ tar xf k.tar.gz test -f empty -9. opcomp04.at:21: testing compress option compatibility ... -./opcomp04.at:24: - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -genfile --file file -tar czf test.tar file -genfile --file newfile -tar rzf test.tar newfile +7. opcomp02.at:21: ok 16. dot-int.at:16: testing dot action and interval ... ./dot-int.at:18: @@ -3014,33 +3016,25 @@ tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . -10. opcomp05.at:21: ok -7. opcomp02.at:21: 20. testsuite.at:246: testing compress: lzip ... -./testsuite.at:246: - -cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --lzip -tar --lzip -cf k.tar.lz empty -tar tf k.tar.lz +6. opcomp01.at:21: 3. options.at:24: 8. opcomp03.at:21: ok + ok + ok +15. dot-compat.at:16: testing dot action (compatibility syntax) ... +./dot-compat.at:18: +mkdir t +cd t +for i in 0 1 2 3 4 5 6 7 8 9 +do + genfile --length 10240 --file $i +done +TAR_OPTIONS=-Hgnu +export TAR_OPTIONS +tar --checkpoint=.2 -c -f ../a.tar . -echo testing .lz -tar -acf k2.tar.lz empty -cat k2.tar.lz | lzip -d > k.lz.tar -tar tf k.lz.tar -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.lz -test -f empty - ok 19. testsuite.at:244: testing compress: xz ... ./testsuite.at:244: @@ -3071,51 +3065,70 @@ tar xf k.tar.xz test -f empty -8. opcomp03.at:21: 1. version.at:19: ok - ok -3. options.at:24: ok 4. options02.at:26: ok -6. opcomp01.at:21: ok -5. options03.at:21: ok ---- - 2025-03-13 01:05:36.829182193 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2025-03-13 01:05:36.802855892 +0000 + +20. testsuite.at:246: testing compress: lzip ... +./testsuite.at:246: + +cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 + +unset TAR_OPTIONS + +touch empty +set -e +: create with --lzip +tar --lzip -cf k.tar.lz empty +tar tf k.tar.lz + + +echo testing .lz +tar -acf k2.tar.lz empty +cat k2.tar.lz | lzip -d > k.lz.tar +tar tf k.lz.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.lz +test -f empty + + +--- - 2026-04-15 07:34:35.936527228 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2026-04-15 07:34:35.933371305 +0000 @@ -1,3 +1 @@ -tar: --acls can be used only on POSIX archives -Try 'tar --help' or 'tar --usage' for more information. -11. opcomp06.at:21: --- - 2025-03-13 01:05:36.838023252 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2025-03-13 01:05:36.822855028 +0000 -@@ -1,4 +1 @@ --empty --testing .lz --empty - -20. testsuite.at:246: skipped (opcomp06.at:24) - skipped (testsuite.at:246) - +18. testsuite.at:243: testing compress: bzip2 ... +./testsuite.at:243: +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 +unset TAR_OPTIONS +touch empty +set -e +: create with --bzip2 +tar --bzip2 -cf k.tar.bz2 empty +tar tf k.tar.bz2 -9. opcomp04.at:21: ok +echo testing .bz2 +tar -acf k2.tar.bz2 empty +cat k2.tar.bz2 | bzip2 -d > k.bz2.tar +tar tf k.bz2.tar +echo testing .tbz2 +tar -acf k2.tar.tbz2 empty +cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar +tar tf k.tbz2.tar -23. positional01.at:21: testing Exclude ... -./positional01.at:24: -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.bz2 +test -f empty -mkdir dir -> dir/A.a -> dir/B.a -> dir/A.b -tar -cf a.tar --exclude '*.b' dir -echo $? -tar -tf a.tar | sort -tar -cf a.tar dir --exclude '*.b' -echo $? -tar -tf a.tar | sort 21. testsuite.at:247: testing compress: lzop ... ./testsuite.at:247: @@ -3142,6 +3155,40 @@ tar xf k.tar.lzo test -f empty +10. opcomp05.at:21: ok +24. positional02.at:21: testing Directory ... +./positional02.at:24: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -cf a.tar -C dir . +echo $? +tar -tf a.tar | sort +tar -cf a.tar . -C dir + + + +23. positional01.at:21: testing Exclude ... +./positional01.at:24: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -cf a.tar --exclude '*.b' dir +echo $? +tar -tf a.tar | sort +tar -cf a.tar dir --exclude '*.b' +echo $? +tar -tf a.tar | sort + +11. opcomp06.at:21: 22. testsuite.at:248: testing compress: zstd ... ./testsuite.at:248: @@ -3173,60 +3220,6 @@ test -f empty -24. positional02.at:21: testing Directory ... -./positional02.at:24: - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -> dir/A.a -> dir/B.a -> dir/A.b -tar -cf a.tar -C dir . -echo $? -tar -tf a.tar | sort -tar -cf a.tar . -C dir - - ---- - 2025-03-13 01:05:36.953882257 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2025-03-13 01:05:36.938850021 +0000 -@@ -1,4 +1 @@ --empty --testing .lzo --empty - -15. dot-compat.at:16: ok -28. T-nest.at:21: testing nested file lists ... -./T-nest.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - ->file1 ->file2 ->file3 ->file4 -cat >F1 <<'_ATEOF' -file1 --T F2 -file2 -_ATEOF - -cat >F2 <<'_ATEOF' -file3 -file4 -_ATEOF - -tar cf archive -T F1 -tar tf archive -) -21. testsuite.at:247: skipped (testsuite.at:247) -13. interval.at:16: ok -12. defaults.at:16: ok 25. positional03.at:21: testing Several options ... ./positional03.at:24: @@ -3240,41 +3233,22 @@ > dir/A.b tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort -14. dot.at:16: ok -27. T-mult.at:21: testing multiple file lists ... -./T-mult.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * ->file1 ->file2 ->file3 ->file4 -cat >F1 <<'_ATEOF' -file1 -file2 -_ATEOF -cat >F2 <<'_ATEOF' -file3 -file4 -_ATEOF -tar cf archive -T F1 -T F2 -tar tf archive -) ---- - 2025-03-13 01:05:36.995094727 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2025-03-13 01:05:36.970848641 +0000 -@@ -1,6 +1 @@ + skipped (opcomp06.at:24) +--- - 2026-04-15 07:34:35.941998827 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2026-04-15 07:34:35.937371305 +0000 +@@ -1,4 +1 @@ -empty --testing .zst +-testing .lzo -empty --testing .tzst + +--- - 2026-04-15 07:34:35.942073928 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2026-04-15 07:34:35.937371305 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lz -empty 26. add-file.at:21: testing The --add-file option ... @@ -3308,30 +3282,35 @@ echo 3: tar -cvf arc.tar -T input ) -./pipe.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +27. T-mult.at:21: testing multiple file lists ... +./T-mult.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +file2 +_ATEOF -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF +tar cf archive -T F1 -T F2 +tar tf archive +) -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) -22. testsuite.at:248: 16. dot-int.at:16: ok 29. T-rec.at:21: testing recursive file lists ... ./T-rec.at:24: mkdir ustar @@ -3358,11 +3337,37 @@ echo $? tar tf archive ) +28. T-nest.at:21: testing nested file lists ... +./T-nest.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * - skipped (testsuite.at:248) +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +-T F2 +file2 +_ATEOF -30. T-recurse.at:27: testing files-from & recurse: toggle ... -./T-recurse.at:30: +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF + +tar cf archive -T F1 +tar tf archive +) +5. options03.at:21: ok +20. testsuite.at:246: 31. T-recurse.at:66: testing toggle --recursion (not) from -T ... +./T-recurse.at:69: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3377,31 +3382,20 @@ cat >F1 <<'_ATEOF' --no-recursion directory1/ ---recursion -directory2/ -_ATEOF - - -cat >F2A <<'_ATEOF' -directory1/ _ATEOF -cat >F2B <<'_ATEOF' +cat >F2 <<'_ATEOF' directory2/ _ATEOF -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +tar cf archive -T F1 --recursion -T F2 +tar tf archive -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" ) -31. T-recurse.at:66: testing toggle --recursion (not) from -T ... -./T-recurse.at:69: +21. testsuite.at:247: 30. T-recurse.at:27: testing files-from & recurse: toggle ... +./T-recurse.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3416,19 +3410,29 @@ cat >F1 <<'_ATEOF' --no-recursion directory1/ +--recursion +directory2/ _ATEOF -cat >F2 <<'_ATEOF' +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF + + +cat >F2B <<'_ATEOF' directory2/ _ATEOF -tar cf archive -T F1 --recursion -T F2 -tar tf archive +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" ) - 32. T-cd.at:21: testing -C in file lists ... ./T-cd.at:24: mkdir ustar @@ -3455,14 +3459,44 @@ tar cf archive -T F1 tar tf archive | sort ) +--- - 2026-04-15 07:34:35.946135437 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2026-04-15 07:34:35.941371305 +0000 +@@ -1,6 +1 @@ +-empty +-testing .zst +-empty +-testing .tzst +-empty + -23. positional01.at:21: - ok + skipped (testsuite.at:247) + +35. T-null2.at:17: testing --null enables verbatim reading ... +./T-null2.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +cat >file-list <<'_ATEOF' +a +-b +--c d +:\\.jpg +_ATEOF +genfile -f a +genfile -f -b +genfile -f '--c d' +genfile -f ':\\.jpg' + +cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - +) -24. positional02.at:21: ok -28. T-nest.at:21: ok 34. T-null.at:21: testing 0-separated file without -0 ... ./T-null.at:24: mkdir ustar @@ -3488,9 +3522,9 @@ tar cfTv archive file-list ) + skipped (testsuite.at:246) +9. opcomp04.at:21: 33. T-empty.at:26: testing empty entries ... -25. positional03.at:21: 29. T-rec.at:21: ok -27. T-mult.at:21: ok ./T-empty.at:36: mkdir ustar (cd ustar @@ -3508,7 +3542,7 @@ tar cfvT archive ../file-list ) ok -37. T-nonl.at:27: testing entries with missing newlines ... +22. testsuite.at:248: 37. T-nonl.at:27: testing entries with missing newlines ... ./T-nonl.at:30: mkdir ustar (cd ustar @@ -3534,27 +3568,6 @@ tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl tar tf archive ) -38. T-dir00.at:28: testing recursive extraction from --files-from ... -./T-dir00.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) 36. T-zfile.at:26: testing empty file ... ./T-zfile.at:29: mkdir ustar @@ -3580,158 +3593,52 @@ tar cf archive -T valid -T empty tar tf archive ) -18. testsuite.at:243: ok -17. testsuite.at:242: ok -35. T-null2.at:17: testing --null enables verbatim reading ... -./T-null2.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -cat >file-list <<'_ATEOF' -a --b ---c d -:\\.jpg -_ATEOF - - -genfile -f a -genfile -f -b -genfile -f '--c d' -genfile -f ':\\.jpg' - -cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - -) - - - -./add-file.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar - - -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF - - -echo 3: -tar -cvf arc.tar -T input -) -./T-recurse.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +38. T-dir00.at:28: testing recursive extraction from --files-from ... +./T-dir00.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF - - -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF - - -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF - -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +test -z "`sort < /dev/null 2>&1`" || exit 77 -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) -./pipe.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + skipped (testsuite.at:248) +39. T-dir01.at:28: testing trailing slash in --files-from ... +./T-dir01.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) -./T-recurse.at:69: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF - - -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF - - -tar cf archive -T F1 --recursion -T F2 -tar tf archive - +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort ) - 40. indexfile.at:26: testing tar --index-file=FILE --file=- ... ./indexfile.at:29: mkdir v7 @@ -3752,9 +3659,19 @@ echo "Testing the archive" tar -tf archive ) -32. T-cd.at:21: -43. recurse.at:21: testing recurse ... -./recurse.at:24: +42. gzip.at:23: testing gzip ... +./gzip.at:28: + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +tar xfvz /dev/null 2>err +RC=$? +sed -n '/^tar:/p' err >&2 +exit $RC + + +41. verbose.at:26: testing tar cvf - ... +./verbose.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3763,14 +3680,15 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) - ok -39. T-dir01.at:28: testing trailing slash in --files-from ... -./T-dir01.at:30: + +43. recurse.at:21: testing recurse ... +./recurse.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3779,18 +3697,12 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -19. testsuite.at:244: ok + 44. recurs02.at:30: testing recurse: toggle ... ./recurs02.at:33: mkdir v7 @@ -3812,53 +3724,7 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -42. gzip.at:23: testing gzip ... -./gzip.at:28: - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -tar xfvz /dev/null 2>err -RC=$? -sed -n '/^tar:/p' err >&2 -exit $RC - -45. shortrec.at:25: testing short records ... -./shortrec.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null - -rm -r directory -) -34. T-null.at:21: ok -33. T-empty.at:26: ok -41. verbose.at:26: testing tar cvf - ... -./verbose.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) 46. numeric.at:18: testing --numeric-owner basic tests ... ./numeric.at:29: mkdir posix @@ -3901,8 +3767,8 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -37. T-nonl.at:27: ok -./T-dir00.at:30: + +./pipe.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3914,51 +3780,77 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) -36. T-zfile.at:26: ok -35. T-null2.at:17: ok -./recurse.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 13 --file directory/file2 +tar cf archive directory +mv directory orig +cat archive | tar xfv - --warning=no-timestamp | sort +echo "separator" +cmp orig/file1 directory/file1 +echo "separator" +cmp orig/file2 directory/file2) +45. shortrec.at:25: testing short records ... +./shortrec.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory ) +48. same-order02.at:25: testing multiple -C options ... +./same-order02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -42. gzip.at:23: ok +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 +mkdir en +mkdir to -./verbose.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 + +ls en +echo separator +ls to +) +49. append.at:21: testing append ... +./append.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) - +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +14. dot.at:16: ok 47. same-order01.at:26: testing working -C with --same-order ... ./same-order01.at:29: mkdir v7 @@ -3982,7 +3874,15 @@ ls directory|sort ) -./indexfile.at:29: +16. dot-int.at:16: ok +24. positional02.at:21: ok +25. positional03.at:21: ok +12. defaults.at:16: + ok +15. dot-compat.at:16: 23. positional01.at:21: ok + ok +13. interval.at:16: 50. append01.at:29: testing appending files with long names ... +./append01.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3991,22 +3891,103 @@ export TAR_OPTIONS rm -rf * +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) + ok +27. T-mult.at:21: ok +52. append03.at:21: testing append with name transformation ... +./append03.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +genfile --file file.1 +genfile --file file.2 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +28. T-nest.at:21: 33. T-empty.at:26: ok + ok +51. append02.at:54: testing append vs. create ... +./append02.at:57: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo "Testing the archive" -tar -tf archive +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" + +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi + +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +29. T-rec.at:21: ok +53. append04.at:29: testing append with verify ... +./append04.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +# Create two empty files: +touch file1 file2 + +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar ) ./add-file.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -4032,11 +4013,11 @@ tar -cvf arc.tar -T input ) ./T-recurse.at:69: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -4058,7 +4039,39 @@ tar tf archive ) -./shortrec.at:28: +42. gzip.at:23: ok +54. append05.at:32: testing append after changed blocking ... +./append05.at:35: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +for f in a b c d e f g h i +do + echo $f > $f +done + +decho 'creating archive' +tar -cf archive -b1 a b c + +tar tf archive + +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive + +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' +tar tf archive +) +./indexfile.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4067,47 +4080,38 @@ export TAR_OPTIONS rm -rf * + mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null +genfile --file=directory/a --length=1035 -rm -r directory +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive ) -48. same-order02.at:25: testing multiple -C options ... -./same-order02.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +32. T-cd.at:21: ok +./verbose.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 - -ls en -echo separator -ls to +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) ./T-recurse.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -4141,9 +4145,12 @@ tar tf "$a" ) +35. T-null2.at:17: -51. append02.at:54: testing append vs. create ... -./append02.at:57: +37. T-nonl.at:27: ok + ok +55. xform-h.at:30: testing transforming hard links on create ... +./xform-h.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4152,60 +4159,28 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo Comparing archives -cmp archive.1 archive.2 -) -50. append01.at:29: testing appending files with long names ... -./append01.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + ) -49. append.at:21: testing append ... -./append.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./T-dir01.at:30: + +./T-dir00.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4222,15 +4197,15 @@ genfile -f dir/file2 tar cf archive dir rm -rf dir -echo dir/ > list +echo dir > list tar xfTv archive list | sort ) ./recurse.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -4239,29 +4214,31 @@ tar --create --file archive --no-recursion directory || exit 1 tar tf archive ) -./pipe.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./T-dir01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort +) + + + -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) ./recurs02.at:33: mkdir oldgnu (cd oldgnu @@ -4282,52 +4259,13 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) +36. T-zfile.at:26: + ok -./verbose.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -53. append04.at:29: testing append with verify ... -./append04.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -# Create two empty files: -touch file1 file2 - -# Create an archive: -tar cpfW archive.tar file1 file2 - -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 - -# Append it to the already created archive: -tar rpfW archive.tar file3 -# Verify content of the new archive: -tar -tf archive.tar -) -52. append03.at:21: testing append with name transformation ... -./append03.at:26: +34. T-null.at:21: ok +57. xform02.at:21: testing transforming escaped delimiters on create ... +./xform02.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4336,62 +4274,27 @@ export TAR_OPTIONS rm -rf * -genfile --file file.1 -genfile --file file.2 - -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -54. append05.at:32: testing append after changed blocking ... -./append05.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -for f in a b c d e f g h i -do - echo $f > $f -done - -decho 'creating archive' -tar -cf archive -b1 a b c - -tar tf archive - -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive - -decho 'adding g h i' -tar -vrf archive -b5 g h i -decho 'resulting archive' -tar tf archive -) -./append01.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./append.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * - -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) -./indexfile.at:29: +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +59. exclude.at:23: testing exclude ... +./exclude.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4401,85 +4304,72 @@ rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive - -echo "Testing the archive" -tar -tf archive -) -./same-order01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +mkdir dir +echo blues > dir/blues +echo jazz > dir/jazz +mkdir dir/folk +echo tagfile > dir/folk/tagfile +echo sanjuan > dir/folk/sanjuan +mkdir dir/rock +echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG +echo "test" > dir/rock/file -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +for option in exclude-caches exclude-caches-under exclude-caches-all +do + echo OPTION $option + tar -cf archive.tar --$option -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done -ls directory|sort +for option in exclude-tag exclude-tag-under exclude-tag-all +do + echo OPTION $option + tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done ) -./T-recurse.at:69: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +58. xform03.at:21: testing transforming hard link targets ... +./xform03.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF - - -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF - - -tar cf archive -T F1 --recursion -T F2 -tar tf archive - +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f ) -./T-dir00.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +56. xform01.at:26: testing transformations and GNU volume labels ... +./xform01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar ) -./append.at:24: + +./same-order02.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4487,47 +4377,29 @@ TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./add-file.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF +mkdir en +mkdir to +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -echo 3: -tar -cvf arc.tar -T input +ls en +echo separator +ls to ) ./shortrec.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -4540,111 +4412,90 @@ rm -r directory ) -./append02.at:57: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +64. exclude05.at:21: testing exclude: lots of excludes ... +./exclude05.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +test -z "`sort < /dev/null 2>&1`" || exit 77 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile -echo Comparing archives -cmp archive.1 archive.2 ) -./same-order02.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +17. testsuite.at:242: 61. exclude02.at:19: testing exclude: anchoring ... +63. exclude04.at:19: testing exclude: case insensitive ... +./exclude04.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to +test -z "`sort < /dev/null 2>&1`" || exit 77 -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 -ls en -echo separator -ls to -) -./verbose.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -./recurse.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -./T-dir01.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort ) ./append03.at:26: mkdir oldgnu @@ -4664,116 +4515,113 @@ echo Testing tar tf archive ) -./numeric.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append01.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 - -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file - - - -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive ) -./append05.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +60. exclude01.at:19: testing exclude wildcards ... +./exclude01.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -for f in a b c d e f g h i -do - echo $f > $f -done -decho 'creating archive' -tar -cf archive -b1 a b c +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar tf archive -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -decho 'adding g h i' -tar -vrf archive -b5 g h i +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort -decho 'resulting archive' -tar tf archive +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir ) -./T-recurse.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +62. exclude03.at:19: testing exclude: wildcards match slash ... +./exclude03.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" ) -./append04.at:32: +./same-order01.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4782,30 +4630,43 @@ export TAR_OPTIONS rm -rf * -# Create two empty files: -touch file1 file2 -# Create an archive: -tar cpfW archive.tar file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 -# Append it to the already created archive: -tar rpfW archive.tar file3 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Verify content of the new archive: -tar -tf archive.tar +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 + +ls directory|sort ) -./pipe.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +66. exclude07.at:19: testing exclude: --exclude-backups option ... +./exclude07.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +./exclude02.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -4813,17 +4674,43 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) -./recurs02.at:33: +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) + ok +./indexfile.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4832,26 +4719,6 @@ export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -) -./indexfile.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - mkdir directory genfile --file=directory/a --length=1035 @@ -4861,23 +4728,24 @@ echo "Testing the archive" tar -tf archive -) -./append01.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +18. testsuite.at:243: ) + ok +./verbose.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) -./append.at:24: +./T-recurse.at:69: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4885,19 +4753,6 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./T-recurse.at:69: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * mkdir directory1 directory2 touch directory1/file directory2/file @@ -4917,55 +4772,8 @@ tar tf archive ) -./add-file.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar - - -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF - - -echo 3: -tar -cvf arc.tar -T input -) -./shortrec.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null -rm -r directory -) -./same-order01.at:29: +./pipe.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4978,51 +4786,38 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 - -ls directory|sort -) -./T-dir00.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 13 --file directory/file2 +tar cf archive directory +mv directory orig +cat archive | tar xfv - --warning=no-timestamp | sort +echo "separator" +cmp orig/file1 directory/file1 +echo "separator" +cmp orig/file2 directory/file2) +65. exclude06.at:26: testing exclude: long files in pax archives ... +./exclude06.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) -./verbose.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive +tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen +mkdir out +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp +find out -type f ) -./recurse.at:24: +68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... +./exclude09.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5031,97 +4826,44 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -./append03.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -genfile --file file.1 -genfile --file file.2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort ) -./indexfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +67. exclude08.at:36: testing --exclude-tag option ... +./exclude08.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Testing the archive" -tar -tf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./append01.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) -./T-dir01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./xform02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -./append.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./same-order02.at:28: +./add-file.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5130,23 +4872,28 @@ export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +genfile --file -File +genfile --file foo +genfile --file bar -mkdir en -mkdir to +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +echo 2: +tar -cvf arc.tar foo --add-file -File bar -ls en -echo separator -ls to + +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input ) -./append02.at:57: +./recurse.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5155,35 +4902,17 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 - -echo Comparing archives -cmp archive.1 archive.2 +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) ./append04.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -5205,35 +4934,54 @@ # Verify content of the new archive: tar -tf archive.tar ) -./recurs02.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +69. exclude10.at:38: testing --exclude-tag option in incremental pass ... +./exclude10.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort ) -2. pipe.at:29: ok -43. recurse.at:21: ok -41. verbose.at:26: ok -./append05.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +19. testsuite.at:244: + ok +70. exclude11.at:36: testing --exclude-tag-under option ... +./exclude11.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +56. xform01.at:26: ./append05.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -5258,7 +5006,41 @@ decho 'resulting archive' tar tf archive ) -./T-recurse.at:30: + ok +./append02.at:57: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" + +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi + +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... +./exclude12.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5267,6 +5049,21 @@ export TAR_OPTIONS rm -rf * + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort +) +./T-recurse.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + mkdir directory1 directory2 touch directory1/file directory2/file @@ -5296,11 +5093,41 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) -40. indexfile.at:26: ok -26. add-file.at:21: ok -50. append01.at:29: ok -31. T-recurse.at:66: ok -./shortrec.at:28: +./append.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./recurs02.at:33: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +) +72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... +./exclude13.at:42: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5309,64 +5136,58 @@ export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null -rm -r directory -) +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile -./append03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort +) + +./xform-h.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file file.1 -genfile --file file.2 +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive -) -./same-order01.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -ls directory|sort ) ./T-dir00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS + rm -rf * @@ -5380,62 +5201,62 @@ echo dir > list tar xfTv archive list | sort ) - -./recurs02.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./T-dir01.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +./append01.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 ) -./append.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -56. xform01.at:26: testing transformations and GNU volume labels ... -./xform01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./xform02.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * genfile --file file -tar -cf archive.tar -V /label/ file -tar tf archive.tar +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort +) ./numeric.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -5471,9 +5292,59 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) +73. exclude14.at:36: testing --exclude-tag-all option ... +./exclude14.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -./same-order02.at:28: +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +stderr: +./indexfile.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +mkdir directory +genfile --file=directory/a --length=1035 + +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) + +./verbose.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive +) +./T-recurse.at:69: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5482,6 +5353,75 @@ export TAR_OPTIONS rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file + +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF + + +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 +tar tf archive + +) +./append03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --file file.1 +genfile --file file.2 + +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... +./exclude16.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort +) +./same-order02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + genfile -l 1024 -f file1 genfile -l 1024 -f file2 tar cf archive file1 file2 @@ -5498,63 +5438,92 @@ echo separator ls to ) -55. xform-h.at:30: testing transforming hard links on create ... -./xform-h.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... +./exclude15.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort +) +./exclude07.at:22: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" +tar -v -c -f archive --exclude-backups dir ) -./T-dir01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./exclude08.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +./append.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./xform03.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f ) -57. xform02.at:21: testing transforming escaped delimiters on create ... ./xform02.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -5564,11 +5533,11 @@ --show-transformed-name ) ./append04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -5590,26 +5559,7 @@ # Verify content of the new archive: tar -tf archive.tar ) -58. xform03.at:21: testing transforming hard link targets ... -./xform03.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) -./append02.at:57: +./pipe.at:33: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5618,53 +5568,26 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 -echo Comparing archives -cmp archive.1 archive.2 -) -./append03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile --file file.1 -genfile --file file.2 -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive -) +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 13 --file directory/file2 +tar cf archive directory +mv directory orig +cat archive | tar xfv - --warning=no-timestamp | sort +echo "separator" +cmp orig/file1 directory/file1 +echo "separator" +cmp orig/file2 directory/file2) ./append05.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -5689,8 +5612,8 @@ decho 'resulting archive' tar tf archive ) -59. exclude.at:23: testing exclude ... -./exclude.at:26: +71. exclude12.at:37: ok +./shortrec.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5699,40 +5622,33 @@ export TAR_OPTIONS rm -rf * +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG -echo "test" > dir/rock/file - -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION $option - tar -cf archive.tar --$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done +rm -r directory +) +./append01.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -for option in exclude-tag exclude-tag-under exclude-tag-all -do - echo OPTION $option - tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive ) -61. exclude02.at:19: testing exclude: anchoring ... -./exclude02.at:22: +68. exclude09.at:37: ok +76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... +./exclude17.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5741,47 +5657,13 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 - -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort - -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort - -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort - -rm -rf testdir file1.txt - +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -60. exclude01.at:19: testing exclude wildcards ... -./exclude01.at:22: +77. exclude18.at:30: testing --exclude-vcs extract list compare ... +./exclude18.at:33: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5793,59 +5675,46 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir gitrepo +cd gitrepo -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* +# Make an empty VCS directory: +mkdir .svn -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +# Make a VCS file: +touch .gitignore -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +# Make non-VCS files: +touch .git_B +touch _C -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -rm -rf testdir -) -45. shortrec.at:25: ./xform02.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name ) - ok ./same-order01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -5862,39 +5731,21 @@ ls directory|sort ) -30. T-recurse.at:27: ok -49. append.at:21: ok -56. xform01.at:26: ok -38. T-dir00.at:28: ok -44. recurs02.at:30: ok -39. T-dir01.at:28: ok - -./same-order02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./recurse.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 - -ls en -echo separator -ls to +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -./xform02.at:24: +./append02.at:57: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5903,55 +5754,6 @@ export TAR_OPTIONS rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -stderr: - -./xform-h.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - -) - -52. append03.at:21: ./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr - ok - -./append02.at:57: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - genfile --file file1 genfile --file file2 @@ -5975,7 +5777,7 @@ echo Comparing archives cmp archive.1 archive.2 ) -./xform03.at:24: +./exclude11.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5984,129 +5786,18 @@ export TAR_OPTIONS rm -rf * -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) - -./append05.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -for f in a b c d e f g h i -do - echo $f > $f -done - -decho 'creating archive' -tar -cf archive -b1 a b c - -tar tf archive - -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive - -decho 'adding g h i' -tar -vrf archive -b5 g h i - -decho 'resulting archive' -tar tf archive -) - -./append04.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -# Create two empty files: -touch file1 file2 - -# Create an archive: -tar cpfW archive.tar file1 file2 - -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 - -# Append it to the already created archive: -tar rpfW archive.tar file3 - -# Verify content of the new archive: -tar -tf archive.tar -) -63. exclude04.at:19: testing exclude: case insensitive ... -./exclude04.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 - -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -touch testdir/file2 -touch testdir/file3 -touch testdir/file4 -touch testdir/dir/File1 -touch testdir/dir/File2 -touch testdir/dir/File3 -touch testdir/dir/File4 - -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort - -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort - -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort - -rm -rf testdir - +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -62. exclude03.at:19: testing exclude: wildcards match slash ... ./exclude03.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -6145,69 +5836,39 @@ rm -rf testdir ) -64. exclude05.at:21: testing exclude: lots of excludes ... -./exclude05.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./xform-h.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir exclfile -mkdir -p testdir -awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ - while read name - do - genfile --file $name - done - -awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile - -tar cf archive --anchored --exclude-from=exclfile \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort - -rm -rf testdir exclfile - -) -65. exclude06.at:26: testing exclude: long files in pax archives ... -./exclude06.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +./T-dir00.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen -mkdir out -tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp -find out -type f +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) - ./xform02.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -6216,98 +5877,77 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) -67. exclude08.at:36: testing --exclude-tag option ... -./exclude08.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) -./numeric.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +) +./add-file.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +genfile --file -File +genfile --file foo +genfile --file bar -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File +echo 2: +tar -cvf arc.tar foo --add-file -File bar -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -) -66. exclude07.at:19: testing exclude: --exclude-backups option ... -./exclude07.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF -mkdir dir -genfile --file dir/file -genfile --file dir/file~ -genfile --file "dir/.#file" -genfile --file "dir/#file#" -tar -v -c -f archive --exclude-backups dir +echo 3: +tar -cvf arc.tar -T input ) - -47. same-order01.at:26: ok -68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... -./exclude09.at:40: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./recurs02.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 ) ./exclude01.at:22: mkdir oldgnu @@ -6353,46 +5993,6 @@ rm -rf testdir ) -./xform02.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -69. exclude10.at:38: testing --exclude-tag option in incremental pass ... -./exclude10.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort -) -stderr: -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr ./exclude02.at:22: mkdir oldgnu (cd oldgnu @@ -6441,40 +6041,107 @@ rm -rf testdir file1.txt ) -48. same-order02.at:25: ok -54. append05.at:32: ok -53. append04.at:29: ok +./append.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./exclude17.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -./xform-h.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +) + +./indexfile.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link +mkdir directory +genfile --file=directory/a --length=1035 -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) +./append03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +genfile --file file.1 +genfile --file file.2 -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +./T-dir01.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort +) +./recurse.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -./xform03.at:24: +./exclude08.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6483,23 +6150,20 @@ export TAR_OPTIONS rm -rf * -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) -51. append02.at:54: ok -57. xform02.at:21: ok + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +65. exclude06.at:26: ok +69. exclude10.at:38: ) + ok ./exclude07.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -6511,45 +6175,47 @@ tar -v -c -f archive --exclude-backups dir ) -70. exclude11.at:36: testing --exclude-tag-under option ... -./exclude11.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./verbose.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) - - - -68. exclude09.at:37: ok - -./exclude08.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./same-order02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir en +mkdir to -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... -./exclude12.at:40: +ls en +echo separator +ls to +) +./T-recurse.at:69: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6558,14 +6224,30 @@ export TAR_OPTIONS rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file + +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 +tar tf archive + ) -73. exclude14.at:36: testing --exclude-tag-all option ... -./exclude14.at:39: +74. exclude15.at:36: 50. append01.at:29: ok + ok +57. xform02.at:21: ok +72. exclude13.at:39: ok +78. delete01.at:23: testing deleting a member after a big one ... +./delete01.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6574,86 +6256,70 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -65. exclude06.at:26: ok -72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... -./exclude13.at:42: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +./shortrec.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort +rm -r directory ) -59. exclude.at:23: ok - -./exclude03.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./T-recurse.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file -test -z "`sort < /dev/null 2>&1`" || exit 77 - +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--recursion +directory2/ +_ATEOF -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +cat >F2B <<'_ATEOF' +directory2/ +_ATEOF -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort -rm -rf testdir +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" ) -stderr: -74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... -./exclude15.at:39: +./pipe.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6663,11 +6329,6 @@ rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort -) ./exclude04.at:22: mkdir oldgnu (cd oldgnu @@ -6715,13 +6376,46 @@ rm -rf testdir ) -75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... -./exclude16.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +79. delete02.at:23: testing deleting a member from stdin archive ... +./delete02.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 13 --file directory/file2 +tar cf archive directory +mv directory orig +cat archive | tar xfv - --warning=no-timestamp | sort +echo "separator" +cmp orig/file1 directory/file1 +echo "separator" +cmp orig/file2 directory/file2) +stderr: +./exclude14.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -6729,17 +6423,36 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +./append04.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort +# Create two empty files: +touch file1 file2 + +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar ) -./exclude07.at:22: +./exclude17.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6749,15 +6462,12 @@ rm -rf * mkdir dir -genfile --file dir/file -genfile --file dir/file~ -genfile --file "dir/.#file" -genfile --file "dir/#file#" - -tar -v -c -f archive --exclude-backups dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) ./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./xform03.at:24: +./append05.at:35: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6766,17 +6476,28 @@ export TAR_OPTIONS rm -rf * -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f +for f in a b c d e f g h i +do + echo $f > $f +done + +decho 'creating archive' +tar -cf archive -b1 a b c + +tar tf archive + +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive + +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' +tar tf archive ) -69. exclude10.at:38: ok -./xform-h.at:39: +./append02.at:57: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6785,49 +6506,36 @@ export TAR_OPTIONS rm -rf * -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - +genfile --file file1 +genfile --file file2 -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 -) -76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... -./exclude17.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +echo Comparing archives +cmp archive.1 archive.2 ) -46. numeric.at:18: ok -./exclude01.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./same-order01.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -6835,43 +6543,21 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -rm -rf testdir +ls directory|sort ) ./exclude11.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -6882,137 +6568,118 @@ tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) - -77. exclude18.at:30: testing --exclude-vcs extract list compare ... -./exclude18.at:33: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +49. append.at:21: ./xform03.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) + ok +75. exclude16.at:38: ./add-file.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A - -# Make a VCS file: -touch .gitignore +genfile --file -File +genfile --file foo +genfile --file bar -# Make non-VCS files: -touch .git_B -touch _C +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo +echo 2: +tar -cvf arc.tar foo --add-file -File bar -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +echo 3: +tar -cvf arc.tar -T input ) -./exclude14.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +40. indexfile.at:26: + ok + ok +./T-dir00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -./exclude17.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) -./exclude08.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./append03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive ) -78. delete01.at:23: testing deleting a member after a big one ... -./delete01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) -71. exclude12.at:37: ok -79. delete02.at:23: testing deleting a member from stdin archive ... -./delete02.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./recurs02.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +) ./exclude07.at:22: mkdir posix (cd posix @@ -7030,56 +6697,37 @@ tar -v -c -f archive --exclude-backups dir ) -./exclude02.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +./xform-h.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 - -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort -rm -rf testdir file1.txt +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' ) -74. exclude15.at:36: ok -80. delete03.at:21: testing deleting members with long names ... +43. recurse.at:21: 80. delete03.at:21: testing deleting members with long names ... ./delete03.at:26: mkdir gnu (cd gnu @@ -7099,102 +6747,53 @@ tar --delete -f archive ./${prefix}5 && tar -tf archive ) -stderr: -./xform-h.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +59. exclude.at:23: ok +./exclude18.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +mkdir gitrepo +cd gitrepo +# Make an empty VCS directory: +mkdir .svn -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -) -./exclude17.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +# Make a VCS file: +touch .gitignore -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) +# Make non-VCS files: +touch .git_B +touch _C -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./xform03.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) -./exclude11.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) - -./delete01.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) 81. delete04.at:23: testing deleting a large last member ... ./delete04.at:26: mkdir v7 @@ -7219,83 +6818,8 @@ tar f archive --delete file10 tar tf archive ) -./exclude08.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) -./exclude14.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -./exclude04.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -touch testdir/file2 -touch testdir/file3 -touch testdir/file4 -touch testdir/dir/File1 -touch testdir/dir/File2 -touch testdir/dir/File3 -touch testdir/dir/File4 - -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort - -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort - -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort - -rm -rf testdir - -) + ok +41. verbose.at:26: ok ./exclude17.at:24: mkdir posix (cd posix @@ -7303,76 +6827,37 @@ export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS -rm -rf * - -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) -72. exclude13.at:39: ok -./exclude07.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +84. extrac01.at:23: testing extract over an existing directory ... +./extrac01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir -genfile --file dir/file -genfile --file dir/file~ -genfile --file "dir/.#file" -genfile --file "dir/#file#" - -tar -v -c -f archive --exclude-backups dir +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) -75. exclude16.at:38: ok -./exclude03.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./delete01.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort - -rm -rf testdir - -) +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) 82. delete05.at:27: testing deleting non-existing member ... ./delete05.at:30: mkdir v7 @@ -7392,72 +6877,34 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) -./delete02.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +83. delete06.at:25: testing EOF detection ... +./delete06.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -./exclude18.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS +mkdir b +touch a b/1 c +tar -cf archive.tar a b/1 c +case $TEST_TAR_FORMAT in +gnu) size=1500;; +pax) size=3072;; +esac +dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null +tar --delete 'b/' -f trunc.tar +) rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A - -# Make a VCS file: -touch .gitignore - -# Make non-VCS files: -touch .git_B -touch _C - -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo - -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort - -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort - -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort - +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./exclude11.at:39: +./exclude08.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7470,55 +6917,32 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) - - -./exclude01.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./T-dir01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort +) +31. T-recurse.at:66: ok -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort - -rm -rf testdir -) -./exclude17.at:24: +./same-order02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7527,47 +6951,85 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 + +mkdir en +mkdir to + +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 + +ls en +echo separator +ls to ) -./delete05.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +85. extrac02.at:23: testing extracting symlinks over an existing file ... +./extrac02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive ) -./exclude14.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./numeric.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file + + + +decho --create +tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --list +tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --diff +tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --extract +tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) + + stderr: -83. delete06.at:25: testing EOF detection ... -./delete06.at:28: +./T-recurse.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7576,50 +7038,36 @@ export TAR_OPTIONS rm -rf * -mkdir b -touch a b/1 c -tar -cf archive.tar a b/1 c -case $TEST_TAR_FORMAT in -gnu) size=1500;; -pax) size=3072;; -esac -dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null -tar --delete 'b/' -f trunc.tar -) -55. xform-h.at:30: ok -66. exclude07.at:19: ok -84. extrac01.at:23: testing extract over an existing directory ... -./extrac01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) -./exclude08.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--recursion +directory2/ +_ATEOF -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort + +cat >F2B <<'_ATEOF' +directory2/ +_ATEOF + + +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" + +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./delete01.at:26: +./exclude03.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7628,69 +7076,47 @@ export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) -./exclude02.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 - -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ testdir tar tf archive | sort -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort -rm -rf testdir file1.txt +rm -rf testdir ) -76. exclude17.at:21: ok -58. xform03.at:21: ok ./delete02.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -7704,50 +7130,27 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) -./delete03.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive -) -./delete04.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./shortrec.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory ) -./exclude11.at:39: +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./append02.at:57: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7756,47 +7159,30 @@ export TAR_OPTIONS rm -rf * +genfile --file file1 +genfile --file file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -./extrac01.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 -./delete06.at:28: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 -mkdir b -touch a b/1 c -tar -cf archive.tar a b/1 c -case $TEST_TAR_FORMAT in -gnu) size=1500;; -pax) size=3072;; -esac -dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null -tar --delete 'b/' -f trunc.tar +echo Comparing archives +cmp archive.1 archive.2 ) -./delete05.at:30: +./exclude14.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7805,63 +7191,13 @@ export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) - -86. extrac03.at:23: testing extraction loops ... -./extrac03.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -85. extrac02.at:23: testing extracting symlinks over an existing file ... -./extrac02.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -./exclude14.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -87. extrac04.at:23: testing extract + fnmatch ... +52. append03.at:21: 87. extrac04.at:23: testing extract + fnmatch ... ./extrac04.at:26: mkdir v7 (cd v7 @@ -7887,8 +7223,7 @@ --exclude='d*/*1' \ --exclude='d*/s*/*2' | sort ) - -./exclude04.at:22: +./exclude11.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7900,42 +7235,42 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) + ok +26. add-file.at:21: ok +./append05.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -touch testdir/file2 -touch testdir/file3 -touch testdir/file4 -touch testdir/dir/File1 -touch testdir/dir/File2 -touch testdir/dir/File3 -touch testdir/dir/File4 - -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort +for f in a b c d e f g h i +do + echo $f > $f +done -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort +decho 'creating archive' +tar -cf archive -b1 a b c -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +tar tf archive -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive -rm -rf testdir +decho 'adding g h i' +tar -vrf archive -b5 g h i +decho 'resulting archive' +tar tf archive ) -./delete01.at:26: +./xform03.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7944,104 +7279,118 @@ export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) -./exclude03.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) +88. extrac05.at:30: testing extracting selected members from pax ... +90. extrac07.at:27: testing extracting symlinks to a read-only dir ... +./extrac07.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +echo Prepare the directory +mkdir dir +genfile -f foo +cd dir +ln -s ../foo . +cd .. +chmod a-w dir -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +echo Create the archive +tar cf archive dir || exit 1 -rm -rf testdir +chmod +w dir +echo Extract +mkdir out +tar -C out -xvf archive ) -./exclude18.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +86. extrac03.at:23: testing extraction loops ... +./extrac03.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +./extrac01.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +./exclude17.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -# Make a VCS file: -touch .gitignore +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +38. T-dir00.at:28: ) + ok +2. pipe.at:29: ./same-order01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -# Make non-VCS files: -touch .git_B -touch _C -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +ls directory|sort ) -88. extrac05.at:30: testing extracting selected members from pax ... + ok ./extrac05.at:38: mkdir posix (cd posix @@ -8066,21 +7415,44 @@ cd .. ) -./extrac01.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +89. extrac06.at:34: testing mode of extracted directories ... +./extrac06.at:37: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 ) -67. exclude08.at:36: ok ./extrac02.at:28: mkdir oldgnu (cd oldgnu @@ -8097,60 +7469,8 @@ touch link tar xf archive ) -./extrac03.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -83. delete06.at:25: ok -./delete02.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -70. exclude11.at:36: ok -./delete05.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) -73. exclude14.at:36: ok -./exclude01.at:22: +./exclude07.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8159,57 +7479,15 @@ export TAR_OPTIONS rm -rf * +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort - -rm -rf testdir +tar -v -c -f archive --exclude-backups dir ) - -./extrac03.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) - -./delete04.at:26: +./exclude02.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8218,29 +7496,6 @@ export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) -./exclude02.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -8280,23 +7535,27 @@ rm -rf testdir file1.txt ) -./delete01.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./delete06.at:28: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) -./extrac02.at:28: +mkdir b +touch a b/1 c +tar -cf archive.tar a b/1 c +case $TEST_TAR_FORMAT in +gnu) size=1500;; +pax) size=3072;; +esac +dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null +tar --delete 'b/' -f trunc.tar +) +44. recurs02.at:30: ok +./exclude01.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8305,112 +7564,102 @@ export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -./extrac04.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort -./extrac01.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) -./delete03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive +rm -rf testdir ) -89. extrac06.at:34: testing mode of extracted directories ... -./extrac06.at:37: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./append04.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -# Force umask -umask 022 +# Create an archive: +tar cpfW archive.tar file1 file2 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +# Append it to the already created archive: +tar rpfW archive.tar file3 -# Archive it -tar cf arc directory +# Verify content of the new archive: +tar -tf archive.tar +) +./exclude08.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +./delete05.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -# After both restores, the directory mode should be 755 +genfile -l 1024 -f en +genfile -l 1024 -f to + +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive ) -88. extrac05.at:30: 91. extrac08.at:33: testing restoring mode on existing directory ... +91. extrac08.at:33: testing restoring mode on existing directory ... ./extrac08.at:36: mkdir v7 (cd v7 @@ -8429,9 +7678,7 @@ tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ) - ok -90. extrac07.at:27: testing extracting symlinks to a read-only dir ... -./extrac07.at:30: +./delete01.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8440,33 +7687,46 @@ export TAR_OPTIONS rm -rf * +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +39. T-dir01.at:28: ok +./xform-h.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod a-w dir -echo Create the archive -tar cf archive dir || exit 1 +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -chmod +w dir -echo Extract -mkdir out -tar -C out -xvf archive +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + ) -92. extrac09.at:34: testing extracting even when . and .. are unreadable ... + +48. same-order02.at:25: 92. extrac09.at:34: testing extracting even when . and .. are unreadable ... ./extrac09.at:37: mkdir gnu (cd gnu @@ -8500,49 +7760,13 @@ cmp f extract/f || status=$? exit $status ) -./delete05.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) -./delete02.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) + ok ./extrac03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -8550,12 +7774,13 @@ tar -cPvf archive directory/../directory echo separator tar -xPvf archive --warning=no-timestamp) + ./extrac01.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -8565,7 +7790,33 @@ tar xf archive --warning=no-timestamp || exit 1 ) -./exclude04.at:22: +./delete04.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) +76. exclude17.at:21: ok + +93. extrac10.at:29: testing -C and delayed setting of metadata ... +./extrac10.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8574,6 +7825,24 @@ export TAR_OPTIONS rm -rf * +mkdir d x x/y +echo foo >d/d1 +echo bar >e + +tar -cf archive.tar d e && +tar -xf archive.tar -C x d -C y e && +diff -r d x/d && +diff e x/y/e +) +./exclude04.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -8612,107 +7881,7 @@ rm -rf testdir ) -./exclude18.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A - -# Make a VCS file: -touch .gitignore - -# Make non-VCS files: -touch .git_B -touch _C - -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo - -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort - -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort - -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort - -) -78. delete01.at:23: ok -./extrac02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -./extrac08.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir -) -93. extrac10.at:29: testing -C and delayed setting of metadata ... -./extrac10.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir d x x/y -echo foo >d/d1 -echo bar >e - -tar -cf archive.tar d e && -tar -xf archive.tar -C x d -C y e && -diff -r d x/d && -diff e x/y/e -) -./extrac06.at:37: +./delete03.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8722,104 +7891,36 @@ rm -rf * -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory - -# Archive it -tar cf arc directory - -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory - -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory - -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory - -# After both restores, the directory mode should be 755 -) -./exclude03.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort - -rm -rf testdir - +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive ) -84. extrac01.at:23: ok - -82. delete05.at:27: ok -./delete04.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +51. append02.at:54: ok +./delete02.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 tar tf archive -) -./extrac04.at:26: +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +./extrac02.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8828,23 +7929,14 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive ) -./extrac03.at:26: +./exclude11.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8853,10 +7945,12 @@ export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) 94. extrac11.at:25: testing scarce file descriptors ... ./extrac11.at:28: mkdir gnu @@ -8925,52 +8019,50 @@ diff -r a dest3/a >/dev/null 2>&1 ) || { diff -r a dest3/a; exit 1; } ) -92. extrac09.at:34: ok -79. delete02.at:23: ok -90. extrac07.at:27: ok -80. delete03.at:21: ok -93. extrac10.at:29: ok - -./extrac02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +45. shortrec.at:25: ok +./exclude14.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -60. exclude01.at:19: ok -95. extrac12.at:25: testing extract dot permissions ... -./extrac12.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac04.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir src dst -echo file1 >src/file1 -echo file2 >src/file2 -chmod a-w src -tar --no-recursion -cf archive.tar -C src . ./file1 file2 && -tar -xf archive.tar -C dst && -cmp src/file1 dst/file1 && -cmp src/file2 dst/file2 -) +test -z "`sort < /dev/null 2>&1`" || exit 77 -./extrac08.at:36: +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +stderr: +./exclude18.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8979,16 +8071,44 @@ export TAR_OPTIONS rm -rf * -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir gitrepo +cd gitrepo + +# Make an empty VCS directory: +mkdir .svn + +# Make a VCS directory with a file: +mkdir .git +touch .git/_A + +# Make a VCS file: +touch .gitignore + +# Make non-VCS files: +touch .git_B +touch _C + +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + ) -96. extrac13.at:26: testing extract over symlinks ... +83. delete06.at:25: 96. extrac13.at:26: testing extract over symlinks ... ./extrac13.at:29: mkdir gnu (cd gnu @@ -9021,11 +8141,43 @@ diff src/file1 dst3/file1 && diff src/file1 dst3/target1 ) + ok +54. append05.at:32: ok +66. exclude07.at:19: ok +47. same-order01.at:26: ./delete05.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -61. exclude02.at:19: ok +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) + ok +./extrac03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -./exclude18.at:33: +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +95. extrac12.at:25: testing extract dot permissions ... +./extrac12.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9034,49 +8186,42 @@ export TAR_OPTIONS rm -rf * +mkdir src dst +echo file1 >src/file1 +echo file2 >src/file2 +chmod a-w src -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A - -# Make a VCS file: -touch .gitignore - -# Make non-VCS files: -touch .git_B -touch _C - -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo - -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort +tar --no-recursion -cf archive.tar -C src . ./file1 file2 && +tar -xf archive.tar -C dst && +cmp src/file1 dst/file1 && +cmp src/file2 dst/file2 +) -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +30. T-recurse.at:27: ./extrac08.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir ) -86. extrac03.at:23: ./extrac06.at:37: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./extrac06.at:37: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -9109,7 +8254,8 @@ # After both restores, the directory mode should be 755 ) ok - +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +88. extrac05.at:30: ok 97. extrac14.at:25: testing extract -C symlink ... ./extrac14.at:28: mkdir gnu @@ -9127,7 +8273,6 @@ tar -xf archive.tar -C symlink --warning=no-timestamp && cmp foo dest/foo ) - 98. extrac15.at:25: testing extract parent mkdir failure ... ./extrac15.at:28: mkdir gnu @@ -9157,7 +8302,40 @@ else (exit 0) fi ) -63. exclude04.at:19: ok +90. extrac07.at:27: ./xform03.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) + ok +./extrac01.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) + 99. extrac16.at:26: testing extract empty directory with -C ... ./extrac16.at:29: mkdir gnu @@ -9174,6 +8352,25 @@ tar -cf archive.tar -C src a && tar -xf archive.tar -C dest ) +./delete01.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +67. exclude08.at:36: ok +53. append04.at:29: + ok 100. extrac17.at:21: testing name matching/transformation ordering ... ./extrac17.at:34: mkdir v7 @@ -9193,6 +8390,86 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) +93. extrac10.at:29: ok + +./extrac02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) + + +./exclude03.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) + +./exclude14.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) 101. extrac18.at:34: testing keep-old-files ... ./extrac18.at:37: @@ -9219,7 +8496,64 @@ cat a ) +./numeric.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 + +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file + + +decho --create +tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --list +tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --diff +tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --extract +tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + +) + +70. exclude11.at:36: +./extrac03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) + ok +95. extrac12.at:25: ok 102. extrac19.at:21: testing skip-old-files ... ./extrac19.at:24: mkdir v7 @@ -9245,12 +8579,32 @@ cat a ) +./delete05.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 1024 -f en +genfile -l 1024 -f to + +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +92. extrac09.at:34: ok +55. xform-h.at:30: ok ./delete04.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -9268,33 +8622,15 @@ tar f archive --delete file10 tar tf archive ) -./extrac04.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac01.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) -95. extrac12.at:25: ok -103. extrac20.at:21: testing keep-directory-symlink ... +97. extrac14.at:25: 103. extrac20.at:21: testing keep-directory-symlink ... ./extrac20.at:24: mkdir v7 (cd v7 @@ -9367,7 +8703,7 @@ clean done ) - + ok 104. extrac21.at:31: testing delay-directory-restore ... ./extrac21.at:33: mkdir ustar @@ -9398,47 +8734,57 @@ mkdir out tar -C out -v -x -f A.tar --delay-directory-restore ) -85. extrac02.at:23: 97. extrac14.at:25: ok -./extrac08.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +./extrac04.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort ) - ok -94. extrac11.at:25: ok -99. extrac16.at:26: ok -./extrac17.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + +107. extrac24.at:18: testing --to-stdout ... +./extrac24.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) -62. exclude03.at:19: ok 105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... ./extrac22.at:29: mkdir v7 @@ -9487,31 +8833,64 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) -./extrac18.at:37: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +99. extrac16.at:26: ok +./delete03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . -rm b -echo 'File a' > a +./delete02.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -tar -x -k -f ../archive -echo status=$? +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive +) +./extrac08.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -cat a +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir ) -./extrac19.at:24: +./extrac17.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9520,23 +8899,49 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -tar -x --skip-old-files -f ../archive -echo status=$? +tar cf dir.tar dir -cat a +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) +109. backup01.at:33: testing extracting existing dir with --backup ... +./backup01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -./extrac06.at:37: +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +./extrac02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +98. extrac15.at:25: +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) + ok +./exclude01.at:22: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9546,38 +8951,40 @@ rm -rf * -# Force umask -umask 022 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -# Archive it -tar cf arc directory +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort -# After both restores, the directory mode should be 755 +rm -rf testdir ) - -98. extrac15.at:25: - ok - - 106. extrac23.at:18: testing --no-overwrite-dir ... ./extrac23.at:32: mkdir v7 @@ -9607,78 +9014,6 @@ chmod 700 dir find dir ) -./extrac08.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir -) -./extrac17.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) -96. extrac13.at:26: ok -77. exclude18.at:30: ok -107. extrac24.at:18: testing --to-stdout ... -./extrac24.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) - -109. backup01.at:33: testing extracting existing dir with --backup ... -./backup01.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp -) 108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... ./extrac25.at:21: mkdir v7 @@ -9697,31 +9032,7 @@ ln -s does_not_exist subdir tar -xvf test.tar ) -./extrac04.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) 110. difflink.at:17: testing link mismatch ... ./difflink.at:19: mkdir ustar @@ -9741,7 +9052,8 @@ ln -s x a/z tar df a.tar ) -./extrac19.at:24: +stderr: +./extrac06.at:37: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -9750,22 +9062,35 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b -tar cf ../archive . +# Force umask +umask 022 -rm b -echo 'File a' > a +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -tar -x --skip-old-files -f ../archive -echo status=$? +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory -cat a +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 ) -104. extrac21.at:31: ok + 111. label01.at:21: testing single-volume label ... ./label01.at:24: mkdir gnu @@ -9781,48 +9106,53 @@ tar -cf archive --label=Test foo bar tar tf archive ) -./extrac18.at:37: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude02.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b -tar cf ../archive . +test -z "`sort < /dev/null 2>&1`" || exit 77 -rm b -echo 'File a' > a -tar -x -k -f ../archive -echo status=$? +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 -cat a -) +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -81. delete04.at:23: - ok -./backup01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp ) 112. label02.at:21: testing multi-volume label ... ./label02.at:24: @@ -9841,23 +9171,24 @@ tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar ) -./extrac24.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +./delete01.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -./extrac22.at:29: +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +./extrac18.at:37: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9866,44 +9197,87 @@ export TAR_OPTIONS rm -rf * +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) + +96. extrac13.at:26: ok +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./extrac03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +./exclude18.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir t -(cd t - genfile --length 100 --file data1 - mkdir dir1 - cp data1 dir1 - mkdir dir2 - cd dir2 - ln -s ../dir1/data1 data2 - cd .. - chmod -w dir2) +mkdir gitrepo +cd gitrepo -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF +# Make an empty VCS directory: +mkdir .svn +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -tar -C t -c -f a.tar --no-recursion -T filelist +# Make a VCS file: +touch .gitignore + +# Make non-VCS files: +touch .git_B +touch _C + +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort -mkdir restore -tar -x -p --delay-directory-restore -C restore -f a.tar -# Previous versions of tar would fail here with the following diagnostics: -# tar: ./dir2/data2: Cannot unlink: Permission denied ) + + +94. extrac11.at:25: ok +58. xform03.at:21: ok 113. label03.at:27: testing test-label option ... ./label03.at:30: mkdir gnu @@ -9937,23 +9311,48 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) -./extrac17.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./delete05.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 +genfile -l 1024 -f en +genfile -l 1024 -f to -tar cf dir.tar dir +tar cf archive en to +# Make sure we don't use bogus blocking factor. -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) +./extrac19.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a ) 114. label04.at:27: testing label with non-create option ... ./label04.at:30: @@ -9974,45 +9373,54 @@ decho "# Update: right label" tar -rf archive --label='New volume' file ) - -./extrac06.at:37: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./exclude04.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -# Force umask -umask 022 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -# Archive it -tar cf arc directory +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir -# After both restores, the directory mode should be 755 ) -./extrac25.at:21: +./backup01.at:36: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10021,17 +9429,13 @@ export TAR_OPTIONS rm -rf * -mkdir subdir -touch subdir/a.txt -tar -cf test.tar subdir/a.txt - -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) - -91. extrac08.at:33: ok -./label01.at:24: +./extrac24.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10040,12 +9444,14 @@ export TAR_OPTIONS rm -rf * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) -115. label05.at:24: testing label with non-create option ... +73. exclude14.at:36: 115. label05.at:24: testing label with non-create option ... ./label05.at:27: mkdir gnu (cd gnu @@ -10064,85 +9470,7 @@ decho "# Update: right label" tar -rf archive file ) -./extrac18.at:37: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -tar -x -k -f ../archive -echo status=$? - -cat a -) -./label02.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --length 0 --file foo -genfile --length 12288 --file bar -genfile --length 12288 --file baz -tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz -tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar -) -./backup01.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp -) -./extrac19.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -tar -x --skip-old-files -f ../archive -echo status=$? - -cat a -) + ok 116. incremental.at:23: testing incremental ... ./incremental.at:26: mkdir gnu @@ -10182,8 +9510,7 @@ echo y >structure/file tar cfv archive --listed=list structure ) -110. difflink.at:17: ok -./extrac24.at:29: +./extrac17.at:34: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -10192,44 +9519,18 @@ export TAR_OPTIONS rm -rf * -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -./extrac23.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir +tar cf dir.tar dir -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) - -87. extrac04.at:23: ok -./extrac17.at:34: +84. extrac01.at:23: ok +118. incr02.at:32: testing restoring timestamps from incremental ... +./incr02.at:35: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10238,32 +9539,42 @@ export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file -tar cf dir.tar dir +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) -./label04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive --label='New volume' file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive --label='New volume' file +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - ) 117. incr01.at:27: testing restore broken symlinks from incremental ... ./incr01.at:30: @@ -10291,41 +9602,7 @@ tar xvfg archive.1 /dev/null --warning=no-timestamp ) -./label05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) - -./label01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive -) -89. extrac06.at:34: ok -./label02.at:24: +./extrac08.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10334,58 +9611,35 @@ export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 0 --file foo -genfile --length 12288 --file bar -genfile --length 12288 --file baz -tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz -tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar -) -./extrac19.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - +umask 000 mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -tar -x --skip-old-files -f ../archive -echo status=$? - -cat a +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir ) -./backup01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./label01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive ) ./extrac25.at:21: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -10397,70 +9651,6 @@ ln -s does_not_exist subdir tar -xvf test.tar ) -100. extrac17.at:21: ok -./extrac24.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -118. incr02.at:32: testing restoring timestamps from incremental ... -./incr02.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, 'dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) 119. listed01.at:26: testing --listed for individual files ... ./listed01.at:29: mkdir gnu @@ -10498,7 +9688,9 @@ tar tf archive.2 || exit 1 ) -./label03.at:30: +85. extrac02.at:23: ok +86. extrac03.at:23: ok +./label02.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10508,34 +9700,18 @@ rm -rf * exec <&- -genfile --file file -tar -c --label='iamalabel' --file iamanarchive file -tar -c --file unlabeled.tar file -decho "# Display label" -tar --test-label --file=iamanarchive; echo $? -decho "# Display label: unlabeled" -tar --test-label --file=unlabeled.tar; echo $? -decho "# Test label: success" -tar --test-label --file=iamanarchive 'iamalabel'; echo $? -decho "# Test label: failure" -tar --test-label --file=iamanarchive 'amalabel'; echo $? -decho "# Test label: unlabeled" -tar --test-label --file=unlabeled.tar 'amalabel'; echo $? -decho "# Test label, verbose: success" -tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? -decho "# Test label, verbose: failure" -tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? -decho "# Test label: multiple arguments" -tar --test-label --file=iamanarchive a iamalabel b; echo $? -decho "# Test label: wildcards" -tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar ) ./extrac18.at:37: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -10554,7 +9730,7 @@ cat a ) -./label04.at:30: +./extrac04.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10563,64 +9739,67 @@ export TAR_OPTIONS rm -rf * -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive --label='New volume' file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive --label='New volume' file -) -./extrac22.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +./delete04.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir t -(cd t - genfile --length 100 --file data1 - mkdir dir1 - cp data1 dir1 - mkdir dir2 - cd dir2 - ln -s ../dir1/data1 data2 - cd .. - chmod -w dir2) - -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) -tar -C t -c -f a.tar --no-recursion -T filelist +./delete02.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -mkdir restore -tar -x -p --delay-directory-restore -C restore -f a.tar -# Previous versions of tar would fail here with the following diagnostics: -# tar: ./dir2/data2: Cannot unlink: Permission denied -) -111. label01.at:21: ok +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +104. extrac21.at:31: ok 120. listed02.at:28: testing working --listed ... ./listed02.at:31: mkdir gnu @@ -10691,13 +9870,12 @@ echo Final files: find tart -print | sort 2>/dev/null ) - ./backup01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -10707,9 +9885,81 @@ tar cf test.tar dir1 dir2 tar xfv test.tar --backup --warning=no-timestamp ) -101. extrac18.at:34: ok -102. extrac19.at:21: ok -./label05.at:27: + + +110. difflink.at:17: ./extrac19.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS + ok +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +./extrac22.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir t +(cd t + genfile --length 100 --file data1 + mkdir dir1 + cp data1 dir1 + mkdir dir2 + cd dir2 + ln -s ../dir1/data1 data2 + cd .. + chmod -w dir2) + +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF + + +tar -C t -c -f a.tar --no-recursion -T filelist + +mkdir restore +tar -x -p --delay-directory-restore -C restore -f a.tar +# Previous versions of tar would fail here with the following diagnostics: +# tar: ./dir2/data2: Cannot unlink: Permission denied +) +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +./extrac06.at:37: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10718,21 +9968,31 @@ export TAR_OPTIONS rm -rf * -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + ./extrac24.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -10742,9 +10002,18 @@ rm -r dir tar --extract --to-stdout --file a.tar test -d dir +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + ) +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory -./incr01.at:30: +# After both restores, the directory mode should be 755 +) +78. delete01.at:23: ok +./label04.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10753,20 +10022,97 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +./label05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -mkdir directory -$as_ln_s foo directory/bar +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory +80. delete03.at:21: ./exclude03.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -mv directory orig -tar xvfg archive.0 /dev/null --warning=no-timestamp -echo separator -tar xvfg archive.1 /dev/null --warning=no-timestamp +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) + ok + +122. listed04.at:26: testing --listed-incremental and --one-file-system ... +./listed04.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +mkdir dir +echo a >dir/a +echo b >dir/b + +tar --one-file-system -cvf archive.tar -g archive.incr dir || exit +tar -tf archive.tar || exit ) 121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... ./listed03.at:27: @@ -10805,8 +10151,7 @@ cat err >&2 exit $status ) -112. label02.at:21: ok -./extrac25.at:21: +./extrac17.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10815,96 +10160,14 @@ export TAR_OPTIONS rm -rf * -mkdir subdir -touch subdir/a.txt -tar -cf test.tar subdir/a.txt - -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar -) -./extrac23.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir -) - - -109. backup01.at:33: 122. listed04.at:26: testing --listed-incremental and --one-file-system ... -./listed04.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -mkdir dir -echo a >dir/a -echo b >dir/b - -tar --one-file-system -cvf archive.tar -g archive.incr dir || exit -tar -tf archive.tar || exit -) - ok -114. label04.at:27: ok +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -./label03.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +tar cf dir.tar dir -exec <&- -genfile --file file -tar -c --label='iamalabel' --file iamanarchive file -tar -c --file unlabeled.tar file -decho "# Display label" -tar --test-label --file=iamanarchive; echo $? -decho "# Display label: unlabeled" -tar --test-label --file=unlabeled.tar; echo $? -decho "# Test label: success" -tar --test-label --file=iamanarchive 'iamalabel'; echo $? -decho "# Test label: failure" -tar --test-label --file=iamanarchive 'amalabel'; echo $? -decho "# Test label: unlabeled" -tar --test-label --file=unlabeled.tar 'amalabel'; echo $? -decho "# Test label, verbose: success" -tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? -decho "# Test label, verbose: failure" -tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? -decho "# Test label: multiple arguments" -tar --test-label --file=iamanarchive a iamalabel b; echo $? -decho "# Test label: wildcards" -tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) 123. listed05.at:33: testing --listed-incremental and remounted directories ... ./listed05.at:36: @@ -10949,7 +10212,67 @@ umount tartest/subdir ) -107. extrac24.at:18: ok +./extrac23.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) +./label01.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +./extrac08.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +46. numeric.at:18: ok 124. incr03.at:28: testing renamed files in incrementals ... ./incr03.at:31: mkdir gnu @@ -10991,41 +10314,46 @@ tar -xf archive.2 -g db --warning=no-timestamp find directory | sort ) -115. label05.at:24: ok - -125. incr04.at:29: testing proper icontents initialization ... -./incr04.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./label02.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 - -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) +82. delete05.at:27: ok -sleep 1 +./backup01.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) ./extrac25.at:21: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -11037,59 +10365,39 @@ ln -s does_not_exist subdir tar -xvf test.tar ) -./extrac22.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +125. incr04.at:29: testing proper icontents initialization ... +./incr04.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +ckmtime || exit 77 -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir t -(cd t - genfile --length 100 --file data1 - mkdir dir1 - cp data1 dir1 - mkdir dir2 - cd dir2 - ln -s ../dir1/data1 data2 - cd .. - chmod -w dir2) - -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF - +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - -tar -C t -c -f a.tar --no-recursion -T filelist +sleep 1 -mkdir restore -tar -x -p --delay-directory-restore -C restore -f a.tar -# Previous versions of tar would fail here with the following diagnostics: -# tar: ./dir2/data2: Cannot unlink: Permission denied +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a ) ./incr01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -11108,7 +10416,31 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) +./extrac19.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) 126. incr05.at:21: testing incremental dumps with -C ... ./incr05.at:24: mkdir gnu @@ -11132,14 +10464,76 @@ echo Level 1 tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) ---- - 2025-03-13 01:05:41.166396390 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2025-03-13 01:05:41.158667876 +0000 -@@ -1,4 +1 @@ --tar: .: Directory is new --tar: ./subdir: Directory is new --tar: ./subdir: directory is on a different filesystem; not dumped - +./exclude18.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir gitrepo +cd gitrepo + +# Make an empty VCS directory: +mkdir .svn + +# Make a VCS directory with a file: +mkdir .git +touch .git/_A + +# Make a VCS file: +touch .gitignore +# Make non-VCS files: +touch .git_B +touch _C + +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + +) +./extrac18.at:37: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) 127. incr06.at:21: testing incremental dumps of nested directories ... ./incr06.at:24: mkdir gnu @@ -11172,121 +10566,99 @@ echo Level 1 sub . tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) -122. listed04.at:26: ok ---- - 2025-03-13 01:05:41.173393625 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2025-03-13 01:05:41.166667530 +0000 -@@ -1,10 +1 @@ --# Level 0 --./ --./subdir/ --./top-level-file --./subdir/subdir-file --# Remount --# Level 1 --./ --./subdir/ - -123. listed05.at:33: skipped (listed05.at:36) -./extrac20.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./extrac24.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +./label03.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -for i in a b c -do - dir=in$i - mkdir -p $dir/root/dir $dir/root/dirsymlink - touch $dir/root/dirsymlink/file$i - test $i != a && touch $dir/root/dirsymlink/file.conflict - tar cf archive$i.tar -C $dir root -done - -prep() -{ - echo "== $1 ==" - echo "== $1 ==" >&2 - backup_dir=$1 - dir=out - mkdir -p $dir/root/dir - ln -s dir $dir/root/dirsymlink - test $round = normal && cd $dir >/dev/null -} - -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} - -# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable -file_spec() -{ - if test $round = normal - then - echo "-f ../$1" - else - echo "-f $1 -C $dir" - fi -} - -for round in normal dir -do - # Check that 'dirsymlink' replaces 'dir' - prep without_option_$round - tar -x `file_spec archivea.tar` || exit 1 - tar -x `file_spec archiveb.tar` || exit 1 - clean - - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean - - prep collision_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 - clean -done +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) -./extrac23.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./exclude01.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir ) + 128. incr07.at:18: testing incremental restores with -C ... ./incr07.at:40: mkdir gnu @@ -11334,6 +10706,62 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) +./exclude02.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) + +--- - 2026-04-15 07:34:38.068479622 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2026-04-15 07:34:38.061371305 +0000 +@@ -1,4 +1 @@ +-tar: .: Directory is new +-tar: ./subdir: Directory is new +-tar: ./subdir: directory is on a different filesystem; not dumped + 129. incr08.at:38: testing filename normalization ... ./incr08.at:41: mkdir gnu @@ -11362,10 +10790,55 @@ DIR=`pwd` tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR ) +./label05.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -121. listed03.at:24: ok +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) +./label04.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -108. extrac25.at:18: ok +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +--- - 2026-04-15 07:34:38.071143641 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2026-04-15 07:34:38.065371305 +0000 +@@ -1,10 +1 @@ +-# Level 0 +-./ +-./subdir/ +-./top-level-file +-./subdir/subdir-file +-# Remount +-# Level 1 +-./ +-./subdir/ + 130. incr09.at:26: testing incremental with alternating -C ... ./incr09.at:29: mkdir gnu @@ -11392,6 +10865,152 @@ decho B tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . ) +./extrac17.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 + +tar cf dir.tar dir + +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +79. delete02.at:23: ./backup01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +123. listed05.at:33: tar xfv test.tar --backup --warning=no-timestamp +) +111. label01.at:21: ./extrac06.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +./exclude04.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 + +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort + +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort + +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir + +) + ok +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +122. listed04.at:26: ok +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 +) +./extrac04.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) + ok +91. extrac08.at:33: ok 131. incr10.at:18: testing concatenated incremental archives (deletes) ... ./incr10.at:28: mkdir gnu @@ -11417,38 +11036,84 @@ mkdir out tar -xvf full.tar -g /dev/null -C out ) -113. label03.at:27: ok -./incr05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + skipped (listed05.at:36) +./delete04.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +132. incr11.at:25: testing concatenated incremental archives (renames) ... +./incr11.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * ckmtime || exit 77 -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -echo Level 0 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +install-sh -d data/dir >/dev/null && genfile --file data/dir/file || exit 77 +decho Level 0 +tar -cvf full.tar -g snap -C data . +decho Level 1 +mv data/dir data/dir2 +tar -cvf incr.tar -g snap -C data . +decho Concat +cp full.tar full2.tar +tar -A -f full2.tar incr.tar +decho Extract +mkdir out +tar -xvf full2.tar -g /dev/null -C out +decho List +find out | sort +) +112. label02.at:21: +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 + ok +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive ) +./extrac25.at:21: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +mkdir subdir +touch subdir/a.txt +tar -cf test.tar subdir/a.txt -117. incr01.at:27: ok +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar +) ./extrac22.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -11490,39 +11155,31 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) -./incr06.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./extrac18.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 mkdir dir -mkdir dir/sub -mkdir dir/sub/a -mkdir dir/sub/b -genfile --file dir/file1 -genfile --file dir/sub/file2 -genfile --file dir/sub/a/file3 +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -echo Level 0 . sub -tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 0 sub . -tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +tar cf ../archive . -mkdir dir/c -genfile --file dir/sub/b/file4 +rm b +echo 'File a' > a -echo Level 1 . sub -tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 1 sub . -tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +tar -x -k -f ../archive +echo status=$? + +cat a ) -132. incr11.at:25: testing concatenated incremental archives (renames) ... -./incr11.at:28: +./extrac24.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11531,28 +11188,15 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -install-sh -d data/dir >/dev/null && genfile --file data/dir/file || exit 77 -decho Level 0 -tar -cvf full.tar -g snap -C data . -decho Level 1 -mv data/dir data/dir2 -tar -cvf incr.tar -g snap -C data . -decho Concat -cp full.tar full2.tar -tar -A -f full2.tar incr.tar -decho Extract -mkdir out -tar -xvf full2.tar -g /dev/null -C out -decho List -find out | sort +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) -133. filerem01.at:36: testing file removed as we read it ... -./filerem01.at:39: + +./extrac19.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11562,23 +11206,51 @@ rm -rf * mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +./incr05.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +mkdir dir mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 -genfile --run --checkpoint=3 --unlink dir/file1 -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v dir >/dev/null +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) -stderr: + ./extrac23.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -11601,83 +11273,7 @@ chmod 700 dir find dir ) -A -B -tar: .: Directory is new -tar: ./subdir: Directory is new -tar: ./subdir/dir1: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2: Directory is new -tar: Removing leading `/' from member names -stdout: -A -. -./foo -./foo/subdir -./foo/subdir/dir1 -./subdir -./subdir/dir2 -B -./ -./subdir/ -./subdir/dir1/ -/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/ -/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/ -/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2/ -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "s|$DIR|ABSPATH|" stdout - -134. filerem02.at:26: testing toplevel file removed ... -./filerem02.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -mkdir dir2 -genfile --file dir2/file1 - -genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null -) -135. dirrem01.at:38: testing directory removed before reading ... -./dirrem01.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 - -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac - -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir >/dev/null -) -./incr05.at:24: +./incr01.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11687,29 +11283,33 @@ rm -rf * ckmtime || exit 77 -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -echo Level 0 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +mkdir directory +$as_ln_s foo directory/bar -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory + +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp ) -130. incr09.at:26: ok -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr -stdout: +121. listed03.at:24: ok + + +115. label05.at:24: 109. backup01.at:33: ok + ok +114. label04.at:27: ok +133. filerem01.at:36: testing file removed as we read it ... ./filerem01.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -11722,64 +11322,35 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v dir >/dev/null ) -131. incr10.at:18: ./incr07.at:40: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +100. extrac17.at:21: ok +134. filerem02.at:26: testing toplevel file removed ... +./filerem02.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -mkdir dirA -echo 'a' > dirA/a -echo 'a' > dirA/b - -decho C0 -tar -g test.snar -vcf test.0.tar dirA - -echo 'a' > dirA/c -decho C1 -tar -g test.snar -vcf test.1.tar dirA - -rm -f dirA/a -decho C2 -tar -g test.snar -vcf test.2.tar dirA - -mkdir ext -rm -rf dirA - -decho E0 -tar -g test.snar -vxf test.0.tar -C ext/ -decho E1 -tar -g test.snar -vxf test.1.tar -C ext/ - -decho E2 -tar -g test.snar -vxf test.2.tar -C ext/ - -mkdir ext/dirA/dirB -touch ext/dirA/dirB/file - -decho E3 -tar -g test.snar -vxf test.2.tar -C ext/ +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 -echo FIN -test -d dirA && echo >&2 "toplevel dirA exists" -exit 0 +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) - ok -129. incr08.at:38: ok - -stdout: - -105. extrac22.at:19: ok +135. dirrem01.at:38: testing directory removed before reading ... ./dirrem01.at:41: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -11800,39 +11371,7 @@ --warning=no-file-changed \ -v dir >/dev/null ) - -./incr06.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -mkdir dir -mkdir dir/sub -mkdir dir/sub/a -mkdir dir/sub/b -genfile --file dir/file1 -genfile --file dir/sub/file2 -genfile --file dir/sub/a/file3 - -echo Level 0 . sub -tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 0 sub . -tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . - -mkdir dir/c -genfile --file dir/sub/b/file4 - -echo Level 1 . sub -tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 1 sub . -tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . -) -stderr: +62. exclude03.at:19: ok 136. dirrem02.at:31: testing explicitly named directory removed before reading ... ./dirrem02.at:34: mkdir gnu @@ -11860,32 +11399,20 @@ --warning=no-file-changed \ -v dir dir/sub >/dev/null ) -tar: dir2: Cannot stat: No such file or directory -tar: dir2: Cannot open: No such file or directory -tar: Exiting with failure status due to previous errors +stderr: +130. incr09.at:26: ok +A +B +tar: .: Directory is new +tar: ./subdir: Directory is new +tar: ./subdir/dir1: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2: Directory is new +tar: Removing leading `/' from member names stdout: -./filerem02.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -mkdir dir2 -genfile --file dir2/file1 - -genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null -) -138. rename02.at:24: testing move between hierarchies ... -./rename02.at:27: +137. rename01.at:24: testing renamed dirs in incrementals ... +./rename01.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11897,40 +11424,36 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 + mkdir foo genfile --file foo/file1 genfile --file foo/file2 mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 +genfile --file foo/bar/file echo "Creating base archive" tar -g incr -cf arch.1 -v foo -mv foo/bar/baz foo +mv foo/bar foo/baz echo "Creating incremental archive" tar -g incr -cf arch.2 -v foo mv foo old -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 +tar xfg arch.1 /dev/null echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfgv arch.2 /dev/null --warning=no-timestamp +tar xfg arch.2 /dev/null echo Begin directory listing 2 find foo | sort echo End directory listing 2 ) -137. rename01.at:24: testing renamed dirs in incrementals ... -./rename01.at:27: +138. rename02.at:24: testing move between hierarchies ... +./rename02.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11942,46 +11465,114 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir foo genfile --file foo/file1 genfile --file foo/file2 mkdir foo/bar -genfile --file foo/bar/file +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 echo "Creating base archive" tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz +mv foo/bar/baz foo echo "Creating incremental archive" tar -g incr -cf arch.2 -v foo mv foo old -tar xfg arch.1 /dev/null +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfg arch.2 /dev/null +tar xfgv arch.2 /dev/null --warning=no-timestamp echo Begin directory listing 2 find foo | sort echo End directory listing 2 ) -106. extrac23.at:18: ok -126. incr05.at:21: ok -132. incr11.at:25: ok -stdout: -133. filerem01.at:36: ok -stdout: +A +. +./foo +./foo/subdir +./foo/subdir/dir1 +./subdir +./subdir/dir2 +B +./ +./subdir/ +./subdir/dir1/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2/ +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "s|$DIR|ABSPATH|" stdout + +107. extrac24.at:18: ok +89. extrac06.at:34: ok -135. dirrem01.at:38: ok +./incr06.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +ckmtime || exit 77 +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 -./incr07.at:40: +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +) +77. exclude18.at:30: ./extrac25.at:21: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir subdir +touch subdir/a.txt +tar -cf test.tar subdir/a.txt + +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar +) + + ok + +102. extrac19.at:21: 87. extrac04.at:23: ok + ok +./label03.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11990,6 +11581,45 @@ export TAR_OPTIONS rm -rf * +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +) +101. extrac18.at:34: ok + +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr + + +./incr07.at:40: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + ckmtime || exit 77 mkdir dirA echo 'a' > dirA/a @@ -12027,10 +11657,7 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) - -stdout: -stderr: -./dirrem02.at:34: +./incr05.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12039,64 +11666,20 @@ export TAR_OPTIONS rm -rf * +ckmtime || exit 77 mkdir dir mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac - -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir dir/sub >/dev/null -) -140. rename04.at:27: testing renamed directory containing subdirectories ... -./rename04.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) - -127. incr06.at:21: ok +131. incr10.at:18: ok 139. rename03.at:23: testing cyclic renames ... ./rename03.at:26: mkdir gnu @@ -12154,12 +11737,9 @@ find foo | sort echo End directory listing 2 ) -tar: dir2: Cannot stat: No such file or directory -tar: dir2: Cannot open: No such file or directory -tar: Exiting with failure status due to previous errors -stdout: -141. rename05.at:24: testing renamed subdirectories ... -./rename05.at:27: +81. delete04.at:23: ok +140. rename04.at:27: testing renamed directory containing subdirectories ... +./rename04.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12181,7 +11761,6 @@ tar -cf archive.1 -g db.1 directory decho Renaming -mv directory/subdir directory/subdir.0 mv directory dir decho Creating incremental archive @@ -12191,57 +11770,16 @@ mv dir orig decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp +tar -xf archive.1 -g db.1 find directory | sort decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp +tar -xf archive.2 -g db.2 find dir | sort ) -134. filerem02.at:26: ok -142. rename06.at:19: testing chained renames ... -./rename06.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure -mkdir test test/d1 test/d2 -genfile --file test/d1/file1 -genfile --file test/d2/file2 - -decho First dump -tar -c -g 0.snar -C test -f backup0.tar . - -decho Altering directory structure -genfile --file test/d2/file3 -mv test/d1 test/d3 -mv test/d2 test/d1 - -decho Second dump -cp 0.snar 1.snar -tar -vc -g 1.snar -C test -f backup1.tar . - -mkdir test1 - -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar - -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar - -decho Resulting directory -find test1 | sort -) -143. chtype.at:27: testing changed file types in incrementals ... -./chtype.at:30: +stdout: +141. rename05.at:24: testing renamed subdirectories ... +./rename05.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12254,185 +11792,6 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a - -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory - -sleep 2 - -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort -) -144. ignfail.at:23: testing ignfail ... -./ignfail.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) - -./rename01.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) - -stdout: -145. link01.at:33: testing link count gt 2 ... -./link01.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) -136. dirrem02.at:31: ok -146. link02.at:32: testing preserve hard links with --remove-files ... -./link02.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' -) -128. incr07.at:18: ok - -./rename04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - decho Creating directory structure mkdir directory mkdir directory/subdir @@ -12442,6 +11801,7 @@ tar -cf archive.1 -g db.1 directory decho Renaming +mv directory/subdir directory/subdir.0 mv directory dir decho Creating incremental archive @@ -12451,87 +11811,28 @@ mv dir orig decho First restore -tar -xf archive.1 -g db.1 +tar -xf archive.1 -g db.1 --warning=no-timestamp find directory | sort decho Second restore -tar -xf archive.2 -g db.2 +tar -xf archive.2 -g db.2 --warning=no-timestamp find dir | sort ) -./link02.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' -) -./link01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) -147. link03.at:24: testing working -l with --remove-files ... -./link03.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +stdout: +./filerem01.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H posix" export TAR_OPTIONS -rm -rf * - - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' -) +142. rename06.at:19: testing chained renames ... ./rename06.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -12566,267 +11867,21 @@ decho Resulting directory find test1 | sort ) -./incr03.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort -) -./incr04.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - - -sleep 1 - -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) -./ignfail.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) - -./rename05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort - -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort -) -./extrac20.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -for i in a b c -do - dir=in$i - mkdir -p $dir/root/dir $dir/root/dirsymlink - touch $dir/root/dirsymlink/file$i - test $i != a && touch $dir/root/dirsymlink/file.conflict - tar cf archive$i.tar -C $dir root -done - -prep() -{ - echo "== $1 ==" - echo "== $1 ==" >&2 - backup_dir=$1 - dir=out - mkdir -p $dir/root/dir - ln -s dir $dir/root/dirsymlink - test $round = normal && cd $dir >/dev/null -} - -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} - -# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable -file_spec() -{ - if test $round = normal - then - echo "-f ../$1" - else - echo "-f $1 -C $dir" - fi -} - -for round in normal dir -do - # Check that 'dirsymlink' replaces 'dir' - prep without_option_$round - tar -x `file_spec archivea.tar` || exit 1 - tar -x `file_spec archiveb.tar` || exit 1 - clean - - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean - - prep collision_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 - clean -done -) -148. link04.at:29: testing link count is 1 but multiple occurrences ... -./link04.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS rm -rf * mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort - -echo -- +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -tar cfl archive dir dir +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null +) +stdout: -echo == -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) -./rename01.at:27: +129. incr08.at:38: ./dirrem02.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12835,152 +11890,24 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -./link02.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' -) -./link01.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) -./link04.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort - -echo -- - -tar cfl archive dir dir - -echo == - -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) -./link03.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' -) -./link02.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir dir/sub >/dev/null ) -./rename04.at:30: +./dirrem01.at:41: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12989,36 +11916,24 @@ export TAR_OPTIONS rm -rf * +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir >/dev/null ) -./rename06.at:29: +./extrac22.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13028,65 +11943,56 @@ rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure -mkdir test test/d1 test/d2 -genfile --file test/d1/file1 -genfile --file test/d2/file2 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -decho First dump -tar -c -g 0.snar -C test -f backup0.tar . -decho Altering directory structure -genfile --file test/d2/file3 -mv test/d1 test/d3 -mv test/d2 test/d1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -decho Second dump -cp 0.snar 1.snar -tar -vc -g 1.snar -C test -f backup1.tar . +mkdir t +(cd t + genfile --length 100 --file data1 + mkdir dir1 + cp data1 dir1 + mkdir dir2 + cd dir2 + ln -s ../dir1/data1 data2 + cd .. + chmod -w dir2) -mkdir test1 +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar +tar -C t -c -f a.tar --no-recursion -T filelist -decho Resulting directory -find test1 | sort +mkdir restore +tar -x -p --delay-directory-restore -C restore -f a.tar +# Previous versions of tar would fail here with the following diagnostics: +# tar: ./dir2/data2: Cannot unlink: Permission denied ) -./link01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt +117. incr01.at:27: ok -rm -r directory -tar xf archive --warning=no-timestamp + ok +61. exclude02.at:19: ok -ls directory/test1 -) -./rename05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +60. exclude01.at:19: ok +143. chtype.at:27: testing changed file types in incrementals ... +./chtype.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -13094,38 +12000,42 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +sleep 2 -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b -mv dir orig +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort +# Delete a +rm -r directory -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort ) + + +144. ignfail.at:23: testing ignfail ... ./ignfail.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -13171,108 +12081,87 @@ chmod 700 directory test $status = 0 ) -137. rename01.at:24: ok -./link04.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +145. link01.at:33: testing link count gt 2 ... +./link01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort - -echo -- +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -tar cfl archive dir dir +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -echo == +tar cf archive directory/test1/test.txt directory/test1/test.txt -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) -./link02.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +rm -r directory +tar xf archive --warning=no-timestamp -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' +ls directory/test1 ) -./link03.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./extrac23.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir ) +stderr: +tar: dir2: Cannot stat: No such file or directory +tar: dir2: Cannot open: No such file or directory +tar: Exiting with failure status due to previous errors -./link01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +stdout: +108. extrac25.at:18: ok +./filerem02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 -ls directory/test1 +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -149. longv7.at:24: testing long names in V7 archives ... -./longv7.at:30: +146. link02.at:32: testing preserve hard links with --remove-files ... +./link02.at:35: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -13281,20 +12170,22 @@ export TAR_OPTIONS rm -rf * -mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems -touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c - -tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems -echo separator -tar tf archive +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) -146. link02.at:32: ok + +63. exclude04.at:19: ok +148. link04.at:29: testing link count is 1 but multiple occurrences ... ./link04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -13320,67 +12211,13 @@ s,symlink,FOO,g ' | sort ) -142. rename06.at:19: ok -140. rename04.at:27: ok - -141. rename05.at:24: ok -./ignfail.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) +147. link03.at:24: testing working -l with --remove-files ... ./link03.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -13403,50 +12240,22 @@ echo testing archive.2 tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) -149. longv7.at:24: ok -./rename02.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +149. longv7.at:24: testing long names in V7 archives ... +./longv7.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems +touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +echo separator +tar tf archive ) 150. long01.at:28: testing long file names divisible by block size ... @@ -13465,8 +12274,6 @@ tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile tar tf archive) -145. link01.at:33: ok - 151. lustar01.at:21: testing ustar: unsplittable file name ... ./lustar01.at:27: @@ -13482,22 +12289,8 @@ tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix ) -153. lustar03.at:21: testing ustar: splitting long names ... -./lustar03.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 -echo "Create archive" -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -echo "List archive" -tar tf archive) +132. incr11.at:25: ok 152. lustar02.at:21: testing ustar: unsplittable path name ... ./lustar02.at:32: mkdir ustar @@ -13512,39 +12305,26 @@ install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be ) - -./link04.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +stdout: +153. lustar03.at:21: testing ustar: splitting long names ... +./lustar03.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort -echo -- - -tar cfl archive dir dir - -echo == +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 +echo "Create archive" +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +echo "List archive" +tar tf archive) -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) -151. lustar01.at:21: ok +126. incr05.at:21: stdout: + ok 154. old.at:23: testing old archives ... ./old.at:27: mkdir directory @@ -13603,52 +12383,9 @@ tar -c -f archive.tar dir tar -d -f archive.tar dir ) +133. filerem01.at:36: ok -./link03.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' -) -154. old.at:23: ok -./long01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile - -tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile -tar tf archive) -152. lustar02.at:21: ok +stdout: 156. time02.at:20: testing time: clamping mtime ... ./time02.at:23: mkdir pax @@ -13673,7 +12410,9 @@ tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir tar -d -f archive.tar dir|sort ) -./rename03.at:26: +151. lustar01.at:21: 135. dirrem01.at:38: ok + ok +./rename01.at:27: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13689,49 +12428,32 @@ mkdir foo genfile --file foo/file1 genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec - -sleep 1 +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +mv foo/bar foo/baz -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +mv foo old -tar xfg arch.1 /dev/null --warning=no-timestamp +tar xfg arch.1 /dev/null echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfgv arch.2 /dev/null --warning=no-timestamp +tar xfg arch.2 /dev/null echo Begin directory listing 2 find foo | sort echo End directory listing 2 ) - -148. link04.at:29: ok -./ignfail.at:26: +157. multiv01.at:23: testing multivolume dumps from pipes ... +./multiv01.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13740,50 +12462,37 @@ export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - +exec <&- +genfile --length 7168 --file file1 -touch file -mkdir directory -touch directory/file +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 ) -153. lustar03.at:21: ok -./extrac20.at:24: +136. dirrem02.at:31: ok +./incr06.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13792,6 +12501,101 @@ export TAR_OPTIONS rm -rf * +ckmtime || exit 77 +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 + +echo Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . + +mkdir dir/c +genfile --file dir/sub/b/file4 + +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +) +./link01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +./link02.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +149. longv7.at:24: + ok +158. multiv02.at:28: testing skipping a straddling member ... +./multiv02.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire + +exec <&- + +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +113. label03.at:27: ok +154. old.at:23: ok +./extrac20.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -13856,8 +12660,9 @@ done ) -157. multiv01.at:23: testing multivolume dumps from pipes ... -./multiv01.at:30: +stderr: +159. multiv03.at:30: testing MV archive & long filenames ... +./multiv03.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13866,86 +12671,83 @@ export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 +AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` +BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +cat > ../experr < ../expout </dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 +exec <&- -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 +tar -tM -f arch.1 -f arch.2 || exit 1 + +echo separator-1 + +genfile --length 15360 --file $BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 + +echo separator-2 +mv $BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp $BFILE bfile ) -150. long01.at:28: ok -158. multiv02.at:28: testing skipping a straddling member ... -./multiv02.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +tar: dir2: Cannot stat: No such file or directory +tar: dir2: Cannot open: No such file or directory +tar: Exiting with failure status due to previous errors +stdout: + + +./rename04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 -) -./incr04.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -ckmtime || exit 77 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +decho Renaming +mv directory dir -sleep 1 +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort ) -156. time02.at:20: ok -./incremental.at:26: +./link04.at:32: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13954,118 +12756,145 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 -mkdir structure -echo x >structure/file +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null +echo -- -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created "on or after" the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 +tar cfl archive dir dir -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort ) -159. multiv03.at:30: testing MV archive & long filenames ... -./multiv03.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +134. filerem02.at:26: ok +./incr07.at:40: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` +ckmtime || exit 77 +mkdir dirA +echo 'a' > dirA/a +echo 'a' > dirA/b -cat > ../experr < ../expout < dirA/c +decho C1 +tar -g test.snar -vcf test.1.tar dirA -genfile --length 15360 --file $AFILE +rm -f dirA/a +decho C2 +tar -g test.snar -vcf test.2.tar dirA -exec <&- +mkdir ext +rm -rf dirA -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ -echo separator-1 +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 +mkdir ext/dirA/dirB +touch ext/dirA/dirB/file -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 -cmp $BFILE bfile +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d dirA && echo >&2 "toplevel dirA exists" +exit 0 ) -./incr03.at:31: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac23.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) +./rename06.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --file=directory/x -genfile --file=directory/y +decho Creating directory structure +mkdir test test/d1 test/d2 +genfile --file test/d1/file1 +genfile --file test/d2/file2 -sleep 1 +decho First dump +tar -c -g 0.snar -C test -f backup0.tar . -tar -cf archive.1 -g db directory +decho Altering directory structure +genfile --file test/d2/file3 +mv test/d1 test/d3 +mv test/d2 test/d1 -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . -mv directory orig +mkdir test1 -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort +decho First extract +tar -C test1 -x -g /dev/null -f backup0.tar -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort +decho Second extract +tar -C test1 -x -g /dev/null -f backup1.tar -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort +decho Resulting directory +find test1 | sort ) - -./multiv01.at:30: +./rename05.at:27: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14074,36 +12903,37 @@ export TAR_OPTIONS rm -rf * -exec <&- -genfile --length 7168 --file file1 -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort ) -147. link03.at:24: 160. multiv04.at:36: testing split directory members in a MV archive ... +160. multiv04.at:36: testing split directory members in a MV archive ... ./multiv04.at:39: mkdir gnu (cd gnu @@ -14130,9 +12960,55 @@ echo separator tar -MRt -f arc.1 -f arc.2) - ok +./extrac22.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -./multiv02.at:31: + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir t +(cd t + genfile --length 100 --file data1 + mkdir dir1 + cp data1 dir1 + mkdir dir2 + cd dir2 + ln -s ../dir1/data1 data2 + cd .. + chmod -w dir2) + +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF + + +tar -C t -c -f a.tar --no-recursion -T filelist + +mkdir restore +tar -x -p --delay-directory-restore -C restore -f a.tar +# Previous versions of tar would fail here with the following diagnostics: +# tar: ./dir2/data2: Cannot unlink: Permission denied +) + +./link03.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14141,17 +13017,26 @@ export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) + 161. multiv05.at:26: testing Restoring after an out of sync volume ... ./multiv05.at:30: mkdir gnu @@ -14191,29 +13076,13 @@ echo Diffing szesc cmp bak/szesc szesc || exit 1 ) -162. multiv06.at:27: testing Multivolumes with L=record_size ... -./multiv06.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) -144. ignfail.at:23: ./multiv01.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +./multiv01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -14246,8 +13115,6 @@ cmp file1 extract-dir-pipe/file1 cmp file2 extract-dir-pipe/file2 ) - ok - 163. multiv07.at:28: testing volumes split at an extended header ... ./multiv07.at:31: @@ -14263,8 +13130,7 @@ cd $TEST_DATA_DIR tar -t -M -fxsplit-1.tar -fxsplit-2.tar - -./multiv03.at:33: +152. lustar02.at:21: ./ignfail.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14273,65 +13139,50 @@ export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` - -cat > ../experr < ../expout < $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -echo separator-1 -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 +touch file +mkdir directory +touch directory/file -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 -cmp $BFILE bfile -) -./multiv02.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -exec <&- +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) ---- - 2025-03-13 01:05:44.006881031 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2025-03-13 01:05:43.998545294 +0000 -@@ -1,4 +1 @@ --Archive volumes split at an extended header Volume 1 --foo --bar - -163. multiv07.at:28: 164. multiv08.at:25: testing multivolume header creation ... + ok +164. multiv08.at:25: testing multivolume header creation ... ./multiv08.at:28: mkdir gnu (cd gnu @@ -14348,13 +13199,13 @@ decho Testing tar -tMR -f A.tar -f B.tar -f C.tar ) - skipped (multiv07.at:31) +162. multiv06.at:27: testing Multivolumes with L=record_size ... ./multiv06.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -14365,7 +13216,7 @@ tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file decho Testing archive tar -t -M -farc.1 -farc.2 -farc.3) -./listed01.at:29: +./long01.at:36: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14374,36 +13225,48 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile -tar tf archive.1 || exit 1 +tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile +tar tf archive) +./link02.at:35: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -sleep 2 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +./multiv02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -genfile --length 10240 --pattern zeros --file directory/file2 +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -echo "separator" -cp listing listing.old -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 +exec <&- -tar tf archive.2 || exit 1 +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 ) -157. multiv01.at:23: ok - -164. multiv08.at:25: ok 165. multiv09.at:26: testing bad next volume ... ./multiv09.at:33: mkdir v7 @@ -14422,10 +13285,6 @@ q EOF ) - -162. multiv06.at:27: ok -161. multiv05.at:26: 158. multiv02.at:28: ok - ok 166. multiv10.at:37: testing file start at the beginning of a posix volume ... ./multiv10.at:40: mkdir posix @@ -14447,32 +13306,6 @@ cmp data2 out/data2 ) -159. multiv03.at:30: ok - - -167. owner.at:21: testing --owner and --group ... -./owner.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -export TZ=UTC0 - -genfile --file a - -tar --owner="Joe the Plumber:1234" \ - --group="Plumber's Union:5678" \ - --mtime='@0' \ - --mode='u=rw,go=r' \ - -cf arc a - -tar -tvf arc -tar --numeric-owner -tvf arc -) 168. map.at:21: testing --owner-map and --group-map ... ./map.at:24: mkdir gnu @@ -14521,8 +13354,79 @@ tar -tvf 2.tar tar --numeric-owner -tvf 2.tar ) +156. time02.at:20: 167. owner.at:21: testing --owner and --group ... +./owner.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +export TZ=UTC0 + +genfile --file a + +tar --owner="Joe the Plumber:1234" \ + --group="Plumber's Union:5678" \ + --mtime='@0' \ + --mode='u=rw,go=r' \ + -cf arc a + +tar -tvf arc +tar --numeric-owner -tvf arc +) + ok +153. lustar03.at:21: ok +./link01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +--- - 2026-04-15 07:34:38.185184728 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2026-04-15 07:34:38.181371305 +0000 +@@ -1,4 +1 @@ +-Archive volumes split at an extended header Volume 1 +-foo +-bar + +163. multiv07.at:28: + skipped (multiv07.at:31) +./multiv06.at:30: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * +exec <&- +decho Creating file +genfile --length 20139 --file file +decho Creating archive +tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file +decho Testing archive +tar -t -M -farc.1 -farc.2 -farc.3) 169. sparse01.at:21: testing sparse files ... ./sparse01.at:24: mkdir posix @@ -14546,49 +13450,80 @@ genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) -./multiv09.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +164. multiv08.at:25: ok + +./link04.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null < dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo -- + +tar cfl archive dir dir + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort ) -166. multiv10.at:37: ok -167. owner.at:21: ok -171. sparse03.at:21: testing storing sparse files > 8G ... -./sparse03.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./multiv01.at:30: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -genfile --length 1000 --file begin -genfile --length 1000 --file end -genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator +exec <&- +genfile --length 7168 --file file1 -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 + +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi + +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 + +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 + +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 ) + +127. incr06.at:21: ok 170. sparse02.at:21: testing extracting sparse file over a pipe ... ./sparse02.at:28: mkdir posix @@ -14606,9 +13541,63 @@ tar xfO archive | cat - > sparsecopy || exit 1 cmp sparsefile sparsecopy ) +./link02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +./rename01.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -./chtype.at:30: +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./multiv03.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -14617,39 +13606,39 @@ export TAR_OPTIONS rm -rf * +AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` +BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` -test -z "`sort < /dev/null 2>&1`" || exit 77 - +cat > ../experr </dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +cat > ../expout < 8G ... +./sparse03.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 +genfile --length 1000 --file begin +genfile --length 1000 --file end +genfile --sparse --file sparsefile --block-size 512 8G A || exit 77 tar -c -f archive --sparse begin sparsefile end || exit 1 echo separator tar tfv archive echo separator mkdir directory -tar Cxf directory archive --warning=no-timestamp +tar Cxf directory archive genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) -168. map.at:21: ok + ok +./multiv09.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null </dev/null < directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +./rename04.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -15738,68 +14796,38 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -for i in a b c -do - dir=in$i - mkdir -p $dir/root/dir $dir/root/dirsymlink - touch $dir/root/dirsymlink/file$i - test $i != a && touch $dir/root/dirsymlink/file.conflict - tar cf archive$i.tar -C $dir root -done +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -prep() -{ - echo "== $1 ==" - echo "== $1 ==" >&2 - backup_dir=$1 - dir=out - mkdir -p $dir/root/dir - ln -s dir $dir/root/dirsymlink - test $round = normal && cd $dir >/dev/null -} +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} +decho Renaming +mv directory dir -# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable -file_spec() -{ - if test $round = normal - then - echo "-f ../$1" - else - echo "-f $1 -C $dir" - fi -} +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -for round in normal dir -do - # Check that 'dirsymlink' replaces 'dir' - prep without_option_$round - tar -x `file_spec archivea.tar` || exit 1 - tar -x `file_spec archiveb.tar` || exit 1 - clean +mv dir orig - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort - prep collision_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 - clean -done +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort ) -172. sparse04.at:21: ok +105. extrac22.at:19: 162. multiv06.at:27: ok + ok +128. incr07.at:18: +150. long01.at:28: ok -./rename02.at:27: + ok +168. map.at:21: ./rename06.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15811,39 +14839,75 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 +decho Creating directory structure +mkdir test test/d1 test/d2 +genfile --file test/d1/file1 +genfile --file test/d2/file2 -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +decho First dump +tar -c -g 0.snar -C test -f backup0.tar . -mv foo/bar/baz foo +decho Altering directory structure +genfile --file test/d2/file3 +mv test/d1 test/d3 +mv test/d2 test/d1 -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . -mv foo old +mkdir test1 -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 +decho First extract +tar -C test1 -x -g /dev/null -f backup0.tar -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +decho Second extract +tar -C test1 -x -g /dev/null -f backup1.tar -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +decho Resulting directory +find test1 | sort ) + ok +./rename05.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) +157. multiv01.at:23: ok 174. sparse06.at:21: testing storing sparse file using seek method ... ./sparse06.at:32: mkdir posix @@ -15916,98 +14980,59 @@ ) -175. sparse07.at:21: testing sparse files with unicode names ... -./sparse07.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./ignfail.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse žluť || exit 1 +# The test is meaningless for super-user. -tar tf archive -) -stdout: -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-03-13 01:05 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2025-03-13 01:05 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-03-13 01:05 end -separator -sparsefile 3102720 -./sparse01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator -tar tfv archive -echo separator +touch file mkdir directory -tar Cxf directory archive --warning=no-timestamp -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) -./multiv09.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null <&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy -) -./sparse07.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse žluť || exit 1 +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -tar tf archive +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) -./multiv09.at:33: + +./link02.at:35: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -16016,20 +15041,23 @@ export TAR_OPTIONS rm -rf * -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null < sparsecopy || exit 1 -cmp sparsefile sparsecopy -) -175. sparse07.at:21: ok -169. sparse01.at:21: ok -165. multiv09.at:26: ok -./rename03.at:26: +./link04.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16073,56 +15075,28 @@ export TAR_OPTIONS rm -rf * +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 - -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec - -sleep 1 - -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 - -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +echo -- -tar xfg arch.1 /dev/null --warning=no-timestamp +tar cfl archive dir dir -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +echo == -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort ) - -125. incr04.at:29: 124. incr03.at:28: ok - ok 176. sparsemv.at:21: testing sparse files in MV archives ... ./sparsemv.at:31: mkdir gnu @@ -16154,12 +15128,42 @@ tar --record-size=512 -d -M -f arc.1 -f arc.2 ) +158. multiv02.at:28: ok +stdout: -170. sparse02.at:21: ok +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2026-04-15 07:34 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 end +separator +sparsefile 3102720 +161. multiv05.at:26: ./sparse01.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator + +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile +) + ok -177. spmvp00.at:21: testing sparse files in PAX MV archives, v.0.0 ... -./spmvp00.at:24: +179. spmvp10.at:21: testing sparse files in PAX MV archives, v.1.0 ... +./spmvp10.at:24: mkdir pax (cd pax TEST_TAR_FORMAT=pax @@ -16170,19 +15174,19 @@ exec <&- TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" -genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 echo "Pass 1: Split between data blocks" echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile echo "Test archive" tar -t -M -f arc.1 -f arc.2 -f arc.3 echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 echo "Create archive" -tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile echo "Test archive" tar -t -M -f arc.1 -f arc.2 -f arc.3 echo "Compare archive" @@ -16218,8 +15222,9 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -179. spmvp10.at:21: testing sparse files in PAX MV archives, v.1.0 ... -./spmvp10.at:24: + +177. spmvp00.at:21: testing sparse files in PAX MV archives, v.0.0 ... +./spmvp00.at:24: mkdir pax (cd pax TEST_TAR_FORMAT=pax @@ -16230,24 +15235,80 @@ exec <&- TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" -genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 +genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77 echo "Pass 1: Split between data blocks" echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile echo "Test archive" tar -t -M -f arc.1 -f arc.2 -f arc.3 echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77 +genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77 echo "Create archive" -tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile +tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile echo "Test archive" tar -t -M -f arc.1 -f arc.2 -f arc.3 echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) +./link01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +./sparse02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1 +echo separator + +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) +./multiv09.at:33: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null < dir/file +ln -s file dir/symlink || exit 77 +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo -- -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +tar cfl archive dir dir -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort ) -138. rename02.at:24: ok + +186. update03.at:20: testing update with chdir ... ./update03.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -16488,77 +15545,8 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) -./incr02.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, 'dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) - -./update.at:31: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 - -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) -174. sparse06.at:21: ok -./exclude05.at:24: +140. rename04.at:27: ok +./sparse07.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16567,31 +15555,10 @@ export TAR_OPTIONS rm -rf * +genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse žluť || exit 1 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir exclfile -mkdir -p testdir -awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ - while read name - do - genfile --file $name - done - -awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile - -tar cf archive --anchored --exclude-from=exclfile \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort - -rm -rf testdir exclfile - +tar tf archive ) 187. update04.at:20: testing update with wildcards ... ./update04.at:23: @@ -16620,29 +15587,40 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -./update03.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + +./sparsemv.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -echo Create -tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -genfile --file dir1/subdir1/b -genfile --file dir2/subdir2/c -echo Update -tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -) +exec <&- +TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 -./update.at:31: +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +) +142. rename06.at:19: stdout: + ok +141. rename05.at:24: ./multiv09.at:33: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16651,19 +15629,22 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 - -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null < $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) -./verify.at:28: +./update.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16707,18 +15740,6 @@ export TAR_OPTIONS rm -rf * -touch foo -tar -cvf archive.tar --verify foo -) -./update.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -16732,66 +15753,7 @@ echo separator tar tf archive | sort || exit 1 ) -./verify.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -touch foo -tar -cvf archive.tar --verify foo -) -139. rename03.at:23: ok -./update03.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -echo Create -tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -genfile --file dir1/subdir1/b -genfile --file dir2/subdir2/c -echo Update -tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -) -./verify.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -touch foo -tar -cvf archive.tar --verify foo -) - -183. update.at:28: ok -./verify.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -touch foo -tar -cvf archive.tar --verify foo -) 189. volume.at:23: testing volume ... ./volume.at:26: mkdir gnu @@ -16818,31 +15780,13 @@ tar xfV archive babel test $? = 2 ) -./sptrdiff00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar -) -186. update03.at:20: ok -./chtype.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +190. volsize.at:29: testing volume header size ... +./volsize.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -16850,36 +15794,51 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo Short Listing +tar tf $TEST_DATA_DIR/abc.tar +echo Verbose Listing +tar --utc -tvf $TEST_DATA_DIR/abc.tar +echo Extracted directory +tar xf $TEST_DATA_DIR/abc.tar +find abc|sort +) +179. spmvp10.at:21: ok +175. sparse07.at:21: ok +178. spmvp01.at:21: ok +./link03.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -sleep 2 -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -# Delete a -rm -r directory +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) +177. spmvp00.at:21: ok - -./volume.at:26: +./sparse02.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16888,86 +15847,37 @@ export TAR_OPTIONS rm -rf * -tar -cf archive -V label -T /dev/null || exit 1 - -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1 +echo separator -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy ) -./incremental.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./update03.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 - -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created "on or after" the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) -190. volsize.at:29: testing volume header size ... -./volsize.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +148. link04.at:29: + ok -echo Short Listing -tar tf $TEST_DATA_DIR/abc.tar -echo Verbose Listing -tar --utc -tvf $TEST_DATA_DIR/abc.tar -echo Extracted directory -tar xf $TEST_DATA_DIR/abc.tar -find abc|sort -) -188. verify.at:25: ok 191. comprec.at:21: testing compressed format recognition ... ./comprec.at:25: mkdir v7 @@ -16989,8 +15899,8 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) ---- - 2025-03-13 01:05:47.069944184 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2025-03-13 01:05:47.054413388 +0000 +--- - 2026-04-15 07:34:38.288990483 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2026-04-15 07:34:38.285371305 +0000 @@ -1,10 +1 @@ -Short Listing -abc/not-a-file.gif @@ -17002,23 +15912,22 @@ -abc -abc/CCC -190. volsize.at:29: skipped (volsize.at:32) -189. volume.at:23: ok -192. shortfile.at:26: testing short input files ... -./shortfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +190. volsize.at:29: ./verify.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --length 511 --file foo || exit 5 -tar tf foo +touch foo +tar -cvf archive.tar --verify foo ) -./sptrdiff01.at:30: +192. shortfile.at:26: testing short input files ... +./shortfile.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17027,17 +15936,13 @@ export TAR_OPTIONS rm -rf * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ - tar --sparse -vdf bar +genfile --length 511 --file foo || exit 5 +tar tf foo ) + skipped (volsize.at:32) -./comprec.at:25: + +./volume.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -17046,18 +15951,22 @@ export TAR_OPTIONS rm -rf * +tar -cf archive -V label -T /dev/null || exit 1 -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +tar xfV archive label || exit 1 +tar xfV archive 'la?el' || exit 1 +tar xfV archive 'l*l' || exit 1 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 +echo 1>&2 ----- +tar xfV archive lab +test $? = 2 || exit 1 +echo 1>&2 ----- +tar xfV archive bel +test $? = 2 || exit 1 +echo 1>&2 ----- +tar xfV archive babel +test $? = 2 ) - 193. shortupd.at:31: testing updating short archives ... ./shortupd.at:34: mkdir v7 @@ -17071,8 +15980,23 @@ touch foo tar uf archive foo ) -192. shortfile.at:26: ok -119. listed01.at:26: ok +./multiv09.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null < file.b -echo First update -tar ufv archive --wildcards './file.*' - -echo "Second update" -tar ufv archive --wildcards './file.*' - -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? -) - -./comprec.at:25: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 -) - -./shortupd.at:34: +./update.at:31: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS -rm -rf * - -touch foo -tar uf archive foo -) -196. sigpipe.at:21: testing sigpipe handling ... -./sigpipe.at:30: - -case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( -?*) exit 77;; -esac - - -genfile --length 2048 --file first -genfile --length 2048 --file second -genfile --length 2049 --file third - -tar cf archive first second third - -# Discard diagnostics that some shells generate about broken pipes. -(tar tf archive 2>&3 | :) 3>&2 2>/dev/null 195. grow.at:24: testing grow ... ./grow.at:27: @@ -17194,89 +16038,45 @@ genfile --file baz genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./shortupd.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -touch foo -tar uf archive foo -) -./shortupd.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS rm -rf * -touch foo -tar uf archive foo -) -196. sigpipe.at:21: ok -./comprec.at:25: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 ) -./truncate.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +196. sigpipe.at:21: testing sigpipe handling ... +./sigpipe.at:30: -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') -./sptrcreat.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( +?*) exit 77;; +esac -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') -193. shortupd.at:31: ok +genfile --length 2048 --file first +genfile --length 2048 --file second +genfile --length 2049 --file third + +tar cf archive first second third + +# Discard diagnostics that some shells generate about broken pipes. +(tar tf archive 2>&3 | :) 3>&2 2>/dev/null +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2026-04-15 07:34 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 end +separator +sparsefile 3102720 197. comperr.at:18: testing compressor program failure ... ./comperr.at:28: mkdir v7 @@ -17292,6 +16092,7 @@ sed -n '$p' err exit $rc ) +192. shortfile.at:26: ok 198. remfiles01.at:28: testing remove-files with compression ... ./remfiles01.at:32: @@ -17338,27 +16139,7 @@ find . | sort exit $EC -./comprec.at:25: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 -) -./comperr.at:28: +./shortupd.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -17367,81 +16148,74 @@ export TAR_OPTIONS rm -rf * -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc +touch foo +tar uf archive foo ) -./update01.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./verify.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 +touch foo +tar -cvf archive.tar --verify foo ) -./update02.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +176. sparsemv.at:21: ok +./update03.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +200. remfiles03.at:28: testing remove-files with symbolic links ... +./remfiles03.at:31: +mkdir a +mkdir a/b +ln -s b a/c || exit 77 +tar --remove-files -cf a.tar a +genfile --stat a -test -z "`sort < /dev/null 2>&1`" || exit 77 +199. remfiles02.at:28: testing remove-files with compression: grand-child ... +./remfiles02.at:32: -mkdir a -genfile --file a/b +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -tar cf arc a -echo "separator" +test -z "`sort < /dev/null 2>&1`" || exit 77 -sleep 2 -touch a/b -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./truncate.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +mkdir dir +cd dir +mkdir a +genfile --file b +mkdir c -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') -./comperr.at:28: +tar -c -f a -z --remove-files b c 2>err +EC=$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit $EC + +./extrac20.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -17450,28 +16224,70 @@ export TAR_OPTIONS rm -rf * -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc -) -191. comprec.at:21: ok -./comperr.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc + +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done + +prep() +{ + echo "== $1 ==" + echo "== $1 ==" >&2 + backup_dir=$1 + dir=out + mkdir -p $dir/root/dir + ln -s dir $dir/root/dirsymlink + test $round = normal && cd $dir >/dev/null +} + +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} + +# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable +file_spec() +{ + if test $round = normal + then + echo "-f ../$1" + else + echo "-f $1 -C $dir" + fi +} + +for round in normal dir +do + # Check that 'dirsymlink' replaces 'dir' + prep without_option_$round + tar -x `file_spec archivea.tar` || exit 1 + tar -x `file_spec archiveb.tar` || exit 1 + clean + + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean + + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done ) -./multiv04.at:39: +./comprec.at:25: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -17481,51 +16297,87 @@ rm -rf * -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' /dev/null 2>&1 || exit 77 -tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +./ignfail.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo separator +# The test is meaningless for super-user. -tar -MRt -f arc.1 -f arc.2) -199. remfiles02.at:28: testing remove-files with compression: grand-child ... -./remfiles02.at:32: +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +touch file +mkdir directory +touch directory/file -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -mkdir dir -cd dir -mkdir a -genfile --file b -mkdir c +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -tar -c -f a -z --remove-files b c 2>err -EC=$? -sed -n '/(child)/p' err >&2 -rm err -find . | sort -exit $EC +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +./shortupd.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -198. remfiles01.at:28: ok +touch foo +tar uf archive foo +) +147. link03.at:24: + ok ./comperr.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -17534,7 +16386,11 @@ sed -n '$p' err exit $rc ) -./truncate.at:32: +196. sigpipe.at:21: ok +189. volume.at:23: ok + +169. sparse01.at:21: ok +./verify.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -17543,16 +16399,10 @@ export TAR_OPTIONS rm -rf * -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') - -./sptrdiff00.at:30: +touch foo +tar -cvf archive.tar --verify foo +) +./truncate.at:32: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -17561,28 +16411,16 @@ export TAR_OPTIONS rm -rf * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file foo --length 200k genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar -) -200. remfiles03.at:28: testing remove-files with symbolic links ... -./remfiles03.at:31: -mkdir a -mkdir a/b -ln -s b a/c || exit 77 -tar --remove-files -cf a.tar a -genfile --stat a - -197. comperr.at:18: ok -199. remfiles02.at:28: ok -200. remfiles03.at:28: - ok - +genfile --run --checkpoint 10 --length 195k --truncate foo -- \ + tar -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar|sed '/foo: Mod time differs/d') +200. remfiles03.at:28: ok +170. sparse02.at:21: ok 201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... ./remfiles04a.at:28: mkdir gnu @@ -17603,25 +16441,43 @@ echo A find . | sort ) +./update.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -./sptrdiff01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +./shortupd.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ - tar --sparse -vdf bar +touch foo +tar uf archive foo ) + +165. multiv09.at:26: ok + 202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... ./remfiles04b.at:36: mkdir gnu @@ -17642,24 +16498,22 @@ echo A find . | sort ) -./truncate.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +./comperr.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') -./update04.at:23: +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) +./comprec.at:25: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -17668,24 +16522,64 @@ export TAR_OPTIONS rm -rf * -genfile --file file.a -genfile --file file.b -genfile --file file.c + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +./update03.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +./shortupd.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo "Second update" -tar ufv archive --wildcards './file.*' +touch foo +tar uf archive foo +) -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? +./verify.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo ) -201. remfiles04a.at:25: ok + 203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... ./remfiles04c.at:36: mkdir gnu @@ -17709,10 +16603,11 @@ echo B find . | sort ) - -202. remfiles04b.at:33: ok -204. remfiles05a.at:34: testing remove-files with -C:rel,rel in -c/non-incr. mode ... -./remfiles05a.at:37: +198. remfiles01.at:28: + ok +199. remfiles02.at:28: ok +205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... +./remfiles05b.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17730,15 +16625,12 @@ echo foo/file > foo/file echo bar/file > bar/file decho A -tar -cvf foo.tar --remove-files -C foo file -C ../bar file +tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file decho B find . | sort ) - -194. truncate.at:29: ok -203. remfiles04c.at:33: ok -205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... -./remfiles05b.at:28: +204. remfiles05a.at:34: testing remove-files with -C:rel,rel in -c/non-incr. mode ... +./remfiles05a.at:37: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17756,13 +16648,30 @@ echo foo/file > foo/file echo bar/file > bar/file decho A -tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file +tar -cvf foo.tar --remove-files -C foo file -C ../bar file decho B find . | sort ) +201. remfiles04a.at:25: ok +./truncate.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -204. remfiles05a.at:34: ok +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- \ + tar -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar|sed '/foo: Mod time differs/d') +193. shortupd.at:31: ok 206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... ./remfiles05c.at:28: mkdir gnu @@ -17789,7 +16698,20 @@ decho C find . | sort ) +./comperr.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) 207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... ./remfiles06a.at:28: mkdir gnu @@ -17814,7 +16736,6 @@ decho B find . | sort ) -205. remfiles05b.at:25: ok 208. remfiles06b.at:25: testing remove-files with -C:rel,abs in -c/incr. mode ... ./remfiles06b.at:28: mkdir gnu @@ -17839,8 +16760,54 @@ decho B find . | sort ) +202. remfiles04b.at:33: ok +./update.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) + +144. ignfail.at:23: ok -207. remfiles06a.at:25: ok +188. verify.at:25: ok +./comprec.at:25: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS + +rm -rf * + + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) 209. remfiles06c.at:25: testing remove-files with -C:rel,abs in -r mode ... ./remfiles06c.at:28: mkdir gnu @@ -17868,13 +16835,30 @@ decho C find . | sort ) -206. remfiles05c.at:25: ok -143. chtype.at:27: ok -208. remfiles06b.at:25: ok - +./update03.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +203. remfiles04c.at:33: ok 210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... ./remfiles07a.at:28: mkdir gnu @@ -17899,7 +16883,21 @@ decho B find . | sort ) -211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... +./comperr.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) +204. remfiles05a.at:34: 211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... ./remfiles07b.at:28: mkdir gnu (cd gnu @@ -17923,6 +16921,9 @@ decho B find . | sort ) + + ok +205. remfiles05b.at:25: ok 212. remfiles07c.at:25: testing remove-files with -C:abs,rel in -r mode ... ./remfiles07c.at:28: mkdir gnu @@ -17950,7 +16951,7 @@ decho C find . | sort ) -209. remfiles06c.at:25: ok + 213. remfiles08a.at:28: testing remove-files deleting two subdirs in -c/non-incr. mode ... ./remfiles08a.at:31: mkdir gnu @@ -17970,9 +16971,6 @@ decho B find . ) - -211. remfiles07b.at:25: ok -213. remfiles08a.at:28: ok 214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... ./remfiles08b.at:34: mkdir gnu @@ -17992,30 +16990,9 @@ decho B find . ) -210. remfiles07a.at:25: ok -212. remfiles07c.at:25: ok - -./sptrcreat.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') - - -./update04.at:23: +208. remfiles06b.at:25: 206. remfiles05c.at:25: ok + ok +./truncate.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -18024,26 +17001,16 @@ export TAR_OPTIONS rm -rf * -genfile --file file.a -genfile --file file.b -genfile --file file.c -echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' - -echo "Second update" -tar ufv archive --wildcards './file.*' - -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? -) +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- \ + tar -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar|sed '/foo: Mod time differs/d') -214. remfiles08b.at:31: ok -215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... +207. remfiles06a.at:25: 183. update.at:28: 215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... ./remfiles08c.at:31: mkdir gnu (cd gnu @@ -18068,6 +17035,9 @@ decho C find . ) + ok + ok + 216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... ./remfiles09a.at:28: mkdir gnu @@ -18085,7 +17055,30 @@ decho B find . ) -217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... + +197. comperr.at:18: ok +./comprec.at:25: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 +) +210. remfiles07a.at:25: ok +209. remfiles06c.at:25: 217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... ./remfiles09b.at:32: mkdir gnu (cd gnu @@ -18102,6 +17095,9 @@ decho B find . ) + ok + + 218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... ./remfiles09c.at:28: mkdir gnu @@ -18125,9 +17121,13 @@ decho C find . | sort ) - -216. remfiles09a.at:25: 182. sptrdiff01.at:26: ok +211. remfiles07b.at:25: ok +213. remfiles08a.at:28: + ok +186. update03.at:20: ok +214. remfiles08b.at:31: ok + 219. remfiles10.at:20: testing remove-files ... ./remfiles10.at:23: mkdir gnu @@ -18147,69 +17147,9 @@ find foo exit $tar_status ) -217. remfiles09b.at:29: ok -./update01.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) - -215. remfiles08c.at:28: ok -./update02.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -stderr: -116. incremental.at:23: 218. remfiles09c.at:25: ok - ok -A -tar: .: Cannot rmdir: Invalid argument -tar: Exiting with failure status due to previous errors -B +216. remfiles09a.at:25: ok 220. xattr01.at:25: testing xattrs: basic functionality ... ./xattr01.at:28: mkdir v7 @@ -18258,8 +17198,23 @@ getfattr -h -d dir | grep -v -e '^#' -e ^$ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ ) -./remfiles10.at:44: sed '2s/:[^:]*$//' stderr +./truncate.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- \ + tar -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar|sed '/foo: Mod time differs/d') 221. xattr02.at:25: testing xattrs: change directory with -C option ... ./xattr02.at:28: @@ -18316,7 +17271,7 @@ getfattr -h -d file2 | grep -v -e '^#' -e ^$ getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ ) -219. remfiles10.at:20: ok +212. remfiles07c.at:25: ok 222. xattr03.at:25: testing xattrs: trusted.* attributes ... ./xattr03.at:28: @@ -18381,69 +17336,9 @@ getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ ) ---- - 2025-03-13 01:05:50.340792226 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2025-03-13 01:05:50.330271987 +0000 -@@ -1,3 +1 @@ --user.test="OurDirValue" --user.test="OurFileValue" - -220. xattr01.at:25: --- - 2025-03-13 01:05:50.366302070 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2025-03-13 01:05:50.350271124 +0000 -@@ -1,4 +1 @@ --user.test="OurFile1Value" --user.test="OurFile2Value" --user.test="OurDirValue" - - skipped (xattr01.at:28) -221. xattr02.at:25: 224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... -./xattr05.at:31: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - - - file=$(TMPDIR=. mktemp fiXXXXXX) - - setfattr -n user.test -v test $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - getfattr $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - file=$(TMPDIR=. mktemp fiXXXXXX) - setfattr -n user.test -v ahoj $file - # check whether tar fails to store xattrs - err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi - - -mkdir dir -mkdir output -genfile --file dir/file - -setfattr -n user.=NAME%3D= -v value dir/file -getfattr -d dir/file | grep -v '# ' > before - -# archive whole directory including binary xattrs -tar --xattrs -cf archive.tar -C dir . - -tar --xattrs -xf archive.tar -C output -getfattr -d output/file | grep -v '# ' > after -diff before after -) +215. remfiles08c.at:28: + ok +217. remfiles09b.at:29: ok 223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... ./xattr04.at:29: mkdir v7 @@ -18493,24 +17388,7 @@ getfattr -h -d output/file | grep -v -e '^#' -e ^$ exit $ret ) - skipped (xattr02.at:28) - ---- - 2025-03-13 01:05:50.446196087 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2025-03-13 01:05:50.438267325 +0000 -@@ -1,4 +1 @@ --trusted.test="OurFile1Value" --trusted.test="OurFile2Value" --trusted.test="OurDirValue" - ---- - 2025-03-13 01:05:50.461918375 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2025-03-13 01:05:50.442267153 +0000 -@@ -1,2 +1 @@ --user.test="value" - -222. xattr03.at:25: skipped (xattr03.at:28) -223. xattr04.at:26: -224. xattr05.at:28: skipped (xattr04.at:29) 225. xattr06.at:27: testing xattrs: exclude xattrs on create ... ./xattr06.at:30: mkdir v7 @@ -18566,9 +17444,9 @@ # if they differ then the attribute is still present diff filtered full ) - skipped (xattr05.at:31) -226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... -./xattr07.at:29: +stderr: +224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... +./xattr05.at:31: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18601,34 +17479,35 @@ exit 77 fi + mkdir dir +mkdir output genfile --file dir/file -genfile --file dir/file2 - -setfattr -n user.test -v OurDirValue dir -setfattr -n user.test -v OurFileValue dir/file -setfattr -n user.test -v OurFileValue dir/file2 - -tar --xattrs --no-recursion -cf archive.tar dir dir/file dir/file2 -setfattr -n user.test -v OurDirValue2 dir -setfattr -n user.test -v OurFileValue2 dir/file -setfattr -n user.test -v OurFileValue2 dir/file2 +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before -# Check that tar continues to file2 too! -tar --xattrs -xvf archive.tar --skip-old-files -tar --xattrs -xvf archive.tar --keep-old-files +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -getfattr -h -d dir | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after ) - - -225. xattr06.at:27: - skipped (xattr06.at:30) -227. xattr08.at:26: testing xattrs: xattrs and read-only files ... -./xattr08.at:29: +A +tar: .: Cannot rmdir: Invalid argument +tar: Exiting with failure status due to previous errors +B +--- - 2026-04-15 07:34:38.421596869 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2026-04-15 07:34:38.417371305 +0000 +@@ -1,3 +1 @@ +-user.test="OurDirValue" +-user.test="OurFileValue" + +./remfiles10.at:44: sed '2s/:[^:]*$//' stderr +191. comprec.at:21: ok +226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... +./xattr07.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18661,41 +17540,38 @@ exit 77 fi -mkdir dir dir2 +mkdir dir genfile --file dir/file +genfile --file dir/file2 -setfattr -n user.test -v OurDirValue dir/file -chmod a-w dir/file +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file +setfattr -n user.test -v OurFileValue dir/file2 -tar --xattrs -C dir -cf archive.tar file -tar --xattrs -C dir2 -xf archive.tar -) +tar --xattrs --no-recursion -cf archive.tar dir dir/file dir/file2 ---- - 2025-03-13 01:05:50.625580720 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2025-03-13 01:05:50.602260247 +0000 -@@ -1,7 +1 @@ --tar: dir: skipping existing file --tar: dir/file: skipping existing file --tar: dir/file2: skipping existing file --tar: dir/file: Cannot open: File exists --tar: dir/file2: Cannot open: File exists --tar: Exiting with failure status due to previous errors - ---- - 2025-03-13 01:05:50.642282931 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2025-03-13 01:05:50.626259211 +0000 -@@ -1,10 +1 @@ --dir/ --dir/file --dir/file2 --dir/ --dir/file --dir/file2 --user.test="OurDirValue2" --user.test="OurFileValue2" --user.test="OurFileValue2" +setfattr -n user.test -v OurDirValue2 dir +setfattr -n user.test -v OurFileValue2 dir/file +setfattr -n user.test -v OurFileValue2 dir/file2 + +# Check that tar continues to file2 too! +tar --xattrs -xvf archive.tar --skip-old-files +tar --xattrs -xvf archive.tar --keep-old-files + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ +) +220. xattr01.at:25: +--- - 2026-04-15 07:34:38.424153198 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2026-04-15 07:34:38.421371305 +0000 +@@ -1,4 +1 @@ +-user.test="OurFile1Value" +-user.test="OurFile2Value" +-user.test="OurDirValue" -229. acls02.at:25: testing acls: work with -C ... -./acls02.at:28: +228. acls01.at:25: testing acls: basic functionality ... +./acls01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18745,33 +17621,27 @@ mkdir dir -mkdir dir/subdir -genfile --file dir/subdir/file +genfile --file dir/file MYNAME=$( id -un ) -setfacl -m u:$MYNAME:--x dir/subdir -setfacl -m u:$MYNAME:--x dir/subdir/file +setfacl -m u:$MYNAME:--x dir/file +setfacl -m u:$MYNAME:--x dir -cd dir -getfattr -h -m. -d subdir subdir/file > ../before -cd .. +getfattr -h -m. -d dir dir/file > before -tar --acls -cf archive.tar -C dir subdir +tar --acls -cf archive.tar dir rm -rf dir -mkdir dir -tar --acls -xf archive.tar -C dir +tar --acls -xf archive.tar -cd dir -getfattr -h -m. -d subdir subdir/file > ../after -cd .. +getfattr -h -m. -d dir dir/file > after diff before after test "$?" = 0 ) -226. xattr07.at:26: 228. acls01.at:25: testing acls: basic functionality ... -./acls01.at:28: +227. xattr08.at:26: testing xattrs: xattrs and read-only files ... +./xattr08.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18781,6 +17651,7 @@ rm -rf * + file=$(TMPDIR=. mktemp fiXXXXXX) setfattr -n user.test -v test $file &> /dev/null @@ -18795,55 +17666,38 @@ fi - - - file=$(TMPDIR=. mktemp fiXXXXXX) - - setfacl -m u:$UID:rwx $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - getfacl $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - rm -rf $file - file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file - err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) if test "$err" != "0"; then exit 77 fi - -mkdir dir +mkdir dir dir2 genfile --file dir/file -MYNAME=$( id -un ) - -setfacl -m u:$MYNAME:--x dir/file -setfacl -m u:$MYNAME:--x dir - -getfattr -h -m. -d dir dir/file > before - -tar --acls -cf archive.tar dir -rm -rf dir - -tar --acls -xf archive.tar - -getfattr -h -m. -d dir dir/file > after +setfattr -n user.test -v OurDirValue dir/file +chmod a-w dir/file -diff before after -test "$?" = 0 +tar --xattrs -C dir -cf archive.tar file +tar --xattrs -C dir2 -xf archive.tar ) - - skipped (xattr07.at:29) -227. xattr08.at:26: 231. selnx01.at:25: testing selinux: basic store/restore ... -./selnx01.at:28: + skipped (xattr01.at:28) +--- - 2026-04-15 07:34:38.426101967 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2026-04-15 07:34:38.421371305 +0000 +@@ -1,2 +1 @@ +-user.test="value" + +221. xattr02.at:25: --- - 2026-04-15 07:34:38.427720660 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2026-04-15 07:34:38.425371305 +0000 +@@ -1,4 +1 @@ +-trusted.test="OurFile1Value" +-trusted.test="OurFile2Value" +-trusted.test="OurDirValue" + +225. xattr06.at:27: 229. acls02.at:25: testing acls: work with -C ... +./acls02.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18871,13 +17725,13 @@ file=$(TMPDIR=. mktemp fiXXXXXX) - restorecon $file &> /dev/null + setfacl -m u:$UID:rwx $file &> /dev/null if test "$?" != 0; then exit 77 fi - chcon -h --user=unconfined_u $file &> /dev/null + getfacl $file &> /dev/null if test "$?" != 0; then exit 77 fi @@ -18885,73 +17739,50 @@ rm -rf $file file=$(TMPDIR=. mktemp fiXXXXXX) - err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) if test "$err" != "0"; then exit 77 fi mkdir dir -genfile --file dir/file -ln -s file dir/link - -getfattr -h -d -msecurity.selinux dir dir/file dir/link > start - -restorecon -R dir -chcon -h --user=system_u dir -chcon -h --user=unconfined_u dir/file -chcon -h --user=system_u dir/link - -# archive whole directory including selinux contexts -tar --selinux -cf archive.tar dir - -# clear the directory -rm -rf dir - -# ================================================ -# check if selinux contexts are correctly restored - -tar --selinux -xf archive.tar +mkdir dir/subdir +genfile --file dir/subdir/file -# archive for later debugging -cp archive.tar archive_origin.tar +MYNAME=$( id -un ) -# check if selinux contexts were restored -getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ - grep -v -e '^#' -e ^$ | cut -d: -f1 +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file -# =========================================================================== -# check if selinux contexts are not restored when --selinux option is missing +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. -getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +tar --acls -cf archive.tar -C dir subdir rm -rf dir -tar -xf archive.tar -getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux - -diff with_selinux without_selinux > diff_with_without -if test "$?" -eq "0"; then - echo "selinux contexts probably restored while --selinux is off" -fi -# ================================================================= -# check if selinux is not archived when --selinux option is missing +mkdir dir +tar --acls -xf archive.tar -C dir -tar -cf archive.tar dir +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. -# clear the directory -rm -rf dir +diff before after +test "$?" = 0 +) +224. xattr05.at:28: 223. xattr04.at:26: -# restore (with --selinux) -tar --selinux -xf archive.tar dir -getfattr -h -d -msecurity.selinux dir dir/file dir/link > final -diff start final > final_diff -if test "$?" -ne "0"; then - echo "bad result" -fi + skipped (xattr02.at:28) +218. remfiles09c.at:25: ok +219. remfiles10.at:20: 222. xattr03.at:25: ok + skipped (xattr06.at:30) + skipped (xattr05.at:31) + skipped (xattr04.at:29) -) - skipped (xattr08.at:29) + skipped (xattr03.at:28) 230. acls03.at:30: testing acls: default ACLs ... ./acls03.at:47: mkdir v7 @@ -19170,8 +18001,36 @@ fi ) -229. acls02.at:25: 232. selacl01.at:25: testing acls/selinux: special files & fifos ... -./selacl01.at:28: +--- - 2026-04-15 07:34:38.434043499 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2026-04-15 07:34:38.429371305 +0000 +@@ -1,7 +1 @@ +-tar: dir: skipping existing file +-tar: dir/file: skipping existing file +-tar: dir/file2: skipping existing file +-tar: dir/file: Cannot open: File exists +-tar: dir/file2: Cannot open: File exists +-tar: Exiting with failure status due to previous errors + +228. acls01.at:25: 227. xattr08.at:26: +--- - 2026-04-15 07:34:38.436388489 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2026-04-15 07:34:38.433371305 +0000 +@@ -1,10 +1 @@ +-dir/ +-dir/file +-dir/file2 +-dir/ +-dir/file +-dir/file2 +-user.test="OurDirValue2" +-user.test="OurFileValue2" +-user.test="OurFileValue2" + + skipped (xattr08.at:29) + +229. acls02.at:25: + skipped (acls01.at:28) +231. selnx01.at:25: testing selinux: basic store/restore ... +./selnx01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19181,14 +18040,6 @@ rm -rf * -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 || exit 77 - - file=$(TMPDIR=. mktemp fiXXXXXX) setfattr -n user.test -v test $file &> /dev/null @@ -19227,72 +18078,95 @@ fi +mkdir dir +genfile --file dir/file +ln -s file dir/link - file=$(TMPDIR=. mktemp fiXXXXXX) +getfattr -h -d -msecurity.selinux dir dir/file dir/link > start - setfacl -m u:$UID:rwx $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi +restorecon -R dir +chcon -h --user=system_u dir +chcon -h --user=unconfined_u dir/file +chcon -h --user=system_u dir/link +# archive whole directory including selinux contexts +tar --selinux -cf archive.tar dir - getfacl $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi +# clear the directory +rm -rf dir - rm -rf $file +# ================================================ +# check if selinux contexts are correctly restored - file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file - err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi +tar --selinux -xf archive.tar +# archive for later debugging +cp archive.tar archive_origin.tar -mkdir dir -mkfifo dir/fifo -MAJOR=$( stat /dev/urandom --printf="%t" ) -MINOR=$( stat /dev/urandom --printf="%T" ) -mknod dir/chartype c $MAJOR $MINOR +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 -# setup attributes -restorecon -R dir -chcon -h --user=system_u dir/fifo -chcon -h --user=system_u dir/chartype -setfacl -m u:$UID:--- dir/fifo -setfacl -m u:$UID:rwx dir/chartype +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing -getfacl dir/fifo >> before -getfattr -msecurity.selinux dir/chartype >> before +getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux +rm -rf dir +tar -xf archive.tar +getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux -tar --xattrs --selinux --acls -cf archive.tar dir +diff with_selinux without_selinux > diff_with_without +if test "$?" -eq "0"; then + echo "selinux contexts probably restored while --selinux is off" +fi -mv dir olddir +# ================================================================= +# check if selinux is not archived when --selinux option is missing -tar --xattrs --selinux --acls -xf archive.tar +tar -cf archive.tar dir -getfacl dir/fifo >> after -getfattr -msecurity.selinux dir/chartype >> after +# clear the directory +rm -rf dir + +# restore (with --selinux) +tar --selinux -xf archive.tar dir + +getfattr -h -d -msecurity.selinux dir dir/file dir/link > final +diff start final > final_diff +if test "$?" -ne "0"; then + echo "bad result" +fi -diff before after -echo separator ) -228. acls01.at:25: +226. xattr07.at:26: skipped (acls02.at:28) - skipped (acls01.at:28) -230. acls03.at:30: --- - 2025-03-13 01:05:50.787858009 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2025-03-13 01:05:50.770252996 +0000 -@@ -1,4 +1 @@ --security.selinux="system_u --security.selinux="unconfined_u --security.selinux="system_u - -231. selnx01.at:25: skipped (acls03.at:47) - skipped (selnx01.at:28) +194. truncate.at:29: ok + skipped (xattr07.at:29) +234. onetop01.at:21: testing tar --one-top-level ... +./onetop01.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level -x -f ../a.tar +find . | sort +) + 233. capabs_raw01.at:25: testing capabilities: binary store/restore ... ./capabs_raw01.at:28: mkdir v7 @@ -19370,13 +18244,8 @@ getcap dir/file | sed 's/+/=/' ) ---- - 2025-03-13 01:05:50.866191616 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2025-03-13 01:05:50.842249888 +0000 -@@ -1,2 +1 @@ --separator - -234. onetop01.at:21: testing tar --one-top-level ... -./onetop01.at:24: +235. onetop02.at:21: testing tar --one-top-level --show-transformed ... +./onetop02.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19394,14 +18263,11 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -232. selacl01.at:25: skipped (selacl01.at:28) - - -235. onetop02.at:21: testing tar --one-top-level --show-transformed ... -./onetop02.at:24: +232. selacl01.at:25: testing acls/selinux: special files & fifos ... +./selacl01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19411,18 +18277,106 @@ rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar -find . | sort -) + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + restorecon $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + chcon -h --user=unconfined_u $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + rm -rf $file + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + + +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR + +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype + +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before + +tar --xattrs --selinux --acls -cf archive.tar dir + +mv dir olddir + +tar --xattrs --selinux --acls -xf archive.tar + +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after + +diff before after +echo separator +) +230. acls03.at:30: + skipped (acls03.at:47) 236. onetop03.at:21: testing tar --one-top-level --transform ... ./onetop03.at:24: mkdir v7 @@ -19445,32 +18399,31 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ---- - 2025-03-13 01:05:50.974167069 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2025-03-13 01:05:50.958244881 +0000 -@@ -1,2 +1 @@ --dir/file = cap_chown=ei +--- - 2026-04-15 07:34:38.448795381 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2026-04-15 07:34:38.445371305 +0000 +@@ -1,4 +1 @@ +-security.selinux="system_u +-security.selinux="unconfined_u +-security.selinux="system_u -181. sptrdiff00.at:26: ok -233. capabs_raw01.at:25: 237. onetop04.at:21: testing tar --one-top-level --transform ... -./onetop04.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +240. gtarfail2.at:21: testing gtarfail2 ... +./gtarfail2.at:26: + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar -test -z "`sort < /dev/null 2>&1`" || exit 77 +239. gtarfail.at:21: testing gtarfail ... +./gtarfail.at:26: -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort -) -238. onetop05.at:21: testing tar --one-top-level restoring permissions ... +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar + +231. selnx01.at:25: 238. onetop05.at:21: testing tar --one-top-level restoring permissions ... ./onetop05.at:28: mkdir v7 (cd v7 @@ -19518,59 +18471,26 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) - skipped (capabs_raw01.at:28) - -239. gtarfail.at:21: testing gtarfail ... -./gtarfail.at:26: - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +242. ustar-big-2g.at:21: testing ustar-big-2g ... +./ustar-big-2g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar -./update04.at:23: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -genfile --file file.a -genfile --file file.b -genfile --file file.c -echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' -echo "Second update" -tar ufv archive --wildcards './file.*' +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? -) ---- - 2025-03-13 01:05:51.137327803 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2025-03-13 01:05:51.106238493 +0000 -@@ -1,7 +1 @@ ---rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif ---rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif ---rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG ---rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg ---rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif ---rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg - -./onetop01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +237. onetop04.at:21: testing tar --one-top-level --transform ... +./onetop04.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -19581,43 +18501,29 @@ genfile --file a/b genfile --file c tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -239. gtarfail.at:21: ./onetop02.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - +243. ustar-big-8g.at:21: testing ustar-big-8g ... +./ustar-big-8g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar -find . | sort -) - skipped (gtarfail.at:26) -240. gtarfail2.at:21: testing gtarfail2 ... -./gtarfail2.at:26: test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar ---- - 2025-03-13 01:05:51.222045823 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2025-03-13 01:05:51.190234867 +0000 +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 + + skipped (selnx01.at:28) +--- - 2026-04-15 07:34:38.454501512 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2026-04-15 07:34:38.449371305 +0000 +@@ -1,2 +1 @@ +-dir/file = cap_chown=ei + +--- - 2026-04-15 07:34:38.455489151 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2026-04-15 07:34:38.449371305 +0000 @@ -1,11 +1 @@ --rwxr-xr-x jes/glone 214 2001-09-21 14:08 .clean -lrwxrwxrwx jes/cats 0 1998-05-07 12:39 RULES -> makefiles/RULES @@ -19630,50 +18536,31 @@ -lrwxrwxrwx jes/glone 0 2001-08-29 10:53 build/psmake/archconf.c -> ../archconf.c -lrwxrwxrwx jes/glone 0 2001-08-29 10:54 build/psmake/astoi.c -> ../../lib/astoi.c -155. time01.at:20: ok -240. gtarfail2.at:21: - skipped (gtarfail2.at:26) -./onetop04.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - +241. multi-fail.at:21: testing multi-fail ... +./multi-fail.at:26: -test -z "`sort < /dev/null 2>&1`" || exit 77 +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort -) -./onetop03.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar -find . | sort -) +tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ + -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- -./incr02.at:35: +--- - 2026-04-15 07:34:38.455970825 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2026-04-15 07:34:38.453371305 +0000 +@@ -1,7 +1 @@ +--rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif +--rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif +--rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG +--rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg +--rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif +--rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg + +233. capabs_raw01.at:25: ./extrac20.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19682,59 +18569,94 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, 'dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. -tar -cf archive -g db dir +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done -# Move away the directory -mv dir orig +prep() +{ + echo "== $1 ==" + echo "== $1 ==" >&2 + backup_dir=$1 + dir=out + mkdir -p $dir/root/dir + ln -s dir $dir/root/dirsymlink + test $round = normal && cd $dir >/dev/null +} -# Wait enough time for timestamps to differ in case of failure. -sleep 5 +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -# Restore the directory -tar -xf archive dir +# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable +file_spec() +{ + if test $round = normal + then + echo "-f ../$1" + else + echo "-f $1 -C $dir" + fi +} -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - +for round in normal dir +do + # Check that 'dirsymlink' replaces 'dir' + prep without_option_$round + tar -x `file_spec archivea.tar` || exit 1 + tar -x `file_spec archiveb.tar` || exit 1 + clean + + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean + + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done ) -241. multi-fail.at:21: testing multi-fail ... -./multi-fail.at:26: +240. gtarfail2.at:21: 239. gtarfail.at:21: stderr: +--- - 2026-04-15 07:34:38.457687577 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2026-04-15 07:34:38.453371305 +0000 +@@ -1,2 +1 @@ +-separator + +244. pax-big-10g.at:21: testing pax-big-10g ... +./pax-big-10g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ - -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- +tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 ---- - 2025-03-13 01:05:51.369922267 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2025-03-13 01:05:51.354227788 +0000 + skipped (capabs_raw01.at:28) + skipped (gtarfail.at:26) +stderr: + skipped (gtarfail2.at:26) +232. selacl01.at:25: --- - 2026-04-15 07:34:38.460482785 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2026-04-15 07:34:38.457371305 +0000 @@ -1,53 +1 @@ -drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ --rw-r--r-- joerg/bs 1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull @@ -19789,21 +18711,111 @@ --rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o --rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o -241. multi-fail.at:21: 242. ustar-big-2g.at:21: testing ustar-big-2g ... -./ustar-big-2g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 +--- - 2026-04-15 07:34:38.461878058 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2026-04-15 07:34:38.457371305 +0000 +@@ -1,3 +1 @@ +--rw------- jes/glone 2147483647 2002-06-15 14:53 big +--rw-r--r-- jes/glone 0 2002-06-15 14:53 file + + skipped (selacl01.at:28) +241. multi-fail.at:21: --- - 2026-04-15 07:34:38.462927264 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2026-04-15 07:34:38.457371305 +0000 +@@ -1,3 +1 @@ +--rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 +--rw-r--r-- jes/glone 0 2002-06-15 14:53 file + +./onetop01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level -x -f ../a.tar +find . | sort +) +242. ustar-big-2g.at:21: stderr: + skipped (multi-fail.at:26) +243. ustar-big-8g.at:21: skipped (ustar-big-2g.at:26) +./onetop02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level --show-transformed -v -x -f ../a.tar +find . | sort +) +--- - 2026-04-15 07:34:38.467617263 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2026-04-15 07:34:38.465371305 +0000 +@@ -1,3 +1 @@ +--rw------- jes/glone 10737418240 2002-06-15 21:18 10g +--rw-r--r-- jes/glone 0 2002-06-15 14:53 file + + skipped (ustar-big-8g.at:26) +./onetop04.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * - skipped (multi-fail.at:26) +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort +) +244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) +./onetop03.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar +find . | sort +) ./onetop05.at:28: mkdir oldgnu (cd oldgnu @@ -19851,7 +18863,7 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop02.at:24: +./onetop01.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -19869,10 +18881,10 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) -./onetop01.at:24: +./onetop04.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -19888,27 +18900,9 @@ genfile --file a/b genfile --file c tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort -) - -stderr: -./grow.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop04.at:24: +./onetop02.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -19924,42 +18918,11 @@ genfile --file a/b genfile --file c tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort +mkdir out +cd out +tar --one-top-level --show-transformed -v -x -f ../a.tar +find . | sort ) ---- - 2025-03-13 01:05:51.494132842 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2025-03-13 01:05:51.474222609 +0000 -@@ -1,3 +1 @@ ---rw------- jes/glone 2147483647 2002-06-15 14:53 big ---rw-r--r-- jes/glone 0 2002-06-15 14:53 file - -242. ustar-big-2g.at:21: 243. ustar-big-8g.at:21: testing ustar-big-8g ... -./ustar-big-8g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 - - skipped (ustar-big-2g.at:26) -244. pax-big-10g.at:21: testing pax-big-10g ... -./pax-big-10g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 - -stderr: ./onetop03.at:24: mkdir ustar (cd ustar @@ -19981,21 +18944,7 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ---- - 2025-03-13 01:05:51.612971909 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2025-03-13 01:05:51.594217430 +0000 -@@ -1,3 +1 @@ ---rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 ---rw-r--r-- jes/glone 0 2002-06-15 14:53 file - -stderr: -243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) ---- - 2025-03-13 01:05:51.666341609 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2025-03-13 01:05:51.634215703 +0000 -@@ -1,3 +1 @@ ---rw------- jes/glone 10737418240 2002-06-15 21:18 10g ---rw-r--r-- jes/glone 0 2002-06-15 14:53 file - -244. pax-big-10g.at:21: ./onetop04.at:24: +./onetop04.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20013,7 +18962,27 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) - skipped (pax-big-10g.at:26) +./onetop01.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level -x -f ../a.tar +find . | sort +) ./onetop02.at:24: mkdir posix (cd posix @@ -20035,7 +19004,7 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop01.at:24: +./onetop03.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20053,7 +19022,7 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ./onetop05.at:28: @@ -20103,27 +19072,6 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop03.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar -find . | sort -) ./onetop04.at:24: mkdir gnu (cd gnu @@ -20142,7 +19090,7 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop02.at:24: +./onetop01.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20160,10 +19108,10 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) -./onetop01.at:24: +./onetop02.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20181,7 +19129,7 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) ./onetop03.at:24: @@ -20205,7 +19153,8 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop05.at:28: +237. onetop04.at:21: ok +234. onetop01.at:21: ./onetop05.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20252,65 +19201,81 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -237. onetop04.at:21: ok + ok 235. onetop02.at:21: ok -./update02.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +236. onetop03.at:21: ok +./extrac20.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./update01.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done -test -z "`sort < /dev/null 2>&1`" || exit 77 +prep() +{ + echo "== $1 ==" + echo "== $1 ==" >&2 + backup_dir=$1 + dir=out + mkdir -p $dir/root/dir + ln -s dir $dir/root/dirsymlink + test $round = normal && cd $dir >/dev/null +} -mkdir a -genfile --file a/b +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -tar cf arc a +# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable +file_spec() +{ + if test $round = normal + then + echo "-f ../$1" + else + echo "-f $1 -C $dir" + fi +} -echo "separator" +for round in normal dir +do + # Check that 'dirsymlink' replaces 'dir' + prep without_option_$round + tar -x `file_spec archivea.tar` || exit 1 + tar -x `file_spec archiveb.tar` || exit 1 + clean -sleep 2 -genfile --file a/c + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done ) -236. onetop03.at:21: ok -160. multiv04.at:36: ok -234. onetop01.at:21: ok -187. update04.at:20: ok -180. sptrcreat.at:33: ok ./onetop05.at:28: mkdir gnu (cd gnu @@ -20358,8 +19323,91 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) +./grow.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) 238. onetop05.at:21: ok -./listed02.at:31: +103. extrac20.at:21: ok +174. sparse06.at:21: ok +./sptrdiff00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vdf bar +) +./grow.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) +./sptrcreat.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') +155. time01.at:20: ok +./sptrdiff01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ + tar --sparse -vdf bar +) +./incr03.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -20372,63 +19420,216 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Create directories +mkdir directory +genfile --file=directory/x +genfile --file=directory/y -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 sleep 1 -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +./incr04.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - sleep 1 -echo Creating main archive -echo >&2 "Creating main archive" -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +./rename02.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z sleep 1 -echo Modifying filesystem -rm tart/a1 -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -echo Directory contents -find tart -print | sort 2>/dev/null +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./rename03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec sleep 1 -echo Creating incremental archive -echo >&2 "Creating incremental archive" -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./grow.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) +./update04.at:23: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file file.a +genfile --file file.b +genfile --file file.c +echo Create +tar cf archive ./file.* sleep 1 +echo "update" > file.b +echo First update +tar ufv archive --wildcards './file.*' -rm -rf tart/* -echo Extracting main archive -echo >&2 "Extracting main archive" -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null +echo "Second update" +tar ufv archive --wildcards './file.*' -echo Final files: -find tart -print | sort 2>/dev/null +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? ) -./update01.at:32: +./sptrdiff00.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vdf bar +) +./grow.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20437,6 +19638,264 @@ export TAR_OPTIONS rm -rf * +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) +./sptrcreat.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') +./sptrdiff01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ + tar --sparse -vdf bar +) +195. grow.at:24: ok +181. sptrdiff00.at:26: ok +182. sptrdiff01.at:26: ok +180. sptrcreat.at:33: ok +./incr03.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +./incr04.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +./chtype.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +) +./rename02.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./rename03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./update01.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -20455,11 +19914,11 @@ tar tf arc | sort || exit 1 ) ./update02.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -20480,7 +19939,7 @@ echo "separator" tar tf arc | sort || exit 1 ) -./grow.at:27: +./update04.at:23: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -20489,16 +19948,29 @@ export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +genfile --file file.a +genfile --file file.b +genfile --file file.c +echo Create +tar cf archive ./file.* +sleep 1 +echo "update" > file.b +echo First update +tar ufv archive --wildcards './file.*' + +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? ) ./exclude05.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -20528,8 +20000,85 @@ rm -rf testdir exclfile ) -118. incr02.at:32: ok -./grow.at:27: +./incremental.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created "on or after" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +) +./listed01.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 + +tar --create \ + --file=archive.1 \ + --listed-incremental=listing \ + directory/file* + +tar tf archive.1 || exit 1 + +sleep 2 + +genfile --length 10240 --pattern zeros --file directory/file2 + +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 +) +124. incr03.at:28: ok +125. incr04.at:29: ok +138. rename02.at:24: ok +139. rename03.at:23: ok +./update04.at:23: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20538,13 +20087,142 @@ export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +genfile --file file.a +genfile --file file.b +genfile --file file.c +echo Create +tar cf archive ./file.* +sleep 1 +echo "update" > file.b +echo First update +tar ufv archive --wildcards './file.*' + +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? ) -184. update01.at:29: ok -185. update02.at:26: ok -./grow.at:27: +./chtype.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 +mkdir directory/a +genfile --file directory/a/a + +echo First backup +tar --create --file=archive.1 --listed-incremental=db.1 directory + +sleep 2 + +# Remove directory b and create a file with this name. +# Previous versions were not able to restore over this file. +rm -r directory/b +genfile --file directory/b +genfile --file directory/a/b + +echo Second backup +tar --create --file=archive.2 --listed-incremental=db.2 directory + +# Delete a +rm -r directory + +echo Restore archive.1 +tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp +echo Restore archive.2 +tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp +find directory | sort +) +./multiv04.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update02.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update04.at:23: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20553,11 +20231,197 @@ export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +genfile --file file.a +genfile --file file.b +genfile --file file.c +echo Create +tar cf archive ./file.* +sleep 1 +echo "update" > file.b +echo First update +tar ufv archive --wildcards './file.*' + +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? +) +./incr02.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +) +./exclude05.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +187. update04.at:20: ok +./incremental.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +mkdir structure +echo x >structure/file + +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null + +# If the time of an initial backup and the creation time of a file contained +# in that backup are the same, the file will be backed up again when an +# incremental backup is done, because the incremental backup backs up +# files created "on or after" the initial backup time. Without the sleep +# command, behaviour of tar becomes variable, depending whether the system +# clock ticked over to the next second between creating the file and +# backing it up. +sleep 1 + +tar cf archive --listed=list structure +tar cfv archive --listed=list structure +echo separator +# ReiserFS often offsets the timestamps of newly created files +# 1 second to the past. Try to compensate for it, until a better +# solution is found. +sleep 2 +echo y >structure/file +tar cfv archive --listed=list structure +) +119. listed01.at:26: ok +143. chtype.at:27: ok +./update01.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 ) -195. grow.at:24: ok ./exclude05.at:24: mkdir posix (cd posix @@ -20593,7 +20457,108 @@ rm -rf testdir exclfile ) -120. listed02.at:28: ok +160. multiv04.at:36: ok +./update01.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update02.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +116. incremental.at:23: ok +./incr02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - +) +184. update01.at:29: ok +185. update02.at:26: ok ./exclude05.at:24: mkdir gnu (cd gnu @@ -20630,14 +20595,85 @@ ) 64. exclude05.at:21: ok +./listed02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File $file > $file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 "Creating main archive" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 "Creating incremental archive" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 "Extracting main archive" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +) +118. incr02.at:32: ok stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-03-13 01:05 begin --rw-r--r-- pbuilder1/pbuilder1 8589935104 2025-03-13 01:05 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-03-13 01:05 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 begin +-rw-r--r-- pbuilder2/pbuilder2 8589935104 2026-04-15 07:34 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-04-15 07:34 end separator sparsefile 8589935104 171. sparse03.at:21: ok +120. listed02.at:28: ok 173. sparse05.at:21: ok ## ------------- ## @@ -20655,7 +20691,7 @@ create-stamp debian/debhelper-build-stamp dh_prep dh_auto_install - make -j20 install DESTDIR=/build/reproducible-path/tar-1.35\+dfsg/debian/tmp AM_UPDATE_INFO_DIR=no + make -j42 install DESTDIR=/build/reproducible-path/tar-1.35\+dfsg/debian/tmp AM_UPDATE_INFO_DIR=no make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' Making install in doc make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/doc' @@ -20694,17 +20730,17 @@ Making install in src make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/src' make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/src' - /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' make[3]: Nothing to be done for 'install-data-am'. + /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' /usr/bin/install -c tar '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' make[3]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/src' make[2]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/src' Making install in scripts make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/scripts' make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/scripts' +make[3]: Nothing to be done for 'install-data-am'. /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' -make[3]: Nothing to be done for 'install-data-am'. /usr/bin/install -c backup.sh dump-remind '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' /usr/bin/install -c backup restore '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' make[3]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/scripts' @@ -20794,45 +20830,45 @@ dh_perl dh_link dh_strip_nondeterminism - Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo dh_compress dh_fixperms dh_missing @@ -20845,8 +20881,8 @@ dh_gencontrol dh_md5sums dh_builddeb -dpkg-deb: building package 'tar' in '../tar_1.35+dfsg-3.1_amd64.deb'. dpkg-deb: building package 'tar-dbgsym' in '../tar-dbgsym_1.35+dfsg-3.1_amd64.deb'. +dpkg-deb: building package 'tar' in '../tar_1.35+dfsg-3.1_amd64.deb'. dpkg-deb: building package 'tar-scripts' in '../tar-scripts_1.35+dfsg-3.1_all.deb'. dpkg-genbuildinfo --build=binary -O../tar_1.35+dfsg-3.1_amd64.buildinfo dpkg-genchanges --build=binary -O../tar_1.35+dfsg-3.1_amd64.changes @@ -20855,12 +20891,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/1342568/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/1140625 and its subdirectories -I: Current time: Wed Mar 12 13:10:14 -12 2025 -I: pbuilder-time-stamp: 1741828214 +I: removing directory /srv/workspace/pbuilder/1342568 and its subdirectories +I: Current time: Wed Apr 15 21:35:19 +14 2026 +I: pbuilder-time-stamp: 1776238519