Diff of the two buildlogs: -- --- b1/build.log 2025-09-26 07:26:29.480349340 +0000 +++ b2/build.log 2025-09-26 07:36:23.565069535 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Thu Sep 25 19:20:58 -12 2025 -I: pbuilder-time-stamp: 1758871258 +I: Current time: Fri Oct 30 03:49:30 +14 2026 +I: pbuilder-time-stamp: 1793281770 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/forky-reproducible-base.tgz] I: copying local configuration @@ -30,53 +30,85 @@ 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/2847349/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/661140/tmp/hooks/D01_modify_environment starting +debug: Running on ionos5-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 Oct 29 13:50 /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/661140/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/661140/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=40 ' - DISTRIBUTION='forky' - 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]="3" [2]="3" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.3.3(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=forky + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='b2d91de313e342868e84b546df541e36' - 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='2847349' - PS1='# ' - PS2='> ' + INVOCATION_ID=766c3db1c71d4fc8a505c6ebdac4959f + 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=661140 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.CwFMhpVR/pbuilderrc_nYr6 --distribution forky --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/forky-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.CwFMhpVR/b1 --logfile b1/build.log tar_1.35+dfsg-3.1.dsc' - SUDO_GID='110' - SUDO_HOME='/var/lib/jenkins' - SUDO_UID='105' - 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.CwFMhpVR/pbuilderrc_KjIB --distribution forky --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/forky-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.CwFMhpVR/b2 --logfile b2/build.log tar_1.35+dfsg-3.1.dsc' + SUDO_GID=110 + SUDO_HOME=/var/lib/jenkins + SUDO_UID=105 + 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 ionos1-amd64 6.12.48+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.12.48+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.48-1 (2025-09-20) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Aug 10 12:30 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/2847349/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Aug 10 2025 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/661140/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: 37 http://deb.debian.org/debian forky/main amd64 libpcre2-dev amd64 10.46-1 [853 kB] Get: 38 http://deb.debian.org/debian forky/main amd64 libsepol-dev amd64 3.8.1-1 [373 kB] Get: 39 http://deb.debian.org/debian forky/main amd64 libselinux1-dev amd64 3.8.1-1 [169 kB] -Fetched 14.6 MB in 0s (76.8 MB/s) +Fetched 14.6 MB in 1s (15.3 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 ... 19917 files and directories currently installed.) @@ -339,7 +371,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/661140/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for forky +I: user script /srv/workspace/pbuilder/661140/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 @@ -379,8 +415,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 @@ -1031,7 +1067,7 @@ config.status: executing tests/atconfig commands make[1]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg' dh_auto_build - make -j40 + 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' @@ -1077,6 +1113,7 @@ printf '#define PKGLIBDIR %s\n' \"/usr/lib/x86_64-linux-gnu/tar\"; \ printf '#define PKGLIBEXECDIR %s\n' \"/usr/sbin/tar\"; \ } | sed '/""/d' > configmake.h-t +mv alloca.h-t alloca.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' \ @@ -1088,6 +1125,8 @@ -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 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' \ @@ -1166,21 +1205,20 @@ -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 +mv error.h-t error.h +mv dirent.h-t dirent.h +mv fcntl.h-t fcntl.h +mv getopt.h-t getopt.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 /usr/bin/mkdir -p 'malloc' -mv configmake.h-t configmake.h /usr/bin/mkdir -p 'malloc' -mv ctype.h-t ctype.h /usr/bin/mkdir -p 'malloc' -mv error.h-t error.h mv getopt-cdefs.h-t getopt-cdefs.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 -mv getopt.h-t getopt.h 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' \ @@ -1190,6 +1228,12 @@ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t 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 +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' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ @@ -1218,14 +1262,6 @@ -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 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|__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 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' \ @@ -1245,6 +1281,8 @@ -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 +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' \ @@ -1278,9 +1316,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./locale.in.h > locale.h-t -mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h +mv langinfo.h-t langinfo.h /usr/bin/mkdir -p 'selinux' -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' \ @@ -1315,9 +1352,7 @@ -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_SELINUX_SELINUX_H''@||g' \ ./se-selinux.in.h > selinux/selinux.h-t -mv limits.h-t limits.h mv inttypes.h-t inttypes.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' \ @@ -1589,9 +1624,6 @@ -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 signal.h-t signal.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' \ @@ -1693,6 +1725,10 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > string.h-t +mv limits.h-t limits.h +mv locale.h-t locale.h +mv selinux/selinux.h-t selinux/selinux.h +mv signal.h-t signal.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_STRINGS_H''@|1|g' \ @@ -1710,10 +1746,109 @@ ./strings.in.h > strings.h-t /usr/bin/mkdir -p 'sys' /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' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ + -e 's|@''PRAGMA_COLUMNS''@||g' \ + -e 's|@''NEXT_SYS_RANDOM_H''@||g' \ + -e 's|@''HAVE_SYS_RANDOM_H''@|1|g' \ + -e 's/@''GNULIB_GETRANDOM''@/1/g' \ + -e 's/@''HAVE_GETRANDOM''@/1/g' \ + -e 's/@''REPLACE_GETRANDOM''@/0/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ + -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 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' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ + -e 's|@''PRAGMA_COLUMNS''@||g' \ + -e 's|@''NEXT_SYS_STAT_H''@||g' \ + -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|0|g' \ + -e 's|@''WINDOWS_STAT_TIMESPEC''@|0|g' \ + -e 's/@''GNULIB_CHMOD''@/1/g' \ + -e 's/@''GNULIB_FCHMODAT''@/1/g' \ + -e 's/@''GNULIB_FSTAT''@/1/g' \ + -e 's/@''GNULIB_FSTATAT''@/1/g' \ + -e 's/@''GNULIB_FUTIMENS''@/1/g' \ + -e 's/@''GNULIB_GETUMASK''@/0/g' \ + -e 's/@''GNULIB_LCHMOD''@/1/g' \ + -e 's/@''GNULIB_LSTAT''@/1/g' \ + -e 's/@''GNULIB_MKDIR''@/1/g' \ + -e 's/@''GNULIB_MKDIRAT''@/1/g' \ + -e 's/@''GNULIB_MKFIFO''@/1/g' \ + -e 's/@''GNULIB_MKFIFOAT''@/1/g' \ + -e 's/@''GNULIB_MKNOD''@/1/g' \ + -e 's/@''GNULIB_MKNODAT''@/1/g' \ + -e 's/@''GNULIB_STAT''@/1/g' \ + -e 's/@''GNULIB_UTIMENSAT''@/1/g' \ + -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/0/g' \ + -e 's/@''GNULIB_MDA_CHMOD''@/1/g' \ + -e 's/@''GNULIB_MDA_MKDIR''@/1/g' \ + -e 's/@''GNULIB_MDA_UMASK''@/1/g' \ + -e 's|@''HAVE_FCHMODAT''@|1|g' \ + -e 's|@''HAVE_FSTATAT''@|1|g' \ + -e 's|@''HAVE_FUTIMENS''@|1|g' \ + -e 's|@''HAVE_GETUMASK''@|1|g' \ + -e 's|@''HAVE_LCHMOD''@|1|g' \ + -e 's|@''HAVE_LSTAT''@|1|g' \ + -e 's|@''HAVE_MKDIRAT''@|1|g' \ + -e 's|@''HAVE_MKFIFO''@|1|g' \ + -e 's|@''HAVE_MKFIFOAT''@|1|g' \ + -e 's|@''HAVE_MKNOD''@|1|g' \ + -e 's|@''HAVE_MKNODAT''@|1|g' \ + -e 's|@''HAVE_UTIMENSAT''@|1|g' \ + -e 's|@''REPLACE_CHMOD''@|0|g' \ + -e 's|@''REPLACE_FCHMODAT''@|0|g' \ + -e 's|@''REPLACE_FSTAT''@|0|g' \ + -e 's|@''REPLACE_FSTATAT''@|0|g' \ + -e 's|@''REPLACE_FUTIMENS''@|0|g' \ + -e 's|@''REPLACE_LSTAT''@|0|g' \ + -e 's|@''REPLACE_MKDIR''@|0|g' \ + -e 's|@''REPLACE_MKFIFO''@|0|g' \ + -e 's|@''REPLACE_MKFIFOAT''@|0|g' \ + -e 's|@''REPLACE_MKNOD''@|0|g' \ + -e 's|@''REPLACE_MKNODAT''@|0|g' \ + -e 's|@''REPLACE_STAT''@|0|g' \ + -e 's|@''REPLACE_UTIMENSAT''@|0|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ + -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 /usr/bin/mkdir -p 'sys' /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/@''HAVE_SYS_TIME_H''@/1/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_TIME_H''@||g' \ + -e 's/@''GNULIB_GETTIMEOFDAY''@/1/g' \ + -e 's|@''HAVE_WINSOCK2_H''@|0|g' \ + -e 's/@''HAVE_GETTIMEOFDAY''@/1/g' \ + -e 's/@''HAVE_STRUCT_TIMEVAL''@/1/g' \ + -e 's/@''REPLACE_GETTIMEOFDAY''@/0/g' \ + -e 's/@''REPLACE_STRUCT_TIMEVAL''@/0/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ + -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 +mv sys/random.h-t sys/random.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|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ -e 's|@''PRAGMA_COLUMNS''@||g' \ @@ -1761,20 +1896,6 @@ ./time.in.h > 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_RANDOM_H''@||g' \ - -e 's|@''HAVE_SYS_RANDOM_H''@|1|g' \ - -e 's/@''GNULIB_GETRANDOM''@/1/g' \ - -e 's/@''HAVE_GETRANDOM''@/1/g' \ - -e 's/@''REPLACE_GETRANDOM''@/0/g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ - -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 -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' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ @@ -1822,94 +1943,14 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ ./uchar.in.h > uchar.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_STAT_H''@||g' \ - -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|0|g' \ - -e 's|@''WINDOWS_STAT_TIMESPEC''@|0|g' \ - -e 's/@''GNULIB_CHMOD''@/1/g' \ - -e 's/@''GNULIB_FCHMODAT''@/1/g' \ - -e 's/@''GNULIB_FSTAT''@/1/g' \ - -e 's/@''GNULIB_FSTATAT''@/1/g' \ - -e 's/@''GNULIB_FUTIMENS''@/1/g' \ - -e 's/@''GNULIB_GETUMASK''@/0/g' \ - -e 's/@''GNULIB_LCHMOD''@/1/g' \ - -e 's/@''GNULIB_LSTAT''@/1/g' \ - -e 's/@''GNULIB_MKDIR''@/1/g' \ - -e 's/@''GNULIB_MKDIRAT''@/1/g' \ - -e 's/@''GNULIB_MKFIFO''@/1/g' \ - -e 's/@''GNULIB_MKFIFOAT''@/1/g' \ - -e 's/@''GNULIB_MKNOD''@/1/g' \ - -e 's/@''GNULIB_MKNODAT''@/1/g' \ - -e 's/@''GNULIB_STAT''@/1/g' \ - -e 's/@''GNULIB_UTIMENSAT''@/1/g' \ - -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/0/g' \ - -e 's/@''GNULIB_MDA_CHMOD''@/1/g' \ - -e 's/@''GNULIB_MDA_MKDIR''@/1/g' \ - -e 's/@''GNULIB_MDA_UMASK''@/1/g' \ - -e 's|@''HAVE_FCHMODAT''@|1|g' \ - -e 's|@''HAVE_FSTATAT''@|1|g' \ - -e 's|@''HAVE_FUTIMENS''@|1|g' \ - -e 's|@''HAVE_GETUMASK''@|1|g' \ - -e 's|@''HAVE_LCHMOD''@|1|g' \ - -e 's|@''HAVE_LSTAT''@|1|g' \ - -e 's|@''HAVE_MKDIRAT''@|1|g' \ - -e 's|@''HAVE_MKFIFO''@|1|g' \ - -e 's|@''HAVE_MKFIFOAT''@|1|g' \ - -e 's|@''HAVE_MKNOD''@|1|g' \ - -e 's|@''HAVE_MKNODAT''@|1|g' \ - -e 's|@''HAVE_UTIMENSAT''@|1|g' \ - -e 's|@''REPLACE_CHMOD''@|0|g' \ - -e 's|@''REPLACE_FCHMODAT''@|0|g' \ - -e 's|@''REPLACE_FSTAT''@|0|g' \ - -e 's|@''REPLACE_FSTATAT''@|0|g' \ - -e 's|@''REPLACE_FUTIMENS''@|0|g' \ - -e 's|@''REPLACE_LSTAT''@|0|g' \ - -e 's|@''REPLACE_MKDIR''@|0|g' \ - -e 's|@''REPLACE_MKFIFO''@|0|g' \ - -e 's|@''REPLACE_MKFIFOAT''@|0|g' \ - -e 's|@''REPLACE_MKNOD''@|0|g' \ - -e 's|@''REPLACE_MKNODAT''@|0|g' \ - -e 's|@''REPLACE_STAT''@|0|g' \ - -e 's|@''REPLACE_UTIMENSAT''@|0|g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ - -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 -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' \ - -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_TIME_H''@||g' \ - -e 's/@''GNULIB_GETTIMEOFDAY''@/1/g' \ - -e 's|@''HAVE_WINSOCK2_H''@|0|g' \ - -e 's/@''HAVE_GETTIMEOFDAY''@/1/g' \ - -e 's/@''HAVE_STRUCT_TIMEVAL''@/1/g' \ - -e 's/@''REPLACE_GETTIMEOFDAY''@/0/g' \ - -e 's/@''REPLACE_STRUCT_TIMEVAL''@/0/g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ - -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 -mv strings.h-t strings.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 -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 string.h-t string.h +mv sys/time.h-t sys/time.h +mv sys/types.h-t sys/types.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' \ @@ -2045,7 +2086,6 @@ -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 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_UNINORM_NFD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2250,14 +2290,17 @@ -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 sys/time.h-t sys/time.h -mv sys/types.h-t sys/types.h -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w unitypes.h-t' ./unitypes.in.h -mv unicase.h-t unicase.h -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.h +mv sys/stat.h-t sys/stat.h +mv stdio.h-t stdio.h mv time.h-t time.h +mv uchar.h-t uchar.h mv uninorm.h-t uninorm.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w unitypes.h-t' ./unitypes.in.h +mv stdlib.h-t stdlib.h +mv unistd.h-t unistd.h mv unitypes.h-t unitypes.h +mv unictype.h-t unictype.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.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' \ @@ -2397,8 +2440,6 @@ -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 string.h-t string.h -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_WCTYPE_H''@/1/g' \ @@ -2428,14 +2469,9 @@ -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 utime.h-t utime.h -mv stdio.h-t stdio.h -mv stdlib.h-t stdlib.h mv wctype.h-t wctype.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' @@ -2689,7 +2725,7 @@ make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' cp tests/testsuite debian/testsuite.orig dh_auto_test - make -j40 check TESTSUITEFLAGS="-j40 --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' @@ -2741,9 +2777,9 @@ 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 -j40 --verbose +/bin/sh ./testsuite -j42 --verbose ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## @@ -2756,6 +2792,14 @@ +1. version.at:19: testing tar version ... +./version.at:21: tar --version | sed 1q + + + + + + @@ -2763,8 +2807,19 @@ -1. version.at:19: testing tar version ... -./version.at:21: tar --version | sed 1q + +6. opcomp01.at:21: testing occurrence compatibility ... +./opcomp01.at:24: +tar --occurrence=1 -cf test.tar . + + +4. options02.at:26: testing interspersed options ... +./options02.at:29: +echo > file1 +tar c file1 -f archive +tar tf archive + + 2. pipe.at:29: testing decompressing from stdin ... @@ -2791,11 +2846,21 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) -3. options.at:24: testing mixing options ... -./options.at:27: -echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 -tar tf archive + + + + + + + +8. opcomp03.at:21: testing --verify compatibility ... +./opcomp03.at:24: +tar -tWf test.tar . + + + + + 5. options03.at:21: testing TAR_OPTIONS with string arguments ... ./options03.at:31: @@ -2807,20 +2872,8 @@ tar tf arc.tar -4. options02.at:26: testing interspersed options ... -./options02.at:29: -echo > file1 -tar c file1 -f archive -tar tf archive - - - - - -7. opcomp02.at:21: testing occurrence compatibility ... -./opcomp02.at:24: -tar --occurrence=1 -tf test.tar - +6. opcomp01.at:21: ok +4. options02.at:26: ok 9. opcomp04.at:21: testing compress option compatibility ... ./opcomp04.at:24: @@ -2831,25 +2884,125 @@ genfile --file newfile tar rzf test.tar newfile -6. opcomp01.at:21: testing occurrence compatibility ... -./opcomp01.at:24: -tar --occurrence=1 -cf test.tar . +19. testsuite.at:244: testing compress: xz ... +./testsuite.at:244: +cat /dev/null | xz - > /dev/null 2>&1 || exit 77 -8. opcomp03.at:21: testing --verify compatibility ... -./opcomp03.at:24: -tar -tWf test.tar . +unset TAR_OPTIONS + +touch empty +set -e +: create with --xz +tar --xz -cf k.tar.xz empty +tar tf k.tar.xz + + +echo testing .xz +tar -acf k2.tar.xz empty +cat k2.tar.xz | xz -d > k.xz.tar +tar tf k.xz.tar + +echo testing .txz +tar -acf k2.tar.txz empty +cat k2.tar.txz | xz -d > k.txz.tar +tar tf k.txz.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.xz +test -f empty +7. opcomp02.at:21: testing occurrence compatibility ... +./opcomp02.at:24: +tar --occurrence=1 -tf test.tar + +37. T-nonl.at:27: testing entries with missing newlines ... +./T-nonl.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +printf c > 1.nonl +printf 'd\ne' > 2.nonl +touch a b c d e +cat >filelist <<'_ATEOF' +a +b +_ATEOF +tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist +tar tf archive +echo == +tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl +tar tf archive +) +1. version.at:19: ok 10. opcomp05.at:21: testing --pax-option compatibility ... ./opcomp05.at:24: tar -Hgnu -cf test.tar --pax-option user:=root . +36. T-zfile.at:26: testing empty file ... +./T-zfile.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --length=0 --file empty +genfile --file a +genfile --file b +cat >valid <<'_ATEOF' +a +b +_ATEOF + -12. defaults.at:16: testing checkpoint defaults ... -./defaults.at:18: +tar cf archive -T empty -T valid +tar tf archive +echo "==" +tar cf archive -T valid -T empty +tar tf archive +) +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 + +8. opcomp03.at:21: ok +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 @@ -2859,8 +3012,139 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint -c -f ../a.tar . +tar --checkpoint=2 -c -f ../a.tar . + + +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 +) + +7. opcomp02.at:21: ok +38. T-dir00.at:28: testing recursive extraction from --files-from ... +3. options.at:24: testing mixing options ... +./options.at:27: +echo > file1 +TAR_OPTIONS=--numeric-owner tar chof archive file1 +tar tf archive + +./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 +) +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 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 +) +3. options.at:24: 5. options03.at:21: +40. indexfile.at:26: testing tar --index-file=FILE --file=- ... +./indexfile.at:29: +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 + +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) + ok + ok +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 + + +10. opcomp05.at:21: ok +22. testsuite.at:248: testing compress: zstd ... +./testsuite.at:248: + +cat /dev/null | zstd - > /dev/null 2>&1 || exit 77 + +unset TAR_OPTIONS + +touch empty +set -e +: create with --zstd +tar --zstd -cf k.tar.zst empty +tar tf k.tar.zst + + +echo testing .zst +tar -acf k2.tar.zst empty +cat k2.tar.zst | zstd -d > k.zst.tar +tar tf k.zst.tar + +echo testing .tzst +tar -acf k2.tar.tzst empty +cat k2.tar.tzst | zstd -d > k.tzst.tar +tar tf k.tzst.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.zst +test -f empty 11. opcomp06.at:21: testing --pax-option compatibility ... ./opcomp06.at:24: @@ -2892,9 +3176,8 @@ tar -cf test.tar --acls -Hgnu file - -13. interval.at:16: testing checkpoint interval ... -./interval.at:18: +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 @@ -2904,53 +3187,72 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=2 -c -f ../a.tar . - +tar --checkpoint -c -f ../a.tar . -1. version.at:19: - ok -14. dot.at:16: testing dot action ... -./dot.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 +--- - 2026-10-29 13:56:37.979562523 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2026-10-29 13:56:37.966399939 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lz +-empty + +./verbose.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS +rm -rf * -tar --checkpoint-action=dot -c -f ../a.tar . - - - -20. testsuite.at:246: testing compress: lzip ... -./testsuite.at:246: - -cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive +) +--- - 2026-10-29 13:56:37.991722192 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2026-10-29 13:56:37.986399939 +0000 +@@ -1,6 +1 @@ +-empty +-testing .zst +-empty +-testing .tzst +-empty + +26. add-file.at:21: testing The --add-file option ... +./add-file.at:33: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -unset TAR_OPTIONS +genfile --file -File +genfile --file foo +genfile --file bar -touch empty -set -e -: create with --lzip -tar --lzip -cf k.tar.lz empty -tar tf k.tar.lz +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File +echo 2: +tar -cvf arc.tar foo --add-file -File bar -echo testing .lz -tar -acf k2.tar.lz empty -cat k2.tar.lz | lzip -d > k.lz.tar -tar tf k.lz.tar +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.lz -test -f empty -6. opcomp01.at:21: 18. testsuite.at:243: testing compress: bzip2 ... +echo 3: +tar -cvf arc.tar -T input +) +18. testsuite.at:243: testing compress: bzip2 ... ./testsuite.at:243: cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 @@ -2980,77 +3282,58 @@ tar xf k.tar.bz2 test -f empty -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 +30. T-recurse.at:27: testing files-from & recurse: toggle ... +./T-recurse.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" export TAR_OPTIONS +rm -rf * -tar --checkpoint=.2 -c -f ../a.tar . - - - ok -21. testsuite.at:247: testing compress: lzop ... -./testsuite.at:247: - -cat /dev/null | lzop - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --lzop -tar --lzop -cf k.tar.lzo empty -tar tf k.tar.lzo - - -echo testing .lzo -tar -acf k2.tar.lzo empty -cat k2.tar.lzo | lzop -d > k.lzo.tar -tar tf k.lzo.tar - +mkdir directory1 directory2 +touch directory1/file directory2/file -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.lzo -test -f empty +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--recursion +directory2/ +_ATEOF -17. testsuite.at:242: testing compress: gzip ... -./testsuite.at:242: -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -unset TAR_OPTIONS -touch empty -set -e -: create with --gzip -tar --gzip -cf k.tar.gz empty -tar tf k.tar.gz +cat >F2B <<'_ATEOF' +directory2/ +_ATEOF -echo testing .gz -tar -acf k2.tar.gz empty -cat k2.tar.gz | gzip -d > k.gz.tar -tar tf k.gz.tar +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" -echo testing .tgz -tar -acf k2.tar.tgz empty -cat k2.tar.tgz | gzip -d > k.tgz.tar -tar tf k.tgz.tar +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" +) +20. testsuite.at:246: 37. T-nonl.at:27: 22. testsuite.at:248: 25. positional03.at:21: testing Several options ... +./positional03.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.gz -test -f empty +mkdir t +cd t +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort -8. opcomp03.at:21: 16. dot-int.at:16: testing dot action and interval ... ./dot-int.at:18: @@ -3067,30 +3350,22 @@ ok -7. opcomp02.at:21: ok -3. options.at:24: - - ok -4. options02.at:26: 10. opcomp05.at:21: ok - ok - -23. positional01.at:21: testing Exclude ... -./positional01.at:24: +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 -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar --checkpoint=.2 -c -f ../a.tar . -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 + skipped (testsuite.at:246) 27. T-mult.at:21: testing multiple file lists ... ./T-mult.at:24: mkdir ustar @@ -3118,95 +3393,104 @@ tar cf archive -T F1 -T F2 tar tf archive ) -19. testsuite.at:244: testing compress: xz ... -./testsuite.at:244: + skipped (testsuite.at:248) -cat /dev/null | xz - > /dev/null 2>&1 || exit 77 +14. dot.at:16: testing dot action ... +./dot.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-action=dot -c -f ../a.tar . + + +17. testsuite.at:242: testing compress: gzip ... +./testsuite.at:242: + +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 unset TAR_OPTIONS touch empty set -e -: create with --xz -tar --xz -cf k.tar.xz empty -tar tf k.tar.xz +: create with --gzip +tar --gzip -cf k.tar.gz empty +tar tf k.tar.gz -echo testing .xz -tar -acf k2.tar.xz empty -cat k2.tar.xz | xz -d > k.xz.tar -tar tf k.xz.tar +echo testing .gz +tar -acf k2.tar.gz empty +cat k2.tar.gz | gzip -d > k.gz.tar +tar tf k.gz.tar -echo testing .txz -tar -acf k2.tar.txz empty -cat k2.tar.txz | xz -d > k.txz.tar -tar tf k.txz.tar +echo testing .tgz +tar -acf k2.tar.tgz empty +cat k2.tar.tgz | gzip -d > k.tgz.tar +tar tf k.tgz.tar # Extraction: ensure compressed format is correctly recognized rm -f empty -tar xf k.tar.xz +tar xf k.tar.gz test -f empty ---- - 2025-09-26 07:23:57.805678888 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2025-09-26 07:23:57.799730984 +0000 +--- - 2026-10-29 13:56:38.015517775 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2026-10-29 13:56:37.998399939 +0000 @@ -1,3 +1 @@ -tar: --acls can be used only on POSIX archives -Try 'tar --help' or 'tar --usage' for more information. +9. opcomp04.at:21: ok +46. numeric.at:18: testing --numeric-owner basic tests ... +./numeric.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -22. testsuite.at:248: testing compress: zstd ... -./testsuite.at:248: +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -cat /dev/null | zstd - > /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 -unset TAR_OPTIONS -touch empty -set -e -: create with --zstd -tar --zstd -cf k.tar.zst empty -tar tf k.tar.zst +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 testing .zst -tar -acf k2.tar.zst empty -cat k2.tar.zst | zstd -d > k.zst.tar -tar tf k.zst.tar -echo testing .tzst -tar -acf k2.tar.tzst empty -cat k2.tar.tzst | zstd -d > k.tzst.tar -tar tf k.tzst.tar +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}' -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.zst -test -f empty +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}' -25. positional03.at:21: testing Several options ... -./positional03.at:24: -test -z "`sort < /dev/null 2>&1`" || exit 77 +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 t -cd t -mkdir dir -> dir/A.a -> dir/B.a -> dir/A.b -tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort +) ---- - 2025-09-26 07:23:57.806986366 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2025-09-26 07:23:57.799730984 +0000 -@@ -1,4 +1 @@ --empty --testing .lzo --empty - -26. add-file.at:21: testing The --add-file option ... -./add-file.at:33: +47. same-order01.at:26: testing working -C with --same-order ... +./same-order01.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3215,83 +3499,90 @@ 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF +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 3: -tar -cvf arc.tar -T input +ls directory|sort ) -28. T-nest.at:21: testing nested file lists ... -./T-nest.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./indexfile.at:29: +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 * ->file1 ->file2 ->file3 ->file4 -cat >F1 <<'_ATEOF' -file1 --T F2 -file2 -_ATEOF -cat >F2 <<'_ATEOF' -file3 -file4 -_ATEOF +mkdir directory +genfile --file=directory/a --length=1035 -tar cf archive -T F1 -tar tf archive +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive ) -32. T-cd.at:21: testing -C in file lists ... -./T-cd.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 + +./T-dir01.at:30: +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 ->file1 mkdir dir ->dir/file2 ->dir/file3 -cat >F1 <<'_ATEOF' -file1 --C dir -. -_ATEOF - -tar cf archive -T F1 -tar tf archive | sort +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: testing toggle --recursion (not) from -T ... -./T-recurse.at:69: +11. opcomp06.at:21: 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 + +48. same-order02.at:25: testing multiple -C options ... +./same-order02.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3300,61 +3591,46 @@ 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 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 +mkdir en +mkdir to -tar cf archive -T F1 --recursion -T F2 -tar tf archive +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 ) ---- - 2025-09-26 07:23:57.808585919 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2025-09-26 07:23:57.799730984 +0000 -@@ -1,6 +1 @@ --empty --testing .zst --empty --testing .tzst --empty - -29. T-rec.at:21: testing recursive file lists ... -./T-rec.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./pipe.at:33: +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 * ->file1 ->file2 -cat >F1 <<'_ATEOF' -file1 --T F2 -_ATEOF -cat >F2 <<'_ATEOF' -file2 --T F1 -_ATEOF +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar cf archive -T F1 -echo $? -tar tf archive -) -34. T-null.at:21: testing 0-separated file without -0 ... -./T-null.at:24: + +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) +./verbose.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3363,23 +3639,42 @@ 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 +) +13. interval.at:16: ok + +21. testsuite.at:247: testing compress: lzop ... +./testsuite.at:247: -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat /dev/null | lzop - > /dev/null 2>&1 || exit 77 +unset TAR_OPTIONS -echo jeden > temp -echo dwa >> temp -echo trzy >> temp -cat temp | tr '\n' '\0' > file-list +touch empty +set -e +: create with --lzop +tar --lzop -cf k.tar.lzo empty +tar tf k.tar.lzo -genfile -f jeden -genfile -f dwa -genfile -f trzy -tar cfTv archive file-list -) -30. T-recurse.at:27: testing files-from & recurse: toggle ... -./T-recurse.at:30: +echo testing .lzo +tar -acf k2.tar.lzo empty +cat k2.tar.lzo | lzop -d > k.lzo.tar +tar tf k.lzo.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.lzo +test -f empty + +36. T-zfile.at:26: ok +31. T-recurse.at:66: testing toggle --recursion (not) from -T ... +./T-recurse.at:69: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3394,44 +3689,21 @@ 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" ) -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 - -35. T-null2.at:17: testing --null enables verbatim reading ... +42. gzip.at:23: ok + skipped (opcomp06.at:24) +27. T-mult.at:21: 35. T-null2.at:17: testing --null enables verbatim reading ... ./T-null2.at:24: mkdir ustar (cd ustar @@ -3456,20 +3728,32 @@ cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - ) -21. testsuite.at:247: 11. opcomp06.at:21: 5. options03.at:21: ok ---- - 2025-09-26 07:23:57.811148910 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2025-09-26 07:23:57.799730984 +0000 + ok +43. recurse.at:21: testing recurse ... +./recurse.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +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 +) + +--- - 2026-10-29 13:56:38.080705032 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2026-10-29 13:56:38.070399939 +0000 @@ -1,4 +1 @@ -empty --testing .lz +-testing .lzo -empty - -22. testsuite.at:248: skipped (opcomp06.at:24) - skipped (testsuite.at:247) -33. T-empty.at:26: testing empty entries ... -20. testsuite.at:246: 38. T-dir00.at:28: testing recursive extraction from --files-from ... -./T-dir00.at:30: +21. testsuite.at:247: 45. shortrec.at:25: testing short records ... +./shortrec.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3478,6 +3762,26 @@ 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 +) + + skipped (testsuite.at:247) +./T-dir00.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 @@ -3489,8 +3793,7 @@ echo dir > list tar xfTv archive list | sort ) -36. T-zfile.at:26: testing empty file ... -./T-zfile.at:29: +./indexfile.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3499,24 +3802,20 @@ export TAR_OPTIONS rm -rf * -genfile --length=0 --file empty -genfile --file a -genfile --file b -cat >valid <<'_ATEOF' -a -b -_ATEOF +mkdir directory +genfile --file=directory/a --length=1035 -tar cf archive -T empty -T valid -tar tf archive -echo "==" -tar cf archive -T valid -T empty -tar tf archive +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive ) -37. T-nonl.at:27: testing entries with missing newlines ... -./T-nonl.at:30: + +28. T-nest.at:21: testing nested file lists ... +./T-nest.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3525,26 +3824,26 @@ export TAR_OPTIONS rm -rf * -genfile --length=0 --file empty -printf c > 1.nonl -printf 'd\ne' > 2.nonl -touch a b c d e -cat >filelist <<'_ATEOF' -a -b +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +-T F2 +file2 _ATEOF +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF -tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist -tar tf archive -echo == -tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl +tar cf archive -T F1 tar tf archive ) - skipped (testsuite.at:248) - -40. indexfile.at:26: testing tar --index-file=FILE --file=- ... -./indexfile.at:29: +49. append.at:21: testing append ... +./append.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3552,40 +3851,45 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +12. defaults.at:16: ok -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 -) - skipped (testsuite.at:246) -39. T-dir01.at:28: testing trailing slash in --files-from ... -./T-dir01.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./add-file.at:33: +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 --file -File +genfile --file foo +genfile --file bar -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -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 -) +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 +) +33. T-empty.at:26: testing empty entries ... ./T-empty.at:36: mkdir ustar (cd ustar @@ -3602,12 +3906,68 @@ tar cfvT archive ../file-list ) +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 * +genfile --file file1 +genfile --file file2 -9. opcomp04.at:21: +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -41. verbose.at:26: testing tar cvf - ... -./verbose.at:29: +# 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: testing recursive file lists ... +./T-rec.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 +cat >F1 <<'_ATEOF' +file1 +-T F2 +_ATEOF + +cat >F2 <<'_ATEOF' +file2 +-T F1 +_ATEOF + +tar cf archive -T F1 +echo $? +tar tf archive +) +15. dot-compat.at:16: 25. positional03.at:21: 52. append03.at:21: testing append with name transformation ... +./append03.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3616,48 +3976,59 @@ 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 +) + ok +./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 ) - ok - -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 - -./pipe.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + ok +32. T-cd.at:21: testing -C in file lists ... +./T-cd.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 * test -z "`sort < /dev/null 2>&1`" || exit 77 +>file1 +mkdir dir +>dir/file2 +>dir/file3 +cat >F1 <<'_ATEOF' +file1 +-C dir +. +_ATEOF -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) -27. T-mult.at:21: +tar cf archive -T F1 +tar tf archive | sort +) 44. recurs02.at:30: testing recurse: toggle ... ./recurs02.at:33: mkdir v7 @@ -3679,47 +4050,8 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -43. recurse.at:21: testing recurse ... -./recurse.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -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 -) -25. positional03.at:21: ok - ok -12. defaults.at:16: - ok - -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 -) -47. same-order01.at:26: testing working -C with --same-order ... -./same-order01.at:29: +53. append04.at:29: testing append with verify ... +./append04.at:32: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3728,20 +4060,25 @@ export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - +# Create an archive: +tar cpfW archive.tar file1 file2 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +# Append it to the already created archive: +tar rpfW archive.tar file3 -ls directory|sort +# Verify content of the new archive: +tar -tf archive.tar ) -./add-file.at:33: +./recurse.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3750,29 +4087,12 @@ 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 +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -29. T-rec.at:21: 28. T-nest.at:21: ok -24. positional02.at:21: 50. append01.at:29: testing appending files with long names ... +50. append01.at:29: testing appending files with long names ... ./append01.at:34: mkdir oldgnu (cd oldgnu @@ -3788,55 +4108,71 @@ 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-recurse.at:69: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +34. T-null.at:21: testing 0-separated file without -0 ... +./T-null.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 * -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF +echo jeden > temp +echo dwa >> temp +echo trzy >> temp +cat temp | tr '\n' '\0' > file-list -tar cf archive -T F1 --recursion -T F2 -tar tf archive +genfile -f jeden +genfile -f dwa +genfile -f trzy +tar cfTv archive file-list ) - ok -./indexfile.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./pipe.at:33: +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 directory -genfile --file=directory/a --length=1035 +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) -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +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 gnu" +export TAR_OPTIONS +rm -rf * -echo "Testing the archive" -tar -tf archive +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar ) -49. append.at:21: testing append ... -./append.at:24: +54. append05.at:32: testing append after changed blocking ... +./append05.at:35: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3844,18 +4180,38 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -48. same-order02.at:25: testing multiple -C options ... + +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 +) +16. dot-int.at:16: 24. positional02.at:21: ok +35. T-null2.at:17: ok + + ok ./same-order02.at:28: -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 * @@ -3875,56 +4231,9 @@ echo separator ls to ) -46. numeric.at:18: testing --numeric-owner basic tests ... -./numeric.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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}' - -) - - ok -13. interval.at:16: ok -16. dot-int.at:16: ok -37. T-nonl.at:27: 15. dot-compat.at:16: ok - ok -52. append03.at:21: testing append with name transformation ... -./append03.at:26: +19. testsuite.at:244: ok +55. xform-h.at:30: testing transforming hard links on create ... +./xform-h.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3933,71 +4242,32 @@ 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 -) -./verbose.at:29: -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 -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -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 * -genfile --file file1 -genfile --file file2 +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' -# 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 "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 -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 "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 Comparing archives -cmp archive.1 archive.2 ) -32. T-cd.at:21: ok -14. dot.at:16: 33. T-empty.at:26: ok ./T-dir01.at:30: -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 * @@ -4012,7 +4282,8 @@ echo dir/ > list tar xfTv archive list | sort ) -./T-dir00.at:30: +14. dot.at:16: ok +./T-recurse.at:69: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4021,76 +4292,24 @@ export TAR_OPTIONS rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file -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 -) - ok -42. gzip.at:23: 34. T-null.at:21: 23. positional01.at:21: ok - ok - 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 +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -# Append it to the already created archive: -tar rpfW archive.tar file3 -# Verify content of the new archive: -tar -tf archive.tar -) +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF -./recurs02.at:33: -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 -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +tar cf archive -T F1 --recursion -T F2 tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ -35. T-null2.at:17: --no-recursion directory1 \ - --recursion directory2 || exit 1 -) - - - ok +) ./T-recurse.at:30: mkdir oldgnu (cd oldgnu @@ -4129,38 +4348,24 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) - -36. T-zfile.at:26: ok -17. testsuite.at:242: ./recurse.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) - - ok - -56. xform01.at:26: testing transformations and GNU volume labels ... -./xform01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --file file -tar -cf archive.tar -V /label/ file -tar tf archive.tar +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 ) ./shortrec.at:28: mkdir oldgnu @@ -4180,88 +4385,27 @@ rm -r directory ) -./append.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) - - -54. append05.at:32: testing append after changed blocking ... -./append05.at:35: -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 * -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' +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) -55. xform-h.at:30: testing transforming hard links on create ... -./xform-h.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 - - -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' - -) ./indexfile.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 * @@ -4276,7 +4420,27 @@ tar -tf archive ) -./T-recurse.at:69: +33. T-empty.at:26: ok +./append03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +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 +) +23. positional01.at:21: ok +./T-dir00.at:30: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4285,28 +4449,17 @@ 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 +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 ) - -18. testsuite.at:243: ok - - 59. exclude.at:23: testing exclude ... ./exclude.at:26: mkdir ustar @@ -4364,8 +4517,29 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) +./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 * -./add-file.at:33: + +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 +) +./recurse.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4374,14 +4548,72 @@ export TAR_OPTIONS rm -rf * -genfile --file -File -genfile --file foo -genfile --file bar +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File -./pipe.at:33: +./append.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +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 v7" +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/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 +) +./add-file.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4390,20 +4622,13 @@ export TAR_OPTIONS rm -rf * +genfile --file -File +genfile --file foo +genfile --file bar -test -z "`sort < /dev/null 2>&1`" || exit 77 - +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -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) echo 2: tar -cvf arc.tar foo --add-file -File bar @@ -4418,6 +4643,8 @@ echo 3: tar -cvf arc.tar -T input ) +56. xform01.at:26: + ok ./append01.at:34: mkdir ustar (cd ustar @@ -4433,31 +4660,18 @@ 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 ) -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 * +18. testsuite.at:243: ok -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 -) +32. T-cd.at:21: ok + + +29. T-rec.at:21: ok ./same-order02.at:28: -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 * @@ -4477,7 +4691,24 @@ echo separator ls to ) +./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 +) ./append02.at:57: mkdir oldgnu (cd oldgnu @@ -4510,8 +4741,24 @@ echo Comparing archives cmp archive.1 archive.2 ) -62. exclude03.at:19: testing exclude: wildcards match slash ... -./exclude03.at:22: +34. T-null.at:21: 28. T-nest.at:21: ok + ok +./recurse.at:24: +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 --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +66. exclude07.at:19: testing exclude: --exclude-backups option ... +./exclude07.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4520,61 +4767,23 @@ 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/\*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 - +tar -v -c -f archive --exclude-backups dir ) -./append03.at:26: + +./xform02.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT TAR_OPTIONS="-H oldgnu" -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 -) -61. exclude02.at:19: testing exclude: anchoring ... -./exclude02.at:22: +63. exclude04.at:19: testing exclude: case insensitive ... +./exclude04.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4588,41 +4797,49 @@ rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt +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="file1.txt" \ +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 --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +rm -rf testdir -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +) -rm -rf testdir file1.txt +export TAR_OPTIONS +rm -rf * +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -./verbose.at:29: +./T-recurse.at:69: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4631,14 +4848,26 @@ export TAR_OPTIONS rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive +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 + ) -60. exclude01.at:19: testing exclude wildcards ... -./exclude01.at:22: +62. exclude03.at:19: testing exclude: wildcards match slash ... +./exclude03.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4653,6 +4882,7 @@ 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 @@ -4660,27 +4890,26 @@ touch testdir/dir3/file3 touch testdir/dir3/\* -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=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 "testdir/dir1/*" -f archive | sort +tar t --wildcards 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort rm -rf testdir + ) 64. exclude05.at:21: testing exclude: lots of excludes ... ./exclude05.at:24: @@ -4718,6 +4947,26 @@ rm -rf testdir exclfile ) +./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 * + + +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 +) 65. exclude06.at:26: testing exclude: long files in pax archives ... ./exclude06.at:31: mkdir pax @@ -4738,78 +4987,75 @@ tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp find out -type f ) -./same-order01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./T-recurse.at:30: +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 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 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -ls directory|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" ) -63. exclude04.at:19: testing exclude: case insensitive ... -./exclude04.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./append05.at:35: +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 * +for f in a b c d e f g h i +do + echo $f > $f +done -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 +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 ) - -69. exclude10.at:38: testing --exclude-tag option in incremental pass ... +41. verbose.at:26: 69. exclude10.at:38: testing --exclude-tag option in incremental pass ... ./exclude10.at:41: mkdir gnu (cd gnu @@ -4834,31 +5080,40 @@ tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort ) -66. exclude07.at:19: testing exclude: --exclude-backups option ... -./exclude07.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + ok + +./pipe.at:33: +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 * -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 -) -67. exclude08.at:36: testing --exclude-tag option ... -./exclude08.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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) + + +68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... +./exclude09.at:40: +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 * @@ -4866,9 +5121,10 @@ 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 etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort ) -19. testsuite.at:244: ./recurse.at:24: + +./same-order01.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4877,51 +5133,99 @@ 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 directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 + +ls directory|sort +) +stderr: +./recurs02.at:33: +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 +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 ) - ok -./T-dir00.at:30: +./append.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS -70. exclude11.at:36: testing --exclude-tag-under option ... -./exclude11.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./append01.at:34: +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 * + +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 +) +./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 -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) +echo 2: +tar -cvf arc.tar foo --add-file -File bar -rm -rf * +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF -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 +echo 3: +tar -cvf arc.tar -T input ) -68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... -./exclude09.at:40: +./indexfile.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4931,12 +5235,16 @@ rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir directory +genfile --file=directory/a --length=1035 -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive ) -56. xform01.at:26: ./xform02.at:24: +./xform-h.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4945,67 +5253,108 @@ export TAR_OPTIONS rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name +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' + ) - ok -./recurs02.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./recurse.at:24: +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 directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 ) -71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... -./exclude12.at:40: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +61. exclude02.at:19: testing exclude: anchoring ... +./exclude02.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 * 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 + +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 + ) -./T-dir01.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +17. testsuite.at:242: 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 -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-under=excludeme -v etest | sort ) ./append04.at:32: mkdir oldgnu @@ -5034,26 +5383,7 @@ # Verify content of the new archive: tar -tf archive.tar ) -./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 -) -./T-recurse.at:30: +./xform02.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5062,54 +5392,29 @@ 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 - +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name +) -a=archive -./shortrec.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +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 -) -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" +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./T-recurse.at:69: +./T-dir00.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5118,40 +5423,37 @@ 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 +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 ) -./append.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./xform03.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 * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... -./exclude13.at:42: +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 +) +74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... +./exclude15.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5164,64 +5466,8 @@ 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 -) -./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 -) -./append01.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -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 * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -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 +tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort ) -stderr: - ./numeric.at:29: mkdir gnu (cd gnu @@ -5263,82 +5509,21 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./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' - -) -./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 -) -./append05.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... +./exclude12.at:40: +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 * -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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -decho 'resulting archive' -tar tf archive +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort ) ./exclude07.at:22: mkdir oldgnu @@ -5357,140 +5542,50 @@ tar -v -c -f archive --exclude-backups dir ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./add-file.at:33: +./T-recurse.at:69: 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 - - -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF - - -echo 3: -tar -cvf arc.tar -T input -) -./append02.at:57: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -./xform02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Comparing archives -cmp archive.1 archive.2 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./same-order01.at:29: -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 -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 +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -ls directory|sort -) -./xform03.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -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 gnu" -export TAR_OPTIONS -rm -rf * +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF -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 -) -export TAR_OPTIONS -rm -rf * +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 ) -./pipe.at:33: +./append03.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5499,58 +5594,29 @@ export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -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) -./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 - -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 +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 ) -./recurse.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 posix" +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 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) 75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... ./exclude16.at:41: @@ -5576,12 +5642,13 @@ cp snar-0 snar-1 tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort ) -./exclude08.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... +./exclude13.at:42: +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 * @@ -5589,64 +5656,68 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +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 ) -./exclude11.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./append02.at:57: +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 --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 -) -68. exclude09.at:37: ./T-dir00.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 +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 -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort +echo Comparing archives +cmp archive.1 archive.2 ) - ok -./indexfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +43. recurse.at:21: ok +./shortrec.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 * - mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > 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 -echo "Testing the archive" -tar -tf archive +rm -r directory ) -./append.at:24: +./xform02.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5654,32 +5725,66 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./append01.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name +) + +77. exclude18.at:30: testing --exclude-vcs extract list compare ... +./exclude18.at:33: +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 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 + +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 + ) ./recurs02.at:33: -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 * @@ -5694,16 +5799,7 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -./verbose.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -./xform02.at:24: +./append.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5711,19 +5807,12 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -./exclude03.at:22: +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 @@ -5732,42 +5821,13 @@ 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 - +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./T-recurse.at:69: +stderr: +./T-dir01.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5776,33 +5836,6 @@ 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 - -) -71. exclude12.at:37: ./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 * - test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -5814,22 +5847,20 @@ echo dir/ > list tar xfTv archive list | sort ) -./exclude07.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./append01.at:34: +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 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 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-recurse.at:30: mkdir posix @@ -5869,58 +5900,6 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) -./exclude14.at:39: -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 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -./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 -) -./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 - -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 -) - ok ./exclude01.at:22: mkdir oldgnu (cd oldgnu @@ -5965,57 +5944,88 @@ rm -rf testdir ) -65. exclude06.at:26: ok -69. exclude10.at:38: ok -./exclude04.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +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 oldgnu" +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) +./append05.at:35: +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 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 -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 tf archive -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort +decho 'adding g h i' +tar -vrf archive -b5 g h i -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +decho 'resulting archive' +tar tf archive +) -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +./exclude11.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -rm -rf testdir +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) +./exclude07.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -./xform02.at:24: +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 +) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./T-dir00.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6024,19 +6034,41 @@ export TAR_OPTIONS rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name + +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 ) -./xform-h.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./pipe.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS -./same-order01.at:29: +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) +./same-order02.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6045,42 +6077,50 @@ 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 directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +mkdir en +mkdir to -ls directory|sort +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 ) +./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 basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - +mkdir directory1 directory2 +touch directory1/file directory2/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' +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -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' +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF -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' +tar cf archive -T F1 --recursion -T F2 +tar tf archive ) -./recurse.at:24: +74. exclude15.at:36: ./append03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6089,11 +6129,34 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 +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 ) + ok +./xform03.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +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 +) ./add-file.at:33: mkdir gnu (cd gnu @@ -6124,83 +6187,6 @@ echo 3: tar -cvf arc.tar -T input ) -./append05.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 -) -./T-dir00.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 - -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 -) -./append04.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 -) ./append02.at:57: mkdir posix (cd posix @@ -6233,8 +6219,27 @@ echo Comparing archives cmp archive.1 archive.2 ) -74. exclude15.at:36: ok -./append.at:24: +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 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) +./xform02.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6242,37 +6247,53 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -./same-order02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name +) +./append.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 * touch file1 touch file2 tar cf archive file1 tar rf archive file2 tar tf archive) +./append04.at:32: +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 +# Create two empty files: +touch file1 file2 -mkdir en -mkdir to +# Create an archive: +tar cpfW archive.tar file1 file2 -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -ls en -echo separator -ls to +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar ) -./exclude02.at:22: +./exclude14.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6284,81 +6305,82 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +69. exclude10.at:38: 65. exclude06.at:26: ok + ok +40. indexfile.at:26: ok +./xform-h.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -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 +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -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' ) -50. append01.at:29: 76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... -./exclude17.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./recurs02.at:33: +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 * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +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 ) -./pipe.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +./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 * - -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) -41. verbose.at:26: ./exclude11.at:39: +(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 +) +68. exclude09.at:37: ok +./exclude17.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6367,21 +6389,17 @@ 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 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) - ok -40. indexfile.at:26: ok - ok ./exclude08.at:39: -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 * @@ -6391,52 +6409,54 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -stderr: - -72. exclude13.at:39: ok -./numeric.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude04.at:22: +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 * -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 - +test -z "`sort < /dev/null 2>&1`" || exit 77 -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}' +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 -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}' +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 -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 "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 -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}' +rm -rf testdir ) - ./exclude07.at:22: mkdir posix (cd posix @@ -6454,28 +6474,13 @@ tar -v -c -f archive --exclude-backups dir ) -57. xform02.at:21: ./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./exclude14.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +71. exclude12.at:37: ok +./same-order01.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix 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 -) -./same-order01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -6492,9 +6497,10 @@ ls directory|sort ) - ok -78. delete01.at:23: testing deleting a member after a big one ... -./delete01.at:26: + +50. append01.at:29: ok +81. delete04.at:23: testing deleting a large last member ... +./delete04.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6503,14 +6509,68 @@ 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) -./shortrec.at:28: +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 +) +52. append03.at:21: ok +./exclude11.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +./append05.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +) +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 +) +26. add-file.at:21: 80. delete03.at:21: testing deleting members with long names ... +./delete03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6518,8 +6578,19 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -77. exclude18.at:30: testing --exclude-vcs extract list compare ... -./exclude18.at:33: + + +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 +) +82. delete05.at:27: testing deleting non-existing member ... +./delete05.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6528,6 +6599,65 @@ 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 +) + ok +39. T-dir01.at:28: ok +./T-recurse.at:30: +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 + +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" + +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" +) + +./exclude18.at:33: +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 @@ -6562,44 +6692,7 @@ echo echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort - -) - -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 -) -49. append.at:21: ok -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 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) - -43. recurse.at:21: ok -38. T-dir00.at:28: ok -./xform03.at:24: +./exclude14.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6608,16 +6701,13 @@ 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 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -75. exclude16.at:38: ./exclude17.at:24: +./exclude03.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6626,13 +6716,64 @@ 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 + +) +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + +) +57. xform02.at:21: +38. T-dir00.at:28: 31. T-recurse.at:66: ok + ok +./exclude17.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 '*.o' >.cvsignore tar -cf - --exclude-vcs-ignores . | tar -tf - ) +2. pipe.at:29: ok ok -./append03.at:26: +./same-order02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6641,41 +6782,39 @@ export TAR_OPTIONS rm -rf * -genfile --file file.1 -genfile --file file.2 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -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 en +mkdir to +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -./recurs02.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +ls en +echo separator +ls to +) +./delete01.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 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 -) - -31. T-recurse.at:66: ok - -./append02.at:57: +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) +49. append.at:21: ./append02.at:57: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6707,7 +6846,7 @@ echo Comparing archives cmp archive.1 archive.2 ) -./T-dir01.at:30: +75. exclude16.at:38: ./same-order01.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6719,69 +6858,38 @@ 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 -) -./T-recurse.at:30: -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 - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF - - -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF - - -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" +ls directory|sort ) - -./exclude11.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./delete02.at:26: +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 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -26. add-file.at:21: ./same-order02.at:28: +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 +stderr: +./shortrec.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6790,24 +6898,17 @@ 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 +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 -ls en -echo separator -ls to +rm -r directory ) -80. delete03.at:21: testing deleting members with long names ... -./delete03.at:26: + +./recurs02.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6816,74 +6917,37 @@ 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 -) -81. delete04.at:23: testing deleting a large last member ... -./delete04.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 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 +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 ) -59. exclude.at:23: ok - - ok -./xform-h.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./exclude07.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 * -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' +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 ) -./exclude08.at:39: +./exclude14.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6896,65 +6960,7 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) -./exclude17.at:24: -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 -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) -./exclude03.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/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 - +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) 83. delete06.at:25: testing EOF detection ... ./delete06.at:28: @@ -6976,106 +6982,49 @@ dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null tar --delete 'b/' -f trunc.tar ) -./exclude07.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) -82. delete05.at:27: testing deleting non-existing member ... -./delete05.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./numeric.at:29: +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 * -genfile -l 1024 -f en -genfile -l 1024 -f to +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -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 -) -./append05.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -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 * +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -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 +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}' -tar tf archive -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive +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 'adding g h i' -tar -vrf archive -b5 g h i -decho 'resulting archive' -tar tf archive -) -2. pipe.at:29: ok -./exclude14.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +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}' -test -z "`sort < /dev/null 2>&1`" || exit 77 +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 ) - 84. extrac01.at:23: testing extract over an existing directory ... ./extrac01.at:26: mkdir v7 @@ -7091,95 +7040,53 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) -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) -./delete01.at:26: +./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 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) -87. extrac04.at:23: testing extract + fnmatch ... -./extrac04.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +./delete05.at:30: +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 en +genfile -l 1024 -f to -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 +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 ) - -./append04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" 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 +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 ) -45. shortrec.at:25: ok -88. extrac05.at:30: testing extracting selected members from pax ... -./exclude04.at:22: + +./delete01.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7188,45 +7095,62 @@ 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 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 rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt 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 \ +tar cf archive --exclude="file1.txt" \ testdir tar tf archive | sort echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort -rm -rf testdir +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 ) -./extrac05.at:38: +./xform03.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7235,73 +7159,70 @@ export TAR_OPTIONS rm -rf * -genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL || exit 77 -genfile --length 118 --file jeden -genfile --length 223 --file dwa -genfile --length 517 --file trzy -genfile --length 110 --file cztery - -tar cf archive jeden dwa trzy cztery || exit 1 - -mkdir dir -cd dir - -tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 - -cd .. +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 ) -52. append03.at:21: ok -./delete02.at:26: -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 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) -47. same-order01.at:26: stderr: - -./extrac01.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +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 oldgnu" +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 -) -44. recurs02.at:30: ok -./exclude17.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +chmod 777 directory +genfile --stat=mode:777 directory -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +# 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 ) - ok ./exclude01.at:22: mkdir ustar (cd ustar @@ -7346,7 +7267,8 @@ rm -rf testdir ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr + + 90. extrac07.at:27: testing extracting symlinks to a read-only dir ... ./extrac07.at:30: mkdir ustar @@ -7383,152 +7305,79 @@ mkdir out tar -C out -xvf archive ) -89. extrac06.at:34: testing mode of extracted directories ... -./extrac06.at:37: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./exclude17.at:24: +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 * - -# 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 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -51. append02.at:54: ok -./delete06.at:28: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -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 -) -./exclude02.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +88. extrac05.at:30: testing extracting selected members from pax ... +./extrac05.at:38: +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 * +genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL || exit 77 +genfile --length 118 --file jeden +genfile --length 223 --file dwa +genfile --length 517 --file trzy +genfile --length 110 --file cztery -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 +tar cf archive jeden dwa trzy cztery || exit 1 -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +mkdir dir +cd dir -rm -rf testdir file1.txt +tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 +cd .. ) -./extrac02.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +87. extrac04.at:23: testing extract + fnmatch ... +./extrac04.at:26: +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 * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -./delete05.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to +test -z "`sort < /dev/null 2>&1`" || exit 77 -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 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 ) +86. extrac03.at:23: testing extraction loops ... ./extrac03.at:26: -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 * @@ -7536,7 +7385,22 @@ tar -cPvf archive directory/../directory echo separator tar -xPvf archive --warning=no-timestamp) +./exclude08.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=excludeme -v etest | sort +) +59. exclude.at:23: ok 91. extrac08.at:33: testing restoring mode on existing directory ... ./extrac08.at:36: mkdir v7 @@ -7556,8 +7420,7 @@ tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ) -66. exclude07.at:19: ok -./xform03.at:24: +./exclude11.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7566,16 +7429,15 @@ 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 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -./exclude11.at:39: +72. exclude13.at:39: ok +95. extrac12.at:25: testing extract dot permissions ... +./extrac12.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7584,10 +7446,16 @@ 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 - -mkexcltest etest +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 +) 92. extrac09.at:34: testing extracting even when . and .. are unreadable ... ./extrac09.at:37: mkdir gnu @@ -7622,32 +7490,8 @@ cmp f extract/f || status=$? exit $status ) -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -30. T-recurse.at:27: ok -48. same-order02.at:25: - ok -./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 -) - -./exclude08.at:39: +30. T-recurse.at:27: 94. extrac11.at:25: testing scarce file descriptors ... +./extrac11.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7656,13 +7500,66 @@ export TAR_OPTIONS rm -rf * +exec $dir/$file || exit + files="$files $file" + done +done -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Check that "ulimit" itself works. Close file descriptors before +# invoking ulimit, to work around a bug (or a "feature") in some shells, +# where they squirrel away dups of file descriptors into FD 10 and up +# before closing the originals. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 100 && + tar -cf archive1.tar a && + tar -xf archive1.tar -C dest1 a + ) && + diff -r a dest1/a +) >/dev/null 2>&1 || + exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +# Another test that "ulimit" itself works: +# tar should fail when completely starved of file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 4 && + tar -cf archive2.tar a && + tar -xf archive2.tar -C dest2 a + ) && + diff -r a dest2/a +) >/dev/null 2>&1 && + exit 77 + +# Test if it is possible to limit the number of file descriptors to 10. +( ulimit -n 10 ) >/dev/null 2>&1 || exit 77 + +# Tar should work when there are few, but enough, file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 10 && + tar -cf archive3.tar a && + tar -xf archive3.tar -C dest3 a + ) && + diff -r a dest3/a >/dev/null 2>&1 +) || { diff -r a dest3/a; exit 1; } ) -./numeric.at:29: + ok +./extrac02.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7671,39 +7568,33 @@ 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}' +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +./delete06.at:28: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +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 ) -./exclude18.at:33: +./extrac01.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7712,42 +7603,10 @@ 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 - +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) 93. extrac10.at:29: testing -C and delayed setting of metadata ... ./extrac10.at:32: @@ -7768,64 +7627,55 @@ diff -r d x/d && diff e x/y/e ) -./extrac01.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude14.at:39: +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 directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) -./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 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -39. T-dir01.at:28: ./exclude17.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +./append04.at:32: +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 dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +# 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 ) - ok ./xform-h.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 * @@ -7849,91 +7699,27 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) - -94. extrac11.at:25: testing scarce file descriptors ... -./extrac11.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -exec $dir/$file || exit - files="$files $file" - done -done - -# Check that "ulimit" itself works. Close file descriptors before -# invoking ulimit, to work around a bug (or a "feature") in some shells, -# where they squirrel away dups of file descriptors into FD 10 and up -# before closing the originals. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 100 && - tar -cf archive1.tar a && - tar -xf archive1.tar -C dest1 a - ) && - diff -r a dest1/a -) >/dev/null 2>&1 || - exit 77 - -# Another test that "ulimit" itself works: -# tar should fail when completely starved of file descriptors. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 4 && - tar -cf archive2.tar a && - tar -xf archive2.tar -C dest2 a - ) && - diff -r a dest2/a -) >/dev/null 2>&1 && - exit 77 - -# Test if it is possible to limit the number of file descriptors to 10. -( ulimit -n 10 ) >/dev/null 2>&1 || exit 77 - -# Tar should work when there are few, but enough, file descriptors. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 10 && - tar -cf archive3.tar a && - tar -xf archive3.tar -C dest3 a - ) && - diff -r a dest3/a >/dev/null 2>&1 -) || { diff -r a dest3/a; exit 1; } -) -./exclude14.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./delete03.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 * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | 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 ) -./extrac02.at:28: +51. append02.at:54: ok +./exclude04.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7942,16 +7728,45 @@ 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 -) -83. delete06.at:25: ok -./extrac04.at:26: +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 + +) +66. exclude07.at:19: ./extrac03.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7960,23 +7775,11 @@ 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 -) -./delete05.at:30: +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +./exclude03.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7985,52 +7788,50 @@ 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 +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 + ) -88. extrac05.at:30: ok -./delete01.at:26: +48. same-order02.at:25: ok + ok +./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 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) - -./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 -) - ./append05.at:35: mkdir gnu (cd gnu @@ -8061,26 +7862,77 @@ decho 'resulting archive' tar tf archive ) -95. extrac12.at:25: testing extract dot permissions ... -./extrac12.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 +) +76. exclude17.at:21: 44. recurs02.at:30: ok + ok +./extrac08.at:36: +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 +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 +) +./delete04.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -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 +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 +) +./extrac02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +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 ) + 96. extrac13.at:26: testing extract over symlinks ... ./extrac13.at:29: mkdir gnu @@ -8114,149 +7966,40 @@ diff src/file1 dst3/file1 && diff src/file1 dst3/target1 ) -97. extrac14.at:25: testing extract -C symlink ... -./extrac14.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dest -ln -s dest symlink -echo foo >foo -tar -cf archive.tar foo && -tar -xf archive.tar -C symlink --warning=no-timestamp && -cmp foo dest/foo -) -./exclude03.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac04.at:26: +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 - -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 - -) - -./extrac03.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - +touch file1 mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) - +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 +) -./extrac01.at:26: +95. extrac12.at:25: 45. shortrec.at:25: 47. same-order01.at:26: ok +./delete01.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 -) -76. exclude17.at:21: 98. extrac15.at:25: testing extract parent mkdir failure ... -./extrac15.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -mkdir src src/a src/a/b dest dest/a -touch src/a/b/c -chmod a-w dest/a - -tar -cf archive.tar -C src a/b/c && -if tar -xf archive.tar -C dest a/b/c -then (exit 1) -else (exit 0) -fi -) - ok -70. exclude11.at:36: -100. extrac17.at:21: testing name matching/transformation ordering ... -./extrac17.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -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/ -) - ok -93. extrac10.at:29: ok ./delete02.at:26: mkdir ustar (cd ustar @@ -8276,88 +8019,100 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) -99. extrac16.at:26: testing extract empty directory with -C ... -./extrac16.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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) + ok +90. extrac07.at:27: 83. delete06.at:25: ok + ok + ok +./extrac03.at:26: +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 src src/a src/a/b dest -touch src/a/c - -tar -cf archive.tar -C src a && -tar -xf archive.tar -C dest -) -92. extrac09.at:34: ok -./exclude04.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +88. extrac05.at:30: ok +./exclude18.at:33: +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 +mkdir gitrepo +cd gitrepo -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 +# Make an empty VCS directory: +mkdir .svn -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort +# Make a VCS file: +touch .gitignore -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +# Make non-VCS files: +touch .git_B +touch _C -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -rm -rf testdir +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 ) -./extrac02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +97. extrac14.at:25: testing extract -C symlink ... +./extrac14.at:28: +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 * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive +mkdir dest +ln -s dest symlink +echo foo >foo +tar -cf archive.tar foo && +tar -xf archive.tar -C symlink --warning=no-timestamp && +cmp foo dest/foo ) -90. extrac07.at:27: -./delete05.at:30: + + + +./exclude08.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8366,39 +8121,11 @@ 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 -) -67. exclude08.at:36: 101. extrac18.at:34: testing keep-old-files ... -./extrac18.at:37: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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=$? +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat a +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) ./append04.at:32: mkdir gnu @@ -8427,8 +8154,21 @@ # Verify content of the new archive: tar -tf archive.tar ) - ok - ok + +./extrac01.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 +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) ./extrac06.at:37: mkdir oldgnu (cd oldgnu @@ -8466,51 +8206,43 @@ # After both restores, the directory mode should be 755 ) +93. extrac10.at:29: ok + stderr: -./extrac08.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +99. extrac16.at:26: testing extract empty directory with -C ... +./extrac16.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 * -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 +mkdir src src/a src/a/b dest +touch src/a/c + +tar -cf archive.tar -C src a && +tar -xf archive.tar -C dest ) -97. extrac14.at:25: ok -102. extrac19.at:21: testing skip-old-files ... -./extrac19.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./exclude11.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 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 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) -rm b -echo 'File a' > a -tar -x --skip-old-files -f ../archive -echo status=$? -cat a -) ./delete03.at:26: mkdir posix (cd posix @@ -8530,104 +8262,55 @@ tar --delete -f archive ./${prefix}5 && tar -tf archive ) -./delete01.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +98. extrac15.at:25: testing extract parent mkdir failure ... +./extrac15.at:28: +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 * -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) -./extrac03.at:26: + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +mkdir src src/a src/a/b dest dest/a +touch src/a/b/c +chmod a-w dest/a + +tar -cf archive.tar -C src a/b/c && +if tar -xf archive.tar -C dest a/b/c +then (exit 1) +else (exit 0) +fi +) +./delete05.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS - -103. extrac20.at:21: testing keep-directory-symlink ... -./extrac20.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -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 +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 ) -./extrac04.at:26: +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./extrac08.at:36: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8636,74 +8319,80 @@ 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 +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 ) -./exclude18.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +73. exclude14.at:36: ok +./extrac03.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 * +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +92. extrac09.at:34: ok -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 +./extrac02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -# Make non-VCS files: -touch .git_B -touch _C +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +102. extrac19.at:21: testing skip-old-files ... +./extrac19.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort +tar cf ../archive . -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort +rm b +echo 'File a' > a -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +tar -x --skip-old-files -f ../archive +echo status=$? +cat a ) +94. extrac11.at:25: ok + ./extrac01.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 * @@ -8712,37 +8401,9 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) -104. extrac21.at:31: testing delay-directory-restore ... -./extrac21.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 -mkdir a a/b a/c -genfile --file a/b/D -genfile --file a/c/A -cd a/b -ln -sf ../c/A -cd ../.. -chmod a-w a/b -tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A -mkdir out -tar -C out -v -x -f A.tar --delay-directory-restore -) -./extrac02.at:28: +./xform-h.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8751,54 +8412,78 @@ 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 +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' + ) -./delete04.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +106. extrac23.at:18: testing --no-overwrite-dir ... +./extrac23.at:32: +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 * -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 +# 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 ) +./delete01.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) -95. extrac12.at:25: ok -55. xform-h.at:30: ok -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -73. exclude14.at:36: - ok -99. extrac16.at:26: ok +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) +100. extrac17.at:21: testing name matching/transformation ordering ... ./extrac17.at:34: -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 * @@ -8811,7 +8496,8 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) -./xform03.at:24: +97. extrac14.at:25: ok +./exclude08.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8820,25 +8506,12 @@ 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 -) - -./exclude01.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) 105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... ./extrac22.at:29: mkdir v7 @@ -8887,100 +8560,53 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) +./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 -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 -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 +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 "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 +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}' -rm -rf testdir -) -46. numeric.at:18: ok -98. extrac15.at:25: - ok -106. extrac23.at:18: testing --no-overwrite-dir ... -./extrac23.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +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}' -# 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 -) -./extrac08.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +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}' -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 ) ./exclude02.at:22: -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 * @@ -9023,25 +8649,31 @@ rm -rf testdir file1.txt ) -./extrac03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +54. append05.at:32: ok +101. extrac18.at:34: testing keep-old-files ... ./extrac18.at:37: -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 * @@ -9060,52 +8692,53 @@ cat a ) -./extrac19.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +99. extrac16.at:26: 104. extrac21.at:31: testing delay-directory-restore ... +./extrac21.at:33: +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 dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . -rm b -echo 'File a' > a +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -tar -x --skip-old-files -f ../archive -echo status=$? -cat a +mkdir a a/b a/c +genfile --file a/b/D +genfile --file a/c/A +cd a/b +ln -sf ../c/A +cd ../.. +chmod a-w a/b +tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A +mkdir out +tar -C out -v -x -f A.tar --delay-directory-restore ) -./delete02.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./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 * -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) -107. extrac24.at:18: testing --to-stdout ... -./extrac24.at:29: +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... +./extrac25.at:21: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -9114,15 +8747,98 @@ 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 +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 ) +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 +103. extrac20.at:21: testing keep-directory-symlink ... +./extrac20.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 + + +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 +) 109. backup01.at:33: testing extracting existing dir with --backup ... ./backup01.at:36: mkdir v7 @@ -9139,7 +8855,26 @@ tar cf test.tar dir1 dir2 tar xfv test.tar --backup --warning=no-timestamp ) -84. extrac01.at:23: 110. difflink.at:17: testing link mismatch ... + +./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 +) +110. difflink.at:17: testing link mismatch ... ./difflink.at:19: mkdir ustar (cd ustar @@ -9158,42 +8893,31 @@ ln -s x a/z tar df a.tar ) -111. label01.at:21: testing single-volume label ... -./label01.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 foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive -) -108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... -./extrac25.at:21: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./delete04.at:26: +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 * -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 +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 ) -54. append05.at:32: ok - ok -96. extrac13.at:26: ./extrac17.at:34: +./extrac06.at:37: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -9202,17 +8926,57 @@ 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 +# Force umask +umask 022 -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +# 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 ) +./delete02.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -./delete05.at:30: +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 +111. label01.at:21: testing single-volume label ... +./label01.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9221,17 +8985,12 @@ 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 +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar tar tf archive ) - ok -94. extrac11.at:25: ok + 112. label02.at:21: testing multi-volume label ... ./label02.at:24: mkdir gnu @@ -9249,51 +9008,55 @@ 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 ) -114. label04.at:27: testing label with non-create option ... -./label04.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) -./exclude03.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./exclude18.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 +mkdir gitrepo +cd gitrepo -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 +# Make an empty VCS directory: +mkdir .svn -touch testdir/dir3/\* +# 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 + +) +98. extrac15.at:25: ok -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ 113. label03.at:27: testing test-label option ... ./label03.at:30: mkdir gnu @@ -9327,100 +9090,159 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort +114. label04.at:27: testing label with non-create option ... +./label04.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort +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 +) +./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 "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +./extrac17.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -rm -rf testdir +tar cf dir.tar dir +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) +80. delete03.at:21: ok -./delete01.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac25.at:21: +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 -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) -./extrac06.at:37: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 +) +./extrac22.at:29: +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 * -# Force umask -umask 022 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Archive it -tar cf arc directory +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) -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF -# ... 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 +tar -C t -c -f a.tar --no-recursion -T filelist -# After both restores, the directory mode should be 755 +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 ) -115. label05.at:24: testing label with non-create option ... -./label05.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./label02.at:24: +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 * 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 +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 ) -85. extrac02.at:23: ok -86. extrac03.at:23: 116. incremental.at:23: testing incremental ... +./extrac24.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +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 +) + +110. difflink.at:17: ok +116. incremental.at:23: testing incremental ... ./incremental.at:26: mkdir gnu (cd gnu @@ -9459,97 +9281,26 @@ echo y >structure/file tar cfv archive --listed=list structure ) - ok -./extrac19.at:24: -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 -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -./extrac18.at:37: -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 -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 -) -tar -x --skip-old-files -f ../archive -echo status=$? - -cat a -) -./extrac04.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 - -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 -) -./extrac24.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +115. label05.at:24: testing label with non-create option ... +./label05.at:27: +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 +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 ) - +104. extrac21.at:31: ok 117. incr01.at:27: testing restore broken symlinks from incremental ... ./incr01.at:30: mkdir gnu @@ -9575,7 +9326,8 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) -./backup01.at:36: + +./label04.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9584,139 +9336,14 @@ 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 -) -./extrac17.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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/ -) -stderr: -104. extrac21.at:31: ok - -./extrac08.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -./delete02.at:26: -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 -) - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -./delete04.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 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 -) -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -./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 - +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 ) ./label01.at:24: mkdir oldgnu @@ -9732,73 +9359,6 @@ tar -cf archive --label=Test foo bar tar tf archive ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./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 - -) - -80. delete03.at:21: ok - -./extrac25.at:21: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -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 -) 118. incr02.at:32: testing restoring timestamps from incremental ... ./incr02.at:35: mkdir gnu @@ -9847,54 +9407,8 @@ genfile --stat=mtime dir/subdir1 | diff ts - ) -./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 -) -78. delete01.at:23: 58. xform03.at:21: ./extrac23.at:32: +./label05.at:27: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9903,26 +9417,15 @@ 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 +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 ) - ok 119. listed01.at:26: testing --listed for individual files ... ./listed01.at:29: mkdir gnu @@ -9960,24 +9463,6 @@ tar tf archive.2 || exit 1 ) -./label04.at:30: -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 --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 -) 120. listed02.at:28: testing working --listed ... ./listed02.at:31: mkdir gnu @@ -10048,7 +9533,44 @@ echo Final files: find tart -print | sort 2>/dev/null ) -./label02.at:24: +121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... +./listed03.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +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 `uname` = "Linux" || exit 77 + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +genfile --file dir/sub/a/file +cd dir/sub + +chmod a-r .. +tar -c -f archive.tar --listed-incremental=db.1 -v a 2>err +status=$? +chmod a+r .. +if test $status -eq 2; then + grep '^tar: \.: Cannot getcwd' err >/dev/null 2>&1 && exit 77 +fi +cat err >&2 +exit $status +) +./label03.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10058,13 +9580,48 @@ 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 +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 $? ) -./label05.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 +) +96. extrac13.at:26: ok +./extrac23.at:32: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10073,6 +9630,81 @@ 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 +) +./exclude04.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/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 + +) +./label05.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + exec <&- genfile --file file decho "# Create volume" @@ -10082,7 +9714,31 @@ decho "# Update: right label" tar -rf archive file ) -./extrac24.at:29: +./extrac18.at:37: +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 -k -f ../archive +echo status=$? + +cat a +) +./backup01.at:36: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -10091,18 +9747,71 @@ 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 +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) -82. delete05.at:27: ok -110. difflink.at:17: ok +./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 + +) +82. delete05.at:27: ./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) ok -122. listed04.at:26: testing --listed-incremental and --one-file-system ... -./listed04.at:29: +./extrac02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10111,15 +9820,70 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +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 posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +umask 000 mkdir dir -echo a >dir/a -echo b >dir/b +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 +) +./label01.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -tar --one-file-system -cvf archive.tar -g archive.incr dir || exit -tar -tf archive.tar || exit +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive ) -./backup01.at:36: +./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 +) +./extrac25.at:21: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -10128,14 +9892,31 @@ 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 +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 ) -121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... -./listed03.at:27: +./extrac24.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +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 +) +./extrac01.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10144,32 +9925,71 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +78. delete01.at:23: ok +./extrac17.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -test `uname` = "Linux" || exit 77 +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -mkdir dir -mkdir dir/sub -mkdir dir/sub/a -genfile --file dir/sub/a/file -cd dir/sub +tar cf dir.tar dir -chmod a-r .. -tar -c -f archive.tar --listed-incremental=db.1 -v a 2>err -status=$? -chmod a+r .. -if test $status -eq 2; then - grep '^tar: \.: Cannot getcwd' err >/dev/null 2>&1 && exit 77 -fi -cat err >&2 -exit $status +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) +./label02.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +) +./extrac04.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 + +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 ) ./extrac06.at:37: mkdir posix @@ -10208,33 +10028,26 @@ # After both restores, the directory mode should be 755 ) -53. append04.at:29: ok - -./extrac19.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +67. exclude08.at:36: 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 posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +ckmtime || exit 77 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=$? +echo a >dir/a +echo b >dir/b -cat a +tar --one-file-system -cvf archive.tar -g archive.incr dir || exit +tar -tf archive.tar || exit ) -./extrac18.at:37: + ok +./label04.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10243,23 +10056,41 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . +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 +) -rm b -echo 'File a' > a -tar -x -k -f ../archive -echo status=$? +./delete04.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -cat a +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 ) -91. extrac08.at:33: ok -./exclude02.at:22: +./exclude18.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10271,76 +10102,105 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir gitrepo +cd gitrepo -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 +# Make an empty VCS directory: +mkdir .svn -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +# Make a VCS file: +touch .gitignore -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +# Make non-VCS files: +touch .git_B +touch _C -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort -rm -rf testdir file1.txt +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) -./label01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./delete02.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 * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 tar tf archive -) -62. exclude03.at:19: ok - - -./extrac17.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +./extrac22.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 dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 -tar cf dir.tar dir +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ + +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 ) 123. listed05.at:33: testing --listed-incremental and remounted directories ... ./listed05.at:36: @@ -10385,9 +10245,8 @@ umount tartest/subdir ) - - -./exclude01.at:22: +124. incr03.at:28: testing renamed files in incrementals ... +./incr03.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10396,6 +10255,47 @@ 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 +) + +./exclude01.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 @@ -10431,8 +10331,33 @@ rm -rf testdir ) +121. listed03.at:24: ok +122. listed04.at:26: ok +./incr01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -./label04.at:30: +ckmtime || exit 77 + +mkdir directory +$as_ln_s foo directory/bar + +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 +) +./backup01.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10441,16 +10366,66 @@ 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 +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +55. xform-h.at:30: 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 gnu" +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 +) + ok +111. label01.at:21: ok +46. numeric.at:18: ok +./extrac19.at:24: +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 +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 ) -79. delete02.at:23: ./label02.at:24: +./extrac17.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10459,15 +10434,19 @@ 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 +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/ ) - ok -./extrac04.at:26: +84. extrac01.at:23: ok +53. append04.at:29: ok +86. extrac03.at:23: ok +./extrac08.at:36: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10476,67 +10455,202 @@ 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 +) +115. label05.at:24: 112. label02.at:21: --- - 2026-10-29 13:56:40.337382875 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2026-10-29 13:56:40.330399939 +0000 +@@ -1,4 +1 @@ +-tar: .: Directory is new +-tar: ./subdir: Directory is new +-tar: ./subdir: directory is on a different filesystem; not dumped + + ok +114. label04.at:27: ./extrac24.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 dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +./extrac18.at:37: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -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 +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 ) -./incr01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +85. extrac02.at:23: ok + ok +--- - 2026-10-29 13:56:40.384811097 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2026-10-29 13:56:40.374399939 +0000 +@@ -1,10 +1 @@ +-# Level 0 +-./ +-./subdir/ +-./top-level-file +-./subdir/subdir-file +-# Remount +-# Level 1 +-./ +-./subdir/ + + ok + +stderr: +123. listed05.at:33: ./extrac25.at:21: +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 * -ckmtime || exit 77 +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 +) +./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 +tar xfv test.tar --backup --warning=no-timestamp +) +./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 +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory mkdir directory -$as_ln_s foo directory/bar +chmod 777 directory +genfile --stat=mode:777 directory -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory +# Archive it +tar cf arc directory -mv directory orig +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory -tar xvfg archive.0 /dev/null --warning=no-timestamp -echo separator -tar xvfg archive.1 /dev/null --warning=no-timestamp +# ... 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 ) +79. delete02.at:23: ok +./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 + +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 -./label05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +rm -rf testdir file1.txt -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 ) -./backup01.at:36: + +./label03.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10545,21 +10659,6 @@ 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 -) -./label03.at:30: -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 tar -c --label='iamalabel' --file iamanarchive file @@ -10583,129 +10682,108 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) -./delete04.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 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 -) -111. label01.at:21: 124. incr03.at:28: testing renamed files in incrementals ... -./incr03.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + skipped (listed05.at:36) +./extrac22.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 * -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --file=directory/x -genfile --file=directory/y +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -sleep 1 -tar -cf archive.1 -g db directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory +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) -mv directory orig +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF -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 +tar -C t -c -f a.tar --no-recursion -T filelist -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | 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 ) -125. incr04.at:29: testing proper icontents initialization ... -./incr04.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./extrac23.at:32: +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 * -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 - +# 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 -sleep 1 +# 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 -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 ) -127. incr06.at:21: testing incremental dumps of nested directories ... -./incr06.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac19.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 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 --skip-old-files -f ../archive +echo status=$? + +cat a ) - ok 126. incr05.at:21: testing incremental dumps with -C ... ./incr05.at:24: mkdir gnu @@ -10729,41 +10807,8 @@ echo Level 1 tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) -./extrac25.at:21: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 -) -./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 -) -129. incr08.at:38: testing filename normalization ... -./incr08.at:41: +./extrac04.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10772,27 +10817,23 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir tartest -cd tartest -mkdir foo -mkdir foo/subdir -mkdir foo/subdir/dir1 -mkdir subdir -mkdir subdir/dir2 -decho A -find .|sort - -decho B -DIR=`pwd` -tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR +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 ) -122. listed04.at:26: ok - -./exclude18.at:33: +./extrac17.at:34: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10801,45 +10842,54 @@ export TAR_OPTIONS rm -rf * +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn +tar cf dir.tar dir -# Make a VCS directory with a file: -mkdir .git -touch .git/_A +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ +) -# Make a VCS file: -touch .gitignore -# Make non-VCS files: -touch .git_B -touch _C +77. exclude18.at:30: ok -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo +127. incr06.at:21: testing incremental dumps of nested directories ... +./incr06.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort +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 -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort +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 . -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +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 . ) -130. incr09.at:26: testing incremental with alternating -C ... -./incr09.at:29: +109. backup01.at:33: ok +129. incr08.at:38: testing filename normalization ... +./incr08.at:41: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10852,18 +10902,22 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo bar middle -echo foo/foo_file > foo/foo_file -echo bar/bar_file > bar/bar_file -echo middle/file > middle/middle_file +mkdir tartest +cd tartest +mkdir foo +mkdir foo/subdir +mkdir foo/subdir/dir1 +mkdir subdir +mkdir subdir/dir2 decho A -tar -cvf foo.tar --incremental -C foo . -C `pwd` middle -C bar . +find .|sort -rm foo.tar ->toplevel_file decho B -tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . +DIR=`pwd` +tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR ) +58. xform03.at:21: 81. delete04.at:23: ok + ok 128. incr07.at:18: testing incremental restores with -C ... ./incr07.at:40: mkdir gnu @@ -10911,13 +10965,30 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) ---- - 2025-09-26 07:23:58.312532932 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2025-09-26 07:23:58.303734767 +0000 -@@ -1,4 +1 @@ --tar: .: Directory is new --tar: ./subdir: Directory is new --tar: ./subdir: directory is on a different filesystem; not dumped - +./incr01.at:30: +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 directory +$as_ln_s foo directory/bar + +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 +) ./extrac19.at:24: mkdir gnu (cd gnu @@ -10942,8 +11013,8 @@ cat a ) - -./extrac06.at:37: +91. extrac08.at:33: ok +./exclude03.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10953,35 +11024,41 @@ 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/\*f\*1 +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*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort -# After both restores, the directory mode should be 755 -) +rm -rf testdir -./extrac18.at:37: +) +./exclude04.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10990,40 +11067,46 @@ 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/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 -cat a -) ---- - 2025-09-26 07:23:58.315624538 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2025-09-26 07:23:58.307734797 +0000 -@@ -1,10 +1 @@ --# Level 0 --./ --./subdir/ --./top-level-file --./subdir/subdir-file --# Remount --# Level 1 --./ --./subdir/ - -123. listed05.at:33: 100. extrac17.at:21: ok - skipped (listed05.at:36) +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort -63. exclude04.at:19: ok -131. incr10.at:18: testing concatenated incremental archives (deletes) ... -./incr10.at:28: +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 + +) +89. extrac06.at:34: ok +./extrac25.at:21: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11032,23 +11115,15 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -mkdir in -mkdir in/dir -decho Level 0 -tar -cvf 1.tar -g snap -C in . -rmdir in/dir -decho Level 1 -tar -cvf 2.tar -g snap -C in . -cp 1.tar full.tar -decho Concat -tar -A 2.tar -f full.tar -g /dev/null -decho Extract -mkdir out -tar -xvf full.tar -g /dev/null -C out +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 ) -132. incr11.at:25: testing concatenated incremental archives (renames) ... -./incr11.at:28: +./extrac24.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11057,59 +11132,65 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) -test -z "`sort < /dev/null 2>&1`" || exit 77 +./extrac18.at:37: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -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 +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 ) -./extrac23.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + +./incr05.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 * -# Test if the directory permissions are restored properly. +ckmtime || exit 77 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 +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -# 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 +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 . ) -114. label04.at:27: 115. label05.at:24: ok - ok -112. label02.at:21: 121. listed03.at:24: ok - ok -./backup01.at:36: +130. incr09.at:26: testing incremental with alternating -C ... +./incr09.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11118,15 +11199,23 @@ 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 -) +ckmtime || exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 -./extrac24.at:29: +mkdir foo bar middle +echo foo/foo_file > foo/foo_file +echo bar/bar_file > bar/bar_file +echo middle/file > middle/middle_file +decho A +tar -cvf foo.tar --incremental -C foo . -C `pwd` middle -C bar . + +rm foo.tar +>toplevel_file +decho B +tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . +) +./exclude01.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11135,36 +11224,143 @@ 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 + +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 ) -./incr01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + + +./extrac20.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 * -ckmtime || exit 77 -mkdir directory -$as_ln_s foo directory/bar +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory -mv directory orig +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 -tar xvfg archive.0 /dev/null --warning=no-timestamp -echo separator -tar xvfg archive.1 /dev/null --warning=no-timestamp +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 +) +100. extrac17.at:21: ok + + +131. incr10.at:18: testing concatenated incremental archives (deletes) ... +./incr10.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 in +mkdir in/dir +decho Level 0 +tar -cvf 1.tar -g snap -C in . +rmdir in/dir +decho Level 1 +tar -cvf 2.tar -g snap -C in . +cp 1.tar full.tar +decho Concat +tar -A 2.tar -f full.tar -g /dev/null +decho Extract +mkdir out +tar -xvf full.tar -g /dev/null -C out ) 134. filerem02.at:26: testing toplevel file removed ... ./filerem02.at:29: @@ -11187,8 +11383,8 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -133. filerem01.at:36: testing file removed as we read it ... -./filerem01.at:39: +132. incr11.at:25: testing concatenated incremental archives (renames) ... +./incr11.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11197,45 +11393,54 @@ export TAR_OPTIONS rm -rf * -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 +ckmtime || exit 77 -genfile --run --checkpoint=3 --unlink dir/file1 -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v dir >/dev/null -) +test -z "`sort < /dev/null 2>&1`" || exit 77 -./incr05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +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 +) +102. extrac19.at:21: 133. filerem01.at:36: testing file removed as we read it ... +./filerem01.at:39: +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 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 . - -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null ) -102. extrac19.at:21: + ok +113. label03.at:27: ok + ./extrac22.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 * @@ -11277,8 +11482,7 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) - ok -87. extrac04.at:23: 135. dirrem01.at:38: testing directory removed before reading ... +135. dirrem01.at:38: testing directory removed before reading ... ./dirrem01.at:41: mkdir gnu (cd gnu @@ -11305,54 +11509,10 @@ --warning=no-file-changed \ -v dir >/dev/null ) +87. extrac04.at:23: ok -136. dirrem02.at:31: testing explicitly named directory removed before reading ... -./dirrem02.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 -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 -) -./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 - -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar -) - -138. rename02.at:24: testing move between hierarchies ... -./rename02.at:27: +139. rename03.at:23: testing cyclic renames ... +./rename03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11364,29 +11524,41 @@ 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 +mkdir foo/a +genfile --file foo/a/filea -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +mkdir foo/b +genfile --file foo/b/fileb -mv foo/bar/baz foo +mkdir foo/c +genfile --file foo/c/filec -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +sleep 1 -mv foo old +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +# 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" @@ -11396,8 +11568,7 @@ find foo | sort echo End directory listing 2 ) - -./label03.at:30: +./extrac23.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11406,28 +11577,24 @@ 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 $? +# 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 ) 137. rename01.at:24: testing renamed dirs in incrementals ... ./rename01.at:27: @@ -11470,87 +11637,36 @@ find foo | sort echo End directory listing 2 ) - - - -./incr06.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +136. dirrem02.at:31: testing explicitly named directory removed before reading ... +./dirrem02.at:34: +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 - -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 +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -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 . +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 ) -107. extrac24.at:18: ok -109. backup01.at:33: ok -81. delete04.at:23: 130. incr09.at:26: ok - ok -stderr: -101. extrac18.at:34: ok -61. exclude02.at:19: 89. extrac06.at:34: 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 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort -) -139. rename03.at:23: testing cyclic renames ... -./rename03.at:26: +138. rename02.at:24: testing move between hierarchies ... +./rename02.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11562,41 +11678,29 @@ 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 -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb +sleep 1 -mkdir foo/c -genfile --file foo/c/filec +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -sleep 1 +mv foo/bar/baz foo -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +mv foo old -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr +tar xfg arch.1 /dev/null --warning=no-timestamp 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" @@ -11606,102 +11710,56 @@ find foo | sort echo End directory listing 2 ) - ok - 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: -stdout: -77. exclude18.at:30: 60. exclude01.at:19: ok - ok -stderr: - -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 - -./filerem01.at:39: -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 - -genfile --run --checkpoint=3 --unlink dir/file1 -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v dir >/dev/null -) -141. rename05.at:24: testing renamed subdirectories ... -./rename05.at:27: +./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 -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -mv dir orig +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | 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 -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort ) -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 + 142. rename06.at:19: testing chained renames ... ./rename06.at:29: mkdir gnu @@ -11743,9 +11801,8 @@ decho Resulting directory find test1 | sort ) -stdout: -143. chtype.at:27: testing changed file types in incrementals ... -./chtype.at:30: +140. rename04.at:27: testing renamed directory containing subdirectories ... +./rename04.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11758,112 +11815,73 @@ 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 +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -sleep 2 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -# 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 +decho Renaming +mv directory dir -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -# Delete a -rm -r directory +mv dir orig -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 +decho First restore +tar -xf archive.1 -g db.1 find directory | sort -) -stdout: - -./dirrem01.at:41: -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 - -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 +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort ) -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr -131. incr10.at:18: ok -stdout: -./incr07.at:40: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +141. rename05.at:24: testing renamed subdirectories ... +./rename05.at:27: +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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -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 +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -mkdir ext -rm -rf dirA +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -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 Renaming +mv directory/subdir directory/subdir.0 +mv directory dir -decho E2 -tar -g test.snar -vxf test.2.tar -C ext/ +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -mkdir ext/dirA/dirB -touch ext/dirA/dirB/file +mv dir orig -decho E3 -tar -g test.snar -vxf test.2.tar -C ext/ +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort -echo FIN -test -d dirA && echo >&2 "toplevel dirA exists" -exit 0 +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort ) +107. extrac24.at:18: ok + 144. ignfail.at:23: testing ignfail ... ./ignfail.at:26: mkdir v7 @@ -11916,7 +11934,38 @@ chmod 700 directory test $status = 0 ) -./extrac25.at:21: +./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 + +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 . +) +./extrac18.at:37: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11924,7 +11973,64 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -./dirrem02.at:34: + +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 +) +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' +) +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 +) +./incr05.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11933,31 +12039,24 @@ 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 +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -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 +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) - -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 +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 +stdout: ./filerem02.at:29: mkdir posix (cd posix @@ -11978,18 +12077,52 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -) -./incr05.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 * -145. link01.at:33: testing link count gt 2 ... -./link01.at:36: +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 +) +117. incr01.at:27: ok +stderr: +108. extrac25.at:18: ok +147. link03.at:24: testing working -l with --remove-files ... +./link03.at:34: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -11998,45 +12131,104 @@ 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 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -tar cf archive directory/test1/test.txt directory/test1/test.txt +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -rm -r directory -tar xf archive --warning=no-timestamp +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -ls directory/test1 +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' ) - -117. incr01.at:27: rm -rf * +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 +130. incr09.at:26: ok +stdout: +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/ +./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 dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 +mkdir dirA +echo 'a' > dirA/a +echo 'a' > dirA/b -echo Level 0 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +decho C0 +tar -g test.snar -vcf test.0.tar dirA -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -) - ok +echo 'a' > dirA/c +decho C1 +tar -g test.snar -vcf test.1.tar dirA -129. incr08.at:38: ok +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/ -stdout: -./extrac22.at:29: +echo FIN +test -d dirA && echo >&2 "toplevel dirA exists" +exit 0 +) +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "s|$DIR|ABSPATH|" stdout + + + +./filerem01.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12045,46 +12237,47 @@ export TAR_OPTIONS rm -rf * +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -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 --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null +) +stdout: +62. exclude03.at:19: ok +./dirrem01.at:41: +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 -tar -C t -c -f a.tar --no-recursion -T filelist +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -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 +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 ) -133. filerem01.at:36: - ok + +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr 148. link04.at:29: testing link count is 1 but multiple occurrences ... ./link04.at:32: mkdir v7 @@ -12117,30 +12310,94 @@ s,symlink,FOO,g ' | sort ) -149. longv7.at:24: testing long names in V7 archives ... -./longv7.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +131. incr10.at:18: ok +63. exclude04.at:19: ok +150. long01.at:28: testing long file names divisible by block size ... +./long01.at:36: +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 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 +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) +101. extrac18.at:34: ok +./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 +) +stdout: +./dirrem02.at:34: +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 + +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 +) +151. lustar01.at:21: testing ustar: unsplittable file name ... +./lustar01.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=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 || 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_between_name_and_prefix ) -146. link02.at:32: testing preserve hard links with --remove-files ... ./link02.at:35: -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 * @@ -12151,8 +12408,8 @@ tar -c -f archive --remove-files file1 file2 file3 file4 tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) -147. link03.at:24: testing working -l with --remove-files ... -./link03.at:34: +149. longv7.at:24: testing long names in V7 archives ... +./longv7.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -12161,34 +12418,21 @@ 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 -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' +tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +echo separator +tar tf archive ) -stdout: -136. dirrem02.at:31: ok - +105. extrac22.at:19: ok +stderr: ./extrac23.at:32: -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 * @@ -12211,70 +12455,52 @@ chmod 700 dir find dir ) -151. lustar01.at:21: testing ustar: unsplittable file name ... -./lustar01.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +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: +129. incr08.at:38: ok -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_between_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_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 * +60. exclude01.at:19: + ok +134. filerem02.at:26: ok -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) -150. long01.at:28: testing long file names divisible by block size ... -./long01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +stdout: +151. lustar01.at:21: ok +./incr06.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 +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 -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: testing ustar: unsplittable path name ... -./lustar02.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +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 -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 +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 . ) -132. incr11.at:25: ok -113. label03.at:27: - ok -stdout: -./extrac20.at:24: + +./rename06.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12286,74 +12512,51 @@ 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 -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 First dump +tar -c -g 0.snar -C test -f backup0.tar . -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 Altering directory structure +genfile --file test/d2/file3 +mv test/d1 test/d3 +mv test/d2 test/d1 -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . -# 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 -} +mkdir test1 -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 +decho First extract +tar -C test1 -x -g /dev/null -f backup0.tar - # 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 Second extract +tar -C test1 -x -g /dev/null -f backup1.tar - 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 Resulting directory +find test1 | sort ) -154. old.at:23: testing old archives ... -./old.at:27: -mkdir directory -tar cfvo archive directory || exit 1 -tar tf archive +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 * -135. dirrem01.at:38: ok +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) +126. incr05.at:21: 133. filerem01.at:36: ok ./rename01.at:27: mkdir oldgnu (cd oldgnu @@ -12394,8 +12597,56 @@ find foo | sort echo End directory listing 2 ) -108. extrac25.at:18: ok -stderr: + + ok +152. lustar02.at:21: testing ustar: unsplittable path name ... +./lustar02.at:32: +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/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 +) +149. longv7.at:24: ok +./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 + +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: testing old archives ... +./old.at:27: +mkdir directory +tar cfvo archive directory || exit 1 +tar tf archive 155. time01.at:20: testing time: tricky time stamps ... ./time01.at:23: @@ -12449,68 +12700,7 @@ tar -c -f archive.tar dir tar -d -f archive.tar dir ) -156. time02.at:20: testing time: clamping mtime ... -./time02.at:23: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -export TZ=UTC0 -mkdir dir - -touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || exit 77 -touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || exit 77 -touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || exit 77 -touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || exit 77 - -tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir -tar -d -f archive.tar dir|sort -) -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: - -151. lustar01.at:21: ok -./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 . -) -./link01.at:36: +./ignfail.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12519,102 +12709,51 @@ 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 -) -126. incr05.at:21: ok -149. longv7.at:24: ok -./link02.at:35: -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. -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' -) -157. multiv01.at:23: testing multivolume dumps from pipes ... -./multiv01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -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 +touch file +mkdir directory +touch directory/file -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || 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 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || 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 directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) -154. old.at:23: 134. filerem02.at:26: ok - 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 <&- +132. incr11.at:25: ok -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 -) +stdout: ./rename04.at:30: mkdir oldgnu (cd oldgnu @@ -12653,48 +12792,9 @@ tar -xf archive.2 -g db.2 find dir | sort ) +61. exclude02.at:19: ok -159. multiv03.at:30: testing MV archive & long filenames ... -./multiv03.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 <&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 +export TZ=UTC0 +mkdir dir -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar +touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || exit 77 +touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || exit 77 +touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || exit 77 +touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || exit 77 -decho Resulting directory -find test1 | sort +tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir +tar -d -f archive.tar dir|sort ) -160. multiv04.at:36: testing split directory members in a MV archive ... -./multiv04.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 +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 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 - -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' +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) +136. dirrem02.at:31: ok -153. lustar03.at:21: ok -./ignfail.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + +154. old.at:23: ok +157. multiv01.at:23: testing multivolume dumps from pipes ... +./multiv01.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 * -# 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 ) -152. lustar02.at:21: 161. multiv05.at:26: testing Restoring after an out of sync volume ... ./multiv05.at:30: mkdir gnu @@ -12954,40 +13016,6 @@ echo Diffing szesc cmp bak/szesc szesc || exit 1 ) - 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) -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) ./incr07.at:40: mkdir posix (cd posix @@ -13034,24 +13062,10 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -./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' -) -./extrac22.at:29: +159. multiv03.at:30: testing MV archive & long filenames ... +./multiv03.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13060,83 +13074,60 @@ 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; }'` -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +cat > ../experr < ../expout <&1`" || exit 77 +genfile --length 15360 --file $AFILE -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) +exec <&- -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF +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 -tar -C t -c -f a.tar --no-recursion -T filelist +genfile --length 15360 --file $BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 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 separator-2 +mv $BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp $BFILE bfile ) -./multiv01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +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 oldgnu" +TAR_OPTIONS="-H gnu" 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 - -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 +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -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 +exec <&- -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +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 ) -./extrac23.at:32: +160. multiv04.at:36: testing split directory members in a MV archive ... +./multiv04.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13145,44 +13136,56 @@ 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 -) -165. multiv09.at:26: testing bad next volume ... -./multiv09.at:33: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir directory +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' /dev/null </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) +153. lustar03.at:21: 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) + ok 164. multiv08.at:25: testing multivolume header creation ... ./multiv08.at:28: mkdir gnu @@ -13200,6 +13203,7 @@ decho Testing tar -tMR -f A.tar -f B.tar -f C.tar ) +152. lustar02.at:21: ok 163. multiv07.at:28: testing volumes split at an extended header ... ./multiv07.at:31: @@ -13215,6 +13219,26 @@ cd $TEST_DATA_DIR tar -t -M -fxsplit-1.tar -fxsplit-2.tar +106. extrac23.at:18: 165. multiv09.at:26: testing bad next volume ... +./multiv09.at:33: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +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 < 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 +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' ) - 167. owner.at:21: testing --owner and --group ... ./owner.at:24: mkdir gnu @@ -13282,35 +13298,7 @@ tar -tvf arc tar --numeric-owner -tvf arc ) -./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 --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 -) -156. time02.at:20: ok ---- - 2025-09-26 07:23:58.465256483 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2025-09-26 07:23:58.459735938 +0000 -@@ -1,4 +1 @@ --Archive volumes split at an extended header Volume 1 --foo --bar - -163. multiv07.at:28: 168. map.at:21: testing --owner-map and --group-map ... +168. map.at:21: testing --owner-map and --group-map ... ./map.at:24: mkdir gnu (cd gnu @@ -13358,46 +13346,53 @@ tar -tvf 2.tar tar --numeric-owner -tvf 2.tar ) - skipped (multiv07.at:31) -./rename01.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +156. time02.at:20: ok + + +127. incr06.at:21: ./link04.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +./multiv01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -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 +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 -mv foo old +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -tar xfg arch.1 /dev/null +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 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 -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 ) ./multiv06.at:30: mkdir pax @@ -13407,74 +13402,6 @@ 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) -127. incr06.at:21: 169. sparse01.at:21: testing sparse files ... -./sparse01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 -./multiv01.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --length 7168 --file file1 - -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ -./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' -) -./link04.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 @@ -13499,74 +13426,86 @@ s,symlink,FOO,g ' | sort ) - " 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 +./rename06.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -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 directory structure +mkdir test test/d1 test/d2 +genfile --file test/d1/file1 +genfile --file test/d2/file2 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/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 -./multiv03.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` +mkdir test1 -cat > ../experr < ../expout < sparsecopy || exit 1 -cmp sparsefile sparsecopy -) -164. multiv08.at:25: ok -150. long01.at:28: ok -167. owner.at:21: ok -166. multiv10.at:37: ok -./rename04.at:30: -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 * +# The test is meaningless for super-user. -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 -decho Creating directory structure +touch file mkdir directory -./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 <&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -mv dir orig +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) -./link02.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./link01.at:36: +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 * -./multiv02.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -exec <&- +tar cf archive directory/test1/test.txt directory/test1/test.txt -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 -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' -) -162. multiv06.at:27: ok +rm -r directory +tar xf archive --warning=no-timestamp +ls directory/test1 +) + skipped (multiv07.at:31) 171. sparse03.at:21: testing storing sparse files > 8G ... ./sparse03.at:29: mkdir posix @@ -13733,32 +13632,29 @@ genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) -./link01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + +./multiv02.at:31: +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 * -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 +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire -rm -r directory -tar xf archive --warning=no-timestamp +exec <&- -ls directory/test1 +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 ) -106. extrac23.at:18: ok -168. map.at:21: ok -./rename05.at:27: +./rename01.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13771,34 +13667,35 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +mv foo/bar foo/baz -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -mv dir orig +mv foo old -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort +tar xfg arch.1 /dev/null -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort -) +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" -./rename06.at:29: +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +170. sparse02.at:21: testing extracting sparse file over a pipe ... +./sparse02.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13807,136 +13704,73 @@ 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 -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 +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy ) -./ignfail.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +166. multiv10.at:37: ok +./multiv09.at:33: +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 * -# 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 - +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 +cat > ../experr <&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 +cat > ../expout <&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +genfile --length 15360 --file $AFILE -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) +exec <&- +tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 +tar -tM -f arch.1 -f arch.2 || exit 1 -105. extrac22.at:19: stdout: - ok -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2025-09-26 07:23 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 end -separator -sparsefile 3102720 -./sparse01.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo separator-1 -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 +genfile --length 15360 --file $BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive --warning=no-timestamp -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile +echo separator-2 +mv $BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp $BFILE bfile ) -128. incr07.at:18: - -172. sparse04.at:21: testing storing long sparse file names ... -./sparse04.at:35: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * -genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 -tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - -) - ok +162. multiv06.at:27: ok 173. sparse05.at:21: testing listing sparse files bigger than 2^33 B ... ./sparse05.at:31: mkdir pax @@ -14740,7 +14574,21 @@ 10M =2560 10M =2560 10M =2560 -10M =2560 +10M 172. sparse04.at:21: testing storing long sparse file names ... +./sparse04.at:35: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 +tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - +) +150. long01.at:28: ok +=2560 10M =2560 10M =2560 10M =2560 @@ -14954,6 +14802,102 @@ genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77 tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print $3, $(NF) }' ) +164. multiv08.at:25: 167. owner.at:21: ./link02.at:35: +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 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) + ok + ok + + +./rename04.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 + + +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 + +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort +) +./multiv01.at:30: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +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 + +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 +) ./incr04.at:34: mkdir oldgnu (cd oldgnu @@ -14979,40 +14923,7 @@ echo "Incremental dump" tar cvf a1.tar -g a.sna a ) - - - -./link04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 -) +168. map.at:21: ok 174. sparse06.at:21: testing storing sparse file using seek method ... ./sparse06.at:32: mkdir posix @@ -15100,9 +15011,34 @@ tar tf archive ) -161. multiv05.at:26: ok -146. link02.at:32: 177. spmvp00.at:21: testing sparse files in PAX MV archives, v.0.0 ... -./spmvp00.at:24: + + + +stdout: +./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 +) +./multiv02.at:31: mkdir pax (cd pax TEST_TAR_FORMAT=pax @@ -15111,25 +15047,86 @@ 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_OPTIONS="$TAR_OPTIONS --hole-detection=raw" -genfile --sparse --file sparsefile 0 ABCDEFGHI 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 -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 -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 -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 +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 +) + +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2026-10-29 13:56 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 end +separator +sparsefile 3102720 +172. sparse04.at:21: + 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 +) +./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 ) 176. sparsemv.at:21: testing sparse files in MV archives ... ./sparsemv.at:31: @@ -15161,7 +15158,6 @@ echo "Compare archive" tar --record-size=512 -d -M -f arc.1 -f arc.2 ) - ok ./multiv09.at:33: mkdir ustar (cd ustar @@ -15179,22 +15175,7 @@ q EOF ) -./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 -) +161. multiv05.at:26: ok ./link03.at:34: mkdir posix (cd posix @@ -15223,8 +15204,130 @@ echo testing archive.2 tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) +./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 +) +./link04.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +) +./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 -137. rename01.at:24: 172. sparse04.at:21: 178. spmvp01.at:21: testing sparse files in PAX MV archives, v.0.1 ... +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +157. multiv01.at:23: ok +178. spmvp01.at:21: testing sparse files in PAX MV archives, v.0.1 ... ./spmvp01.at:24: mkdir pax (cd pax @@ -15254,8 +15357,39 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -180. sptrcreat.at:33: testing sparse file truncated while archiving ... -./sptrcreat.at:36: + +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 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * + +exec <&- +TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" +genfile --sparse --file sparsefile 0 ABCDEFGH 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 +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 +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 +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 +) +181. sptrdiff00.at:26: testing file truncated in sparse region while comparing ... +./sptrdiff00.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15267,14 +15401,30 @@ 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 -vcf bar foo baz -echo Exit status: $? + tar --sparse -vdf bar +) +./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 -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') -179. spmvp10.at:21: testing sparse files in PAX MV archives, v.1.0 ... -./spmvp10.at:24: + +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) +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 @@ -15285,67 +15435,269 @@ 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 ) - ok - ok -./incr03.at:31: +./sparse07.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 + +tar tf archive +) +180. sptrcreat.at:33: testing sparse file truncated while archiving ... +./sptrcreat.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +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 +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') +128. incr07.at:18: ok + + +182. sptrdiff01.at:26: testing file truncated in data region while comparing ... +./sptrdiff01.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +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 +) +142. rename06.at:19: ./rename02.at:27: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT TAR_OPTIONS="-H oldgnu" -158. multiv02.at:28: export TAR_OPTIONS +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 +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 -tar -cf archive.1 -g db directory +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory +mv foo/bar/baz foo -mv directory orig +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort +mv foo old -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort +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 +) + ok +159. multiv03.at:30: 146. link02.at:32: ./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 +) + ok ok + +184. update01.at:29: testing update directories ... +./update01.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 + +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 +) +183. update.at:28: testing update unchanged directories ... +./update.at:31: +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 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 +) +158. multiv02.at:28: ok +./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 <&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 -) -./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 -) -./sparse07.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 tar tf archive ) -159. multiv03.at:30: ok -181. sptrdiff00.at:26: testing file truncated in sparse region while comparing ... -./sptrdiff00.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -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 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar -) - stdout: - separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2025-09-26 07:23 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2026-10-29 13:56 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 end separator sparsefile 3102720 ./sparse01.at:24: @@ -15535,8 +15799,6 @@ genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) - - ./link04.at:32: mkdir gnu (cd gnu @@ -15568,28 +15830,9 @@ s,symlink,FOO,g ' | sort ) - -182. sptrdiff01.at:26: testing file truncated in data region while comparing ... -./sptrdiff01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -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 -) -183. update.at:28: testing update unchanged directories ... -./update.at:31: +137. rename01.at:24: ok +185. update02.at:26: testing update changed files ... +./update02.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -15601,17 +15844,49 @@ 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 +mkdir a +genfile --file a/b -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 ) -./sparse07.at:24: +./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' +) +./sparsemv.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -15620,15 +15895,28 @@ 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 +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 -tar tf archive +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 ) -140. rename04.at:27: - ok -184. update01.at:29: testing update directories ... -./update01.at:32: +186. update03.at:20: testing update with chdir ... +./update03.at:27: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -15637,29 +15925,57 @@ 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 +) +./sparse02.at:28: +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 --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 -mkdir a -genfile --file a/b +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy +) -tar cf arc a +188. verify.at:25: testing verify ... +./verify.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo "separator" +touch foo +tar -cvf archive.tar --verify foo +) -sleep 2 -genfile --file a/c -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) +141. rename05.at:24: ok ./ignfail.at:26: -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 * @@ -15705,57 +16021,8 @@ chmod 700 directory test $status = 0 ) -185. update02.at:26: testing update changed files ... -./update02.at:29: -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 - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -186. update03.at:20: testing update with chdir ... -./update03.at:27: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 -) 187. update04.at:20: testing update with wildcards ... -./update04.at:23: +175. sparse07.at:21: ./update04.at:23: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -15781,140 +16048,10 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -./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 < sparsecopy || exit 1 -cmp sparsefile sparsecopy -) -178. spmvp01.at:21: 179. spmvp10.at:21: ok ok 177. spmvp00.at:21: ok -./sparsemv.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -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 - -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 -) -./update.at:31: -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 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 -) -148. link04.at:29: ok +140. rename04.at:27: ok +178. spmvp01.at:21: ok 189. volume.at:23: testing volume ... ./volume.at:26: mkdir gnu @@ -15941,16 +16078,7 @@ tar xfV archive babel test $? = 2 ) -stdout: - -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:24 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2025-09-26 07:24 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:24 end -separator -sparsefile 3102720 - -./verify.at:28: +./update.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -15959,107 +16087,20 @@ export TAR_OPTIONS rm -rf * -touch foo -tar -cvf archive.tar --verify foo -) - - -./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 +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 -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 -) - -./update03.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -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 +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 ) - 191. comprec.at:21: testing compressed format recognition ... ./comprec.at:25: mkdir v7 @@ -16099,6 +16140,9 @@ EOF ) +179. spmvp10.at:21: ok + + 190. volsize.at:29: testing volume header size ... ./volsize.at:32: mkdir v7 @@ -16124,6 +16168,40 @@ tar xf $TEST_DATA_DIR/abc.tar find abc|sort ) + +./update03.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +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 +) +./verify.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo +) 192. shortfile.at:26: testing short input files ... ./shortfile.at:29: mkdir gnu @@ -16155,19 +16233,9 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -193. shortupd.at:31: testing updating short archives ... -./shortupd.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch foo -tar uf archive foo -) +147. link03.at:24: ok +148. link04.at:29: ok 196. sigpipe.at:21: testing sigpipe handling ... ./sigpipe.at:30: @@ -16185,6 +16253,19 @@ # Discard diagnostics that some shells generate about broken pipes. (tar tf archive 2>&3 | :) 3>&2 2>/dev/null +193. shortupd.at:31: testing updating short archives ... +./shortupd.at:34: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) 195. grow.at:24: testing grow ... ./grow.at:27: mkdir v7 @@ -16199,41 +16280,27 @@ genfile --file baz genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./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 -) -./verify.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2026-10-29 13:56 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 end +separator +sparsefile 3102720 +./shortupd.at:34: +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 * touch foo -tar -cvf archive.tar --verify foo +tar uf archive foo ) -./volume.at:26: +176. sparsemv.at:21: ./volume.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16258,24 +16325,10 @@ tar xfV archive babel test $? = 2 ) -169. sparse01.at:21: ok -197. comperr.at:18: testing compressor program failure ... -./comperr.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc -) ---- - 2025-09-26 07:24:00.104785099 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2025-09-26 07:24:00.099748247 +0000 + ok +170. sparse02.at:21: ok +--- - 2026-10-29 13:56:42.424116588 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2026-10-29 13:56:42.406399939 +0000 @@ -1,10 +1 @@ -Short Listing -abc/not-a-file.gif @@ -16287,16 +16340,8 @@ -abc -abc/CCC -./ignfail.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. +198. remfiles01.at:28: testing remove-files with compression ... +./remfiles01.at:32: echo "test" > $$ chmod 0 $$ @@ -16306,55 +16351,57 @@ test $result -eq 0 && exit 77 -touch file -mkdir directory -touch directory/file +cat /dev/null | gzip - > /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 +case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( +?*) exit 77;; +esac -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: ok -190. volsize.at:29: 192. shortfile.at:26: ./shortupd.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir dir +cd dir +genfile --file a --length 0 +chmod 0 a +genfile --file b +mkdir c + +# Depending on when the SIGPIPE gets delivered, the invocation below +# may finish with either +# tar: a: Cannot write: Broken pipe +# or +# tar: Child returned status 2 + +# Discard diagnostics that some shells generate about broken pipes, +# and discard all of tar's diagnostics except for the ones saying "(child)". +# Gzip's exit code is propagated to the shell. Usually it is 141. +# Convert all non-zero exits to 2 to make it predictable. +(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null +EC=$? +sed -n '/(child)/p' err >&2 +rm err +find . | sort +exit $EC + +197. comperr.at:18: testing compressor program failure ... +./comperr.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 * -touch foo -tar uf archive foo +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc ) - ok - skipped (volsize.at:32) -170. sparse02.at:21: ok -./update03.at:27: +./verify.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -16363,19 +16410,9 @@ 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 +touch foo +tar -cvf archive.tar --verify foo ) -196. sigpipe.at:21: ok ./comprec.at:25: mkdir oldgnu (cd oldgnu @@ -16396,34 +16433,31 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) -./verify.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +190. volsize.at:29: 196. sigpipe.at:21: ./update.at:31: +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 * -touch foo -tar -cvf archive.tar --verify foo -) -165. multiv09.at:26: ok -./comperr.at:28: -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 -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc +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 ) + ok + + skipped (volsize.at:32) ./shortupd.at:34: mkdir ustar (cd ustar @@ -16436,9 +16470,29 @@ touch foo tar uf archive foo ) +./update03.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * - -176. sparsemv.at:21: ok +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 +) +192. shortfile.at:26: ok +165. multiv09.at:26: ok ./truncate.at:32: mkdir oldgnu @@ -16457,76 +16511,11 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -./update.at:31: -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 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 -) -198. remfiles01.at:28: testing remove-files with compression ... -./remfiles01.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 - - -case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( -?*) exit 77;; -esac - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir dir -cd dir -genfile --file a --length 0 -chmod 0 a -genfile --file b -mkdir c - -# Depending on when the SIGPIPE gets delivered, the invocation below -# may finish with either -# tar: a: Cannot write: Broken pipe -# or -# tar: Child returned status 2 - -# Discard diagnostics that some shells generate about broken pipes, -# and discard all of tar's diagnostics except for the ones saying "(child)". -# Gzip's exit code is propagated to the shell. Usually it is 141. -# Convert all non-zero exits to 2 to make it predictable. -(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null -EC=$? -sed -n '/(child)/p' err >&2 -rm err -find . | sort -exit $EC +144. ignfail.at:23: ok +169. sparse01.at:21: ok ./shortupd.at:34: mkdir posix (cd posix @@ -16539,15 +16528,7 @@ touch foo tar uf archive foo ) -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 - -189. volume.at:23: 199. remfiles02.at:28: testing remove-files with compression: grand-child ... +199. remfiles02.at:28: testing remove-files with compression: grand-child ... ./remfiles02.at:32: cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 @@ -16569,73 +16550,18 @@ find . | sort exit $EC - ok -201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... -./remfiles04a.at:28: -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 foo -echo bar > bar -echo foobar > foo/bar -tar -cf foo.tar --remove-files -C foo bar -echo A -find . | sort -) - ./verify.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 foo tar -cvf archive.tar --verify foo ) -202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... -./remfiles04b.at:36: -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 foo -echo bar > bar -echo foobar > foo/bar -tar -cf foo.tar --incremental --remove-files -C foo bar -echo A -find . | sort -) -./comperr.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc ./comprec.at:25: mkdir ustar (cd ustar @@ -16656,9 +16582,10 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) -) -203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... -./remfiles04c.at:36: + + +202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... +./remfiles04b.at:36: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -16673,14 +16600,24 @@ mkdir foo echo bar > bar echo foobar > foo/bar -tar -cf foo.tar -C foo bar +tar -cf foo.tar --incremental --remove-files -C foo bar echo A find . | sort -tar -rf foo.tar --remove-files -C foo bar -echo B -find . | sort ) +./comperr.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) ./shortupd.at:34: mkdir gnu (cd gnu @@ -16693,8 +16630,17 @@ touch foo tar uf archive foo ) +189. volume.at:23: 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 -./update03.at:27: + + ok +./update.at:31: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16703,13 +16649,21 @@ export TAR_OPTIONS rm -rf * -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -204. remfiles05a.at:34: testing remove-files with -C:rel,rel in -c/non-incr. mode ... -./remfiles05a.at:37: + +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 +) +201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... +./remfiles04a.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -16722,25 +16676,14 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir foo -mkdir bar -echo file > file -echo foo/file > foo/file -echo bar/file > bar/file -decho A -tar -cvf foo.tar --remove-files -C foo file -C ../bar file -decho B +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar --remove-files -C foo bar +echo A find . | sort ) -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: ok -201. remfiles04a.at:25: ok -./update.at:31: +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 @@ -16752,16 +16695,17 @@ 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 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --remove-files -C foo file -C ../bar file +decho B +find . | sort ) + 205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... ./remfiles05b.at:28: mkdir gnu @@ -16785,39 +16729,30 @@ decho B find . | sort ) -193. shortupd.at:31: ok -./truncate.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... +./remfiles04c.at:36: +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 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') -144. ignfail.at:23: 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 * -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +echo bar > bar +echo foobar > foo/bar +tar -cf foo.tar -C foo bar +echo A +find . | sort +tar -rf foo.tar --remove-files -C foo bar +echo B +find . | sort ) + 206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... ./remfiles05c.at:28: mkdir gnu @@ -16844,35 +16779,45 @@ decho C find . | sort ) -188. verify.at:25: ok - -202. remfiles04b.at:33: ok -199. remfiles02.at:28: ok - - -./comprec.at:25: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./incremental.at:26: +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 -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +mkdir structure +echo x >structure/file -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 +# 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 ) -203. remfiles04c.at:33: ok -204. remfiles05a.at:34: ok -198. remfiles01.at:28: ./update03.at:27: +./verify.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -16880,20 +16825,9 @@ TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * - ok - -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 +touch foo +tar -cvf archive.tar --verify foo ) 207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... ./remfiles06a.at:28: @@ -16919,12 +16853,15 @@ decho B find . | sort ) +193. shortupd.at:31: ok +199. remfiles02.at:28: ok + ./comperr.at:28: -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 * @@ -16933,10 +16870,27 @@ sed -n '$p' err exit $rc ) +./update03.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - -205. remfiles05b.at:25: ok - +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 +) 208. remfiles06b.at:25: testing remove-files with -C:rel,abs in -c/incr. mode ... ./remfiles06b.at:28: mkdir gnu @@ -16961,6 +16915,23 @@ decho B find . | sort ) +./truncate.at:32: +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 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') 209. remfiles06c.at:25: testing remove-files with -C:rel,abs in -r mode ... ./remfiles06c.at:28: mkdir gnu @@ -16988,7 +16959,30 @@ decho C find . | sort ) -./truncate.at:32: +./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 +) +200. remfiles03.at:28: ok +./comprec.at:25: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16997,15 +16991,47 @@ 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') -183. update.at:28: 210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... + +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 +) + +188. verify.at:25: ok + +202. remfiles04b.at:33: ok +201. remfiles04a.at:25: ok +198. remfiles01.at:28: ok +203. remfiles04c.at:33: ok +205. remfiles05b.at:25: ok +206. remfiles05c.at:25: 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 * + +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) + +207. remfiles06a.at:25: ok + +204. remfiles05a.at:34: ok +210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... ./remfiles07a.at:28: mkdir gnu (cd gnu @@ -17029,10 +17055,6 @@ decho B find . | sort ) - ok - - - 211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... ./remfiles07b.at:28: mkdir gnu @@ -17057,6 +17079,102 @@ decho B find . | sort ) +208. remfiles06b.at:25: ok + +./extrac20.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 + + +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 +) +./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 +) + 212. remfiles07c.at:25: testing remove-files with -C:abs,rel in -r mode ... ./remfiles07c.at:28: mkdir gnu @@ -17084,9 +17202,8 @@ decho C find . | sort ) - -213. remfiles08a.at:28: testing remove-files deleting two subdirs in -c/non-incr. mode ... -./remfiles08a.at:31: +215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... +./remfiles08c.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17095,39 +17212,24 @@ export TAR_OPTIONS rm -rf * + +test -z "`sort < /dev/null 2>&1`" || exit 77 + mkdir foo mkdir bar echo foo/foo_file > foo/foo_file echo bar/bar_file > bar/bar_file +tar -cf foo.tar -C foo . -C ../bar . decho A -tar -cvf foo.tar --remove-files -C foo . -C ../bar . +find . | sort decho B +tar -rvf foo.tar --remove-files -C foo . -C ../bar . +decho C find . ) -206. remfiles05c.at:25: ok -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 -) -215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... -./remfiles08c.at:31: +214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... +./remfiles08b.at:34: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17136,23 +17238,34 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir foo mkdir bar echo foo/foo_file > foo/foo_file echo bar/bar_file > bar/bar_file -tar -cf foo.tar -C foo . -C ../bar . decho A -find . | sort +tar -cvf foo.tar --incremental --remove-files -C foo . -C ../bar . decho B -tar -rvf foo.tar --remove-files -C foo . -C ../bar . -decho C find . ) -216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... -./remfiles09a.at:28: +./truncate.at:32: +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 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') +217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... +./remfiles09b.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17164,12 +17277,21 @@ mkdir foo echo foo/file > foo/file decho A -tar -cvf foo.tar --remove-files foo +tar -cvf foo.tar --incremental --remove-files foo decho B find . ) -214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... -./remfiles08b.at:34: +./comperr.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +213. remfiles08a.at:28: testing remove-files deleting two subdirs in -c/non-incr. mode ... +./remfiles08a.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17183,15 +17305,41 @@ echo foo/foo_file > foo/foo_file echo bar/bar_file > bar/bar_file decho A -tar -cvf foo.tar --incremental --remove-files -C foo . -C ../bar . +tar -cvf foo.tar --remove-files -C foo . -C ../bar . decho B find . ) +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) +209. remfiles06c.at:25: ok +183. update.at:28: ok -186. update03.at:20: ok -207. remfiles06a.at:25: ok -217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... -./remfiles09b.at:32: + +./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 +) +216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... +./remfiles09a.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17203,32 +17351,50 @@ mkdir foo echo foo/file > foo/file decho A -tar -cvf foo.tar --incremental --remove-files foo +tar -cvf foo.tar --remove-files foo decho B find . ) +211. remfiles07b.at:25: ok -209. remfiles06c.at:25: ./truncate.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./listed01.at:29: +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 --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') - ok -208. remfiles06b.at:25: ok -210. remfiles07a.at:25: 218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... +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 +) +218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... ./remfiles09c.at:28: mkdir gnu (cd gnu @@ -17251,11 +17417,7 @@ decho C find . | sort ) - ok -211. remfiles07b.at:25: - ok - -213. remfiles08a.at:28: ok +197. comperr.at:18: ok 219. remfiles10.at:20: testing remove-files ... ./remfiles10.at:23: mkdir gnu @@ -17275,9 +17437,10 @@ find foo exit $tar_status ) -216. remfiles09a.at:25: ok -220. xattr01.at:25: testing xattrs: basic functionality ... -./xattr01.at:28: + + +221. xattr02.at:25: testing xattrs: change directory with -C option ... +./xattr02.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17310,29 +17473,29 @@ exit 77 fi + mkdir dir -genfile --file dir/file +mkdir dir/subdir +mkdir dir/subdir/subsubdir +genfile --file dir/file1 +genfile --file dir/subdir/file2 -setfattr -n user.test -v OurDirValue dir -setfattr -n user.test -v OurFileValue dir/file +setfattr -n user.test -v OurFile1Value dir/file1 +setfattr -n user.test -v OurFile2Value dir/subdir/file2 +setfattr -n user.test -v OurDirValue dir/subdir/subsubdir -tar --xattrs -cf archive.tar dir +tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir rm -rf dir + tar --xattrs -xf archive.tar -getfattr -h -d dir | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +getfattr -h -d file1 | grep -v -e '^#' -e ^$ +getfattr -h -d file2 | grep -v -e '^#' -e ^$ +getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ ) -217. remfiles09b.at:29: 191. comprec.at:21: 214. remfiles08b.at:31: ok - ok - ok - - - - -221. xattr02.at:25: testing xattrs: change directory with -C option ... -./xattr02.at:28: +222. xattr03.at:25: testing xattrs: trusted.* attributes ... +./xattr03.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17342,6 +17505,14 @@ rm -rf * +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + + file=$(TMPDIR=. mktemp fiXXXXXX) @@ -17372,26 +17543,24 @@ genfile --file dir/file1 genfile --file dir/subdir/file2 -setfattr -n user.test -v OurFile1Value dir/file1 -setfattr -n user.test -v OurFile2Value dir/subdir/file2 -setfattr -n user.test -v OurDirValue dir/subdir/subsubdir +setfattr -n trusted.test -v OurFile1Value dir/file1 +setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 +setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir rm -rf dir -tar --xattrs -xf archive.tar +tar --xattrs --xattrs-include=trusted* -xf archive.tar -getfattr -h -d file1 | grep -v -e '^#' -e ^$ -getfattr -h -d file2 | grep -v -e '^#' -e ^$ -getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ +getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ ) -215. remfiles08c.at:28: - ok -stderr: -212. remfiles07c.at:25: ok -222. xattr03.at:25: testing xattrs: trusted.* attributes ... -./xattr03.at:28: + +217. remfiles09b.at:29: ok +220. xattr01.at:25: testing xattrs: basic functionality ... +./xattr01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17401,14 +17570,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) @@ -17432,41 +17593,22 @@ exit 77 fi - mkdir dir -mkdir dir/subdir -mkdir dir/subdir/subsubdir -genfile --file dir/file1 -genfile --file dir/subdir/file2 +genfile --file dir/file -setfattr -n trusted.test -v OurFile1Value dir/file1 -setfattr -n trusted.test -v OurFile2Value dir/subdir/file2 -setfattr -n trusted.test -v OurDirValue dir/subdir/subsubdir +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file -tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir +tar --xattrs -cf archive.tar dir rm -rf dir +tar --xattrs -xf archive.tar -tar --xattrs --xattrs-include=trusted* -xf archive.tar - -getfattr -mtrusted. -d file1 | grep -v -e '^#' -e ^$ -getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ -getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ ) - -A -tar: .: Cannot rmdir: Invalid argument -tar: Exiting with failure status due to previous errors -B ---- - 2025-09-26 07:24:00.257065586 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2025-09-26 07:24:00.251749389 +0000 -@@ -1,3 +1 @@ --user.test="OurDirValue" --user.test="OurFileValue" - - - -220. xattr01.at:25: ./remfiles10.at:44: sed '2s/:[^:]*$//' stderr +186. update03.at:20: ok +214. remfiles08b.at:31: ok 224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... ./xattr05.at:31: mkdir v7 @@ -17516,9 +17658,7 @@ getfattr -d output/file | grep -v '# ' > after diff before after ) -194. truncate.at:29: ok - -223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... +210. remfiles07a.at:25: 223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... ./xattr04.at:29: mkdir v7 (cd v7 @@ -17567,87 +17707,32 @@ getfattr -h -d output/file | grep -v -e '^#' -e ^$ exit $ret ) ---- - 2025-09-26 07:24:00.262763065 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2025-09-26 07:24:00.255749419 +0000 -@@ -1,4 +1 @@ --user.test="OurFile1Value" --user.test="OurFile2Value" + ok +--- - 2026-10-29 13:56:43.050590395 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2026-10-29 13:56:43.046399939 +0000 +@@ -1,3 +1 @@ -user.test="OurDirValue" +-user.test="OurFileValue" -./extrac20.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +216. remfiles09a.at:25: ok +./truncate.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 -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 -) - skipped (xattr01.at:28) -225. xattr06.at:27: testing xattrs: exclude xattrs on create ... +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') +220. xattr01.at:25: 225. xattr06.at:27: testing xattrs: exclude xattrs on create ... ./xattr06.at:30: mkdir v7 (cd v7 @@ -17702,6 +17787,48 @@ # if they differ then the attribute is still present diff filtered full ) + +212. remfiles07c.at:25: stderr: +--- - 2026-10-29 13:56:43.085034035 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2026-10-29 13:56:43.054399939 +0000 +@@ -1,4 +1 @@ +-user.test="OurFile1Value" +-user.test="OurFile2Value" +-user.test="OurDirValue" + + skipped (xattr01.at:28) + ok +--- - 2026-10-29 13:56:43.080937583 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2026-10-29 13:56:43.062399939 +0000 +@@ -1,4 +1 @@ +-trusted.test="OurFile1Value" +-trusted.test="OurFile2Value" +-trusted.test="OurDirValue" + +A +tar: .: Cannot rmdir: Invalid argument +tar: Exiting with failure status due to previous errors +B +--- - 2026-10-29 13:56:43.106411455 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2026-10-29 13:56:43.090399939 +0000 +@@ -1,2 +1 @@ +-user.test="value" + +222. xattr03.at:25: 215. remfiles08c.at:28: 213. remfiles08a.at:28: +./remfiles10.at:44: sed '2s/:[^:]*$//' stderr + ok + ok +218. remfiles09c.at:25: ok +223. xattr04.at:26: 225. xattr06.at:27: skipped (xattr03.at:28) +191. comprec.at:21: ok + +221. xattr02.at:25: skipped (xattr06.at:30) + + skipped (xattr04.at:29) + + +224. xattr05.at:28: 219. remfiles10.at:20: ok + 226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... ./xattr07.at:29: mkdir v7 @@ -17758,11 +17885,55 @@ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ ) -218. remfiles09c.at:25: ok -221. xattr02.at:25: 219. remfiles10.at:20: - ok - skipped (xattr02.at:28) + + + + skipped (xattr05.at:31) +227. xattr08.at:26: testing xattrs: xattrs and read-only files ... +./xattr08.at:29: +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 dir2 +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir/file +chmod a-w dir/file + +tar --xattrs -C dir -cf archive.tar file +tar --xattrs -C dir2 -xf archive.tar +) + 228. acls01.at:25: testing acls: basic functionality ... ./acls01.at:28: mkdir v7 @@ -17833,16 +18004,9 @@ diff before after test "$?" = 0 ) ---- - 2025-09-26 07:24:00.272004845 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2025-09-26 07:24:00.263749479 +0000 -@@ -1,4 +1 @@ --trusted.test="OurFile1Value" --trusted.test="OurFile2Value" --trusted.test="OurDirValue" - -227. xattr08.at:26: testing xattrs: xattrs and read-only files ... -./xattr08.at:29: +229. acls02.at:25: testing acls: work with -C ... +./acls02.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17852,7 +18016,6 @@ rm -rf * - file=$(TMPDIR=. mktemp fiXXXXXX) setfattr -n user.test -v test $file &> /dev/null @@ -17867,25 +18030,88 @@ 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 ) + + 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 dir2 -genfile --file dir/file -setfattr -n user.test -v OurDirValue dir/file -chmod a-w dir/file +mkdir dir +mkdir dir/subdir +genfile --file dir/subdir/file -tar --xattrs -C dir -cf archive.tar file -tar --xattrs -C dir2 -xf archive.tar +MYNAME=$( id -un ) + +setfacl -m u:$MYNAME:--x dir/subdir +setfacl -m u:$MYNAME:--x dir/subdir/file + +cd dir +getfattr -h -m. -d subdir subdir/file > ../before +cd .. + +tar --acls -cf archive.tar -C dir subdir +rm -rf dir + +mkdir dir +tar --acls -xf archive.tar -C dir + +cd dir +getfattr -h -m. -d subdir subdir/file > ../after +cd .. + +diff before after +test "$?" = 0 ) -222. xattr03.at:25: 224. xattr05.at:28: 229. acls02.at:25: testing acls: work with -C ... -./acls02.at:28: +./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 +) + + + + +232. selacl01.at:25: testing acls/selinux: special files & fifos ... +./selacl01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17895,6 +18121,14 @@ 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 @@ -17913,6 +18147,29 @@ 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 @@ -17935,36 +18192,143 @@ mkdir dir -mkdir dir/subdir -genfile --file dir/subdir/file +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR -MYNAME=$( id -un ) +# 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 -setfacl -m u:$MYNAME:--x dir/subdir -setfacl -m u:$MYNAME:--x dir/subdir/file +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before -cd dir -getfattr -h -m. -d subdir subdir/file > ../before -cd .. +tar --xattrs --selinux --acls -cf archive.tar dir -tar --acls -cf archive.tar -C dir subdir -rm -rf dir +mv dir olddir -mkdir dir -tar --acls -xf archive.tar -C dir +tar --xattrs --selinux --acls -xf archive.tar -cd dir -getfattr -h -m. -d subdir subdir/file > ../after -cd .. +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after diff before after -test "$?" = 0 +echo separator +) + +231. selnx01.at:25: testing selinux: basic store/restore ... +./selnx01.at:28: +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) + + 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 + + +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 + +# archive for later debugging +cp archive.tar archive_origin.tar + +# check if selinux contexts were restored +getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ + grep -v -e '^#' -e ^$ | cut -d: -f1 + +# =========================================================================== +# check if selinux contexts are not restored when --selinux option is missing + +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 + +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 + +tar -cf archive.tar dir + +# 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 + ) ---- - 2025-09-26 07:24:00.277182319 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2025-09-26 07:24:00.271749539 +0000 -@@ -1,2 +1 @@ --user.test="value" - 230. acls03.at:30: testing acls: default ACLs ... ./acls03.at:47: mkdir v7 @@ -18183,135 +18547,9 @@ fi ) -225. xattr06.at:27: - skipped (xattr03.at:28) - skipped (xattr05.at:31) -223. xattr04.at:26: 231. selnx01.at:25: testing selinux: basic store/restore ... -./selnx01.at:28: -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) - - 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 - - -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 - -# archive for later debugging -cp archive.tar archive_origin.tar - -# check if selinux contexts were restored -getfattr -h -d dir dir/file dir/link -msecurity.selinux | \ - grep -v -e '^#' -e ^$ | cut -d: -f1 - -# =========================================================================== -# check if selinux contexts are not restored when --selinux option is missing - -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 - -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 - -tar -cf archive.tar dir - -# 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 - -) - skipped (xattr06.at:30) - ---- - 2025-09-26 07:24:00.282747518 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2025-09-26 07:24:00.275749569 +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 - - skipped (xattr04.at:29) - -228. acls01.at:25: 232. selacl01.at:25: testing acls/selinux: special files & fifos ... -./selacl01.at:28: +227. xattr08.at:26: 234. onetop01.at:21: testing tar --one-top-level ... +./onetop01.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18321,117 +18559,17 @@ 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 - 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -diff before after -echo separator +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 ) ---- - 2025-09-26 07:24:00.285331149 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2025-09-26 07:24:00.279749599 +0000 -@@ -1,10 +1 @@ --dir/ --dir/file --dir/file2 --dir/ --dir/file --dir/file2 --user.test="OurDirValue2" --user.test="OurFileValue2" --user.test="OurFileValue2" - 233. capabs_raw01.at:25: testing capabilities: binary store/restore ... ./capabs_raw01.at:28: mkdir v7 @@ -18508,13 +18646,38 @@ # Newer systems print = instead of + here getcap dir/file | sed 's/+/=/' ) - - skipped (acls01.at:28) -226. xattr07.at:26: -227. xattr08.at:26: 230. acls03.at:30: - skipped (xattr07.at:29) -229. acls02.at:25: 234. onetop01.at:21: testing tar --one-top-level ... -./onetop01.at:24: + skipped (xattr08.at:29) +--- - 2026-10-29 13:56:43.270315539 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2026-10-29 13:56:43.242399939 +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 + +194. truncate.at:29: ok +--- - 2026-10-29 13:56:43.284999685 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2026-10-29 13:56:43.278399939 +0000 +@@ -1,10 +1 @@ +-dir/ +-dir/file +-dir/file2 +-dir/ +-dir/file +-dir/file2 +-user.test="OurDirValue2" +-user.test="OurFileValue2" +-user.test="OurFileValue2" + +--- - 2026-10-29 13:56:43.306726087 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2026-10-29 13:56:43.302399939 +0000 +@@ -1,2 +1 @@ +-separator + +226. xattr07.at:26: 232. selacl01.at:25: 235. onetop02.at:21: testing tar --one-top-level --show-transformed ... +./onetop02.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18532,11 +18695,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 ) -235. onetop02.at:21: testing tar --one-top-level --show-transformed ... -./onetop02.at:24: +237. onetop04.at:21: testing tar --one-top-level --transform ... +./onetop04.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18552,23 +18715,49 @@ 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 +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) +228. acls01.at:25: ./incr03.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * - skipped (xattr08.at:29) - skipped (acls03.at:47) - skipped (acls02.at:28) ---- - 2025-09-26 07:24:00.295243991 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2025-09-26 07:24:00.287749659 +0000 -@@ -1,4 +1 @@ --security.selinux="system_u --security.selinux="unconfined_u --security.selinux="system_u - +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 +) + skipped (xattr07.at:29) 236. onetop03.at:21: testing tar --one-top-level --transform ... ./onetop03.at:24: mkdir v7 @@ -18591,39 +18780,180 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -237. onetop04.at:21: testing tar --one-top-level --transform ... -./onetop04.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + skipped (acls01.at:28) + skipped (selacl01.at:28) +230. acls03.at:30: +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 + + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar + +241. multi-fail.at:21: testing multi-fail ... +./multi-fail.at:26: + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $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 <&- + +--- - 2026-10-29 13:56:43.345071719 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2026-10-29 13:56:43.322399939 +0000 +@@ -1,4 +1 @@ +-security.selinux="system_u +-security.selinux="unconfined_u +-security.selinux="system_u + +./chtype.at:30: +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 * 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 + +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 ) -231. selnx01.at:25: --- - 2025-09-26 07:24:00.301489152 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2025-09-26 07:24:00.291749689 +0000 -@@ -1,2 +1 @@ --separator - + skipped (acls03.at:47) +231. selnx01.at:25: 229. acls02.at:25: ./rename02.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar +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 +) +--- - 2026-10-29 13:56:43.391241597 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2026-10-29 13:56:43.378399939 +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 +--rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d +--rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d +--rw-r--r-- joerg/bs 1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d +--rw-r--r-- joerg/bs 2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d +--rw-r--r-- joerg/bs 1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d +--rw-r--r-- joerg/bs 1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d +--rw-r--r-- joerg/bs 1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d +--rw-r--r-- joerg/bs 1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d +--rw-r--r-- joerg/bs 1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d +--rw-r--r-- joerg/bs 1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d +--rw-r--r-- joerg/bs 1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d +--rw-r--r-- joerg/bs 1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d +--rw-r--r-- joerg/bs 1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d +--rw-r--r-- joerg/bs 1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d +--rw-r--r-- joerg/bs 2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d +--rw-r--r-- joerg/bs 969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d +--rw-r--r-- joerg/bs 1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d +--rw-r--r-- joerg/bs 1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d +--rw-r--r-- joerg/bs 1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d +--rw-r--r-- joerg/bs 1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d +--rw-r--r-- joerg/bs 1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d +--rw-r--r-- joerg/bs 961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d +--rw-r--r-- joerg/bs 1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d +--rw-r--r-- joerg/bs 2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d +--rw-r--r-- joerg/bs 1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d +--rw-r--r-- joerg/bs 1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d +--rw-r--r-- joerg/bs 2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d +--rw-r--r-- joerg/bs 1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d +--rw-r--r-- joerg/bs 42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o +--rw-r--r-- joerg/bs 22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o +--rw-r--r-- joerg/bs 7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o +--rw-r--r-- joerg/bs 14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o +--rw-r--r-- joerg/bs 924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o +--rw-r--r-- joerg/bs 6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o +--rw-r--r-- joerg/bs 12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o +--rw-r--r-- joerg/bs 14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o +--rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o +--rw-r--r-- joerg/bs 7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o +--rw-r--r-- joerg/bs 3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o +--rw-r--r-- joerg/bs 5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o +--rw-r--r-- joerg/bs 6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o +--rw-r--r-- joerg/bs 1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o +--rw-r--r-- joerg/bs 20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o +--rw-r--r-- joerg/bs 2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o +--rw-r--r-- joerg/bs 1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o +--rw-r--r-- joerg/bs 10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o +--rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o +--rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o +--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 + 238. onetop05.at:21: testing tar --one-top-level restoring permissions ... ./onetop05.at:28: mkdir v7 @@ -18672,36 +19002,28 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -239. gtarfail.at:21: testing gtarfail ... -./gtarfail.at:26: +240. gtarfail2.at:21: testing gtarfail2 ... +./gtarfail2.at:26: test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - +tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar - skipped (selnx01.at:28) ---- - 2025-09-26 07:24:00.304346685 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2025-09-26 07:24:00.295749719 +0000 -@@ -1,2 +1 @@ --dir/file = cap_chown=ei - -232. selacl01.at:25: 233. capabs_raw01.at:25: 241. multi-fail.at:21: testing multi-fail ... -./multi-fail.at:26: +241. multi-fail.at:21: skipped (acls02.at:28) +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 "$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 ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $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/ustar-big-8g.tar.bz2 - skipped (selacl01.at:28) 242. ustar-big-2g.at:21: testing ustar-big-2g ... ./ustar-big-2g.at:26: test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 @@ -18715,36 +19037,8 @@ tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 ---- - 2025-09-26 07:24:00.309675833 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2025-09-26 07:24:00.303749779 +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 --drwxr-sr-x jes/glone 0 2001-12-10 00:00 build/ ---rw-r--r-- jes/glone 312019 2001-12-10 00:00 build/smake-1.2.tar.gz --drwxr-sr-x jes/glone 0 2001-11-09 18:20 build/psmake/ ---rwxr-xr-x jes/glone 259 2000-01-09 16:36 build/psmake/MAKE ---rwxr-xr-x jes/glone 4820 2001-02-25 22:45 build/psmake/MAKE.sh ---rw-r--r-- jes/glone 647 2001-02-25 23:50 build/psmake/Makefile --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 - -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 (capabs_raw01.at:28) -240. gtarfail2.at:21: --- - 2025-09-26 07:24:00.313098844 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2025-09-26 07:24:00.307749809 +0000 +--- - 2026-10-29 13:56:43.417250949 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2026-10-29 13:56:43.402399939 +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 @@ -18753,66 +19047,7 @@ --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 - skipped (gtarfail2.at:26) ---- - 2025-09-26 07:24:00.317581702 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2025-09-26 07:24:00.307749809 +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 ---rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d ---rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d ---rw-r--r-- joerg/bs 1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d ---rw-r--r-- joerg/bs 2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d ---rw-r--r-- joerg/bs 1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d ---rw-r--r-- joerg/bs 1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d ---rw-r--r-- joerg/bs 1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d ---rw-r--r-- joerg/bs 1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d ---rw-r--r-- joerg/bs 1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d ---rw-r--r-- joerg/bs 1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d ---rw-r--r-- joerg/bs 1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d ---rw-r--r-- joerg/bs 1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d ---rw-r--r-- joerg/bs 1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d ---rw-r--r-- joerg/bs 1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d ---rw-r--r-- joerg/bs 2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d ---rw-r--r-- joerg/bs 969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d ---rw-r--r-- joerg/bs 1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d ---rw-r--r-- joerg/bs 1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d ---rw-r--r-- joerg/bs 1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d ---rw-r--r-- joerg/bs 1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d ---rw-r--r-- joerg/bs 1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d ---rw-r--r-- joerg/bs 961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d ---rw-r--r-- joerg/bs 1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d ---rw-r--r-- joerg/bs 2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d ---rw-r--r-- joerg/bs 1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d ---rw-r--r-- joerg/bs 1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d ---rw-r--r-- joerg/bs 2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d ---rw-r--r-- joerg/bs 1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d ---rw-r--r-- joerg/bs 42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o ---rw-r--r-- joerg/bs 22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o ---rw-r--r-- joerg/bs 7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o ---rw-r--r-- joerg/bs 14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o ---rw-r--r-- joerg/bs 924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o ---rw-r--r-- joerg/bs 6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o ---rw-r--r-- joerg/bs 12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o ---rw-r--r-- joerg/bs 14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o ---rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o ---rw-r--r-- joerg/bs 7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o ---rw-r--r-- joerg/bs 3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o ---rw-r--r-- joerg/bs 5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o ---rw-r--r-- joerg/bs 6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o ---rw-r--r-- joerg/bs 1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o ---rw-r--r-- joerg/bs 20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o ---rw-r--r-- joerg/bs 2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o ---rw-r--r-- joerg/bs 1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o ---rw-r--r-- joerg/bs 10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o ---rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o ---rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o ---rw-r--r-- joerg/bs stderr: - 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 - -stderr: -239. gtarfail.at:21: 244. pax-big-10g.at:21: testing pax-big-10g ... +244. pax-big-10g.at:21: testing pax-big-10g ... ./pax-big-10g.at:26: test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 @@ -18825,21 +19060,28 @@ tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 -241. multi-fail.at:21: --- - 2025-09-26 07:24:00.321545580 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2025-09-26 07:24:00.315749869 +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 (multi-fail.at:26) + skipped (selnx01.at:28) +--- - 2026-10-29 13:56:43.422066825 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2026-10-29 13:56:43.398399939 +0000 +@@ -1,2 +1 @@ +-dir/file = cap_chown=ei ---- - 2025-09-26 07:24:00.322330852 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2025-09-26 07:24:00.315749869 +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 +--- - 2026-10-29 13:56:43.426894820 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2026-10-29 13:56:43.422399939 +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 +-drwxr-sr-x jes/glone 0 2001-12-10 00:00 build/ +--rw-r--r-- jes/glone 312019 2001-12-10 00:00 build/smake-1.2.tar.gz +-drwxr-sr-x jes/glone 0 2001-11-09 18:20 build/psmake/ +--rwxr-xr-x jes/glone 259 2000-01-09 16:36 build/psmake/MAKE +--rwxr-xr-x jes/glone 4820 2001-02-25 22:45 build/psmake/MAKE.sh +--rw-r--r-- jes/glone 647 2001-02-25 23:50 build/psmake/Makefile +-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 - skipped (multi-fail.at:26) - skipped (gtarfail.at:26) -243. ustar-big-8g.at:21: ./onetop04.at:24: +./onetop04.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -18857,7 +19099,56 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -242. ustar-big-2g.at:21: ./onetop01.at:24: +stderr: +233. capabs_raw01.at:25: stderr: +240. gtarfail2.at:21: 239. gtarfail.at:21: --- - 2026-10-29 13:56:43.457806017 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2026-10-29 13:56:43.450399939 +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 + +./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.*' + +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? +) +--- - 2026-10-29 13:56:43.460420338 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2026-10-29 13:56:43.450399939 +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 + + skipped (capabs_raw01.at:28) +244. pax-big-10g.at:21: skipped (gtarfail.at:26) +stderr: +--- - 2026-10-29 13:56:43.463025592 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2026-10-29 13:56:43.458399939 +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 + +./onetop01.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -18878,9 +19169,6 @@ tar --one-top-level -x -f ../a.tar find . | sort ) - skipped (ustar-big-8g.at:26) - skipped (ustar-big-2g.at:26) -stderr: ./onetop02.at:24: mkdir oldgnu (cd oldgnu @@ -18902,6 +19190,66 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) + skipped (gtarfail2.at:26) +243. ustar-big-8g.at:21: 242. ustar-big-2g.at:21: skipped (pax-big-10g.at:26) + skipped (ustar-big-2g.at:26) + skipped (ustar-big-8g.at:26) +./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 +) ./onetop03.at:24: mkdir oldgnu (cd oldgnu @@ -18923,12 +19271,24 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ---- - 2025-09-26 07:24:00.331900006 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2025-09-26 07:24:00.323749929 +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 - +./onetop04.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 + +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 +) ./onetop05.at:28: mkdir oldgnu (cd oldgnu @@ -18976,7 +19336,7 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop04.at:24: +./onetop02.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18992,15 +19352,17 @@ 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 ) -244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) -./onetop04.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./onetop01.at:24: +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 * @@ -19011,14 +19373,17 @@ 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 -x -f ../a.tar +find . | sort ) -./onetop02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop04.at:24: +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 * @@ -19029,10 +19394,7 @@ 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 +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) ./onetop03.at:24: mkdir ustar @@ -19055,12 +19417,12 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop01.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop02.at:24: +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 * @@ -19073,7 +19435,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 ) ./onetop05.at:28: @@ -19141,48 +19503,6 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop02.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 --show-transformed -v -x -f ../a.tar -find . | sort -) -./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 -) ./onetop01.at:24: mkdir posix (cd posix @@ -19204,81 +19524,6 @@ tar --one-top-level -x -f ../a.tar find . | sort ) -./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 -) -./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 -) -237. onetop04.at:21: ok -./onetop02.at:24: -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 -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 -) ./extrac20.at:24: mkdir gnu (cd gnu @@ -19351,6 +19596,70 @@ clean done ) +174. sparse06.at:21: ok +./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 +) +./onetop02.at:24: +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 +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 +) +./onetop01.at:24: +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 +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level -x -f ../a.tar +find . | sort +) ./onetop03.at:24: mkdir gnu (cd gnu @@ -19372,6 +19681,7 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) +237. onetop04.at:21: ok ./onetop05.at:28: mkdir posix (cd posix @@ -19419,27 +19729,6 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop01.at:24: -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 -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort -) 235. onetop02.at:21: ok 234. onetop01.at:21: ok 236. onetop03.at:21: ok @@ -19490,28 +19779,21 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -174. sparse06.at:21: ok -238. onetop05.at:21: ok -103. extrac20.at:21: ok -./sptrdiff00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./grow.at:27: +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 --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file foo --length 50000k 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 +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./sptrdiff01.at:30: +238. onetop05.at:21: ok +./sptrdiff00.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19526,155 +19808,88 @@ echo creating tar --sparse -vcf bar foo baz echo comparing -genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ tar --sparse -vdf bar ) -./sptrcreat.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./update01.at:32: +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 --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') -./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 -) -./incr04.at:34: -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 -ckmtime || exit 77 +mkdir a +genfile --file a/b -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 cf arc a -sleep 1 +echo "separator" -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 +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 ) -./incr03.at:31: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +103. extrac20.at:21: ok +./update02.at:29: +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 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 +mkdir a +genfile --file a/b -mv directory orig +tar cf arc a -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort +echo "separator" -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort +sleep 2 +touch a/b -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 ) -./rename02.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./sptrdiff01.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 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 +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 ) +125. incr04.at:29: ok +124. incr03.at:28: ok ./update04.at:23: -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 * @@ -19695,137 +19910,117 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -155. time01.at:20: ok -./rename03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +138. rename02.at:24: ok +139. rename03.at:23: ok +./incr02.at:35: +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 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file -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 +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) +# 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. -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 +tar -cf archive -g db dir -tar xfg arch.1 /dev/null --warning=no-timestamp +# Move away the directory +mv dir orig -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +# Wait enough time for timestamps to differ in case of failure. +sleep 5 -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 * +# Restore the directory +tar -xf archive dir -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - ) -./sptrdiff00.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./sptrcreat.at:36: +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 --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 -) -./sptrdiff01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + 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') +./grow.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 * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file foo --length 50000k 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 --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./sptrcreat.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./update04.at:23: +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 -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') -181. sptrdiff00.at:26: ok +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 $? +) ./update02.at:29: -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 * @@ -19847,11 +20042,11 @@ tar tf arc | sort || exit 1 ) ./incremental.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +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 * @@ -19884,114 +20079,6 @@ echo y >structure/file tar cfv archive --listed=list structure ) -./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 - -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 -) -./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 -) -./update04.at:23: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 $? -) -./grow.at:27: -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 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) -125. incr04.at:29: ok -124. incr03.at:28: ok -138. rename02.at:24: ok -139. rename03.at:23: ok -182. sptrdiff01.at:26: ok -180. sptrcreat.at:33: ok -195. grow.at:24: ok ./chtype.at:30: mkdir posix (cd posix @@ -20032,139 +20119,6 @@ tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp find directory | sort ) -./exclude05.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 - - -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 - -) -./update04.at:23: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 $? -) -./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 - -) -./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 -) ./update01.at:32: mkdir ustar (cd ustar @@ -20217,6 +20171,75 @@ echo separator tar -MRt -f arc.1 -f arc.2) +./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') +155. time01.at:20: ok +./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 +) +119. listed01.at:26: ok +./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 +) +./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 +) ./update04.at:23: mkdir gnu (cd gnu @@ -20243,48 +20266,7 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -119. listed01.at:26: ok -143. chtype.at:27: 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 -) -187. update04.at:20: ok -./update01.at:32: +./update02.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20304,13 +20286,13 @@ echo "separator" sleep 2 -genfile --file a/c +touch a/b tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -./update02.at:29: +./update01.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20330,48 +20312,15 @@ echo "separator" sleep 2 -touch a/b +genfile --file a/c tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -./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 - -) -./update01.at:32: +143. chtype.at:27: ok +187. update04.at:20: ok +./grow.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20380,23 +20329,12 @@ 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 +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) +182. sptrdiff01.at:26: ok +181. sptrdiff00.at:26: ok ./incr02.at:35: mkdir posix (cd posix @@ -20443,6 +20381,8 @@ # Check the timestamp genfile --stat=mtime dir/subdir1 | diff ts - ) +116. incremental.at:23: ok +180. sptrcreat.at:33: ok ./update02.at:29: mkdir gnu (cd gnu @@ -20469,16 +20409,40 @@ echo "separator" tar tf arc | sort || exit 1 ) +195. grow.at:24: ok 160. multiv04.at:36: ok -116. incremental.at:23: ok -184. update01.at:29: ok -185. update02.at:26: 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 +) ./exclude05.at:24: -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 * @@ -20577,8 +20541,81 @@ echo Final files: find tart -print | sort 2>/dev/null ) +185. update02.at:26: ok +184. update01.at:29: ok 118. incr02.at:32: ok ./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 + +) +120. listed02.at:28: ok +./exclude05.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 + + +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 + +) +./exclude05.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20615,14 +20652,13 @@ ) stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 begin --rw-r--r-- pbuilder1/pbuilder1 8589935104 2025-09-26 07:23 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-09-26 07:23 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 begin +-rw-r--r-- pbuilder2/pbuilder2 8589935104 2026-10-29 13:56 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2026-10-29 13:56 end separator sparsefile 8589935104 171. sparse03.at:21: ok 64. exclude05.at:21: ok -120. listed02.at:28: ok 173. sparse05.at:21: ok ## ------------- ## @@ -20640,7 +20676,7 @@ create-stamp debian/debhelper-build-stamp dh_prep dh_auto_install - make -j40 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' @@ -20679,19 +20715,19 @@ 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' -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' +make[3]: Nothing to be done for 'install-data-am'. /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' +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/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' + /usr/bin/install -c backup.sh dump-remind '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' make[3]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/scripts' make[2]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/scripts' Making install in po @@ -20779,45 +20815,45 @@ dh_perl dh_link dh_strip_nondeterminism - Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo 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/pt_BR/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo dh_compress dh_fixperms dh_missing @@ -20830,8 +20866,8 @@ dh_gencontrol dh_md5sums dh_builddeb -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-dbgsym' in '../tar-dbgsym_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 @@ -20840,12 +20876,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/661140/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/661140/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/2847349 and its subdirectories -I: Current time: Thu Sep 25 19:26:29 -12 2025 -I: pbuilder-time-stamp: 1758871589 +I: removing directory /srv/workspace/pbuilder/661140 and its subdirectories +I: Current time: Fri Oct 30 03:59:22 +14 2026 +I: pbuilder-time-stamp: 1793282362