Diff of the two buildlogs: -- --- b1/build.log 2024-12-19 11:46:04.779148441 +0000 +++ b2/build.log 2024-12-19 11:58:18.390114696 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Jan 21 06:05:48 -12 2026 -I: pbuilder-time-stamp: 1769018748 +I: Current time: Fri Dec 20 01:46:08 +14 2024 +I: pbuilder-time-stamp: 1734608768 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -34,54 +34,86 @@ 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/12565/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/52244/tmp/hooks/D01_modify_environment starting +debug: Running on ionos2-i386. +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 Dec 19 11:46 /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/52244/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/52244/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='i386' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=22 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='i386' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=i386 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=10 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=i686 + HOST_ARCH=i386 IFS=' ' - INVOCATION_ID='1c591971dd4542cfaa6423f0f4b484a5' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - LD_LIBRARY_PATH='/usr/lib/libeatmydata' - LD_PRELOAD='libeatmydata.so' - 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='12565' - PS1='# ' - PS2='> ' + INVOCATION_ID=6197ab6790674a4b8cebd2dba52d1a1a + LANG=C + LANGUAGE=de_CH:de + LC_ALL=C + LD_LIBRARY_PATH=/usr/lib/libeatmydata + LD_PRELOAD=libeatmydata.so + MACHTYPE=i686-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=52244 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.K1NduxYG/pbuilderrc_uztn --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.K1NduxYG/b1 --logfile b1/build.log tar_1.35+dfsg-3.1.dsc' - SUDO_GID='112' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://213.165.73.152: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.K1NduxYG/pbuilderrc_3Kb0 --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.K1NduxYG/b2 --logfile b2/build.log tar_1.35+dfsg-3.1.dsc' + SUDO_GID=112 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://46.16.76.132:3128 I: uname -a - Linux ionos16-i386 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-28-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.119-1 (2024-11-22) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Nov 22 2024 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/12565/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/52244/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -172,7 +204,7 @@ Get: 37 http://deb.debian.org/debian unstable/main i386 libpcre2-dev i386 10.44-5 [800 kB] Get: 38 http://deb.debian.org/debian unstable/main i386 libsepol-dev i386 3.7-1 [405 kB] Get: 39 http://deb.debian.org/debian unstable/main i386 libselinux1-dev i386 3.7-3+b1 [168 kB] -Fetched 23.4 MB in 0s (79.8 MB/s) +Fetched 23.4 MB in 1s (18.4 MB/s) debconf: delaying package configuration, since apt-utils is not installed 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 ... 19953 files and directories currently installed.) @@ -344,7 +376,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/52244/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/52244/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 @@ -381,8 +417,8 @@ checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... 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 whether make supports nested variables... (cached) yes checking for gcc... gcc @@ -1036,7 +1072,7 @@ config.status: executing tests/atconfig commands make[1]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg' dh_auto_build - make -j22 + make -j10 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' @@ -1093,6 +1129,9 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./ctype.in.h > ctype.h-t +mv alloca.h-t alloca.h +mv configmake.h-t configmake.h +mv ctype.h-t ctype.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_DIRENT_H''@|1|g' \ @@ -1162,7 +1201,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./fcntl.in.h > fcntl.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|@''HAVE_GETOPT_H''@|1|g' \ @@ -1172,16 +1210,29 @@ -e 's|@''NEXT_GETOPT_H''@||g' \ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ ./getopt.in.h > getopt.h-t -mv configmake.h-t configmake.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_SYS_CDEFS_H''@|1|g' \ ./getopt-cdefs.in.h > getopt-cdefs.h-t -mv ctype.h-t ctype.h -/usr/bin/mkdir -p 'malloc' -/usr/bin/mkdir -p 'malloc' /usr/bin/mkdir -p 'malloc' +mv dirent.h-t dirent.h mv error.h-t error.h mv getopt.h-t getopt.h +mv getopt-cdefs.h-t getopt-cdefs.h +mv fcntl.h-t fcntl.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e '/libc_hidden_proto/d' \ + ./malloc/dynarray.h > malloc/dynarray.gl.h-t +/usr/bin/mkdir -p 'malloc' +mv malloc/dynarray.gl.h-t malloc/dynarray.gl.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' \ + -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \ + -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \ + -e 's|__glibc_likely|_GL_LIKELY|g' \ + -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ + ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t +/usr/bin/mkdir -p 'malloc' 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' \ @@ -1211,26 +1262,14 @@ -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 -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 -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' \ - -e 's|__attribute_nonnull__|_GL_ATTRIBUTE_NONNULL|g' \ - -e 's|__attribute_warn_unused_result__|_GL_ATTRIBUTE_NODISCARD|g' \ - -e 's|__glibc_likely|_GL_LIKELY|g' \ - -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ - ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t +mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ -e 's|__glibc_likely|_GL_LIKELY|g' \ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ -e '/libc_hidden_proto/d' \ ./malloc/scratch_buffer.h > malloc/scratch_buffer.gl.h-t +mv inttypes.h-t inttypes.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_LANGINFO_H''@|1|g' \ @@ -1249,6 +1288,7 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./langinfo.in.h > langinfo.h-t +mv malloc/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' \ @@ -1256,6 +1296,7 @@ -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_LIMITS_H''@||g' \ ./limits.in.h > limits.h-t +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' \ @@ -1282,9 +1323,7 @@ -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.gl.h-t malloc/dynarray.gl.h -mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h -mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h +mv limits.h-t limits.h /usr/bin/mkdir -p 'selinux' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ @@ -1312,27 +1351,28 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./signal.in.h > signal.h-t -mv inttypes.h-t inttypes.h -mv langinfo.h-t langinfo.h -mv limits.h-t limits.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SELINUX_SELINUX_H''@/1/g' \ -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_STDDEF_H''@||g' \ - -e 's|@''HAVE_MAX_ALIGN_T''@|1|g' \ - -e 's|@''HAVE_WCHAR_T''@|1|g' \ - -e 's|@''REPLACE_NULL''@|0|g' \ - ./stddef.in.h > stddef.h-t + -e 's|@''NEXT_SELINUX_SELINUX_H''@||g' \ + ./se-selinux.in.h > selinux/selinux.h-t sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ - -e 's/@''HAVE_SELINUX_SELINUX_H''@/1/g' \ -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_SELINUX_SELINUX_H''@||g' \ - ./se-selinux.in.h > selinux/selinux.h-t + -e 's|@''NEXT_STDDEF_H''@||g' \ + -e 's|@''HAVE_MAX_ALIGN_T''@|1|g' \ + -e 's|@''HAVE_WCHAR_T''@|1|g' \ + -e 's|@''REPLACE_NULL''@|0|g' \ + ./stddef.in.h > stddef.h-t +mv locale.h-t locale.h +mv signal.h-t signal.h +mv selinux/selinux.h-t selinux/selinux.h +mv stddef.h-t stddef.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1457,7 +1497,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > stdio.h-t -mv locale.h-t locale.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' \ @@ -1605,7 +1644,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 stddef.h-t stddef.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1707,8 +1745,6 @@ -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 signal.h-t signal.h -mv selinux/selinux.h-t selinux/selinux.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' \ @@ -1726,7 +1762,6 @@ ./strings.in.h > strings.h-t /usr/bin/mkdir -p 'sys' /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' \ @@ -1741,7 +1776,8 @@ -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 -/usr/bin/mkdir -p 'sys' +mv strings.h-t strings.h +mv stdio.h-t stdio.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' \ @@ -1799,7 +1835,11 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_stat.in.h > sys/stat.h-t -mv strings.h-t strings.h +mv sys/random.h-t sys/random.h +mv string.h-t string.h +mv stdlib.h-t stdlib.h +/usr/bin/mkdir -p 'sys' +mv sys/stat.h-t sys/stat.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_SYS_TIME_H''@/1/g' \ @@ -1817,6 +1857,7 @@ -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 +/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' \ @@ -1864,6 +1905,7 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./time.in.h > time.h-t +mv sys/time.h-t sys/time.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' \ @@ -1873,6 +1915,7 @@ -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 time.h-t time.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_UCHAR_H''@/1/g' \ @@ -1921,7 +1964,8 @@ -e 's|@''REPLACE_MBRTOC32''@|1|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ ./uchar.in.h > uchar.h-t -mv sys/random.h-t sys/random.h +mv sys/types.h-t sys/types.h +mv uchar.h-t uchar.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' \ @@ -2062,8 +2106,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/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 \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNINORM_NFD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2071,6 +2113,7 @@ -e 's/@''GNULIB_UNINORM_NFKD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNINORM_NFKC_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ ./uninorm.in.h > uninorm.h-t +mv unicase.h-t unicase.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_UNISTD_H''@|1|g' \ @@ -2268,11 +2311,11 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > unistd.h-t -mv unicase.h-t unicase.h +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 sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.h -mv uninorm.h-t uninorm.h -mv time.h-t time.h +mv unitypes.h-t unitypes.h +mv uniwidth.h-t uniwidth.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_UTIME_H''@/1/g' \ @@ -2288,10 +2331,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./utime.in.h > utime.h-t -mv unitypes.h-t unitypes.h -mv sys/stat.h-t sys/stat.h -mv uniwidth.h-t uniwidth.h -mv uchar.h-t uchar.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' \ @@ -2415,7 +2454,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > wchar.h-t -mv string.h-t string.h +mv unictype.h-t unictype.h +mv utime.h-t utime.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' \ @@ -2445,13 +2485,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 utime.h-t utime.h -mv stdio.h-t stdio.h +mv unistd.h-t unistd.h mv wctype.h-t wctype.h -mv stdlib.h-t stdlib.h mv wchar.h-t wchar.h -mv unictype.h-t unictype.h -mv unistd.h-t unistd.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' @@ -2703,7 +2739,7 @@ make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' cp tests/testsuite debian/testsuite.orig dh_auto_test - make -j22 check "TESTSUITEFLAGS=-j22 --verbose" VERBOSE=1 + make -j10 check "TESTSUITEFLAGS=-j10 --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' @@ -2755,9 +2791,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 -j22 --verbose +/bin/sh ./testsuite -j10 --verbose ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## @@ -2771,22 +2807,54 @@ +3. options.at:24: testing mixing options ... +./options.at:27: +echo > file1 +TAR_OPTIONS=--numeric-owner tar chof archive file1 +tar tf archive + +7. opcomp02.at:21: testing occurrence compatibility ... +./opcomp02.at:24: +tar --occurrence=1 -tf test.tar + +10. opcomp05.at:21: testing --pax-option compatibility ... +./opcomp05.at:24: +tar -Hgnu -cf test.tar --pax-option user:=root . +4. options02.at:26: testing interspersed options ... +./options02.at:29: +echo > file1 +tar c file1 -f archive +tar tf archive +9. opcomp04.at:21: testing compress option compatibility ... +./opcomp04.at:24: +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +genfile --file file +tar czf test.tar file +genfile --file newfile +tar rzf test.tar newfile +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: +echo dir/bar > exclude.list +mkdir dir +genfile --file=dir/foo +genfile --file=dir/bar +TAR_OPTIONS=--exclude-from=exclude.list tar cf arc.tar dir +tar tf arc.tar 1. version.at:19: testing tar version ... ./version.at:21: tar --version | sed 1q - -3. options.at:24: testing mixing options ... -./options.at:27: -echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 -tar tf archive - +7. opcomp02.at:21: 1. version.at:19: ok + ok +4. options02.at:26: ok 2. pipe.at:29: testing decompressing from stdin ... ./pipe.at:33: mkdir v7 @@ -2811,63 +2879,19 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) - - -4. options02.at:26: testing interspersed options ... -./options02.at:29: -echo > file1 -tar c file1 -f archive -tar tf archive - 6. opcomp01.at:21: testing occurrence compatibility ... ./opcomp01.at:24: tar --occurrence=1 -cf test.tar . -5. options03.at:21: testing TAR_OPTIONS with string arguments ... -./options03.at:31: -echo dir/bar > exclude.list -mkdir dir -genfile --file=dir/foo -genfile --file=dir/bar -TAR_OPTIONS=--exclude-from=exclude.list tar cf arc.tar dir -tar tf arc.tar - - - -8. opcomp03.at:21: testing --verify compatibility ... -./opcomp03.at:24: -tar -tWf test.tar . - -7. opcomp02.at:21: testing occurrence compatibility ... -./opcomp02.at:24: -tar --occurrence=1 -tf test.tar - -9. opcomp04.at:21: testing compress option compatibility ... -./opcomp04.at:24: - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -genfile --file file -tar czf test.tar file -genfile --file newfile -tar rzf test.tar newfile +6. opcomp01.at:21: ok +8. opcomp03.at:21: ok +10. opcomp05.at:21: ok +3. options.at:24: ok -10. opcomp05.at:21: testing --pax-option compatibility ... -./opcomp05.at:24: -tar -Hgnu -cf test.tar --pax-option user:=root . +5. options03.at:21: ok -12. defaults.at:16: testing checkpoint defaults ... -./defaults.at:18: -mkdir t -cd t -for i in 0 1 2 3 4 5 6 7 8 9 -do - genfile --length 10240 --file $i -done -TAR_OPTIONS=-Hgnu -export TAR_OPTIONS -tar --checkpoint -c -f ../a.tar . +9. opcomp04.at:21: ok 11. opcomp06.at:21: testing --pax-option compatibility ... @@ -2899,8 +2923,10 @@ genfile --file file tar -cf test.tar --acls -Hgnu file -14. dot.at:16: testing dot action ... -./dot.at:18: + + +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 @@ -2910,11 +2936,11 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint-action=dot -c -f ../a.tar . +tar --checkpoint=2 -c -f ../a.tar . -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 @@ -2924,9 +2950,30 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=2 -c -f ../a.tar . +tar --checkpoint -c -f ../a.tar . + + +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 . +--- - 2024-12-19 11:49:50.650146267 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2024-12-19 11:49:50.641064231 +0000 +@@ -1,3 +1 @@ +-tar: --acls can be used only on POSIX archives +-Try 'tar --help' or 'tar --usage' for more information. + + 15. dot-compat.at:16: testing dot action (compatibility syntax) ... ./dot-compat.at:18: mkdir t @@ -2941,7 +2988,44 @@ tar --checkpoint=.2 -c -f ../a.tar . -6. opcomp01.at:21: ok +16. dot-int.at:16: testing dot action and interval ... +./dot-int.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 --checkpoint=2 -c -f ../a.tar . + + +11. opcomp06.at:21: +./pipe.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 + + +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) 17. testsuite.at:242: testing compress: gzip ... ./testsuite.at:242: @@ -2972,6 +3056,37 @@ tar xf k.tar.gz test -f empty +18. testsuite.at:243: testing compress: bzip2 ... +./testsuite.at:243: + +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 + +unset TAR_OPTIONS + +touch empty +set -e +: create with --bzip2 +tar --bzip2 -cf k.tar.bz2 empty +tar tf k.tar.bz2 + + +echo testing .bz2 +tar -acf k2.tar.bz2 empty +cat k2.tar.bz2 | bzip2 -d > k.bz2.tar +tar tf k.bz2.tar + +echo testing .tbz2 +tar -acf k2.tar.tbz2 empty +cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar +tar tf k.tbz2.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.bz2 +test -f empty + + skipped (opcomp06.at:24) 19. testsuite.at:244: testing compress: xz ... ./testsuite.at:244: @@ -3002,61 +3117,90 @@ tar xf k.tar.xz test -f empty -18. testsuite.at:243: testing compress: bzip2 ... -./testsuite.at:243: -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 +./pipe.at:33: +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 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) +12. defaults.at:16: ok +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 --bzip2 -tar --bzip2 -cf k.tar.bz2 empty -tar tf k.tar.bz2 - +: create with --lzip +tar --lzip -cf k.tar.lz empty +tar tf k.tar.lz -echo testing .bz2 -tar -acf k2.tar.bz2 empty -cat k2.tar.bz2 | bzip2 -d > k.bz2.tar -tar tf k.bz2.tar -echo testing .tbz2 -tar -acf k2.tar.tbz2 empty -cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar -tar tf k.tbz2.tar +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.bz2 +tar xf k.tar.lz test -f empty -3. options.at:24: 4. options02.at:26: ok -16. dot-int.at:16: testing dot action and interval ... -./dot-int.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 +13. interval.at:16: 16. dot-int.at:16: ok + ok +14. dot.at:16: ok +--- - 2024-12-19 11:49:50.832273475 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2024-12-19 11:49:50.821056869 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lz +-empty + +20. testsuite.at:246: skipped (testsuite.at:246) +15. dot-compat.at:16: ok + + + + +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 -tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . -7. opcomp02.at:21: 10. opcomp05.at:21: ok - ok - ok ---- - 2026-01-21 18:07:04.099943599 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2026-01-21 18:07:04.093765610 +0000 -@@ -1,3 +1 @@ --tar: --acls can be used only on POSIX archives --Try 'tar --help' or 'tar --usage' for more information. - -1. version.at:19: 8. opcomp03.at:21: ok 22. testsuite.at:248: testing compress: zstd ... ./testsuite.at:248: @@ -3087,33 +3231,7 @@ tar xf k.tar.zst test -f empty - ok -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 - -11. opcomp06.at:21: 21. testsuite.at:247: testing compress: lzop ... +21. testsuite.at:247: testing compress: lzop ... ./testsuite.at:247: cat /dev/null | lzop - > /dev/null 2>&1 || exit 77 @@ -3138,16 +3256,9 @@ tar xf k.tar.lzo test -f empty - skipped (opcomp06.at:24) ---- - 2026-01-21 18:07:04.104617616 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2026-01-21 18:07:04.101765610 +0000 -@@ -1,4 +1 @@ --empty --testing .lzo --empty - ---- - 2026-01-21 18:07:04.104787644 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2026-01-21 18:07:04.101765610 +0000 +17. testsuite.at:242: ok +--- - 2024-12-19 11:49:50.951513469 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2024-12-19 11:49:50.945051797 +0000 @@ -1,6 +1 @@ -empty -testing .zst @@ -3155,44 +3266,6 @@ -testing .tzst -empty ---- - 2026-01-21 18:07:04.105923715 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2026-01-21 18:07:04.101765610 +0000 -@@ -1,4 +1 @@ --empty --testing .lz --empty - -22. testsuite.at:248: 21. testsuite.at:247: -5. options03.at:21: ok -20. testsuite.at:246: skipped (testsuite.at:248) - skipped (testsuite.at:247) - - - skipped (testsuite.at:246) - -9. opcomp04.at:21: - ok - - - - - -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 - 24. positional02.at:21: testing Directory ... ./positional02.at:24: @@ -3207,8 +3280,45 @@ tar -tf a.tar | sort tar -cf a.tar . -C dir +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 * + +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 + -25. positional03.at:21: testing Several options ... +echo 3: +tar -cvf arc.tar -T input +) +--- - 2024-12-19 11:49:50.960368091 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2024-12-19 11:49:50.945051797 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lzo +-empty + +22. testsuite.at:248: 25. positional03.at:21: testing Several options ... ./positional03.at:24: test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -3221,7 +3331,37 @@ > dir/A.b tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort +18. testsuite.at:243: ok +21. testsuite.at:247: skipped (testsuite.at:248) + skipped (testsuite.at:247) +./pipe.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 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) + + +24. positional02.at:21: ok +25. positional03.at:21: ok 27. T-mult.at:21: testing multiple file lists ... ./T-mult.at:24: mkdir ustar @@ -3249,62 +3389,8 @@ tar cf archive -T F1 -T F2 tar tf archive ) -13. interval.at:16: ./pipe.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 - - -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) - ok -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 * - -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 - +23. positional01.at:21: ok -echo 3: -tar -cvf arc.tar -T input -) -15. dot-compat.at:16: ok 28. T-nest.at:21: testing nested file lists ... ./T-nest.at:24: mkdir ustar @@ -3333,7 +3419,6 @@ tar cf archive -T F1 tar tf archive ) - 29. T-rec.at:21: testing recursive file lists ... ./T-rec.at:24: mkdir ustar @@ -3360,7 +3445,7 @@ echo $? tar tf archive ) -14. dot.at:16: ok + 30. T-recurse.at:27: testing files-from & recurse: toggle ... ./T-recurse.at:30: mkdir v7 @@ -3400,6 +3485,38 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) + + +./add-file.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file -File +genfile --file foo +genfile --file bar + +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File + +echo 2: +tar -cvf arc.tar foo --add-file -File bar + + +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input +) 31. T-recurse.at:66: testing toggle --recursion (not) from -T ... ./T-recurse.at:69: mkdir v7 @@ -3428,7 +3545,49 @@ tar tf archive ) -12. defaults.at:16: 32. T-cd.at:21: testing -C in file lists ... +27. T-mult.at:21: ok +28. T-nest.at:21: ok +./pipe.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir 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) +33. T-empty.at:26: testing empty entries ... +./T-empty.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +genfile --file jeden +genfile --file dwa +genfile --file trzy + +tar cfvT archive ../file-list +) +32. T-cd.at:21: testing -C in file lists ... ./T-cd.at:24: mkdir ustar (cd ustar @@ -3454,9 +3613,9 @@ tar cf archive -T F1 tar tf archive | sort ) - ok -16. dot-int.at:16: ok -33. T-empty.at:26: testing empty entries ... +29. T-rec.at:21: ok + + 34. T-null.at:21: testing 0-separated file without -0 ... ./T-null.at:24: mkdir ustar @@ -3482,22 +3641,6 @@ tar cfTv archive file-list ) -./T-empty.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -genfile --file jeden -genfile --file dwa -genfile --file trzy - -tar cfvT archive ../file-list -) 35. T-null2.at:17: testing --null enables verbatim reading ... ./T-null2.at:24: mkdir ustar @@ -3524,17 +3667,34 @@ cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - ) +./T-recurse.at:69: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file -25. positional03.at:21: ok +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -24. positional02.at:21: 23. positional01.at:21: - ok - ok -28. T-nest.at:21: ok -27. T-mult.at:21: ok -36. T-zfile.at:26: testing empty file ... -./T-zfile.at:29: + +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 +tar tf archive + +) +./add-file.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3543,23 +3703,69 @@ export TAR_OPTIONS rm -rf * -genfile --length=0 --file empty -genfile --file a -genfile --file b -cat >valid <<'_ATEOF' -a -b +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 -tar cf archive -T empty -T valid -tar tf archive -echo "==" -tar cf archive -T valid -T empty -tar tf archive +echo 3: +tar -cvf arc.tar -T input ) -37. T-nonl.at:27: testing entries with missing newlines ... -./T-nonl.at:30: +./T-recurse.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory1 directory2 +touch directory1/file directory2/file + +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--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" +) +33. T-empty.at:26: ok +32. T-cd.at:21: ok +36. T-zfile.at:26: testing empty file ... +./T-zfile.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3569,49 +3775,26 @@ 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' +genfile --file a +genfile --file b +cat >valid <<'_ATEOF' a b _ATEOF -tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist +tar cf archive -T empty -T valid tar tf archive -echo == -tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl +echo "==" +tar cf archive -T valid -T empty tar tf archive ) -29. T-rec.at:21: 17. testsuite.at:242: ok -38. T-dir00.at:28: testing recursive extraction from --files-from ... -./T-dir00.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) ./T-recurse.at:69: -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 * @@ -3633,14 +3816,15 @@ tar tf archive ) - ok -18. testsuite.at:243: ok -32. T-cd.at:21: ./add-file.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + + +35. T-null2.at:17: ok +./add-file.at:33: +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 * @@ -3665,30 +3849,9 @@ echo 3: tar -cvf arc.tar -T input ) - ok -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 -) - -39. T-dir01.at:28: testing trailing slash in --files-from ... -./T-dir01.at:30: +2. pipe.at:29: ok +38. T-dir00.at:28: testing recursive extraction from --files-from ... +./T-dir00.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3705,10 +3868,10 @@ genfile -f dir/file2 tar cf archive dir rm -rf dir -echo dir/ > list +echo dir > list tar xfTv archive list | sort ) -./pipe.at:33: +./T-recurse.at:30: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3717,29 +3880,6 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) -./T-recurse.at:30: -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 @@ -3769,85 +3909,100 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) +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 -35. T-null2.at:17: ok +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 +) 34. T-null.at:21: ok +36. T-zfile.at:26: ok -33. T-empty.at:26: ok - -41. verbose.at:26: testing tar cvf - ... -./verbose.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./add-file.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) - +genfile --file -File +genfile --file foo +genfile --file bar +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -42. gzip.at:23: testing gzip ... -./gzip.at:28: +echo 2: +tar -cvf arc.tar foo --add-file -File bar -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 +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF -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 +echo 3: +tar -cvf arc.tar -T input ) -44. recurs02.at:30: testing recurse: toggle ... -./recurs02.at:33: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +./T-recurse.at:69: +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 directory1 directory2 touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 + +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF + + +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 + ) +40. indexfile.at:26: testing tar --index-file=FILE --file=- ... ./indexfile.at:29: -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 * @@ -3861,8 +4016,8 @@ echo "Testing the archive" tar -tf archive ) -45. shortrec.at:25: testing short records ... -./shortrec.at:28: +39. T-dir01.at:28: testing trailing slash in --files-from ... +./T-dir01.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3871,63 +4026,21 @@ 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 -) - - - -36. T-zfile.at:26: 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 * -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file - - - -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | 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}' -) -47. same-order01.at:26: testing working -C with --same-order ... -./same-order01.at:29: +41. verbose.at:26: testing tar cvf - ... +./verbose.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3936,33 +4049,12 @@ 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 - -ls directory|sort +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) -49. append.at:21: testing append ... -./append.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) ./T-dir00.at:30: mkdir oldgnu (cd oldgnu @@ -3984,12 +4076,22 @@ tar xfTv archive list | sort ) 37. T-nonl.at:27: 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 + ./T-recurse.at:69: -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 * @@ -4011,7 +4113,7 @@ tar tf archive ) -./T-dir01.at:30: +./indexfile.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4021,94 +4123,76 @@ 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 -) -48. same-order02.at:25: testing multiple -C options ... -./same-order02.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to +mkdir directory +genfile --file=directory/a --length=1035 -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -ls en -echo separator -ls to +echo "Testing the archive" +tar -tf archive ) -./add-file.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +26. add-file.at:21: ok +./T-recurse.at:30: +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 --file -File -genfile --file foo -genfile --file bar +mkdir directory1 directory2 +touch directory1/file directory2/file -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--recursion +directory2/ +_ATEOF -echo 2: -tar -cvf arc.tar foo --add-file -File bar + +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -cat >input <<'_ATEOF' -foo ---add-file=-File -bar +cat >F2B <<'_ATEOF' +directory2/ _ATEOF -echo 3: -tar -cvf arc.tar -T input +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" ) -42. gzip.at:23: ok -52. append03.at:21: testing append with name transformation ... -./append03.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./T-dir01.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 --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 +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 ) -50. append01.at:29: testing appending files with long names ... -./append01.at:34: + +./verbose.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4117,52 +4201,40 @@ export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) -51. append02.at:54: testing append vs. create ... -./append02.at:57: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +42. gzip.at:23: ok +./indexfile.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 --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 +mkdir directory +genfile --file=directory/a --length=1035 -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 "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -echo Comparing archives -cmp archive.1 archive.2 +echo "Testing the archive" +tar -tf archive ) +43. recurse.at:21: testing recurse ... ./recurse.at:24: -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 * @@ -4171,45 +4243,49 @@ tar --create --file archive --no-recursion directory || exit 1 tar tf archive ) -./verbose.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +31. T-recurse.at:66: ok +./T-dir00.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 * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -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 ) -./pipe.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +44. recurs02.at:30: testing recurse: toggle ... +./recurs02.at:33: +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 * - -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) -./indexfile.at:29: +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 +) +./verbose.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4218,22 +4294,18 @@ 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 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) ./T-recurse.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -4266,40 +4338,27 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) - - -./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) -./shortrec.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./T-dir01.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 directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null -rm -r directory +test -z "`sort < /dev/null 2>&1`" || exit 77 + +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 ) -./recurs02.at:33: +./recurse.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4308,77 +4367,34 @@ 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 ) -53. append04.at:29: testing append with verify ... -./append04.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./indexfile.at:29: +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 * -# 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 +mkdir directory +genfile --file=directory/a --length=1035 -# Append it to the already created archive: -tar rpfW archive.tar file3 +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -# Verify content of the new archive: -tar -tf archive.tar +echo "Testing the archive" +tar -tf archive ) -54. append05.at:32: testing append after changed blocking ... -./append05.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -for f in a b c d e f g h i -do - echo $f > $f -done -decho 'creating archive' -tar -cf archive -b1 a b c - -tar tf archive - -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive - -decho 'adding g h i' -tar -vrf archive -b5 g h i -decho 'resulting archive' -tar tf archive -) -./T-recurse.at:69: +46. numeric.at:18: testing --numeric-owner basic tests ... +./numeric.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -4387,26 +4403,40 @@ export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF +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 cf archive -T F1 --recursion -T F2 -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 --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}' ) -55. xform-h.at:30: testing transforming hard links on create ... -./xform-h.at:39: +45. shortrec.at:25: testing short records ... +./shortrec.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4415,27 +4445,35 @@ 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' +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 +) +./indexfile.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +mkdir directory +genfile --file=directory/a --length=1035 -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive +echo "Testing the archive" +tar -tf archive ) -./T-dir00.at:30: +./recurse.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4444,18 +4482,12 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -./append03.at:26: +./recurs02.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4464,52 +4496,54 @@ 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 +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 ) -./recurse.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./verbose.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) -./same-order01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +30. T-recurse.at:27: ok +./T-dir01.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * 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 +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 ) -./add-file.at:33: +./T-dir00.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -4518,28 +4552,20 @@ 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo 3: -tar -cvf arc.tar -T input +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) -./verbose.at:29: +40. indexfile.at:26: ok + +./recurs02.at:33: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4548,28 +4574,47 @@ 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 +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 ) -./append01.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./recurse.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 * -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 +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 tar tf archive ) -./same-order02.at:28: +./verbose.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 +) +./shortrec.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4578,6 +4623,50 @@ 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: +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 + + +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 +) + +41. verbose.at:26: ok +48. same-order02.at:25: testing multiple -C options ... +./same-order02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + genfile -l 1024 -f file1 genfile -l 1024 -f file2 tar cf archive file1 file2 @@ -4594,12 +4683,26 @@ echo separator ls to ) +./recurse.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) ./T-dir01.at:30: -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 * @@ -4614,71 +4717,7 @@ echo dir/ > list tar xfTv archive list | sort ) -./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 -) -./append02.at:57: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 - -echo Comparing archives -cmp archive.1 archive.2 -) -./append.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./pipe.at:33: +./numeric.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4687,59 +4726,39 @@ 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 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 13 --file directory/file2 -tar cf archive directory -mv directory orig -cat archive | tar xfv - --warning=no-timestamp | sort -echo "separator" -cmp orig/file1 directory/file1 -echo "separator" -cmp orig/file2 directory/file2) -./T-recurse.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF +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}' -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF +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}' -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +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}' -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +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}' -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" ) -./recurse.at:24: +./recurs02.at:33: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -4748,38 +4767,6 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -./shortrec.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 -) -./recurs02.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - mkdir directory1 directory2 touch directory1/file directory2/file tar --create --file archive \ @@ -4791,22 +4778,7 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -./verbose.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -./T-recurse.at:69: +./T-dir00.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4815,25 +4787,18 @@ 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 ) -./append03.at:26: +./shortrec.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4842,16 +4807,18 @@ export TAR_OPTIONS rm -rf * -genfile --file file.1 -genfile --file file.2 +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 -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 +rm -r directory ) -./append04.at:32: + +43. recurse.at:21: ok +./same-order01.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4860,40 +4827,60 @@ export TAR_OPTIONS rm -rf * -# Create two empty files: -touch file1 file2 -# Create an archive: -tar cpfW archive.tar file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 -# Append it to the already created archive: -tar rpfW archive.tar file3 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Verify content of the new archive: -tar -tf archive.tar +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 + +ls directory|sort ) -./append01.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +49. append.at:21: testing append ... +./append.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 * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./same-order02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive +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 ) -./indexfile.at:29: + +./recurs02.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4902,17 +4889,37 @@ 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 +) +./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 -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 ) -./append05.at:35: +50. append01.at:29: testing appending files with long names ... +./append01.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4921,25 +4928,27 @@ 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 == +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 +) +39. T-dir01.at:28: ok +38. T-dir00.at:28: ok +./append01.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -decho 'adding g h i' -tar -vrf archive -b5 g h i - -decho 'resulting archive' +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 ) ./same-order01.at:29: @@ -4964,56 +4973,19 @@ ls directory|sort ) -./add-file.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar - - -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF - - -echo 3: -tar -cvf arc.tar -T input -) -./T-dir00.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./append.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) ./same-order02.at:28: mkdir ustar (cd ustar @@ -5040,11 +5012,11 @@ ls to ) ./numeric.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -5080,56 +5052,137 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./T-dir01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + + +44. recurs02.at:30: ok +51. append02.at:54: testing append vs. create ... +./append02.at:57: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" 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" -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 +# 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 ) -./xform-h.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./shortrec.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link +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 +) -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' +52. append03.at:21: testing append with name transformation ... +./append03.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +genfile --file file.1 +genfile --file file.2 -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +./append.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./append01.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir 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 +) +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 -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' +# 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 ) -./append.at:24: +./same-order01.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5137,17 +5190,26 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) + + +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 +) ./append02.at:57: -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 * @@ -5174,36 +5236,26 @@ echo Comparing archives cmp archive.1 archive.2 ) -./recurse.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append03.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 directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -./verbose.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +genfile --file file.1 +genfile --file file.2 -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing tar tf archive ) -./append03.at:26: +45. shortrec.at:25: ok +./same-order02.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5212,16 +5264,23 @@ 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 + +ls en +echo separator +ls to ) -31. T-recurse.at:66: ./recurs02.at:33: +./append.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5229,21 +5288,11 @@ TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -) - ok -40. indexfile.at:26: ok -2. pipe.at:29: ok +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) ./append01.at:34: mkdir gnu (cd gnu @@ -5259,63 +5308,80 @@ 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 ) -./shortrec.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +54. append05.at:32: testing append after changed blocking ... +./append05.at:35: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +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 +for f in a b c d e f g h i +do + echo $f > $f +done -rm -r directory +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-recurse.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./numeric.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 * -mkdir directory1 directory2 -touch directory1/file directory2/file +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF +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}' -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +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}' -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" +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}' + ) -26. add-file.at:21: ./append04.at:32: +./append02.at:57: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5324,6 +5390,38 @@ export TAR_OPTIONS rm -rf * +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" + +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi + +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 +) +./append04.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + # Create two empty files: touch file1 file2 @@ -5342,46 +5440,30 @@ # Verify content of the new archive: tar -tf archive.tar ) - ok -./append.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./T-dir00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append03.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 * +genfile --file file.1 +genfile --file file.2 -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 +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive ) ./same-order01.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 * @@ -5398,42 +5480,26 @@ ls directory|sort ) -./append05.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./append.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 * - -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 -) +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +50. append01.at:29: ok ./same-order02.at:28: -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 * @@ -5453,30 +5519,24 @@ echo separator ls to ) -./T-dir01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -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 +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 ) -41. verbose.at:26: ok - - -43. recurse.at:21: ok ./append02.at:57: mkdir posix @@ -5510,51 +5570,45 @@ echo Comparing archives cmp archive.1 archive.2 ) -./append03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append05.at:35: +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 file.1 -genfile --file file.2 +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 -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 -) -./recurs02.at:33: -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 -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -) +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' +tar tf archive +) +47. same-order01.at:26: ok +49. append.at:21: ok +55. xform-h.at:30: testing transforming hard links on create ... ./xform-h.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -5578,7 +5632,54 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) -50. append01.at:29: ok +./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 +) + + +./append03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 +) +48. same-order02.at:25: ok 56. xform01.at:26: testing transformations and GNU volume labels ... ./xform01.at:29: mkdir gnu @@ -5593,25 +5694,37 @@ tar -cf archive.tar -V /label/ file tar tf archive.tar ) - -58. xform03.at:21: testing transforming hard link targets ... -./xform03.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./append02.at:57: +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 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 +genfile --file file1 +genfile --file file2 + +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" + +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi + +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 ) 57. xform02.at:21: testing transforming escaped delimiters on create ... ./xform02.at:24: @@ -5628,28 +5741,8 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) - -./shortrec.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) -49. append.at:21: ok -59. exclude.at:23: testing exclude ... -./exclude.at:26: +46. numeric.at:18: ok +./append05.at:35: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5658,132 +5751,60 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG -echo "test" > dir/rock/file - -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION $option - tar -cf archive.tar --$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done - -for option in exclude-tag exclude-tag-under exclude-tag-all +for f in a b c d e f g h i do - echo OPTION $option - tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort + echo $f > $f done -) -./same-order01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 +decho 'creating archive' +tar -cf archive -b1 a b c +tar tf archive -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +decho 'adding g h i' +tar -vrf archive -b5 g h i -ls directory|sort +decho 'resulting archive' +tar tf archive ) -38. T-dir00.at:28: 60. exclude01.at:19: testing exclude wildcards ... -./exclude01.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +52. append03.at:21: ok +./xform-h.at:39: +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 * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/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 +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' -rm -rf testdir -) - ok -30. T-recurse.at:27: ok -./same-order02.at:28: -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 file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -mkdir en -mkdir to -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -ls en -echo separator -ls to ) +19. testsuite.at:244: ok +56. xform01.at:26: ok ./xform02.at:24: mkdir oldgnu (cd oldgnu @@ -5798,6 +5819,26 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) +58. xform03.at:21: testing transforming hard link targets ... +./xform03.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) + ./append04.at:32: mkdir posix (cd posix @@ -5825,40 +5866,52 @@ # Verify content of the new archive: tar -tf archive.tar ) - -56. xform01.at:26: 39. T-dir01.at:28: ok - ok -./append05.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +59. exclude.at:23: testing exclude ... +./exclude.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 * -for f in a b c d e f g h i -do - echo $f > $f -done -decho 'creating archive' -tar -cf archive -b1 a b c +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar tf archive -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive +mkdir dir +echo blues > dir/blues +echo jazz > dir/jazz +mkdir dir/folk +echo tagfile > dir/folk/tagfile +echo sanjuan > dir/folk/sanjuan +mkdir dir/rock +echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG +echo "test" > dir/rock/file -decho 'adding g h i' -tar -vrf archive -b5 g h i +for option in exclude-caches exclude-caches-under exclude-caches-all +do + echo OPTION $option + tar -cf archive.tar --$option -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done -decho 'resulting archive' -tar tf archive +for option in exclude-tag exclude-tag-under exclude-tag-all +do + echo OPTION $option + tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done ) -./numeric.at:29: + + + +./xform02.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5867,37 +5920,10 @@ 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}' - +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) 61. exclude02.at:19: testing exclude: anchoring ... ./exclude02.at:22: @@ -5948,42 +5974,7 @@ rm -rf testdir file1.txt ) - -52. append03.at:21: ok -./append02.at:57: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 - -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 - -echo Comparing archives -cmp archive.1 archive.2 -) - -44. recurs02.at:30: ok +51. append02.at:54: ok 62. exclude03.at:19: testing exclude: wildcards match slash ... ./exclude03.at:22: mkdir v7 @@ -6029,25 +6020,52 @@ rm -rf testdir ) -stderr: - - - -./xform02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 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 + +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 ) -./xform-h.at:39: +./append05.at:35: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6056,6 +6074,38 @@ 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 +) + +stderr: +./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 * + mkdir basedir echo "hello" > basedir/test ln basedir/test basedir/test_link @@ -6076,6 +6126,25 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./xform03.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) 63. exclude04.at:19: testing exclude: case insensitive ... ./exclude04.at:22: mkdir v7 @@ -6124,63 +6193,6 @@ rm -rf testdir ) -45. shortrec.at:25: ./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr - ok - -./xform03.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) -64. exclude05.at:21: testing exclude: lots of excludes ... -./exclude05.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 - -) ./append04.at:32: mkdir gnu (cd gnu @@ -6208,80 +6220,6 @@ # Verify content of the new archive: tar -tf archive.tar ) -65. exclude06.at:26: testing exclude: long files in pax archives ... -./exclude06.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - - -install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c - -tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen -mkdir out -tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp -find out -type f -) - -66. exclude07.at:19: testing exclude: --exclude-backups option ... -./exclude07.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -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 -) -48. same-order02.at:25: 67. exclude08.at:36: testing --exclude-tag option ... -./exclude08.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) - ok -47. same-order01.at:26: ok - -68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... -./exclude09.at:40: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort -) ./xform02.at:24: mkdir posix (cd posix @@ -6296,7 +6234,6 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) -51. append02.at:54: ok ./append05.at:35: mkdir gnu (cd gnu @@ -6327,65 +6264,6 @@ decho 'resulting archive' tar tf archive ) -69. exclude10.at:38: testing --exclude-tag option in incremental pass ... -./exclude10.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort -) -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 v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) - - -./exclude07.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -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 -) ./xform02.at:24: mkdir gnu (cd gnu @@ -6400,13 +6278,13 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) - +53. append04.at:29: 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 * @@ -6430,7 +6308,57 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) +./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 +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 + +) stderr: +57. xform02.at:21: ok + ./exclude01.at:22: mkdir oldgnu (cd oldgnu @@ -6475,37 +6403,26 @@ rm -rf testdir ) -71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... -./exclude12.at:40: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./xform03.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * - -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 +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 ) -./exclude08.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=excludeme -v etest | sort -) ./exclude03.at:22: mkdir oldgnu (cd oldgnu @@ -6550,37 +6467,15 @@ rm -rf testdir ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -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 gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag-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 -) -./exclude02.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +54. append05.at:32: ok +59. exclude.at:23: ok +64. exclude05.at:21: testing exclude: lots of excludes ... +./exclude05.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -6588,139 +6483,28 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -rm -rf testdir +rm -rf testdir exclfile mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ +tar cf archive --anchored --exclude-from=exclfile \ testdir tar tf archive | sort -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ +echo "NEXT" +tar cf archive --exclude-from=exclfile \ 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 - -) -./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 -) -68. exclude09.at:37: ok -53. append04.at:29: ok -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 -) -./numeric.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 - -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file - - - -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - - -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' - -) -57. xform02.at:21: ok -./exclude11.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 +rm -rf testdir exclfile -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -65. exclude06.at:26: ok -54. append05.at:32: ok - - -59. exclude.at:23: ok ./exclude04.at:22: mkdir oldgnu (cd oldgnu @@ -6768,28 +6552,28 @@ rm -rf testdir ) - -69. exclude10.at:38: ok -./exclude07.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +65. exclude06.at:26: testing exclude: long files in pax archives ... +./exclude06.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H pax" 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 +install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c + +tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen +mkdir out +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp +find out -type f ) -71. exclude12.at:37: ok -75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... -./exclude16.at:41: + +./xform-h.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6798,58 +6582,30 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort -) -./exclude08.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -test -z "`sort < /dev/null 2>&1`" || exit 77 +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' -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) -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 * +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -test -z "`sort < /dev/null 2>&1`" || exit 77 +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' -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort ) -55. xform-h.at:30: ok stderr: - -76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... -./exclude17.at:24: +67. exclude08.at:36: testing --exclude-tag option ... +./exclude08.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6858,31 +6614,14 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) - -./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 +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr - -77. exclude18.at:30: testing --exclude-vcs extract list compare ... -./exclude18.at:33: +66. exclude07.at:19: testing exclude: --exclude-backups option ... +./exclude07.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6891,60 +6630,15 @@ export TAR_OPTIONS rm -rf * +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" -test -z "`sort < /dev/null 2>&1`" || exit 77 - -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 - +tar -v -c -f archive --exclude-backups dir ) -78. delete01.at:23: testing deleting a member after a big one ... -./delete01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr ./xform03.at:24: mkdir posix (cd posix @@ -6963,66 +6657,55 @@ tar -C t -xf a.tar find t -type f ) -72. exclude13.at:39: ok -79. delete02.at:23: testing deleting a member from stdin archive ... -./delete02.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./exclude02.at:22: +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 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) -./exclude07.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 -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 -) -80. delete03.at:21: testing deleting members with long names ... -./delete03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +rm -rf testdir +mkdir -p testdir +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 -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 ) -./exclude17.at:24: +./exclude07.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7032,11 +6715,14 @@ rm -rf * mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir ) -./exclude11.at:39: +./exclude01.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7048,33 +6734,42 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -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 -tar tf archive +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +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 ) +55. xform-h.at:30: ok +stderr: +65. exclude06.at:26: ok +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr ./exclude03.at:22: mkdir ustar (cd ustar @@ -7119,27 +6814,59 @@ rm -rf testdir ) -74. exclude15.at:36: ok -82. delete05.at:27: testing deleting non-existing member ... -./delete05.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./xform03.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 * -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 +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: +./exclude08.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=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 * + +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 +) + +./exclude04.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7153,38 +6880,80 @@ 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/\* +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=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ testdir tar tf archive | sort -echo "NEXT" +echo "SUB 1" tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +echo "SUB 2" +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort rm -rf testdir + ) +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 gnu" +export TAR_OPTIONS +rm -rf * -./exclude02.at:22: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort +) +69. exclude10.at:38: testing --exclude-tag option in incremental pass ... +./exclude10.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort +) +./exclude08.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7196,6 +6965,39 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +./exclude07.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +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 +) +stderr: +./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 @@ -7232,6 +7034,161 @@ rm -rf testdir file1.txt ) +./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 + + +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 +) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +58. xform03.at:21: ok +68. exclude09.at:37: 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 + +) +./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 + +) +./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 +) ./exclude08.at:39: mkdir posix (cd posix @@ -7247,12 +7204,16 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./exclude14.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +69. exclude10.at:38: ok + +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 ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -7260,43 +7221,51 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort ) -./exclude17.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -./delete01.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +66. exclude07.at:19: ok +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 * -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) -46. numeric.at:18: ok -stderr: -83. delete06.at:25: testing EOF detection ... -./delete06.at:28: +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 +) +./exclude08.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7305,17 +7274,13 @@ 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 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./exclude07.at:22: +./exclude01.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7324,22 +7289,172 @@ 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 +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 ) -75. exclude16.at:38: ok -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr + +./exclude02.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) +./exclude11.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-under=excludeme -v etest | sort +) +./exclude03.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort + +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort + +rm -rf testdir + +) +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 +) +71. exclude12.at:37: ok ./exclude04.at:22: -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 * @@ -7381,22 +7496,11 @@ rm -rf testdir ) -./exclude11.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 +67. exclude08.at:36: ok -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -./xform03.at:24: +72. exclude13.at:39: ok +74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... +./exclude15.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7405,16 +7509,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 --listed=snar -v etest | sort ) -./delete02.at:26: +./exclude14.at:39: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7423,36 +7524,57 @@ 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) -./delete05.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) + +./exclude11.at:39: +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 -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 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -84. extrac01.at:23: testing extract over an existing directory ... -./extrac01.at:26: +75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... +./exclude16.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort +) + +60. exclude01.at:19: ok +74. exclude15.at:36: ok +76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... +./exclude17.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7461,13 +7583,30 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./exclude17.at:24: +./exclude14.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) + +61. exclude02.at:19: ok +./exclude11.at:39: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7476,18 +7615,19 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +77. exclude18.at:30: testing --exclude-vcs extract list compare ... ./exclude18.at:33: -mkdir 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 * @@ -7528,7 +7668,7 @@ tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) -./delete03.at:26: +./exclude17.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7537,16 +7677,53 @@ 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 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) +62. exclude03.at:19: ok +78. delete01.at:23: testing deleting a member after a big one ... +./delete01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) + +75. exclude16.at:38: 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) + +63. exclude04.at:19: ok ./exclude14.at:39: mkdir posix (cd posix @@ -7562,49 +7739,21 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./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 -) -./delete04.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./exclude17.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 * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./exclude08.at:39: +./exclude11.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7617,31 +7766,35 @@ 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-under=excludeme -v etest | sort ) -85. extrac02.at:23: testing extracting symlinks over an existing file ... -./extrac02.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +80. delete03.at:21: testing deleting members with long names ... +./delete03.at:26: +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 * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive + +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 ) ./delete01.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -7652,7 +7805,22 @@ tar tf archout tar f archive --delete file2 cmp archive archout) -./extrac01.at:26: + +./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 - +) +./delete02.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7661,14 +7829,64 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +./exclude18.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +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 + ) -66. exclude07.at:19: ok -86. extrac03.at:23: testing extraction loops ... -./extrac03.at:26: +81. delete04.at:23: testing deleting a large last member ... +./delete04.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7677,25 +7895,40 @@ export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -./exclude17.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 +) +82. delete05.at:27: testing deleting non-existing member ... +./delete05.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +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 ) -./exclude11.at:39: +./exclude14.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7708,10 +7941,23 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -stderr: -./delete05.at:30: +./exclude17.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +) +./delete01.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7720,6 +7966,42 @@ 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) +70. exclude11.at:36: 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 +) +./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 @@ -7729,51 +8011,8 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./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 - -) +73. exclude14.at:36: ok +76. exclude17.at:21: ok ./delete02.at:26: mkdir ustar (cd ustar @@ -7794,51 +8033,74 @@ tar f - --delete 2 < archive > archive3 cmp archive2 archive3) -./exclude01.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./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/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* +# Make an empty VCS directory: +mkdir .svn -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +# Make a VCS file: +touch .gitignore -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +# Make non-VCS files: +touch .git_B +touch _C -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +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 -rm -rf testdir ) -./extrac01.at:26: + +83. delete06.at:25: testing EOF detection ... +./delete06.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 +) +./delete05.at:30: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7847,12 +8109,32 @@ 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 +) + +84. extrac01.at:23: testing extract over an existing directory ... +./extrac01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + mkdir directory touch directory/file tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) -./extrac02.at:28: +./delete04.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7861,6 +8143,46 @@ 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 +) +./delete01.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +85. extrac02.at:23: testing extracting symlinks over an existing file ... +./extrac02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + touch file ln -s file link 2> /dev/null || ln file link tar cf archive link @@ -7868,38 +8190,26 @@ touch link tar xf archive ) -83. delete06.at:25: ok -./extrac03.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -58. xform03.at:21: ./exclude14.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./delete06.at:28: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +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 ) - ok -76. exclude17.at:21: ok -./exclude02.at:22: +./delete02.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7908,73 +8218,31 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 - -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort - -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort - -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort - -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort - -rm -rf testdir file1.txt - -) -87. extrac04.at:23: testing extract + fnmatch ... -./extrac04.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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) +./extrac01.at:26: +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 - -touch file1 mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) -67. exclude08.at:36: ok -./delete01.at:26: +./delete05.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7983,13 +8251,15 @@ 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) +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 +) ./delete03.at:26: mkdir posix (cd posix @@ -8009,8 +8279,7 @@ tar --delete -f archive ./${prefix}5 && tar -tf archive ) - -70. exclude11.at:36: ./exclude04.at:22: +83. delete06.at:25: ./exclude18.at:33: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8022,49 +8291,79 @@ 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 + +) ok +./extrac02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +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 +) +./delete01.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 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) ./extrac01.at:26: -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 * @@ -8073,12 +8372,55 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) +./delete02.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) + +./delete04.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive +) ./delete05.at:30: -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 * @@ -8090,7 +8432,22 @@ # 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 -./exclude18.at:33: +) +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) +./extrac02.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8099,6 +8456,53 @@ 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 +) +./extrac01.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +78. delete01.at:23: ok +80. delete03.at:21: ok +82. delete05.at:27: ok + +./extrac03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +./exclude18.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -8136,27 +8540,45 @@ tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) +./extrac01.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 +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) +79. delete02.at:23: ok -./extrac03.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +./extrac02.at:28: +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) +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) ./delete04.at:26: -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 * @@ -8174,47 +8596,31 @@ 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 -) - -88. extrac05.at:30: testing extracting selected members from pax ... -./extrac05.at:38: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 posix" +TAR_OPTIONS="-H v7" 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -cd .. +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 ) 89. extrac06.at:34: testing mode of extracted directories ... ./extrac06.at:37: @@ -8254,6 +8660,46 @@ # After both restores, the directory mode should be 755 ) +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 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 + +tar cf archive jeden dwa trzy cztery || exit 1 + +mkdir dir +cd dir + +tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 + +cd .. +) +84. extrac01.at:23: ok +./extrac03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) + 90. extrac07.at:27: testing extracting symlinks to a read-only dir ... ./extrac07.at:30: mkdir ustar @@ -8290,28 +8736,7 @@ mkdir out tar -C out -xvf archive ) - -73. exclude14.at:36: ./delete02.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) - ok -./extrac01.at:26: +./extrac02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8320,24 +8745,14 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive ) -./extrac03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) 91. extrac08.at:33: testing restoring mode on existing directory ... ./extrac08.at:36: mkdir v7 @@ -8357,6 +8772,20 @@ tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ) +./extrac03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +85. extrac02.at:23: ok ./extrac04.at:26: mkdir oldgnu (cd oldgnu @@ -8382,150 +8811,8 @@ --exclude='d*/*1' \ --exclude='d*/s*/*2' | sort ) -./extrac02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -./delete01.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 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) -./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 -) -92. extrac09.at:34: testing extracting even when . and .. are unreadable ... -./extrac09.at:37: -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 dir -mkdir dir/sub -mkdir dir/sub/extract -genfile --file dir/sub/f -cd dir/sub - -tar -cf archive.tar f - -chmod a-r . .. -tar -xvf archive.tar -C extract f -status=$? -chmod a+r . .. -cmp f extract/f || status=$? -exit $status -) -./exclude03.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort - -rm -rf testdir - -) -80. delete03.at:21: ./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 -./exclude01.at:22: +./delete04.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8534,50 +8821,6 @@ 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 -) -./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 @@ -8592,128 +8835,7 @@ tar f archive --delete file10 tar tf archive ) -84. extrac01.at:23: 93. extrac10.at:29: testing -C and delayed setting of metadata ... -./extrac10.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir d x x/y -echo foo >d/d1 -echo bar >e - -tar -cf archive.tar d e && -tar -xf archive.tar -C x d -C y e && -diff -r d x/d && -diff e x/y/e -) - ok -./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 -) -88. extrac05.at:30: ok -./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 - -) -82. delete05.at:27: ./delete02.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) - ok -./extrac02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -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 -) -./extrac06.at:37: +88. extrac05.at:30: ./extrac06.at:37: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8750,9 +8872,8 @@ # After both restores, the directory mode should be 755 ) -90. extrac07.at:27: ok - -./exclude02.at:22: + ok +./extrac03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8761,46 +8882,32 @@ export TAR_OPTIONS rm -rf * +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +77. exclude18.at:30: ok +90. extrac07.at:27: ok +./extrac08.at:36: +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 -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 - +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 ) -./exclude04.at:22: +92. extrac09.at:34: testing extracting even when . and .. are unreadable ... +./extrac09.at:37: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8810,74 +8917,50 @@ 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 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -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 +mkdir dir +mkdir dir/sub +mkdir dir/sub/extract +genfile --file dir/sub/f +cd dir/sub -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +tar -cf archive.tar f -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +chmod a-r . .. +tar -xvf archive.tar -C extract f +status=$? +chmod a+r . .. +cmp f extract/f || status=$? +exit $status +) -rm -rf testdir -) -78. delete01.at:23: 86. extrac03.at:23: ok - ok -./extrac04.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +93. extrac10.at:29: testing -C and delayed setting of metadata ... +./extrac10.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +mkdir d x x/y +echo foo >d/d1 +echo bar >e -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.tar d e && +tar -xf archive.tar -C x d -C y e && +diff -r d x/d && +diff e x/y/e ) - - -92. extrac09.at:34: ok - 94. extrac11.at:25: testing scarce file descriptors ... ./extrac11.at:28: mkdir gnu @@ -8946,8 +9029,9 @@ diff -r a dest3/a >/dev/null 2>&1 ) || { diff -r a dest3/a; exit 1; } ) -93. extrac10.at:29: ok -./extrac08.at:36: +86. extrac03.at:23: ok + +./extrac06.at:37: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8956,16 +9040,34 @@ 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 -) +# 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 +) 95. extrac12.at:25: testing extract dot permissions ... ./extrac12.at:28: mkdir gnu @@ -8986,8 +9088,73 @@ cmp src/file1 dst/file1 && cmp src/file2 dst/file2 ) +93. extrac10.at:29: ok +./extrac08.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +./extrac04.at:26: +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 + +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 +) +81. delete04.at:23: ok + +92. extrac09.at:34: ok + +95. extrac12.at:25: ok +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 +) 96. extrac13.at:26: testing extract over symlinks ... ./extrac13.at:29: mkdir gnu @@ -9021,25 +9188,7 @@ diff src/file1 dst3/file1 && diff src/file1 dst3/target1 ) -85. extrac02.at:23: ok -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 -) - +94. extrac11.at:25: ok 98. extrac15.at:25: testing extract parent mkdir failure ... ./extrac15.at:28: mkdir gnu @@ -9069,71 +9218,30 @@ else (exit 0) fi ) -./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 -) - -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/ -) -79. delete02.at:23: 99. extrac16.at:26: testing extract empty directory with -C ... -./extrac16.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac08.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 * -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 +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 ) ./extrac06.at:37: -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 * @@ -9165,10 +9273,46 @@ # After both restores, the directory mode should be 755 ) - ok -62. exclude03.at:19: ok -./extrac08.at:36: +97. extrac14.at:25: ok + + +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 gnu" +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 +) +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/ +) +./extrac04.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9177,15 +9321,23 @@ export TAR_OPTIONS rm -rf * -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort ) + 101. extrac18.at:34: testing keep-old-files ... ./extrac18.at:37: mkdir v7 @@ -9211,8 +9363,7 @@ cat a ) -95. extrac12.at:25: ok -./exclude18.at:33: +./extrac08.at:36: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9221,75 +9372,105 @@ 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 +) +98. extrac15.at:25: ok +99. extrac16.at:26: ok +./extrac06.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir gitrepo -cd gitrepo +# Force umask +umask 022 -# Make an empty VCS directory: -mkdir .svn +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Make a VCS directory with a file: -mkdir .git -touch .git/_A +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory -# Make a VCS file: -touch .gitignore +# Archive it +tar cf arc directory -# Make non-VCS files: -touch .git_B -touch _C +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort +# After both restores, the directory mode should be 755 +) +96. extrac13.at:26: ok +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 * -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | 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 --skip-old-files -f ../archive +echo status=$? + +cat a ) -./extrac04.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./extrac17.at:34: +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 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 +tar cf dir.tar 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 +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) -102. extrac19.at:21: testing skip-old-files ... -./extrac19.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./extrac18.at:37: +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 * @@ -9303,14 +9484,11 @@ rm b echo 'File a' > a -tar -x --skip-old-files -f ../archive +tar -x -k -f ../archive echo status=$? cat a ) -97. extrac14.at:25: ok - -60. exclude01.at:19: ok 103. extrac20.at:21: testing keep-directory-symlink ... ./extrac20.at:24: @@ -9385,7 +9563,7 @@ clean done ) -./extrac17.at:34: +./extrac19.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9394,6 +9572,57 @@ 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 +) + +./extrac04.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +91. extrac08.at:33: 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 * + mkdir dir dir/subdir1 dir/subdir2 out genfile --file dir/subdir1/file1 genfile --file dir/subdir2/file2 @@ -9403,9 +9632,6 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) -99. extrac16.at:26: ok - - 104. extrac21.at:31: testing delay-directory-restore ... ./extrac21.at:33: mkdir ustar @@ -9436,90 +9662,7 @@ mkdir out tar -C out -v -x -f A.tar --delay-directory-restore ) -96. extrac13.at:26: 98. extrac15.at:25: ok - ok -./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 -) -63. exclude04.at:19: 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 * - -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 -) -./extrac06.at:37: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 -) - -61. exclude02.at:19: ok +89. extrac06.at:34: ok 105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... ./extrac22.at:29: mkdir v7 @@ -9568,13 +9711,12 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) - ./extrac19.at:24: -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 * @@ -9593,23 +9735,49 @@ cat a ) -94. extrac11.at:25: ok -107. extrac24.at:18: testing --to-stdout ... -./extrac24.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +./extrac18.at:37: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir +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 +) + +./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/ ) 106. extrac23.at:18: testing --no-overwrite-dir ... ./extrac23.at:32: @@ -9640,14 +9808,81 @@ chmod 700 dir find dir ) +104. extrac21.at:31: ok +107. extrac24.at:18: testing --to-stdout ... +./extrac24.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +87. extrac04.at:23: ok +./extrac18.at:37: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +./extrac19.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) + -81. delete04.at:23: ok ./extrac17.at:34: -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 * @@ -9660,8 +9895,6 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) - - 108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... ./extrac25.at:21: mkdir v7 @@ -9680,7 +9913,22 @@ ln -s does_not_exist subdir tar -xvf test.tar ) +./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 +) 109. backup01.at:33: testing extracting existing dir with --backup ... ./backup01.at:36: mkdir v7 @@ -9697,7 +9945,54 @@ tar cf test.tar dir1 dir2 tar xfv test.tar --backup --warning=no-timestamp ) -./extrac04.at:26: +./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 +) +./extrac18.at:37: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9706,24 +10001,22 @@ export TAR_OPTIONS rm -rf * +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar cf ../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 +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a ) -111. label01.at:21: testing single-volume label ... -./label01.at:24: +./extrac19.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9732,10 +10025,113 @@ export TAR_OPTIONS rm -rf * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive +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 +) +100. extrac17.at:21: ok +./extrac23.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) +./backup01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) +./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 +) +./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 +) + +./backup01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) 110. difflink.at:17: testing link mismatch ... ./difflink.at:19: @@ -9756,13 +10152,13 @@ ln -s x a/z tar df a.tar ) -77. exclude18.at:30: ok +102. extrac19.at:21: ok ./extrac24.at:29: -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 * @@ -9773,9 +10169,70 @@ tar --extract --to-stdout --file a.tar test -d dir ) -91. extrac08.at:33: ok +101. extrac18.at:34: ok +./extrac22.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -./extrac18.at:37: + +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 +) +./backup01.at:36: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +) +./extrac25.at:21: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -9784,22 +10241,62 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b +mkdir subdir +touch subdir/a.txt +tar -cf test.tar subdir/a.txt -tar cf ../archive . +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar +) -rm b -echo 'File a' > a -tar -x -k -f ../archive -echo status=$? +./extrac24.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -cat a +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) +./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 +) +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 +) 112. label02.at:21: testing multi-volume label ... ./label02.at:24: mkdir gnu @@ -9817,7 +10314,8 @@ tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar ) -./extrac19.at:24: +110. difflink.at:17: ok +./extrac23.at:32: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -9826,22 +10324,124 @@ export TAR_OPTIONS rm -rf * +# Test if the directory permissions are restored properly. mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir -tar cf ../archive . +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) +109. backup01.at:33: ok +./extrac22.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -rm b -echo 'File a' > a -tar -x --skip-old-files -f ../archive -echo status=$? +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -cat a + +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 ) -104. extrac21.at:31: ok +107. extrac24.at:18: ok +./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 +) +./label01.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 foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +./label02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) + + + 113. label03.at:27: testing test-label option ... ./label03.at:30: mkdir gnu @@ -9875,7 +10475,7 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) -./backup01.at:36: +./extrac20.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9884,84 +10484,101 @@ 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 * +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Force umask -umask 022 -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" +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 -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +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 +} -# Archive it -tar cf arc directory +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +# 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 +} -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +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 -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory + # 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 -# After both restores, the directory mode should be 755 + 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 ) -./extrac17.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +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 ) - -./extrac25.at:21: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./label01.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir 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 --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive ) 114. label04.at:27: testing label with non-create option ... ./label04.at:30: @@ -9982,8 +10599,23 @@ decho "# Update: right label" tar -rf archive --label='New volume' file ) -115. label05.at:24: testing label with non-create option ... -./label05.at:27: +./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 +) +./extrac25.at:21: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9992,6 +10624,23 @@ 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 +) +./label05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + exec <&- genfile --file file decho "# Create volume" @@ -10001,8 +10650,7 @@ decho "# Update: right label" tar -rf archive file ) - -./label01.at:24: +./label04.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10011,17 +10659,50 @@ export TAR_OPTIONS rm -rf * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf 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 +) +./extrac23.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# 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 ) +111. label01.at:21: ok ./extrac22.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -10063,24 +10744,7 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) -./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 -) - -./label02.at:24: +./label03.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10090,53 +10754,33 @@ 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 $? ) -87. extrac04.at:23: ok -./backup01.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +112. label02.at:21: ok -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp -) -./extrac19.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -tar -x --skip-old-files -f ../archive -echo status=$? - -cat a -) -./extrac18.at:37: +108. extrac25.at:18: ok +./label05.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10145,48 +10789,14 @@ 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 -) -./extrac23.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir +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 ) 116. incremental.at:23: testing incremental ... ./incremental.at:26: @@ -10227,7 +10837,24 @@ echo y >structure/file tar cfv archive --listed=list structure ) -110. difflink.at:17: ok +./label04.at:30: +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" +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 +) 117. incr01.at:27: testing restore broken symlinks from incremental ... ./incr01.at:30: mkdir gnu @@ -10253,24 +10880,9 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) -./extrac17.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) +115. label05.at:24: ok +105. extrac22.at:19: ok 118. incr02.at:32: testing restoring timestamps from incremental ... ./incr02.at:35: mkdir gnu @@ -10318,107 +10930,35 @@ # Check the timestamp genfile --stat=mtime dir/subdir1 | diff ts - ) -./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 -) -./label05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) -./extrac24.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac23.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir dir/ -echo TEXT > dir/file +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -./label01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive -) - -./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 -) -./backup01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 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 +# 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 ) - -./label02.at:24: +114. label04.at:27: ./label03.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10428,61 +10968,55 @@ 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 $? ) -89. extrac06.at:34: ok -./extrac18.at:37: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -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 . - -rm b -echo 'File a' > a - -tar -x -k -f ../archive -echo status=$? + ok -cat a -) -./extrac19.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./incr01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b +ckmtime || exit 77 -tar cf ../archive . +mkdir directory +$as_ln_s foo directory/bar -rm b -echo 'File a' > a +tar -cf archive.0 -g db directory +rm directory/bar +tar -cf archive.1 -g db directory -tar -x --skip-old-files -f ../archive -echo status=$? +mv directory orig -cat a +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp ) + 119. listed01.at:26: testing --listed for individual files ... ./listed01.at:29: mkdir gnu @@ -10520,40 +11054,6 @@ tar tf archive.2 || exit 1 ) -./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 -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 $? -) -100. extrac17.at:21: ok -111. label01.at:21: ok 120. listed02.at:28: testing working --listed ... ./listed02.at:31: mkdir gnu @@ -10624,195 +11124,7 @@ echo Final files: find tart -print | sort 2>/dev/null ) -./extrac24.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -mkdir dir/ -echo TEXT > dir/file -tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -./label05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) -./label04.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -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 -) -./incr01.at:30: -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 -$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 -) -./extrac22.at:29: -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 - - -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 -) - -./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 -) -./extrac23.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir -) -./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 -) -112. label02.at:21: - ok - -102. extrac19.at:21: ok -101. extrac18.at:34: ok 121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... ./listed03.at:27: mkdir gnu @@ -10850,7 +11162,33 @@ cat err >&2 exit $status ) -107. extrac24.at:18: ok +./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 +) +106. extrac23.at:18: ok +113. label03.at:27: ok + 122. listed04.at:26: testing --listed-incremental and --one-file-system ... ./listed04.at:29: mkdir gnu @@ -10913,53 +11251,105 @@ umount tartest/subdir ) -114. label04.at:27: 109. backup01.at:33: ok - ok -115. label05.at:24: ok - +117. incr01.at:27: ok +122. listed04.at:26: ok +121. listed03.at:24: ok +--- - 2024-12-19 11:49:58.675557191 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2024-12-19 11:49:58.648736667 +0000 +@@ -1,4 +1 @@ +-tar: .: Directory is new +-tar: ./subdir: Directory is new +-tar: ./subdir: directory is on a different filesystem; not dumped + -./extrac25.at:21: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +--- - 2024-12-19 11:49:58.695420279 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2024-12-19 11:49:58.676735521 +0000 +@@ -1,10 +1 @@ +-# Level 0 +-./ +-./subdir/ +-./top-level-file +-./subdir/subdir-file +-# Remount +-# Level 1 +-./ +-./subdir/ + +./extrac20.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -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 -) +test -z "`sort < /dev/null 2>&1`" || exit 77 -./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 +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 -mkdir directory -$as_ln_s foo directory/bar +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 +} -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -mv directory orig +# 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 +} -tar xvfg archive.0 /dev/null --warning=no-timestamp -echo separator -tar xvfg archive.1 /dev/null --warning=no-timestamp +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 ) + +123. listed05.at:33: + skipped (listed05.at:36) 124. incr03.at:28: testing renamed files in incrementals ... ./incr03.at:31: mkdir gnu @@ -11001,30 +11391,6 @@ tar -xf archive.2 -g db --warning=no-timestamp find directory | sort ) - ---- - 2026-01-21 18:07:04.640671814 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2026-01-21 18:07:04.637765610 +0000 -@@ -1,4 +1 @@ --tar: .: Directory is new --tar: ./subdir: Directory is new --tar: ./subdir: directory is on a different filesystem; not dumped - - - -19. testsuite.at:244: ok ---- - 2026-01-21 18:07:04.642937358 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2026-01-21 18:07:04.637765610 +0000 -@@ -1,10 +1 @@ --# Level 0 --./ --./subdir/ --./top-level-file --./subdir/subdir-file --# Remount --# Level 1 --./ --./subdir/ - 125. incr04.at:29: testing proper icontents initialization ... ./incr04.at:34: mkdir gnu @@ -11051,93 +11417,68 @@ echo "Incremental dump" tar cvf a1.tar -g a.sna a ) -./label03.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +126. incr05.at:21: testing incremental dumps with -C ... +./incr05.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 * -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 $? +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 . ) -./extrac22.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +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 posix" +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 "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 - +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 -C t -c -f a.tar --no-recursion -T filelist +mkdir dir/c +genfile --file dir/sub/b/file4 -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 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 . ) -123. listed05.at:33: 122. listed04.at:26: ok -126. incr05.at:21: testing incremental dumps with -C ... ./incr05.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -11154,14 +11495,12 @@ echo Level 1 tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) - skipped (listed05.at:36) -127. incr06.at:21: testing incremental dumps of nested directories ... ./incr06.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -11187,7 +11526,7 @@ echo Level 1 sub . tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) -./extrac23.at:32: +./incr05.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11196,25 +11535,52 @@ 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 . +) +126. incr05.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 . ) + 128. incr07.at:18: testing incremental restores with -C ... ./incr07.at:40: mkdir gnu @@ -11262,71 +11628,13 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -130. incr09.at:26: testing incremental with alternating -C ... -./incr09.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -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 -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 . -) - -129. incr08.at:38: testing filename normalization ... -./incr08.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) - - -121. listed03.at:24: ok -108. extrac25.at:18: ok +127. incr06.at:21: ok ./extrac20.at:24: -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 * @@ -11393,6 +11701,291 @@ clean done ) + +129. incr08.at:38: testing filename normalization ... +./incr08.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 +) +./incr07.at:40: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +mkdir dirA +echo 'a' > dirA/a +echo 'a' > dirA/b + +decho C0 +tar -g test.snar -vcf test.0.tar dirA + +echo 'a' > dirA/c +decho C1 +tar -g test.snar -vcf test.1.tar dirA + +rm -f dirA/a +decho C2 +tar -g test.snar -vcf test.2.tar dirA + +mkdir ext +rm -rf dirA + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/dirA/dirB +touch ext/dirA/dirB/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d dirA && echo >&2 "toplevel dirA exists" +exit 0 +) +stderr: +A +B +tar: .: Directory is new +tar: ./subdir: Directory is new +tar: ./subdir/dir1: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2: Directory is new +tar: Removing leading `/' from member names +stdout: +A +. +./foo +./foo/subdir +./foo/subdir/dir1 +./subdir +./subdir/dir2 +B +./ +./subdir/ +./subdir/dir1/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2/ +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "s|$DIR|ABSPATH|" stdout + +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr +./incr04.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +129. incr08.at:38: ok +./incr07.at:40: +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 dirA +echo 'a' > dirA/a +echo 'a' > dirA/b + +decho C0 +tar -g test.snar -vcf test.0.tar dirA + +echo 'a' > dirA/c +decho C1 +tar -g test.snar -vcf test.1.tar dirA + +rm -f dirA/a +decho C2 +tar -g test.snar -vcf test.2.tar dirA + +mkdir ext +rm -rf dirA + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/dirA/dirB +touch ext/dirA/dirB/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d dirA && echo >&2 "toplevel dirA exists" +exit 0 +) +./incr03.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) + +130. incr09.at:26: testing incremental with alternating -C ... +./incr09.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +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 +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 . +) +./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 + +) +130. incr09.at:26: ok +128. incr07.at:18: ok + + 131. incr10.at:18: testing concatenated incremental archives (deletes) ... ./incr10.at:28: mkdir gnu @@ -11418,8 +12011,6 @@ mkdir out tar -xvf full.tar -g /dev/null -C out ) -117. incr01.at:27: ok - 132. incr11.at:25: testing concatenated incremental archives (renames) ... ./incr11.at:28: mkdir gnu @@ -11450,28 +12041,79 @@ decho List find out | sort ) -./incr05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./extrac20.at:24: +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 . +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . + +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 ) +131. incr10.at:18: ok 133. filerem01.at:36: testing file removed as we read it ... ./filerem01.at:39: @@ -11492,7 +12134,7 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v dir >/dev/null ) -stderr: +132. incr11.at:25: ok 134. filerem02.at:26: testing toplevel file removed ... ./filerem02.at:29: @@ -11515,116 +12157,38 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -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: -./extrac22.at:29: -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 - - -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 -) -130. incr09.at:26: ok -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 - -./extrac23.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./filerem01.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -# 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 +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 -135. dirrem01.at:38: testing directory removed before reading ... -./dirrem01.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null +) +stderr: +stdout: +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: +133. filerem01.at:36: ok +./filerem02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -11632,22 +12196,15 @@ mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 -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 -- \ +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir >/dev/null -) + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -113. label03.at:27: ok -./incr06.at:24: + +./incremental.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11657,32 +12214,36 @@ 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 structure +echo x >structure/file -mkdir dir/c -genfile --file dir/sub/b/file4 +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null -echo 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 . +# 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 ) -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr -136. dirrem02.at:31: testing explicitly named directory removed before reading ... -./dirrem02.at:34: +135. dirrem01.at:38: testing directory removed before reading ... +./dirrem01.at:41: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11706,10 +12267,10 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db \ --warning=no-file-changed \ - -v dir dir/sub >/dev/null + -v dir >/dev/null ) -stdout: -./filerem01.at:39: +stderr: +./incr04.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11718,17 +12279,29 @@ 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 -) +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 - -./incr05.at:24: +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 +) +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: +stdout: +134. filerem02.at:26: ok +./dirrem01.at:41: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11737,20 +12310,25 @@ 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 . +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -genfile --file dir/file3 -echo Level 1 -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 >/dev/null ) -./incr07.at:40: + +./listed01.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -11760,97 +12338,81 @@ rm -rf * ckmtime || exit 77 -mkdir dirA -echo 'a' > dirA/a -echo 'a' > dirA/b - -decho C0 -tar -g test.snar -vcf test.0.tar dirA - -echo 'a' > dirA/c -decho C1 -tar -g test.snar -vcf test.1.tar dirA -rm -f dirA/a -decho C2 -tar -g test.snar -vcf test.2.tar dirA +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 -mkdir ext -rm -rf dirA +tar --create \ + --file=archive.1 \ + --listed-incremental=listing \ + directory/file* -decho E0 -tar -g test.snar -vxf test.0.tar -C ext/ -decho E1 -tar -g test.snar -vxf test.1.tar -C ext/ +tar tf archive.1 || exit 1 -decho E2 -tar -g test.snar -vxf test.2.tar -C ext/ +sleep 2 -mkdir ext/dirA/dirB -touch ext/dirA/dirB/file +genfile --length 10240 --pattern zeros --file directory/file2 -decho E3 -tar -g test.snar -vxf test.2.tar -C ext/ +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 -echo FIN -test -d dirA && echo >&2 "toplevel dirA exists" -exit 0 +tar tf archive.2 || exit 1 ) - -129. incr08.at:38: ok -131. incr10.at:18: ok -stdout: -stderr: -137. rename01.at:24: testing renamed dirs in incrementals ... -./rename01.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./incr03.at:31: +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 -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 +sleep 1 -mv foo/bar foo/baz +tar -cf archive.1 -g db directory -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory -mv foo old +mv directory orig -tar xfg arch.1 /dev/null +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | 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 -./dirrem01.at:41: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +stdout: +135. dirrem01.at:38: 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 posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -11869,10 +12431,13 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db \ --warning=no-file-changed \ - -v dir >/dev/null + -v dir dir/sub >/dev/null ) +103. extrac20.at:21: ok + + stdout: -./filerem02.at:29: +./dirrem02.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -11885,14 +12450,60 @@ mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 -mkdir dir2 -genfile --file dir2/file1 -genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ +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 -v --warning=no-new-dir dir dir2 >/dev/null + --listed-incremental db \ + --warning=no-file-changed \ + -v dir dir/sub >/dev/null +) +137. rename01.at:24: testing renamed dirs in incrementals ... +./rename01.at:27: +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 +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 ) -stdout: 138. rename02.at:24: testing move between hierarchies ... ./rename02.at:27: mkdir gnu @@ -11938,47 +12549,15 @@ find foo | sort echo End directory listing 2 ) - -./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 -) - stdout: -133. filerem01.at:36: ok -105. extrac22.at:19: ok -126. incr05.at:21: 106. extrac23.at:18: ok - ok -132. incr11.at:25: ok -140. rename04.at:27: testing renamed directory containing subdirectories ... -./rename04.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +136. dirrem02.at:31: ok + +./rename01.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 * @@ -11986,30 +12565,32 @@ 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 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 -find directory | sort +tar xfg arch.1 /dev/null -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 ) 139. rename03.at:23: testing cyclic renames ... ./rename03.at:26: @@ -12068,8 +12649,7 @@ find foo | sort echo End directory listing 2 ) -stdout: -./incr06.at:24: +./rename01.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12078,90 +12658,42 @@ 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 . -) - -135. dirrem01.at:38: ok - -stdout: - -136. dirrem02.at:31: - ok -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: -134. filerem02.at:26: ok -./incr07.at:40: -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 dirA -echo 'a' > dirA/a -echo 'a' > dirA/b -decho C0 -tar -g test.snar -vcf test.0.tar dirA - -echo 'a' > dirA/c -decho C1 -tar -g test.snar -vcf test.1.tar dirA +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file -rm -f dirA/a -decho C2 -tar -g test.snar -vcf test.2.tar dirA +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -mkdir ext -rm -rf dirA +mv foo/bar foo/baz -decho E0 -tar -g test.snar -vxf test.0.tar -C ext/ -decho E1 -tar -g test.snar -vxf test.1.tar -C ext/ +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -decho E2 -tar -g test.snar -vxf test.2.tar -C ext/ +mv foo old -mkdir ext/dirA/dirB -touch ext/dirA/dirB/file +tar xfg arch.1 /dev/null -decho E3 -tar -g test.snar -vxf test.2.tar -C ext/ +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" -echo FIN -test -d dirA && echo >&2 "toplevel dirA exists" -exit 0 +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 ) +137. rename01.at:24: ok -142. rename06.at:19: testing chained renames ... -./rename06.at:29: +125. incr04.at:29: ok +140. rename04.at:27: testing renamed directory containing subdirectories ... +./rename04.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12173,34 +12705,33 @@ 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 Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -decho Altering directory structure -genfile --file test/d2/file3 -mv test/d1 test/d3 -mv test/d2 test/d1 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -decho Second dump -cp 0.snar 1.snar -tar -vc -g 1.snar -C test -f backup1.tar . +decho Renaming +mv directory dir -mkdir test1 +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar +mv dir orig -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar +decho First restore +tar -xf archive.1 -g db.1 +find directory | sort -decho Resulting directory -find test1 | sort +decho Second restore +tar -xf archive.2 -g db.2 +find dir | sort ) + 141. rename05.at:24: testing renamed subdirectories ... ./rename05.at:27: mkdir gnu @@ -12241,10 +12772,48 @@ tar -xf archive.2 -g db.2 --warning=no-timestamp find dir | sort ) +124. incr03.at:28: ok +./rename04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -143. chtype.at:27: testing changed file types in incrementals ... -./chtype.at:30: +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 +) + +142. rename06.at:19: testing chained renames ... +./rename06.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12256,87 +12825,74 @@ 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 -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a +decho First dump +tar -c -g 0.snar -C test -f backup0.tar . -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +decho Altering directory structure +genfile --file test/d2/file3 +mv test/d1 test/d3 +mv test/d2 test/d1 -sleep 2 +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . -# 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 +mkdir test1 -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +decho First extract +tar -C test1 -x -g /dev/null -f backup0.tar -# Delete a -rm -r directory +decho Second extract +tar -C test1 -x -g /dev/null -f backup1.tar -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 +decho Resulting directory +find test1 | sort ) -144. ignfail.at:23: testing ignfail ... -./ignfail.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./rename05.at:27: +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 * -# 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -touch file +decho Creating directory structure mkdir directory -touch directory/file +mkdir directory/subdir +genfile --file=directory/file -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -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 Renaming +mv directory/subdir directory/subdir.0 +mv directory dir -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 +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 ) -./rename01.at:27: +./rename02.at:27: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12348,144 +12904,168 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 - mkdir foo genfile --file foo/file1 genfile --file foo/file2 mkdir foo/bar -genfile --file foo/bar/file +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 echo "Creating base archive" tar -g incr -cf arch.1 -v foo -mv foo/bar foo/baz +mv foo/bar/baz foo echo "Creating incremental archive" tar -g incr -cf arch.2 -v foo mv foo old -tar xfg arch.1 /dev/null +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 echo "Begin directory listing 1" find foo | sort echo "End directory listing 1" -tar xfg arch.2 /dev/null +tar xfgv arch.2 /dev/null --warning=no-timestamp echo Begin directory listing 2 find foo | sort echo End directory listing 2 ) - -145. link01.at:33: testing link count gt 2 ... -./link01.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./rename04.at:30: +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 * + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure mkdir directory -mkdir directory/test1 -mkdir directory/test2 +mkdir directory/subdir +genfile --file=directory/file -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -tar cf archive directory/test1/test.txt directory/test1/test.txt +decho Renaming +mv directory dir -rm -r directory -tar xf archive --warning=no-timestamp +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -ls directory/test1 -) -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 * +mv dir orig -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' +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 ) -147. link03.at:24: testing working -l with --remove-files ... -./link03.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./rename06.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 +decho Creating directory structure +mkdir test test/d1 test/d2 +genfile --file test/d1/file1 +genfile --file test/d2/file2 -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +decho First dump +tar -c -g 0.snar -C test -f backup0.tar . -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' +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 ) -127. incr06.at:21: ok -148. link04.at:29: testing link count is 1 but multiple occurrences ... -./link04.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./incr02.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 * +ckmtime || exit 77 +# Create directory structure mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts -echo -- +# 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 cfl archive dir dir +tar -cf archive -g db dir -echo == +# Move away the directory +mv dir orig -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort +# 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 - ) -./rename04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./rename05.at:27: +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 * @@ -12502,6 +13082,7 @@ tar -cf archive.1 -g db.1 directory decho Renaming +mv directory/subdir directory/subdir.0 mv directory dir decho Creating incremental archive @@ -12511,14 +13092,14 @@ mv dir orig decho First restore -tar -xf archive.1 -g db.1 +tar -xf archive.1 -g db.1 --warning=no-timestamp find directory | sort decho Second restore -tar -xf archive.2 -g db.2 +tar -xf archive.2 -g db.2 --warning=no-timestamp find dir | sort ) -./link02.at:35: +./rename03.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12527,44 +13108,60 @@ export TAR_OPTIONS rm -rf * -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' -) -./link01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -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 +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 -rm -r directory -tar xf archive --warning=no-timestamp +mkdir foo/a +genfile --file foo/a/filea -ls directory/test1 -) +mkdir foo/b +genfile --file foo/b/fileb -128. incr07.at:18: ok +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 +) +140. rename04.at:27: ok ./rename06.at:29: -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 * @@ -12599,12 +13196,57 @@ decho Resulting directory find test1 | sort ) + +141. rename05.at:24: ok +143. chtype.at:27: testing changed file types in incrementals ... +./chtype.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +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 +) + +144. ignfail.at:23: testing ignfail ... ./ignfail.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 * @@ -12650,35 +13292,33 @@ chmod 700 directory test $status = 0 ) -./link03.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +142. rename06.at:19: ok + +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 oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +echo TEST > 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 -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +rm -r directory +tar xf archive --warning=no-timestamp -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' +ls directory/test1 ) -./rename05.at:27: +./ignfail.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12687,37 +13327,49 @@ 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 -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 +touch directory/file -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +echo 1>&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 --warning=no-timestamp -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 --warning=no-timestamp -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 ) -./link04.at:32: +./link01.at:36: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12726,101 +13378,70 @@ 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 +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -echo -- +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -tar cfl archive dir dir +tar cf archive directory/test1/test.txt directory/test1/test.txt -echo == +rm -r directory +tar xf archive --warning=no-timestamp -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort +ls directory/test1 ) -./rename01.at:27: -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 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -149. longv7.at:24: testing long names in V7 archives ... -./longv7.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +touch file +mkdir directory +touch directory/file -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 +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems -echo separator -tar tf archive -) +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -./link02.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -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' +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) ./link01.at:36: mkdir ustar @@ -12845,79 +13466,45 @@ ls directory/test1 ) -./extrac20.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./incremental.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 * +ckmtime || exit 77 -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 -} +mkdir structure +echo x >structure/file -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 +# 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 - # 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 +# 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 - 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 --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 ) -./rename04.at:30: +./link01.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12926,112 +13513,65 @@ 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 +mkdir directory/test1 +mkdir directory/test2 -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -mv dir orig +tar cf archive directory/test1/test.txt directory/test1/test.txt -decho First restore -tar -xf archive.1 -g db.1 -find directory | sort +rm -r directory +tar xf archive --warning=no-timestamp -decho Second restore -tar -xf archive.2 -g db.2 -find dir | sort +ls directory/test1 ) -149. longv7.at:24: 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 gnu" -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) - ok -./link04.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./rename02.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir dir -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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo -- +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 -tar cfl archive dir dir +sleep 1 -echo == +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) -./link03.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +mv foo/bar/baz foo +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +mv foo old -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" -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 xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 ) -./link02.at:35: +./ignfail.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13040,20 +13580,54 @@ 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' -) +# 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 +) ./link01.at:36: -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 * @@ -13071,52 +13645,14 @@ ls directory/test1 ) -./rename06.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 - -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 +145. link01.at:33: ok -decho Resulting directory -find test1 | sort -) ./ignfail.at:26: -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 * @@ -13162,21 +13698,55 @@ chmod 700 directory test $status = 0 ) -151. lustar01.at:21: testing ustar: unsplittable file name ... -./lustar01.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +TAR_OPTIONS="-H v7" 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 +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' ) -137. rename01.at:24: ok -./rename05.at:27: +119. listed01.at:26: ok + +147. link03.at:24: testing working -l with --remove-files ... +./link03.at:34: +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 + +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' +) +./rename03.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13189,38 +13759,55 @@ 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 -decho Creating initial archive -tar -cf archive.1 -g db.1 directory +mkdir foo/a +genfile --file foo/a/filea -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir +mkdir foo/b +genfile --file foo/b/fileb -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir +mkdir foo/c +genfile --file foo/c/filec -mv dir orig +sleep 1 -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort +# 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 ) ./link02.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -13231,7 +13818,8 @@ tar -c -f archive --remove-files file1 file2 file3 file4 tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) -./long01.at:36: +144. ignfail.at:23: ok +./link03.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13241,17 +13829,32 @@ 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 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -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) +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' +) + +148. link04.at:29: testing link count is 1 but multiple occurrences ... ./link04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -13277,30 +13880,96 @@ s,symlink,FOO,g ' | sort ) +./link02.at:35: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -151. lustar01.at:21: ok -./link01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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' +) +./link03.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -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' +) +./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 oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo -- + +tar cfl archive dir dir + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort ) ./link03.at:34: mkdir posix @@ -13330,10 +13999,23 @@ echo testing archive.2 tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) -140. rename04.at:27: ok +./link02.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -152. lustar02.at:21: testing ustar: unsplittable path name ... -./lustar02.at:32: +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 @@ -13342,12 +14024,30 @@ export TAR_OPTIONS rm -rf * +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 -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 +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 ) 146. link02.at:32: ok -./ignfail.at:26: +./link04.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13356,50 +14056,74 @@ export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort +echo -- -touch file -mkdir directory -touch directory/file +tar cfl archive dir dir -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +echo == -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 chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +./link03.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo 1>&2 ----- -chmod 000 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 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) -142. rename06.at:19: ok +149. longv7.at:24: testing long names in V7 archives ... +./longv7.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems +touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c + +tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems +echo separator +tar tf archive +) ./link04.at:32: mkdir gnu (cd gnu @@ -13431,6 +14155,132 @@ s,symlink,FOO,g ' | sort ) +138. rename02.at:24: ok +149. longv7.at:24: ./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 + +) + ok + +147. link03.at:24: ok +148. link04.at:29: 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 gnu" +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) + + +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 +) + +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 +) +./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 +) 153. lustar03.at:21: testing ustar: splitting long names ... ./lustar03.at:29: mkdir ustar @@ -13447,44 +14297,35 @@ 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) +151. lustar01.at:21: 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) -150. long01.at:28: ok -145. link01.at:33: ok +152. lustar02.at:21: ok 154. old.at:23: testing old archives ... ./old.at:27: mkdir directory tar cfvo archive directory || exit 1 tar tf archive -./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 +153. lustar03.at:21: ok -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 +154. old.at:23: ok -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' -) -141. rename05.at:24: ok +139. rename03.at:23: ok 155. time01.at:20: testing time: tricky time stamps ... ./time01.at:23: @@ -13538,11 +14379,6 @@ tar -c -f archive.tar dir tar -d -f archive.tar dir ) -152. lustar02.at:21: - ok -154. old.at:23: ok - - 156. time02.at:20: testing time: clamping mtime ... ./time02.at:23: mkdir pax @@ -13567,7 +14403,7 @@ tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir tar -d -f archive.tar dir|sort ) - +150. long01.at:28: ok 157. multiv01.at:23: testing multivolume dumps from pipes ... ./multiv01.at:30: mkdir gnu @@ -13608,59 +14444,7 @@ cmp file2 extract-dir-pipe/file2 ) -148. link04.at:29: ok -153. lustar03.at:21: ok -./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. - -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 -) 158. multiv02.at:28: testing skipping a straddling member ... ./multiv02.at:31: mkdir gnu @@ -13682,46 +14466,83 @@ echo separator tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 ) -159. multiv03.at:30: testing MV archive & long filenames ... -./multiv03.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./multiv01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` +exec <&- +genfile --length 7168 --file file1 -cat > ../experr <file2 -cat > ../expout </dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 + +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +) +156. time02.at:20: 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 -tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 -tar -tM -f arch.1 -f arch.2 || exit 1 +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 separator-1 +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 -cmp $BFILE bfile +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 ) 160. multiv04.at:36: testing split directory members in a MV archive ... ./multiv04.at:39: @@ -13750,8 +14571,8 @@ echo separator tar -MRt -f arc.1 -f arc.2) -161. multiv05.at:26: testing Restoring after an out of sync volume ... -./multiv05.at:30: +159. multiv03.at:30: testing MV archive & long filenames ... +./multiv03.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13760,94 +14581,37 @@ export TAR_OPTIONS rm -rf * -exec <&- - -genfile --length 250k --file jeden -genfile --length 250k --file dwa -genfile --length 250k --file trzy -genfile --length 250k --file cztery -genfile --length 250k --file piec -genfile --length 250k --file szesc - +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 Creating archive -tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc -echo separator -mkdir bak -mv jeden dwa trzy cztery piec szesc bak -tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar -echo Diffing jeden - cmp bak/jeden jeden || exit 1 -echo Diffing dwa - cmp bak/dwa dwa || exit 1 -echo Diffing trzy - cmp bak/trzy trzy || exit 1 -echo Diffing cztery - cmp bak/cztery cztery || exit 1 -echo Diffing piec - cmp bak/piec piec || exit 1 -echo Diffing szesc - cmp bak/szesc szesc || exit 1 -) +cat > ../experr < ../expout <file2 - -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi +tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1 +tar -tM -f arch.1 -f arch.2 || exit 1 -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 +echo separator-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 +genfile --length 15360 --file $BFILE +tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 +echo separator-2 +mv $BFILE bfile +tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 +cmp $BFILE bfile ) -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) ./multiv02.at:31: mkdir oldgnu (cd oldgnu @@ -13868,31 +14632,29 @@ echo separator tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 ) -163. multiv07.at:28: testing volumes split at an extended header ... -./multiv07.at:31: - - -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +./multiv02.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * -test -z "$TEST_DATA_DIR" && exit 77 -tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire exec <&- -cd $TEST_DATA_DIR -tar -t -M -fxsplit-1.tar -fxsplit-2.tar - - +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 ---- - 2026-01-21 18:07:04.884464007 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2026-01-21 18:07:04.881765610 +0000 -@@ -1,4 +1 @@ --Archive volumes split at an extended header Volume 1 --foo --bar - -163. multiv07.at:28: ./multiv03.at:33: +./multiv03.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13932,45 +14694,65 @@ tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 cmp $BFILE bfile ) - skipped (multiv07.at:31) -./multiv01.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +161. multiv05.at:26: testing Restoring after an out of sync volume ... +./multiv05.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * 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 +genfile --length 250k --file jeden +genfile --length 250k --file dwa +genfile --length 250k --file trzy +genfile --length 250k --file cztery +genfile --length 250k --file piec +genfile --length 250k --file szesc -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 +echo Creating archive +tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc +echo separator +mkdir bak +mv jeden dwa trzy cztery piec szesc bak +tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar +echo Diffing jeden + cmp bak/jeden jeden || exit 1 +echo Diffing dwa + cmp bak/dwa dwa || exit 1 +echo Diffing trzy + cmp bak/trzy trzy || exit 1 +echo Diffing cztery + cmp bak/cztery cztery || exit 1 +echo Diffing piec + cmp bak/piec piec || exit 1 +echo Diffing szesc + cmp bak/szesc szesc || exit 1 +) +158. multiv02.at:28: ok -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 +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 * -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) +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) +159. multiv03.at:30: ok ./multiv06.at:30: mkdir pax (cd pax @@ -13980,13 +14762,41 @@ 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) +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) + +161. multiv05.at:26: ok +163. multiv07.at:28: testing volumes split at an extended header ... +./multiv07.at:31: + + +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + +test -z "$TEST_DATA_DIR" && exit 77 +tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 $TEST_DATA_DIR $TEST_DATA_URL || exit 77 + +exec <&- + +cd $TEST_DATA_DIR +tar -t -M -fxsplit-1.tar -fxsplit-2.tar + +162. multiv06.at:27: ok + +--- - 2024-12-19 11:50:07.015668792 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2024-12-19 11:50:06.992395358 +0000 +@@ -1,4 +1 @@ +-Archive volumes split at an extended header Volume 1 +-foo +-bar + + +163. multiv07.at:28: skipped (multiv07.at:31) 164. multiv08.at:25: testing multivolume header creation ... ./multiv08.at:28: mkdir gnu @@ -14004,6 +14814,7 @@ decho Testing tar -tMR -f A.tar -f B.tar -f C.tar ) + 165. multiv09.at:26: testing bad next volume ... ./multiv09.at:33: mkdir v7 @@ -14022,101 +14833,6 @@ q EOF ) -./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 -) -144. ignfail.at:23: ok -./multiv02.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -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 -) - - 166. multiv10.at:37: testing file start at the beginning of a posix volume ... ./multiv10.at:40: mkdir posix @@ -14137,11 +14853,26 @@ cmp data1 out/data1 cmp data2 out/data2 ) -164. multiv08.at:25: 162. multiv06.at:27: ok - ok -157. multiv01.at:23: ok -161. multiv05.at:26: 158. multiv02.at:28: ok - ok +164. multiv08.at:25: ok + +./multiv09.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null </dev/null < sparsecopy || exit 1 +cmp sparsefile sparsecopy +) 169. sparse01.at:21: testing sparse files ... ./sparse01.at:24: mkdir posix @@ -14260,13 +15023,13 @@ genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) -167. owner.at:21: 170. sparse02.at:21: testing extracting sparse file over a pipe ... +168. map.at:21: ok ./sparse02.at:28: -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 * @@ -14277,20 +15040,52 @@ tar xfO archive | cat - > sparsecopy || exit 1 cmp sparsefile sparsecopy ) - ok -172. sparse04.at:21: testing storing long sparse file names ... -./sparse04.at:35: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +stdout: +./multiv09.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 -tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - +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 < 8G ... ./sparse03.at:29: @@ -14316,7 +15111,76 @@ genfile --stat=name,size sparsefile cmp sparsefile directory/sparsefile ) +165. multiv09.at:26: ok +./sparse02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +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 +) +stdout: + +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-12-19 11:50 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 end +separator +sparsefile 3102720 +./sparse01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +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 +) +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 - +) +172. sparse04.at:21: ok +170. sparse02.at:21: ok +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-12-19 11:50 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 end +separator +sparsefile 3102720 173. sparse05.at:21: testing listing sparse files bigger than 2^33 B ... ./sparse05.at:31: @@ -15335,24 +16199,6 @@ genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77 tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print $3, $(NF) }' ) -./multiv09.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null <&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 ) -stdout: -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2026-01-21 18:07 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2026-01-21 18:07 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2026-01-21 18:07 end -separator -sparsefile 3102720 -./sparse01.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./incr02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --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 +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive --warning=no-timestamp -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile +# 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 - ) -168. map.at:21: ok +175. sparse07.at:21: testing sparse files with unicode names ... +./sparse07.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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 +) ./sparse07.at:24: mkdir gnu (cd gnu @@ -15485,22 +16388,21 @@ tar tf archive ) -./sparse02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./sparse07.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 * -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 --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse žluť || exit 1 -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy +tar tf archive ) +175. sparse07.at:21: ok 176. sparsemv.at:21: testing sparse files in MV archives ... ./sparsemv.at:31: @@ -15532,24 +16434,7 @@ echo "Compare archive" tar --record-size=512 -d -M -f arc.1 -f arc.2 ) -./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 </dev/null < sparsecopy || exit 1 -cmp sparsefile sparsecopy -) -./sparsemv.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &1`" || exit 77 +sleep 2 -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 -} +tar --listed-incremental=list -c -f archive.a directory -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} +sleep 2 -# 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 -} +tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory -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 +echo separator - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean +tar -MRt -f arc.1 -f arc.2) +177. spmvp00.at:21: ok - 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 -) -178. spmvp01.at:21: testing sparse files in PAX MV archives, v.0.1 ... +143. chtype.at:27: 178. spmvp01.at:21: testing sparse files in PAX MV archives, v.0.1 ... ./spmvp01.at:24: mkdir pax (cd pax @@ -15795,10 +16553,9 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -177. spmvp00.at:21: ok - -169. sparse01.at:21: 165. multiv09.at:26: ok ok + +174. sparse06.at:21: ok 179. spmvp10.at:21: testing sparse files in PAX MV archives, v.1.0 ... ./spmvp10.at:24: mkdir pax @@ -15830,12 +16587,9 @@ tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -170. sparse02.at:21: ok - -176. sparsemv.at:21: 178. spmvp01.at:21: ok - ok -181. sptrdiff00.at:26: testing file truncated in sparse region while comparing ... -./sptrdiff00.at:30: +178. spmvp01.at:21: ok +180. sptrcreat.at:33: testing sparse file truncated while archiving ... +./sptrcreat.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15847,14 +16601,17 @@ 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 -) -180. sptrcreat.at:33: testing sparse file truncated while archiving ... -./sptrcreat.at:36: + 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') +179. spmvp10.at:21: ok + + +181. sptrdiff00.at:26: testing file truncated in sparse region while comparing ... +./sptrdiff00.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15866,15 +16623,12 @@ 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: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') - - - + tar --sparse -vdf bar +) 182. sptrdiff01.at:26: testing file truncated in data region while comparing ... ./sptrdiff01.at:30: mkdir posix @@ -15894,7 +16648,77 @@ genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ tar --sparse -vdf bar ) -179. spmvp10.at:21: ok +./listed02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +echo Create directories + +mkdir tart +sleep 1 +mkdir tart/c0 +sleep 1 +mkdir tart/c1 +sleep 1 + +for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 +do + echo File $file > $file + sleep 1 +done + +sleep 1 +echo Creating main archive +echo >&2 "Creating main archive" +tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 + +# The above prints two lines to stderr announcing the new directories c0 and c1. +# Ensure that they appear in this script's stderr in sorted order. +sort err 1>&2; rm -f err + +sleep 1 +echo Modifying filesystem +rm tart/a1 + +mv tart/b1 tart/b2 +mv tart/c1 tart/c2 +touch tart/c2/ca3 + +echo Directory contents +find tart -print | sort 2>/dev/null + +sleep 1 +echo Creating incremental archive +echo >&2 "Creating incremental archive" +cp -p tart.incr1 tart.incr2 +tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 + +sleep 1 + +rm -rf tart/* +echo Extracting main archive +echo >&2 "Extracting main archive" +tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 +echo Extracting incremental archive +# This command should produce three messages about deletion +# of the existing files, that may appear in any order. Piping +# to sort makes sure we don't depend on any particular ordering. +tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null + +echo Final files: +find tart -print | sort 2>/dev/null +) +118. incr02.at:32: ok + 183. update.at:28: testing update unchanged directories ... ./update.at:31: mkdir v7 @@ -15918,34 +16742,6 @@ echo separator tar tf archive | sort || exit 1 ) -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 -) - ./update.at:31: mkdir oldgnu (cd oldgnu @@ -15968,33 +16764,6 @@ echo separator tar tf archive | sort || exit 1 ) -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 -) ./update.at:31: mkdir ustar (cd ustar @@ -16017,7 +16786,6 @@ echo separator tar tf archive | sort || exit 1 ) -103. extrac20.at:21: ok ./update.at:31: mkdir posix (cd posix @@ -16040,7 +16808,25 @@ echo separator tar tf archive | sort || exit 1 ) +160. multiv04.at:36: ok +./sptrdiff00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vdf bar +) ./update.at:31: mkdir gnu (cd gnu @@ -16063,6 +16849,83 @@ echo separator tar tf archive | sort || exit 1 ) + +155. time01.at:20: 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 +) +./sptrdiff01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ + tar --sparse -vdf bar +) +183. update.at:28: ok + + +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 @@ -16085,7 +16948,24 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) -183. update.at:28: ok +./sptrcreat.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') ./update03.at:27: mkdir oldgnu (cd oldgnu @@ -16107,34 +16987,6 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) - -187. update04.at:20: testing update with wildcards ... -./update04.at:23: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 $? -) ./update03.at:27: mkdir ustar (cd ustar @@ -16177,6 +17029,67 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) +./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 + +) +./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 +) ./update03.at:27: mkdir gnu (cd gnu @@ -16198,10 +17111,36 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) +./update02.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +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: ok -188. verify.at:25: testing verify ... -./verify.at:28: +187. update04.at:20: testing update with wildcards ... +./update04.at:23: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -16210,10 +17149,24 @@ export TAR_OPTIONS rm -rf * -touch foo -tar -cvf archive.tar --verify foo +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 $? ) -./verify.at:28: +./sptrdiff00.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16222,10 +17175,34 @@ export TAR_OPTIONS rm -rf * -touch foo -tar -cvf archive.tar --verify foo +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 ) -./verify.at:28: +./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 +) +./update01.at:32: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -16234,10 +17211,173 @@ export TAR_OPTIONS rm -rf * -touch foo -tar -cvf archive.tar --verify foo + +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 ) -./verify.at:28: +./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 $? +) +./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 +) +./sptrcreat.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') +./update04.at:23: +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 $? +) +./update01.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +181. sptrdiff00.at:26: ok +./update02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update04.at:23: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16246,11 +17386,52 @@ 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 $? +) + +182. sptrdiff01.at:26: ok +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 * + touch foo tar -cvf archive.tar --verify foo ) -174. sparse06.at:21: ok +./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 +) + +180. sptrcreat.at:33: ok 189. volume.at:23: testing volume ... ./volume.at:26: mkdir gnu @@ -16277,6 +17458,18 @@ tar xfV archive babel test $? = 2 ) +./verify.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo +) ./volume.at:26: mkdir oldgnu (cd oldgnu @@ -16302,89 +17495,19 @@ tar xfV archive babel test $? = 2 ) -./incr04.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - - -sleep 1 -echo "Initial dump" -tar cvf a0.tar -g a.sna a -mv a/b a/c -echo "Incremental dump" -tar cvf a1.tar -g a.sna a -) ./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 ) -189. volume.at:23: ok -./rename02.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "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 -) - 190. volsize.at:29: testing volume header size ... ./volsize.at:32: mkdir v7 @@ -16410,8 +17533,20 @@ tar xf $TEST_DATA_DIR/abc.tar find abc|sort ) ---- - 2026-01-21 18:07:05.984935461 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2026-01-21 18:07:05.965765610 +0000 +./verify.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo +) +--- - 2024-12-19 11:50:25.144965168 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/190/stdout 2024-12-19 11:50:25.123653679 +0000 @@ -1,10 +1 @@ -Short Listing -abc/not-a-file.gif @@ -16423,126 +17558,37 @@ -abc -abc/CCC -./incr03.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort -) -155. time01.at:20: ok +188. verify.at:25: ok +189. volume.at:23: ok 190. volsize.at:29: skipped (volsize.at:32) -./rename03.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 - -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec - -sleep 1 - -echo "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 -) -191. comprec.at:21: testing compressed format recognition ... -./comprec.at:25: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./update04.at:23: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile --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.*' -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +echo "Second update" +tar ufv archive --wildcards './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 +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? ) 192. shortfile.at:26: testing short input files ... ./shortfile.at:29: @@ -16557,13 +17603,13 @@ genfile --length 511 --file foo || exit 5 tar tf foo ) -192. shortfile.at:26: ok +191. comprec.at:21: testing compressed format recognition ... ./comprec.at:25: -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 * @@ -16578,33 +17624,6 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) - -./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 $? -) 193. shortupd.at:31: testing updating short archives ... ./shortupd.at:34: mkdir v7 @@ -16618,13 +17637,26 @@ touch foo tar uf archive foo ) -188. verify.at:25: ok +192. shortfile.at:26: ok +./shortupd.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) + ./comprec.at:25: -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 * @@ -16639,37 +17671,18 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) - ./shortupd.at:34: -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 * touch foo tar uf archive foo ) -./sptrdiff00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar -) 194. truncate.at:29: testing truncate ... ./truncate.at:32: mkdir v7 @@ -16689,6 +17702,56 @@ genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') ./shortupd.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) +./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 +) +./shortupd.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) +./comprec.at:25: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -16697,9 +17760,18 @@ export TAR_OPTIONS rm -rf * -touch foo -tar uf archive foo + +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 ) +193. shortupd.at:31: ok ./truncate.at:32: mkdir oldgnu (cd oldgnu @@ -16717,6 +17789,7 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') + ./comprec.at:25: mkdir posix (cd posix @@ -16737,35 +17810,45 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) -./sptrdiff01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +195. grow.at:24: testing grow ... +./grow.at:27: +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 --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 ) -./shortupd.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./update02.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 * -touch foo -tar uf archive foo + +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 ) ./truncate.at:32: mkdir ustar @@ -16804,71 +17887,8 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) -./sptrcreat.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') -./shortupd.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -touch foo -tar uf archive foo -) -./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') -191. comprec.at:21: ok -193. shortupd.at:31: ok - - -195. grow.at:24: testing grow ... -./grow.at:27: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +187. update04.at:20: ok -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) 196. sigpipe.at:21: testing sigpipe handling ... ./sigpipe.at:30: @@ -16886,53 +17906,12 @@ # Discard diagnostics that some shells generate about broken pipes. (tar tf archive 2>&3 | :) 3>&2 2>/dev/null -196. sigpipe.at:21: ok -./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 -) ./truncate.at:32: -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 * @@ -16944,7 +17923,10 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') +191. comprec.at:21: ok +120. listed02.at:28: ok +196. sigpipe.at:21: ok 197. comperr.at:18: testing compressor program failure ... ./comperr.at:28: mkdir v7 @@ -16960,61 +17942,26 @@ sed -n '$p' err exit $rc ) -./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 -) -./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 -) -./update01.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./truncate.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./update02.at:29: +genfile --file foo --length 200k +genfile --file baz +genfile --run --checkpoint 10 --length 195k --truncate foo -- \ + tar -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 195k --length 5k --pattern=zeros +tar dvf bar|sed '/foo: Mod time differs/d') +./comperr.at:28: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -17023,78 +17970,11 @@ 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 -) -./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 -) -194. truncate.at:29: ok -./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 -) -./comperr.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - tar --use-compress-program false -cf a.tar . 2>err rc=$? sed -n '$p' err exit $rc ) - 198. remfiles01.at:28: testing remove-files with compression ... ./remfiles01.at:32: @@ -17141,92 +18021,6 @@ find . | sort exit $EC -./rename02.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -197. comperr.at:18: ok -./incr03.at:31: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --file=directory/x -genfile --file=directory/y - -sleep 1 - -tar -cf archive.1 -g db directory - -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory - -mv directory orig - -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort - -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp -find directory | sort - -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort -) - 199. remfiles02.at:28: testing remove-files with compression: grand-child ... ./remfiles02.at:32: @@ -17249,9 +18043,37 @@ find . | sort exit $EC -198. remfiles01.at:28: ok +./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 +) 199. remfiles02.at:28: ok +194. truncate.at:29: 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 +) + 200. remfiles03.at:28: testing remove-files with symbolic links ... ./remfiles03.at:31: @@ -17261,6 +18083,21 @@ tar --remove-files -cf a.tar a genfile --stat a +198. remfiles01.at:28: ok +./comperr.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) 201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... ./remfiles04a.at:28: mkdir gnu @@ -17281,94 +18118,11 @@ echo A find . | sort ) -./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 $? -) 200. remfiles03.at:28: ok -201. remfiles04a.at:25: ok -./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 -) -202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... -./remfiles04b.at:36: +203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... +./remfiles04c.at:36: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17383,12 +18137,15 @@ mkdir foo echo bar > bar echo foobar > foo/bar -tar -cf foo.tar --incremental --remove-files -C 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 ) -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 @@ -17403,19 +18160,17 @@ 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 ) -202. remfiles04b.at:33: ok -203. remfiles04c.at:33: ok - +201. remfiles04a.at:25: ok +197. comperr.at:18: ok -205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... -./remfiles05b.at:28: +184. update01.at:29: ok +203. remfiles04c.at:33: ok +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 @@ -17433,12 +18188,15 @@ echo foo/file > foo/file echo bar/file > bar/file decho A -tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file +tar -cvf foo.tar --remove-files -C foo file -C ../bar file decho B find . | sort ) -204. remfiles05a.at:34: testing remove-files with -C:rel,rel in -c/non-incr. mode ... -./remfiles05a.at:37: + +202. remfiles04b.at:33: ok + +205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... +./remfiles05b.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17456,16 +18214,13 @@ echo foo/file > foo/file echo bar/file > bar/file decho A -tar -cvf foo.tar --remove-files -C foo file -C ../bar file +tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file decho B find . | sort ) -205. remfiles05b.at:25: ok -204. remfiles05a.at:34: ok - -206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... -./remfiles05c.at:28: +207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... +./remfiles06a.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17482,16 +18237,14 @@ echo file > file echo foo/file > foo/file echo bar/file > bar/file -tar -cf foo.tar -C foo file -C ../bar file +DIR=`pwd` decho A -find . | sort +tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file decho B -tar -rvf foo.tar --remove-files -C foo file -C ../bar file -decho C find . | sort ) -207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... -./remfiles06a.at:28: +206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... +./remfiles05c.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -17508,16 +18261,30 @@ echo file > file echo foo/file > foo/file echo bar/file > bar/file -DIR=`pwd` +tar -cf foo.tar -C foo file -C ../bar file decho A -tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file +find . | sort decho B +tar -rvf foo.tar --remove-files -C foo file -C ../bar file +decho C find . | sort ) -206. remfiles05c.at:25: ok -207. remfiles06a.at:25: ok +204. remfiles05a.at:34: ok +205. remfiles05b.at:25: ok +./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 +) 208. remfiles06b.at:25: testing remove-files with -C:rel,abs in -c/incr. mode ... ./remfiles06b.at:28: mkdir gnu @@ -17542,6 +18309,9 @@ decho B find . | sort ) + + +207. remfiles06a.at:25: ok 209. remfiles06c.at:25: testing remove-files with -C:rel,abs in -r mode ... ./remfiles06c.at:28: mkdir gnu @@ -17569,59 +18339,8 @@ decho C find . | sort ) -208. remfiles06b.at:25: ok -./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 -) -./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 -) -209. remfiles06c.at:25: ok - - +185. update02.at:26: ok +206. remfiles05c.at:25: ok 210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... ./remfiles07a.at:28: mkdir gnu @@ -17646,6 +18365,9 @@ decho B find . | sort ) + + + 211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... ./remfiles07b.at:28: mkdir gnu @@ -17670,10 +18392,7 @@ decho B find . | sort ) -210. remfiles07a.at:25: ok -211. remfiles07b.at:25: ok - - +208. remfiles06b.at:25: ok 212. remfiles07c.at:25: testing remove-files with -C:abs,rel in -r mode ... ./remfiles07c.at:28: mkdir gnu @@ -17720,48 +18439,9 @@ decho B find . ) -./incremental.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created "on or after" the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) -213. remfiles08a.at:28: ok - -212. remfiles07c.at:25: ok +209. remfiles06c.at:25: ok +210. remfiles07a.at:25: ok 214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... ./remfiles08b.at:34: mkdir gnu @@ -17781,6 +18461,11 @@ decho B find . ) + +211. remfiles07b.at:25: ok + +212. remfiles07c.at:25: ok +213. remfiles08a.at:28: ok 215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... ./remfiles08c.at:31: mkdir gnu @@ -17806,28 +18491,8 @@ decho C find . ) -214. remfiles08b.at:31: ok -./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 -) -215. remfiles08c.at:28: ok - +214. remfiles08b.at:31: ok 216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... ./remfiles09a.at:28: mkdir gnu @@ -17845,6 +18510,7 @@ decho B find . ) + 217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... ./remfiles09b.at:32: mkdir gnu @@ -17862,8 +18528,6 @@ decho B find . ) -216. remfiles09a.at:25: ok -217. remfiles09b.at:29: ok 218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... @@ -17889,6 +18553,54 @@ decho C find . | sort ) +220. xattr01.at:25: testing xattrs: basic functionality ... +./xattr01.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) + 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 +genfile --file dir/file + +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file + +tar --xattrs -cf archive.tar dir + +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 ^$ +) 219. remfiles10.at:20: testing remove-files ... ./remfiles10.at:23: mkdir gnu @@ -17908,36 +18620,28 @@ find foo exit $tar_status ) -125. incr04.at:29: ok +--- - 2024-12-19 11:50:29.612159617 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2024-12-19 11:50:29.595470755 +0000 +@@ -1,3 +1 @@ +-user.test="OurDirValue" +-user.test="OurFileValue" + +220. xattr01.at:25: 217. remfiles09b.at:29: ok +215. remfiles08c.at:28: ok + skipped (xattr01.at:28) stderr: +216. remfiles09a.at:25: ok A tar: .: Cannot rmdir: Invalid argument tar: Exiting with failure status due to previous errors B -./remfiles10.at:44: sed '2s/:[^:]*$//' stderr -./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 -) -218. remfiles09c.at:25: ok +./remfiles10.at:44: sed '2s/:[^:]*$//' stderr -220. xattr01.at:25: testing xattrs: basic functionality ... -./xattr01.at:28: + +223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... +./xattr04.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17970,19 +18674,20 @@ exit 77 fi + mkdir dir +mkdir output genfile --file dir/file -setfattr -n user.test -v OurDirValue dir -setfattr -n user.test -v OurFileValue dir/file - -tar --xattrs -cf archive.tar dir +setfattr -n user.test -v value dir/file -rm -rf dir -tar --xattrs -xf archive.tar +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -getfattr -h -d dir | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +tar --xattrs -xf archive.tar -C output +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret ) 221. xattr02.at:25: testing xattrs: change directory with -C option ... ./xattr02.at:28: @@ -18039,49 +18744,6 @@ getfattr -h -d file2 | grep -v -e '^#' -e ^$ getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ ) -219. remfiles10.at:20: ok ---- - 2026-01-21 18:07:08.547914009 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2026-01-21 18:07:08.545765610 +0000 -@@ -1,3 +1 @@ --user.test="OurDirValue" --user.test="OurFileValue" - -138. rename02.at:24: ok -./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 $? -) ---- - 2026-01-21 18:07:08.550233803 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2026-01-21 18:07:08.545765610 +0000 -@@ -1,4 +1 @@ --user.test="OurFile1Value" --user.test="OurFile2Value" --user.test="OurDirValue" - - -124. incr03.at:28: ok 222. xattr03.at:25: testing xattrs: trusted.* attributes ... ./xattr03.at:28: mkdir v7 @@ -18145,10 +18807,16 @@ getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ ) +219. remfiles10.at:20: ok - -220. xattr01.at:25: 221. xattr02.at:25: 223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... -./xattr04.at:29: +--- - 2024-12-19 11:50:29.900009941 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2024-12-19 11:50:29.883458975 +0000 +@@ -1,2 +1 @@ +-user.test="value" + +223. xattr04.at:26: skipped (xattr04.at:29) +225. xattr06.at:27: testing xattrs: exclude xattrs on create ... +./xattr06.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18186,45 +18854,22 @@ mkdir output genfile --file dir/file -setfattr -n user.test -v value dir/file +for attr in excluded incla inclb inclc incl_excluded +do + setfattr -n user.${attr} -v value dir/file || exit 77 +done -# archive whole directory including binary xattrs -tar --xattrs -cf archive.tar -C dir . +tar --xattrs-include=user.incl'*' --xattrs-exclude=user.incl_excluded -cf archive.tar -C dir . +tar -xf archive.tar --xattrs-include=user.incl[ab] --xattrs-exclude=user.inclb -C output -tar --xattrs -xf archive.tar -C output -ret=$? -getfattr -h -d output/file | grep -v -e '^#' -e ^$ -exit $ret +getfattr -d output/file | grep -v \ + -e excluded \ + -e inclb \ + -e inclc > filtered +getfattr -d output/file > full +# if they differ then the attribute is still present +diff filtered full ) ---- - 2026-01-21 18:07:08.636318171 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2026-01-21 18:07:08.617765610 +0000 -@@ -1,4 +1 @@ --trusted.test="OurFile1Value" --trusted.test="OurFile2Value" --trusted.test="OurDirValue" - - skipped (xattr01.at:28) - skipped (xattr02.at:28) -./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') - - 224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... ./xattr05.at:31: mkdir v7 @@ -18274,66 +18919,18 @@ getfattr -d output/file | grep -v '# ' > after diff before after ) ---- - 2026-01-21 18:07:08.657306996 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2026-01-21 18:07:08.653765610 +0000 -@@ -1,2 +1 @@ --user.test="value" +218. remfiles09c.at:25: ok +--- - 2024-12-19 11:50:30.000396895 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2024-12-19 11:50:29.943456520 +0000 +@@ -1,4 +1 @@ +-trusted.test="OurFile1Value" +-trusted.test="OurFile2Value" +-trusted.test="OurDirValue" -223. xattr04.at:26: 225. xattr06.at:27: testing xattrs: exclude xattrs on create ... -./xattr06.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - +222. xattr03.at:25: skipped (xattr03.at:28) - file=$(TMPDIR=. mktemp fiXXXXXX) - - setfattr -n user.test -v test $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - getfattr $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - file=$(TMPDIR=. mktemp fiXXXXXX) - setfattr -n user.test -v ahoj $file - # check whether tar fails to store xattrs - err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi - - -mkdir dir -mkdir output -genfile --file dir/file - -for attr in excluded incla inclb inclc incl_excluded -do - setfattr -n user.${attr} -v value dir/file || exit 77 -done - -tar --xattrs-include=user.incl'*' --xattrs-exclude=user.incl_excluded -cf archive.tar -C dir . -tar -xf archive.tar --xattrs-include=user.incl[ab] --xattrs-exclude=user.inclb -C output -getfattr -d output/file | grep -v \ - -e excluded \ - -e inclb \ - -e inclc > filtered -getfattr -d output/file > full -# if they differ then the attribute is still present -diff filtered full -) 226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... ./xattr07.at:29: mkdir v7 @@ -18390,37 +18987,16 @@ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ ) -222. xattr03.at:25: skipped (xattr04.at:29) -224. xattr05.at:28: skipped (xattr03.at:28) - skipped (xattr05.at:31) - - ---- - 2026-01-21 18:07:08.699861994 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2026-01-21 18:07:08.693765610 +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 - - ---- - 2026-01-21 18:07:08.701746964 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2026-01-21 18:07:08.697765610 +0000 -@@ -1,10 +1 @@ --dir/ --dir/file --dir/file2 --dir/ --dir/file --dir/file2 --user.test="OurDirValue2" --user.test="OurFileValue2" --user.test="OurFileValue2" +--- - 2024-12-19 11:50:30.181410456 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2024-12-19 11:50:30.107449812 +0000 +@@ -1,4 +1 @@ +-user.test="OurFile1Value" +-user.test="OurFile2Value" +-user.test="OurDirValue" -139. rename03.at:23: ok -227. xattr08.at:26: testing xattrs: xattrs and read-only files ... +221. xattr02.at:25: 225. xattr06.at:27: skipped (xattr02.at:28) + skipped (xattr06.at:30) +224. xattr05.at:28: 227. xattr08.at:26: testing xattrs: xattrs and read-only files ... ./xattr08.at:29: mkdir v7 (cd v7 @@ -18463,6 +19039,17 @@ tar --xattrs -C dir -cf archive.tar file tar --xattrs -C dir2 -xf archive.tar ) + skipped (xattr05.at:31) +--- - 2024-12-19 11:50:30.229761414 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2024-12-19 11:50:30.207445721 +0000 +@@ -1,7 +1 @@ +-tar: dir: skipping existing file +-tar: dir/file: skipping existing file +-tar: dir/file2: skipping existing file +-tar: dir/file: Cannot open: File exists +-tar: dir/file2: Cannot open: File exists +-tar: Exiting with failure status due to previous errors + 228. acls01.at:25: testing acls: basic functionality ... ./acls01.at:28: mkdir v7 @@ -18533,83 +19120,26 @@ diff before after test "$?" = 0 ) -229. acls02.at:25: testing acls: work with -C ... -./acls02.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) - - 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 -mkdir dir/subdir -genfile --file dir/subdir/file - -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 +--- - 2024-12-19 11:50:30.256603144 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2024-12-19 11:50:30.231444739 +0000 +@@ -1,10 +1 @@ +-dir/ +-dir/file +-dir/file2 +-dir/ +-dir/file +-dir/file2 +-user.test="OurDirValue2" +-user.test="OurFileValue2" +-user.test="OurFileValue2" + +226. xattr07.at:26: + skipped (xattr07.at:29) -cd dir -getfattr -h -m. -d subdir subdir/file > ../after -cd .. -diff before after -test "$?" = 0 -) +228. acls01.at:25: 227. xattr08.at:26: skipped (acls01.at:28) + skipped (xattr08.at:29) 230. acls03.at:30: testing acls: default ACLs ... ./acls03.at:47: mkdir v7 @@ -18828,40 +19358,6 @@ fi ) -227. xattr08.at:26: 229. acls02.at:25: 226. xattr07.at:26: skipped (xattr07.at:29) -228. acls01.at:25: 225. xattr06.at:27: skipped (xattr08.at:29) - skipped (acls01.at:28) - skipped (xattr06.at:30) - skipped (acls02.at:28) - -230. acls03.at:30: - - - skipped (acls03.at:47) - - -234. onetop01.at:21: testing tar --one-top-level ... -./onetop01.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort -) 232. selacl01.at:25: testing acls/selinux: special files & fifos ... ./selacl01.at:28: mkdir v7 @@ -18971,7 +19467,85 @@ diff before after echo separator ) -231. selnx01.at:25: testing selinux: basic store/restore ... + +229. acls02.at:25: testing acls: work with -C ... +./acls02.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) + + 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 +mkdir dir/subdir +genfile --file dir/subdir/file + +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 +) + +230. acls03.at:30: 231. selnx01.at:25: testing selinux: basic store/restore ... ./selnx01.at:28: mkdir v7 (cd v7 @@ -19080,6 +19654,11 @@ fi ) +--- - 2024-12-19 11:50:30.549263443 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2024-12-19 11:50:30.543431977 +0000 +@@ -1,2 +1 @@ +-separator + 233. capabs_raw01.at:25: testing capabilities: binary store/restore ... ./capabs_raw01.at:28: mkdir v7 @@ -19156,8 +19735,21 @@ # Newer systems print = instead of + here getcap dir/file | sed 's/+/=/' ) -236. onetop03.at:21: testing tar --one-top-level --transform ... -./onetop03.at:24: +232. selacl01.at:25: --- - 2024-12-19 11:50:30.555167638 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2024-12-19 11:50:30.547431814 +0000 +@@ -1,4 +1 @@ +-security.selinux="system_u +-security.selinux="unconfined_u +-security.selinux="system_u + + skipped (acls03.at:47) + skipped (selacl01.at:28) +229. acls02.at:25: 231. selnx01.at:25: skipped (acls02.at:28) + skipped (selnx01.at:28) + + +234. onetop01.at:21: testing tar --one-top-level ... +./onetop01.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19175,9 +19767,16 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) + +--- - 2024-12-19 11:50:30.652115022 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2024-12-19 11:50:30.639428051 +0000 +@@ -1,2 +1 @@ +-dir/file = cap_chown=ei + + 235. onetop02.at:21: testing tar --one-top-level --show-transformed ... ./onetop02.at:24: mkdir v7 @@ -19200,73 +19799,28 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) ---- - 2026-01-21 18:07:08.871334630 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2026-01-21 18:07:08.865765610 +0000 -@@ -1,2 +1 @@ --separator - ---- - 2026-01-21 18:07:08.871418919 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2026-01-21 18:07:08.865765610 +0000 -@@ -1,4 +1 @@ --security.selinux="system_u --security.selinux="unconfined_u --security.selinux="system_u - ---- - 2026-01-21 18:07:08.874334097 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2026-01-21 18:07:08.869765610 +0000 -@@ -1,2 +1 @@ --dir/file = cap_chown=ei - -./onetop01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +233. capabs_raw01.at:25: ./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 * - -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 +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./onetop02.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 + skipped (capabs_raw01.at:28) -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 -) -233. capabs_raw01.at:25: 231. selnx01.at:25: 232. selacl01.at:25: skipped (capabs_raw01.at:28) - skipped (selnx01.at:28) +236. onetop03.at:21: testing tar --one-top-level --transform ... ./onetop03.at:24: -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 * @@ -19282,10 +19836,6 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) - - - skipped (selacl01.at:28) - 238. onetop05.at:21: testing tar --one-top-level restoring permissions ... ./onetop05.at:28: mkdir v7 @@ -19334,12 +19884,22 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop01.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 + +237. onetop04.at:21: testing tar --one-top-level --transform ... +./onetop04.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -19350,17 +19910,14 @@ genfile --file a/b genfile --file c tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop01.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 * @@ -19373,16 +19930,27 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) -237. onetop04.at:21: testing tar --one-top-level --transform ... +--- - 2024-12-19 11:50:30.912421415 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2024-12-19 11:50:30.895417579 +0000 +@@ -1,7 +1 @@ +--rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif +--rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif +--rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG +--rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg +--rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif +--rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg + +239. gtarfail.at:21: skipped (gtarfail.at:26) + ./onetop04.at:24: -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 * @@ -19395,44 +19963,12 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./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 -) -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 - ---- - 2026-01-21 18:07:09.024145557 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2026-01-21 18:07:09.005765610 +0000 -@@ -1,7 +1 @@ ---rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif ---rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif ---rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG ---rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg ---rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif ---rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg - ./onetop03.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -19448,7 +19984,7 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop04.at:24: +./onetop02.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -19464,7 +20000,10 @@ 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 ) ./onetop05.at:28: mkdir oldgnu @@ -19513,80 +20052,57 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -239. gtarfail.at:21: skipped (gtarfail.at:26) - -./chtype.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a - -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory - -sleep 2 - -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b +240. gtarfail2.at:21: testing gtarfail2 ... +./gtarfail2.at:26: -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -# Delete a -rm -r directory +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort -) -./multiv04.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./onetop01.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 directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &1`" || exit 77 -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 +) +--- - 2024-12-19 11:50:31.220804519 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2024-12-19 11:50:31.211404653 +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 + +240. gtarfail2.at:21: skipped (gtarfail2.at:26) -tar -MRt -f arc.1 -f arc.2) -./onetop03.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./onetop04.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 * @@ -19597,12 +20113,9 @@ genfile --file a/b genfile --file c tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar -find . | sort +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop02.at:24: +./onetop01.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19620,32 +20133,45 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --show-transformed -v -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) -240. gtarfail2.at:21: testing gtarfail2 ... -./gtarfail2.at:26: +./exclude05.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 "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar +test -z "`sort < /dev/null 2>&1`" || exit 77 ---- - 2026-01-21 18:07:09.159312904 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2026-01-21 18:07:09.153765610 +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 - -./onetop04.at:24: + +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 + +) +./onetop02.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -19661,9 +20187,12 @@ 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 ) -./update02.at:29: +./onetop03.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -19677,18 +20206,83 @@ 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 +) +241. multi-fail.at:21: testing multi-fail ... +./multi-fail.at:26: -tar cf arc a +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -echo "separator" -sleep 2 -touch a/b +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) + +tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ + -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- + +--- - 2024-12-19 11:50:31.515126312 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2024-12-19 11:50:31.507392546 +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 + ./onetop05.at:28: mkdir ustar (cd ustar @@ -19736,12 +20330,13 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop02.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +241. multi-fail.at:21: skipped (multi-fail.at:26) +./onetop04.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 * @@ -19752,12 +20347,9 @@ 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: +./onetop01.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19775,10 +20367,11 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar +tar --one-top-level -x -f ../a.tar find . | sort ) -./onetop01.at:24: + +./onetop03.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19796,15 +20389,15 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./update01.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop04.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 * @@ -19813,21 +20406,24 @@ 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 +) +242. ustar-big-2g.at:21: testing ustar-big-2g ... +./ustar-big-2g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -tar cf arc a +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -echo "separator" -sleep 2 -genfile --file a/c +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -240. gtarfail2.at:21: skipped (gtarfail2.at:26) -./onetop04.at:24: +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 + +./onetop02.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19843,24 +20439,21 @@ 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 ) -236. onetop03.at:21: ok -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 <&- - -./onetop01.at:24: +stderr: +234. onetop01.at:21: ok +--- - 2024-12-19 11:50:31.756691263 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2024-12-19 11:50:31.751382565 +0000 +@@ -1,3 +1 @@ +--rw------- jes/glone 2147483647 2002-06-15 14:53 big +--rw-r--r-- jes/glone 0 2002-06-15 14:53 file + +242. ustar-big-2g.at:21: skipped (ustar-big-2g.at:26) +./onetop03.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19878,67 +20471,12 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ---- - 2026-01-21 18:07:09.331053597 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2026-01-21 18:07:09.325765610 +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 - +237. onetop04.at:21: ok + -235. onetop02.at:21: ok ./onetop05.at:28: mkdir posix (cd posix @@ -19986,22 +20524,6 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -241. multi-fail.at:21: skipped (multi-fail.at:26) - - -242. ustar-big-2g.at:21: testing ustar-big-2g ... -./ustar-big-2g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2 - 243. ustar-big-8g.at:21: testing ustar-big-8g ... ./ustar-big-8g.at:26: test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 @@ -20016,28 +20538,10 @@ tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 stderr: -./onetop04.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 -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort -) ---- - 2026-01-21 18:07:09.450816319 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2026-01-21 18:07:09.445765610 +0000 +--- - 2024-12-19 11:50:31.962181022 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2024-12-19 11:50:31.947374548 +0000 @@ -1,3 +1 @@ ---rw------- jes/glone 2147483647 2002-06-15 14:53 big +--rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 --rw-r--r-- jes/glone 0 2002-06-15 14:53 file 244. pax-big-10g.at:21: testing pax-big-10g ... @@ -20053,21 +20557,37 @@ tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 -234. onetop01.at:21: ok -stderr: +243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) stderr: ---- - 2026-01-21 18:07:09.479909158 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2026-01-21 18:07:09.453765610 +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-01-21 18:07:09.482068264 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2026-01-21 18:07:09.453765610 +0000 +236. onetop03.at:21: ok +--- - 2024-12-19 11:50:32.081864959 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2024-12-19 11:50:32.055370130 +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 +./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 +) +244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) ./onetop05.at:28: mkdir gnu (cd gnu @@ -20115,121 +20635,8 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) -244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) -242. ustar-big-2g.at:21: skipped (ustar-big-2g.at:26) -237. onetop04.at:21: ok -./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 - -) +235. onetop02.at:21: ok 238. onetop05.at:21: ok -./update04.at:23: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 $? -) -181. sptrdiff00.at:26: ok -182. sptrdiff01.at:26: ok -180. sptrcreat.at:33: ok -./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 - -) ./grow.at:27: mkdir posix (cd posix @@ -20243,61 +20650,6 @@ genfile --file baz genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -187. update04.at:20: ok -./update02.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -119. listed01.at:26: ok -143. chtype.at:27: ok -./update01.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) ./grow.at:27: mkdir gnu (cd gnu @@ -20311,329 +20663,13 @@ genfile --file baz genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./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 -) 195. grow.at:24: ok -160. multiv04.at:36: ok -./update02.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./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 -) -./incr02.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, 'dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) -116. incremental.at:23: ok -185. update02.at:26: ok -184. update01.at:29: 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 - -) -./listed02.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -echo Create directories - -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 - -for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2 -do - echo File $file > $file - sleep 1 -done - -sleep 1 -echo Creating main archive -echo >&2 "Creating main archive" -tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1 - -# The above prints two lines to stderr announcing the new directories c0 and c1. -# Ensure that they appear in this script's stderr in sorted order. -sort err 1>&2; rm -f err - -sleep 1 -echo Modifying filesystem -rm tart/a1 - -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 - -echo Directory contents -find tart -print | sort 2>/dev/null - -sleep 1 -echo Creating incremental archive -echo >&2 "Creating incremental archive" -cp -p tart.incr1 tart.incr2 -tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1 - -sleep 1 - -rm -rf tart/* -echo Extracting main archive -echo >&2 "Extracting main archive" -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null - -echo Final files: -find tart -print | sort 2>/dev/null -) -118. incr02.at:32: ok -./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 -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 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 64. exclude05.at:21: ok stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2026-01-21 18:07 begin --rw-r--r-- pbuilder1/pbuilder1 8589935104 2026-01-21 18:07 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2026-01-21 18:07 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 begin +-rw-r--r-- pbuilder2/pbuilder2 8589935104 2024-12-19 11:50 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-19 11:50 end separator sparsefile 8589935104 171. sparse03.at:21: ok @@ -20654,7 +20690,7 @@ create-stamp debian/debhelper-build-stamp dh_prep dh_auto_install - make -j22 install DESTDIR=/build/reproducible-path/tar-1.35\+dfsg/debian/tmp AM_UPDATE_INFO_DIR=no + make -j10 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' @@ -20701,8 +20737,8 @@ 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' @@ -20793,45 +20829,45 @@ dh_perl dh_link dh_strip_nondeterminism - Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/da/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/pt_BR/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo dh_compress dh_fixperms dh_missing @@ -20845,8 +20881,8 @@ dh_md5sums dh_builddeb dpkg-deb: building package 'tar-dbgsym' in '../tar-dbgsym_1.35+dfsg-3.1_i386.deb'. -dpkg-deb: building package 'tar-scripts' in '../tar-scripts_1.35+dfsg-3.1_all.deb'. dpkg-deb: building package 'tar' in '../tar_1.35+dfsg-3.1_i386.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_i386.buildinfo dpkg-genchanges --build=binary -O../tar_1.35+dfsg-3.1_i386.changes dpkg-genchanges: info: binary-only upload (no source code included) @@ -20854,12 +20890,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/52244/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/52244/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/12565 and its subdirectories -I: Current time: Wed Jan 21 06:09:01 -12 2026 -I: pbuilder-time-stamp: 1769018941 +I: removing directory /srv/workspace/pbuilder/52244 and its subdirectories +I: Current time: Fri Dec 20 01:58:17 +14 2024 +I: pbuilder-time-stamp: 1734609497