Diff of the two buildlogs: -- --- b1/build.log 2024-12-24 08:20:53.433357875 +0000 +++ b2/build.log 2024-12-24 08:23:26.118397649 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Mon Dec 23 20:17:59 -12 2024 -I: pbuilder-time-stamp: 1735028279 +I: Current time: Tue Dec 24 22:20:56 +14 2024 +I: pbuilder-time-stamp: 1735028456 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration @@ -33,52 +33,84 @@ dpkg-source: info: applying tar-1.35-revert-fix-savannah-bug-633567.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/652451/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/3037335/tmp/hooks/D01_modify_environment starting +debug: Running on codethink02-arm64. +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 24 08:21 /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/3037335/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/3037335/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='arm64' - DEBIAN_FRONTEND='noninteractive' + 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]="aarch64-unknown-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=arm64 + DEBIAN_FRONTEND=noninteractive DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=12 ' - DISTRIBUTION='trixie' - HOME='/root' - HOST_ARCH='arm64' + DIRSTACK=() + DISTRIBUTION=trixie + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=aarch64 + HOST_ARCH=arm64 IFS=' ' - INVOCATION_ID='dc00651969634a358a3014ffbf4ff745' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='652451' - PS1='# ' - PS2='> ' + INVOCATION_ID=b9051b76572444bf8c45896267cb4d65 + LANG=C + LANGUAGE=nl_BE:nl + LC_ALL=C + MACHTYPE=aarch64-unknown-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=3037335 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.YMAVcDZa/pbuilderrc_S473 --distribution trixie --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.YMAVcDZa/b1 --logfile b1/build.log tar_1.35+dfsg-3.1.dsc' - SUDO_GID='109' - SUDO_UID='104' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://192.168.101.4: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.YMAVcDZa/pbuilderrc_0d4d --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.YMAVcDZa/b2 --logfile b2/build.log tar_1.35+dfsg-3.1.dsc' + SUDO_GID=109 + SUDO_UID=104 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://192.168.101.4:3128 I: uname -a - Linux codethink04-arm64 6.1.0-28-cloud-arm64 #1 SMP Debian 6.1.119-1 (2024-11-22) aarch64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-28-cloud-arm64 #1 SMP Debian 6.1.119-1 (2024-11-22) aarch64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/652451/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/3037335/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -169,7 +201,7 @@ Get: 37 http://deb.debian.org/debian trixie/main arm64 libpcre2-dev arm64 10.44-5 [704 kB] Get: 38 http://deb.debian.org/debian trixie/main arm64 libsepol-dev arm64 3.7-1 [354 kB] Get: 39 http://deb.debian.org/debian trixie/main arm64 libselinux1-dev arm64 3.7-3+b1 [164 kB] -Fetched 22.5 MB in 0s (142 MB/s) +Fetched 22.5 MB in 0s (133 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 ... 20082 files and directories currently installed.) @@ -341,7 +373,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/3037335/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for trixie +I: user script /srv/workspace/pbuilder/3037335/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 @@ -378,8 +414,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 @@ -1079,8 +1115,6 @@ printf '#define PKGLIBDIR %s\n' \"/usr/lib/aarch64-linux-gnu/tar\"; \ printf '#define PKGLIBEXECDIR %s\n' \"/usr/sbin/tar\"; \ } | sed '/""/d' > configmake.h-t -mv alloca.h-t alloca.h -mv configmake.h-t configmake.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' \ @@ -1138,9 +1172,6 @@ -e 's|@''REPLACE_ERROR_AT_LINE''@|0|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ ./error.in.h > error.h-t -mv ctype.h-t ctype.h -mv dirent.h-t dirent.h -mv error.h-t error.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1164,6 +1195,7 @@ -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' \ @@ -1173,19 +1205,20 @@ -e 's|@''NEXT_GETOPT_H''@||g' \ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ ./getopt.in.h > getopt.h-t +mv 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 fcntl.h-t fcntl.h -mv getopt-cdefs.h-t getopt-cdefs.h +mv ctype.h-t ctype.h +/usr/bin/mkdir -p 'malloc' +mv dirent.h-t dirent.h +mv error.h-t error.h /usr/bin/mkdir -p 'malloc' mv getopt.h-t getopt.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' -/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' \ @@ -1195,14 +1228,6 @@ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ - -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ - -e 's|__glibc_likely|_GL_LIKELY|g' \ - -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ - -e '/libc_hidden_proto/d' \ - ./malloc/scratch_buffer.h > malloc/scratch_buffer.gl.h-t -mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h -mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's/@''HAVE_INTTYPES_H''@/1/g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ @@ -1231,6 +1256,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 getopt-cdefs.h-t getopt-cdefs.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e 's|__always_inline|inline _GL_ATTRIBUTE_ALWAYS_INLINE|g' \ + -e 's|__glibc_likely|_GL_LIKELY|g' \ + -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ + -e '/libc_hidden_proto/d' \ + ./malloc/scratch_buffer.h > malloc/scratch_buffer.gl.h-t 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,8 +1282,6 @@ -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 inttypes.h-t inttypes.h -mv langinfo.h-t langinfo.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1284,17 +1315,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./locale.in.h > locale.h-t -mv limits.h-t limits.h +mv malloc/dynarray.gl.h-t malloc/dynarray.gl.h /usr/bin/mkdir -p 'selinux' -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/@''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 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' \ @@ -1321,7 +1343,6 @@ -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 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|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1332,8 +1353,14 @@ -e 's|@''HAVE_WCHAR_T''@|1|g' \ -e 's|@''REPLACE_NULL''@|0|g' \ ./stddef.in.h > stddef.h-t -mv signal.h-t signal.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/@''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 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' \ @@ -1458,6 +1485,14 @@ -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 malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h +mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h +mv langinfo.h-t langinfo.h +mv limits.h-t limits.h +mv signal.h-t signal.h +mv stddef.h-t stddef.h +mv selinux/selinux.h-t selinux/selinux.h +mv inttypes.h-t inttypes.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1605,6 +1640,7 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > stdlib.h-t +mv locale.h-t locale.h 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' \ @@ -1722,10 +1758,7 @@ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./strings.in.h > strings.h-t /usr/bin/mkdir -p 'sys' -mv stdio.h-t stdio.h -mv string.h-t string.h -mv stdlib.h-t stdlib.h -mv strings.h-t strings.h +/usr/bin/mkdir -p 'sys' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1741,6 +1774,7 @@ -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 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,8 +1833,6 @@ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_stat.in.h > sys/stat.h-t mv sys/random.h-t sys/random.h -/usr/bin/mkdir -p 'sys' -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' \ @@ -1824,6 +1856,15 @@ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ -e 's|@''PRAGMA_COLUMNS''@||g' \ + -e 's|@''NEXT_SYS_TYPES_H''@||g' \ + -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \ + -e 's|@''WINDOWS_STAT_INODES''@|0|g' \ + ./sys_types.in.h > sys/types.h-t +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|include_next|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ + -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_TIME_H''@||g' \ -e 's/@''GNULIB_CTIME''@/0/g' \ -e 's/@''GNULIB_LOCALTIME''@/0/g' \ @@ -1866,18 +1907,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' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ - -e 's|@''PRAGMA_COLUMNS''@||g' \ - -e 's|@''NEXT_SYS_TYPES_H''@||g' \ - -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \ - -e 's|@''WINDOWS_STAT_INODES''@|0|g' \ - ./sys_types.in.h > sys/types.h-t -mv time.h-t time.h -mv sys/types.h-t sys/types.h +mv string.h-t string.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' \ @@ -1931,6 +1961,9 @@ -e 's/@''GNULIB_UNICASE_EMPTY_PREFIX_CONTEXT_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNICASE_EMPTY_SUFFIX_CONTEXT_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ ./unicase.in.h > unicase.h-t +mv sys/time.h-t sys/time.h +mv sys/stat.h-t sys/stat.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_UNICTYPE_CATEGORY_L_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2066,6 +2099,7 @@ -e 's/@''GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNICTYPE_PROPERTY_REGIONAL_INDICATOR_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ > unictype.h-t +mv unicase.h-t unicase.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNINORM_NFD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2073,9 +2107,8 @@ -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 uchar.h-t uchar.h -mv unicase.h-t unicase.h -mv uninorm.h-t uninorm.h +mv stdio.h-t stdio.h +mv time.h-t time.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_UNISTD_H''@|1|g' \ @@ -2274,11 +2307,7 @@ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > unistd.h-t sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w unitypes.h-t' ./unitypes.in.h -mv unitypes.h-t unitypes.h -mv unictype.h-t unictype.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.h -mv uniwidth.h-t uniwidth.h -mv unistd.h-t unistd.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' \ @@ -2294,6 +2323,10 @@ -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 uchar.h-t uchar.h +mv unitypes.h-t unitypes.h +mv uninorm.h-t uninorm.h +mv uniwidth.h-t uniwidth.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -2447,8 +2480,11 @@ -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 wchar.h-t wchar.h +mv stdlib.h-t stdlib.h mv wctype.h-t wctype.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' @@ -2752,9 +2788,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 -j12 --verbose +/bin/sh ./testsuite -j12 --verbose ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## @@ -2770,6 +2806,42 @@ +3. options.at:24: testing mixing options ... +./options.at:27: +echo > file1 +TAR_OPTIONS=--numeric-owner tar chof archive file1 +tar tf archive + +1. version.at:19: testing tar version ... +./version.at:21: tar --version | sed 1q +2. pipe.at:29: testing decompressing from stdin ... +./pipe.at:33: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 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) +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: @@ -2780,26 +2852,6 @@ genfile --file newfile tar rzf test.tar newfile -8. opcomp03.at:21: testing --verify compatibility ... -./opcomp03.at:24: -tar -tWf test.tar . - -1. version.at:19: testing tar version ... -./version.at:21: tar --version | sed 1q -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 . - - 5. options03.at:21: testing TAR_OPTIONS with string arguments ... ./options03.at:31: echo dir/bar > exclude.list @@ -2813,27 +2865,23 @@ ./opcomp01.at:24: tar --occurrence=1 -cf test.tar . -7. opcomp02.at:21: testing occurrence compatibility ... -./opcomp02.at:24: -tar --occurrence=1 -tf test.tar +12. defaults.at:16: testing checkpoint defaults ... +./defaults.at:18: +mkdir t +cd t +for i in 0 1 2 3 4 5 6 7 8 9 +do + genfile --length 10240 --file $i +done +TAR_OPTIONS=-Hgnu +export TAR_OPTIONS -10. opcomp05.at:21: testing --pax-option compatibility ... -./opcomp05.at:24: -tar -Hgnu -cf test.tar --pax-option user:=root . +tar --checkpoint -c -f ../a.tar . -3. options.at:24: testing mixing options ... -./options.at:27: -echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 -tar tf archive -8. opcomp03.at:21: ok -6. opcomp01.at:21: ok -4. options02.at:26: testing interspersed options ... -./options02.at:29: -echo > file1 -tar c file1 -f archive -tar tf archive +8. opcomp03.at:21: testing --verify compatibility ... +./opcomp03.at:24: +tar -tWf test.tar . 11. opcomp06.at:21: testing --pax-option compatibility ... ./opcomp06.at:24: @@ -2864,14 +2912,58 @@ genfile --file file tar -cf test.tar --acls -Hgnu file +3. options.at:24: ok +4. options02.at:26: testing interspersed options ... +./options02.at:29: +echo > file1 +tar c file1 -f archive +tar tf archive + +6. opcomp01.at:21: ok +1. version.at:19: ok 7. opcomp02.at:21: ok -2. pipe.at:29: testing decompressing from stdin ... +8. opcomp03.at:21: ok +--- - 2024-12-24 08:22:48.912213853 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2024-12-24 08:22:48.903340839 +0000 +@@ -1,3 +1 @@ +-tar: --acls can be used only on POSIX archives +-Try 'tar --help' or 'tar --usage' for more information. + +11. opcomp06.at:21: 4. options02.at:26: ok + skipped (opcomp06.at:24) +10. opcomp05.at:21: testing --pax-option compatibility ... +./opcomp05.at:24: +tar -Hgnu -cf test.tar --pax-option user:=root . + +9. opcomp04.at:21: ok +5. options03.at:21: ok + + +10. opcomp05.at:21: ok + + + + +15. dot-compat.at:16: testing dot action (compatibility syntax) ... +./dot-compat.at:18: +mkdir t +cd t +for i in 0 1 2 3 4 5 6 7 8 9 +do + genfile --length 10240 --file $i +done +TAR_OPTIONS=-Hgnu +export TAR_OPTIONS + +tar --checkpoint=.2 -c -f ../a.tar . + + ./pipe.at:33: -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 * @@ -2889,16 +2981,8 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) -5. options03.at:21: ok - -1. version.at:19: ok -3. options.at:24: ok -4. options02.at:26: 10. opcomp05.at:21: ok - ok - - -15. dot-compat.at:16: testing dot action (compatibility syntax) ... -./dot-compat.at:18: +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 @@ -2908,21 +2992,13 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=.2 -c -f ../a.tar . - - -9. opcomp04.at:21: ok +tar --checkpoint-action=dot -c -f ../a.tar . ---- - 2024-12-24 08:19:53.750372361 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2024-12-24 08:19:53.736199915 +0000 -@@ -1,3 +1 @@ --tar: --acls can be used only on POSIX archives --Try 'tar --help' or 'tar --usage' for more information. - -13. interval.at:16: testing checkpoint interval ... -./interval.at:18: +12. defaults.at:16: 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 @@ -2932,7 +3008,7 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=2 -c -f ../a.tar . +tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . 18. testsuite.at:243: testing compress: bzip2 ... @@ -2965,7 +3041,8 @@ tar xf k.tar.bz2 test -f empty -11. opcomp06.at:21: skipped (opcomp06.at:24) + + 17. testsuite.at:242: testing compress: gzip ... ./testsuite.at:242: @@ -2996,8 +3073,8 @@ tar xf k.tar.gz test -f empty -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 @@ -3007,25 +3084,34 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint-action=dot -c -f ../a.tar . +tar --checkpoint=2 -c -f ../a.tar . -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 +21. testsuite.at:247: testing compress: lzop ... +./testsuite.at:247: -tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . +cat /dev/null | lzop - > /dev/null 2>&1 || exit 77 +unset TAR_OPTIONS -12. defaults.at:16: ok +touch empty +set -e +: create with --lzop +tar --lzop -cf k.tar.lzo empty +tar tf k.tar.lzo + + +echo testing .lzo +tar -acf k2.tar.lzo empty +cat k2.tar.lzo | lzop -d > k.lzo.tar +tar tf k.lzo.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.lzo +test -f empty 19. testsuite.at:244: testing compress: xz ... ./testsuite.at:244: @@ -3057,64 +3143,7 @@ tar xf k.tar.xz test -f empty - - -21. testsuite.at:247: testing compress: lzop ... -./testsuite.at:247: - -cat /dev/null | lzop - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --lzop -tar --lzop -cf k.tar.lzo empty -tar tf k.tar.lzo - - -echo testing .lzo -tar -acf k2.tar.lzo empty -cat k2.tar.lzo | lzop -d > k.lzo.tar -tar tf k.lzo.tar - - -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.lzo -test -f empty - -./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) ---- - 2024-12-24 08:19:53.792251935 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2024-12-24 08:19:53.788200231 +0000 -@@ -1,4 +1 @@ --empty --testing .lzo --empty - -21. testsuite.at:247: 20. testsuite.at:246: testing compress: lzip ... +20. testsuite.at:246: testing compress: lzip ... ./testsuite.at:246: cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 @@ -3139,8 +3168,13 @@ tar xf k.tar.lz test -f empty - skipped (testsuite.at:247) - +--- - 2024-12-24 08:22:48.957239285 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2024-12-24 08:22:48.951341130 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lzo +-empty + 22. testsuite.at:248: testing compress: zstd ... ./testsuite.at:248: @@ -3171,16 +3205,15 @@ tar xf k.tar.zst test -f empty ---- - 2024-12-24 08:19:53.822931882 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2024-12-24 08:19:53.808200352 +0000 +21. testsuite.at:247: --- - 2024-12-24 08:22:48.960562225 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2024-12-24 08:22:48.955341154 +0000 @@ -1,4 +1 @@ -empty -testing .lz -empty -13. interval.at:16: ok -20. testsuite.at:246: --- - 2024-12-24 08:19:53.830133485 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2024-12-24 08:19:53.824200449 +0000 +--- - 2024-12-24 08:22:48.961963874 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2024-12-24 08:22:48.955341154 +0000 @@ -1,6 +1 @@ -empty -testing .zst @@ -3188,10 +3221,14 @@ -testing .tzst -empty - skipped (testsuite.at:246) +20. testsuite.at:246: skipped (testsuite.at:246) + skipped (testsuite.at:247) + +22. testsuite.at:248: 15. dot-compat.at:16: ok + skipped (testsuite.at:248) + +16. dot-int.at:16: ok -14. dot.at:16: ok -22. testsuite.at:248: skipped (testsuite.at:248) 23. positional01.at:21: testing Exclude ... ./positional01.at:24: @@ -3231,22 +3268,8 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) -24. positional02.at:21: testing Directory ... -./positional02.at:24: - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -> dir/A.a -> dir/B.a -> dir/A.b -tar -cf a.tar -C dir . -echo $? -tar -tf a.tar | sort -tar -cf a.tar . -C dir - - +13. interval.at:16: ok 25. positional03.at:21: testing Several options ... ./positional03.at:24: @@ -3260,38 +3283,21 @@ > dir/A.b tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort +24. positional02.at:21: testing Directory ... +./positional02.at:24: -15. dot-compat.at:16: ok -16. dot-int.at:16: ok - -27. T-mult.at:21: testing multiple file lists ... -./T-mult.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 ->file1 ->file2 ->file3 ->file4 -cat >F1 <<'_ATEOF' -file1 -file2 -_ATEOF +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -cf a.tar -C dir . +echo $? +tar -tf a.tar | sort +tar -cf a.tar . -C dir -cat >F2 <<'_ATEOF' -file3 -file4 -_ATEOF -tar cf archive -T F1 -T F2 -tar tf archive -) -19. testsuite.at:244: ok 26. add-file.at:21: testing The --add-file option ... ./add-file.at:33: mkdir v7 @@ -3324,10 +3330,36 @@ tar -cvf arc.tar -T input ) -18. testsuite.at:243: ok -25. positional03.at:21: ok -23. positional01.at:21: ok +14. dot.at:16: ok +27. T-mult.at:21: testing multiple file lists ... +./T-mult.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +>file1 +>file2 +>file3 +>file4 +cat >F1 <<'_ATEOF' +file1 +file2 +_ATEOF + +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF + +tar cf archive -T F1 -T F2 +tar tf archive +) + +23. positional01.at:21: ok 28. T-nest.at:21: testing nested file lists ... ./T-nest.at:24: mkdir ustar @@ -3384,6 +3416,48 @@ tar tf archive ) +18. testsuite.at:243: ok +19. testsuite.at:244: ok +30. T-recurse.at:27: testing files-from & recurse: toggle ... +./T-recurse.at:30: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +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" +) +17. testsuite.at:242: ok ./add-file.at:33: mkdir oldgnu (cd oldgnu @@ -3414,8 +3488,63 @@ 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 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir directory1 directory2 +touch directory1/file directory2/file + +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF + + +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 +tar tf archive + +) +27. T-mult.at:21: ok +./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) + +25. positional03.at:21: ok 28. T-nest.at:21: ok -24. positional02.at:21: ok + + 32. T-cd.at:21: testing -C in file lists ... ./T-cd.at:24: mkdir ustar @@ -3442,42 +3571,39 @@ tar cf archive -T F1 tar tf archive | sort ) -31. T-recurse.at:66: testing toggle --recursion (not) from -T ... -./T-recurse.at:69: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + + +34. T-null.at:21: testing 0-separated file without -0 ... +./T-null.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF +echo jeden > temp +echo dwa >> temp +echo trzy >> temp +cat temp | tr '\n' '\0' > file-list -tar cf archive -T F1 --recursion -T F2 -tar tf archive +genfile -f jeden +genfile -f dwa +genfile -f trzy +tar cfTv archive file-list ) -27. T-mult.at:21: ok -30. T-recurse.at:27: testing files-from & recurse: toggle ... ./T-recurse.at:30: -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 * @@ -3510,56 +3636,62 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) - - -17. testsuite.at:242: ./pipe.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./add-file.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 * +genfile --file -File +genfile --file foo +genfile --file bar -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File +echo 2: +tar -cvf arc.tar foo --add-file -File bar -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 -34. T-null.at:21: testing 0-separated file without -0 ... -./T-null.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input +) +./T-recurse.at:69: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +mkdir directory1 directory2 +touch directory1/file directory2/file -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -echo jeden > temp -echo dwa >> temp -echo trzy >> temp -cat temp | tr '\n' '\0' > file-list +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF -genfile -f jeden -genfile -f dwa -genfile -f trzy -tar cfTv archive file-list +tar cf archive -T F1 --recursion -T F2 +tar tf archive + ) 33. T-empty.at:26: testing empty entries ... ./T-empty.at:36: @@ -3579,12 +3711,31 @@ tar cfvT archive ../file-list ) +36. T-zfile.at:26: testing empty file ... +./T-zfile.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +genfile --length=0 --file empty +genfile --file a +genfile --file b +cat >valid <<'_ATEOF' +a +b +_ATEOF -32. T-cd.at:21: ok -33. T-empty.at:26: ok -29. T-rec.at:21: ok +tar cf archive -T empty -T valid +tar tf archive +echo "==" +tar cf archive -T valid -T empty +tar tf archive +) 35. T-null2.at:17: testing --null enables verbatim reading ... ./T-null2.at:24: mkdir ustar @@ -3610,6 +3761,7 @@ cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - ) +24. positional02.at:21: ok 37. T-nonl.at:27: testing entries with missing newlines ... ./T-nonl.at:30: mkdir ustar @@ -3636,38 +3788,34 @@ tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl tar tf archive ) -./add-file.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +29. T-rec.at:21: ok +./pipe.at:33: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF +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: ok +34. T-null.at:21: ok -echo 3: -tar -cvf arc.tar -T input -) -36. T-zfile.at:26: testing empty file ... -./T-zfile.at:29: +./T-recurse.at:69: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3676,30 +3824,6 @@ export TAR_OPTIONS rm -rf * -genfile --length=0 --file empty -genfile --file a -genfile --file b -cat >valid <<'_ATEOF' -a -b -_ATEOF - - -tar cf archive -T empty -T valid -tar tf archive -echo "==" -tar cf archive -T valid -T empty -tar tf archive -) -./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 @@ -3719,11 +3843,11 @@ ) ./T-recurse.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -3756,6 +3880,39 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) + +35. T-null2.at:17: ./add-file.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file -File +genfile --file foo +genfile --file bar + +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File + +echo 2: +tar -cvf arc.tar foo --add-file -File bar + + +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input +) + ok +36. T-zfile.at:26: ok 38. T-dir00.at:28: testing recursive extraction from --files-from ... ./T-dir00.at:30: mkdir v7 @@ -3777,31 +3934,7 @@ echo dir > list tar xfTv archive list | sort ) - -./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) - +32. T-cd.at:21: ok 39. T-dir01.at:28: testing trailing slash in --files-from ... ./T-dir01.at:30: @@ -3824,7 +3957,9 @@ echo dir/ > list tar xfTv archive list | sort ) -34. T-null.at:21: ok + + +37. T-nonl.at:27: ok 40. indexfile.at:26: testing tar --index-file=FILE --file=- ... ./indexfile.at:29: mkdir v7 @@ -3845,8 +3980,7 @@ echo "Testing the archive" tar -tf archive ) -37. T-nonl.at:27: ok -./add-file.at:33: +./T-recurse.at:69: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -3855,36 +3989,6 @@ export TAR_OPTIONS rm -rf * -genfile --file -File -genfile --file foo -genfile --file bar - -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File - -echo 2: -tar -cvf arc.tar foo --add-file -File bar - - -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF - - -echo 3: -tar -cvf arc.tar -T input -) -./T-recurse.at:69: -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 @@ -3920,44 +4024,6 @@ echo Testing the archive tar tf archive ) -36. T-zfile.at:26: ok - -35. T-null2.at:17: ok -./T-dir01.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 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort -) -./verbose.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -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 -) 42. gzip.at:23: testing gzip ... ./gzip.at:28: @@ -3968,67 +4034,12 @@ sed -n '/^tar:/p' err >&2 exit $RC -./T-dir00.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -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 -) -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 -) -./indexfile.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive - -echo "Testing the archive" -tar -tf archive -) - ./T-recurse.at:30: -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 * @@ -4061,6 +4072,28 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) +2. pipe.at:29: ok +./T-dir00.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +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: mkdir gnu (cd gnu @@ -4091,23 +4124,62 @@ echo 3: tar -cvf arc.tar -T input ) +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 * -2. pipe.at:29: ok -42. gzip.at:23: ok -./verbose.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) + +./T-dir01.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the 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 +) +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 v7" +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 ) 45. shortrec.at:25: testing short records ... ./shortrec.at:28: @@ -4128,12 +4200,31 @@ rm -r directory ) +./indexfile.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +mkdir directory +genfile --file=directory/a --length=1035 + +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) ./T-recurse.at:69: -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 * @@ -4156,7 +4247,7 @@ ) -./recurse.at:24: +./verbose.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4165,115 +4256,27 @@ 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 ) - -./indexfile.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive - -echo "Testing the archive" -tar -tf archive -) -./T-dir00.at:30: -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 dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) -47. same-order01.at:26: testing working -C with --same-order ... -./same-order01.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./recurse.at:24: +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 - - -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 -) -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 v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +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 -) -./T-dir01.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -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 ) +42. gzip.at:23: ok 46. numeric.at:18: testing --numeric-owner basic tests ... ./numeric.at:29: mkdir posix @@ -4316,27 +4319,12 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./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: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 * @@ -4369,69 +4357,22 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) -./indexfile.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./recurse.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 * - 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 -) -26. add-file.at:21: ok -./T-recurse.at:69: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF - - -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF - - -tar cf archive -T F1 --recursion -T F2 -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 --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 tar tf archive ) -./recurse.at:24: +26. add-file.at:21: ok +./T-dir01.at:30: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4440,11 +4381,18 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -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 ) + ./shortrec.at:28: mkdir oldgnu (cd oldgnu @@ -4463,7 +4411,7 @@ rm -r directory ) - +31. T-recurse.at:66: ok ./recurs02.at:33: mkdir oldgnu (cd oldgnu @@ -4484,26 +4432,66 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -./indexfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./T-dir00.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort +) +./verbose.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -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-dir01.at:30: +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 +) + +./recurse.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -4512,17 +4500,31 @@ export TAR_OPTIONS rm -rf * +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +./indexfile.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 dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort +mkdir directory +genfile --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 ) + 48. same-order02.at:25: testing multiple -C options ... ./same-order02.at:28: mkdir v7 @@ -4549,26 +4551,36 @@ echo separator ls to ) -31. T-recurse.at:66: ok -./shortrec.at:28: -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 -(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 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) -41. verbose.at:26: ok +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) +30. T-recurse.at:27: ok ./T-dir00.at:30: mkdir posix (cd posix @@ -4589,29 +4601,20 @@ echo dir > list tar xfTv archive list | sort ) -./same-order01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./recurse.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 * - -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 +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) - ./recurs02.at:33: mkdir ustar (cd ustar @@ -4633,11 +4636,11 @@ --recursion directory2 || exit 1 ) ./shortrec.at:28: -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 * @@ -4650,7 +4653,7 @@ rm -r directory ) -./recurse.at:24: +./indexfile.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -4659,67 +4662,17 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -40. indexfile.at:26: ok -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-recurse.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF - - -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF - - -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +mkdir directory +genfile --file=directory/a --length=1035 -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" +echo "Testing the archive" +tar -tf archive ) -50. append01.at:29: testing appending files with long names ... -./append01.at:34: +./same-order01.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4728,11 +4681,18 @@ export TAR_OPTIONS rm -rf * -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +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 ) ./same-order02.at:28: mkdir oldgnu @@ -4759,33 +4719,28 @@ echo separator ls to ) -./recurs02.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./verbose.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 * -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 ) - ./T-dir01.at:30: -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 * @@ -4800,25 +4755,20 @@ echo dir/ > list tar xfTv archive list | sort ) -./shortrec.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append.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 * - -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 -) -./recurse.at:24: +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./indexfile.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4827,10 +4777,15 @@ export TAR_OPTIONS rm -rf * + mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive +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 ) ./numeric.at:29: mkdir gnu @@ -4873,6 +4828,133 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) +43. recurse.at:21: 50. append01.at:29: testing appending files with long names ... +./append01.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive +) + ok +./T-dir00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort +) +./shortrec.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory +(cd directory && touch a b c d e f g h i j k l m n o p q r) +tar -c -b 1 -f - directory | tar -t -f - > /dev/null +tar -c -b 1 -f archive directory +tar -t -f archive > /dev/null +tar -t -f - < archive > /dev/null + +rm -r directory +) +./recurs02.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +) +./same-order01.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +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 +./append01.at:34: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +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) 51. append02.at:54: testing append vs. create ... ./append02.at:57: mkdir v7 @@ -4906,7 +4988,7 @@ echo Comparing archives cmp archive.1 archive.2 ) -./T-dir00.at:30: +./T-dir01.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4923,9 +5005,10 @@ genfile -f dir/file2 tar cf archive dir rm -rf dir -echo dir > list +echo dir/ > list tar xfTv archive list | sort ) +40. indexfile.at:26: ok ./recurs02.at:33: mkdir gnu (cd gnu @@ -4946,21 +5029,6 @@ --no-recursion directory1 \ --recursion directory2 || exit 1 ) -./append01.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX -touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 -tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 -tar tf archive -) ./same-order02.at:28: mkdir ustar (cd ustar @@ -4986,13 +5054,31 @@ echo separator ls to ) -30. T-recurse.at:27: ok + +./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 +) ./append.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 * touch file1 @@ -5000,33 +5086,8 @@ tar cf archive file1 tar rf archive file2 tar tf archive) -43. recurse.at:21: ok -./same-order01.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -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 -) 38. T-dir00.at:28: ok -45. shortrec.at:25: ok -44. recurs02.at:30: ok ./append02.at:57: mkdir oldgnu (cd oldgnu @@ -5059,26 +5120,6 @@ echo Comparing archives cmp archive.1 archive.2 ) - -39. T-dir01.at:28: ok -./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 -) - - - 52. append03.at:21: testing append with name transformation ... ./append03.at:26: mkdir v7 @@ -5098,51 +5139,42 @@ echo Testing tar tf archive ) - -54. append05.at:32: testing append after changed blocking ... -./append05.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./same-order01.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 * -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 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -decho 'adding g h i' -tar -vrf archive -b5 g h i +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -decho 'resulting archive' -tar tf archive +ls directory|sort ) -56. xform01.at:26: testing transformations and GNU volume labels ... -./xform01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append01.at:34: +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 -tar -cf archive.tar -V /label/ file -tar tf archive.tar +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: @@ -5172,8 +5204,23 @@ # Verify content of the new archive: tar -tf archive.tar ) -55. xform-h.at:30: testing transforming hard links on create ... -./xform-h.at:39: + +44. recurs02.at:30: 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) +54. append05.at:32: testing append after changed blocking ... +./append05.at:35: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5182,41 +5229,28 @@ 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' - +for f in a b c d e f g h i +do + echo $f > $f +done -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +decho 'creating archive' +tar -cf archive -b1 a b c +tar tf archive -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive -) -./append01.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +decho 'adding g h i' +tar -vrf archive -b5 g h i -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 +decho 'resulting archive' tar tf archive ) +39. T-dir01.at:28: ok ./same-order02.at:28: mkdir posix (cd posix @@ -5242,23 +5276,7 @@ echo separator ls to ) -57. xform02.at:21: testing transforming escaped delimiters on create ... -./xform02.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -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 -) -56. xform01.at:26: ok -./append.at:24: +./append02.at:57: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5266,32 +5284,57 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./same-order01.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +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 posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - +# Create an archive: +tar cpfW archive.tar file1 file2 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +# Append it to the already created archive: +tar rpfW archive.tar file3 -ls directory|sort +# Verify content of the new archive: +tar -tf archive.tar ) ./numeric.at:29: mkdir ustar @@ -5334,20 +5377,76 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./xform02.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +45. shortrec.at:25: ok +55. xform-h.at:30: testing transforming hard links on create ... +./xform-h.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +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 +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link + + +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + +) +./append01.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX +touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 +tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2 +tar tf archive ) +49. append.at:21: ok +./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 + + +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 +) + ./append03.at:26: mkdir oldgnu (cd oldgnu @@ -5366,44 +5465,52 @@ echo Testing tar tf archive ) -./append02.at:57: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +./same-order02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +mkdir en +mkdir to -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +HERE=`pwd` +tar -xf archive --same-order --warning=no-timestamp \ + -C $HERE/en file1 \ + -C $HERE/to file2 || exit 1 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +ls en +echo separator +ls to +) +56. xform01.at:26: testing transformations and GNU volume labels ... +./xform01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -echo Comparing archives -cmp archive.1 archive.2 +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar ) ./append04.at:32: -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 * @@ -5455,39 +5562,8 @@ decho 'resulting archive' tar tf archive ) - -50. append01.at:29: ok -./xform-h.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - -) -58. xform03.at:21: testing transforming hard link targets ... -./xform03.at:24: +57. xform02.at:21: testing transforming escaped delimiters on create ... +./xform02.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -5496,28 +5572,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 +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -./append.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) +50. append01.at:29: ok + ./append03.at:26: mkdir ustar (cd ustar @@ -5536,100 +5597,76 @@ echo Testing tar tf archive ) -./append02.at:57: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./xform02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -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 +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -./same-order02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +58. xform03.at:21: testing transforming hard link targets ... +./xform03.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 - -ls en -echo separator -ls to +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f ) - -./append05.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +56. xform01.at:26: ok +./xform-h.at:39: +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 * -for f in a b c d e f g h i -do - echo $f > $f -done +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -decho 'creating archive' -tar -cf archive -b1 a b c -tar tf archive +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' -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 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -decho 'resulting archive' -tar tf archive ) + ./append04.at:32: -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 * @@ -5651,20 +5688,39 @@ # Verify content of the new archive: tar -tf archive.tar ) -./xform02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./append02.at:57: +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 -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name +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 ) +47. same-order01.at:26: ok 59. exclude.at:23: testing exclude ... ./exclude.at:26: mkdir ustar @@ -5707,6 +5763,21 @@ tar tf archive.tar | sort done ) +./xform02.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name +) + ./append03.at:26: mkdir posix (cd posix @@ -5725,42 +5796,36 @@ echo Testing tar tf archive ) -./same-order01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append05.at:35: +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 * +for f in a b c d e f g h i +do + echo $f > $f +done -test -z "`sort < /dev/null 2>&1`" || exit 77 +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 ) -stderr: -./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) ./xform02.at:24: mkdir posix (cd posix @@ -5775,6 +5840,35 @@ --transform='s/file/other\/name/' \ --show-transformed-name ) +./append04.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +# Create two empty files: +touch file1 file2 + +# Create an archive: +tar cpfW archive.tar file1 file2 + +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar +) + +stderr: ./xform-h.at:39: mkdir ustar (cd ustar @@ -5804,55 +5898,8 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) -./append05.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -for f in a b c d e f g h i -do - echo $f > $f -done - -decho 'creating archive' -tar -cf archive -b1 a b c - -tar tf archive - -decho 'adding d e f' -tar -vrf archive -b3 d e f -echo == -tar tf archive - -decho 'adding g h i' -tar -vrf archive -b5 g h i - -decho 'resulting archive' -tar tf archive -) ./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./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 ./xform03.at:24: mkdir oldgnu (cd oldgnu @@ -5871,7 +5918,7 @@ tar -C t -xf a.tar find t -type f ) -./append02.at:57: +./xform02.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5880,75 +5927,60 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +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: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -# 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -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 +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 -echo Comparing archives -cmp archive.1 archive.2 -) -./append04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort -# Create two empty files: -touch file1 file2 +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -# Create an archive: -tar cpfW archive.tar file1 file2 +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort -# Append it to the already created archive: -tar rpfW archive.tar file3 +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort -# Verify content of the new archive: -tar -tf archive.tar -) -48. same-order02.at:25: ok -./xform02.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -51. append02.at:54: ok -52. append03.at:21: ok -47. same-order01.at:26: ok +rm -rf testdir file1.txt +) ./numeric.at:29: mkdir oldgnu (cd oldgnu @@ -5990,35 +6022,6 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./append04.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -# Create two empty files: -touch file1 file2 - -# Create an archive: -tar cpfW archive.tar file1 file2 - -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 - -# Append it to the already created archive: -tar rpfW archive.tar file3 - -# Verify content of the new archive: -tar -tf archive.tar -) - -49. append.at:21: ok 60. exclude01.at:19: testing exclude wildcards ... ./exclude01.at:22: mkdir v7 @@ -6064,10 +6067,91 @@ rm -rf testdir ) +./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 -61. exclude02.at:19: testing exclude: anchoring ... -./exclude02.at:22: +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) + +./append05.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +for f in a b c d e f g h i +do + echo $f > $f +done + +decho 'creating archive' +tar -cf archive -b1 a b c + +tar tf archive + +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive + +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' +tar tf archive +) +./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 +) +53. append04.at:29: ok +57. xform02.at:21: ok +62. exclude03.at:19: testing exclude: wildcards match slash ... +./exclude03.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6081,42 +6165,88 @@ rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 +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="file1.txt" \ +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ testdir tar tf archive | sort -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +echo "NEXT" +tar cf archive testdir +tar t --wildcards 'testdir/*f*1' -f archive | sort -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +echo "NEXT" +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +echo "NEXT" +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +rm -rf testdir -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +) +stderr: -rm -rf testdir file1.txt +52. append03.at:21: ok + +./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 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 +) +./xform-h.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link + + +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' ) -stderr: -57. xform02.at:21: ok 63. exclude04.at:19: testing exclude: case insensitive ... ./exclude04.at:22: mkdir v7 @@ -6165,6 +6295,7 @@ rm -rf testdir ) +51. append02.at:54: ok ./append05.at:35: mkdir gnu (cd gnu @@ -6195,37 +6326,6 @@ decho 'resulting archive' tar tf archive ) - -./xform-h.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link - - -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - - -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' - -) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr 64. exclude05.at:21: testing exclude: lots of excludes ... ./exclude05.at:24: mkdir v7 @@ -6262,31 +6362,63 @@ rm -rf testdir exclfile ) -./xform03.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +./exclude02.at:22: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -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 + + +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 + ) -62. exclude03.at:19: testing exclude: wildcards match slash ... -./exclude03.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +59. exclude.at:23: ok +./exclude01.at:22: +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 * @@ -6296,7 +6428,6 @@ 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 @@ -6304,32 +6435,29 @@ 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' \ +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 --wildcards 'testdir/*f*1' -f archive | sort +tar t "testdir/dir1/*" -f archive | sort echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort rm -rf testdir - ) -53. append04.at:29: ok - stderr: - -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr 65. exclude06.at:26: testing exclude: long files in pax archives ... ./exclude06.at:31: mkdir pax @@ -6350,24 +6478,6 @@ tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp find out -type f ) -./xform03.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 -) 66. exclude07.at:19: testing exclude: --exclude-backups option ... ./exclude07.at:22: mkdir v7 @@ -6386,7 +6496,6 @@ tar -v -c -f archive --exclude-backups dir ) -54. append05.at:32: ok ./xform-h.at:39: mkdir gnu (cd gnu @@ -6416,73 +6525,9 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) -./exclude04.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -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 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 -) 46. numeric.at:18: ok -59. exclude.at:23: ok -./exclude01.at:22: +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./exclude03.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6497,6 +6542,7 @@ rm -rf testdir mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 touch testdir/dir1/file1 touch testdir/dir1/\* touch testdir/dir2/file2 @@ -6504,37 +6550,33 @@ touch testdir/dir3/file3 touch testdir/dir3/\* -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ testdir tar tf archive | sort echo "NEXT" tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +tar t --wildcards 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort rm -rf testdir -) -stderr: -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +) ./xform03.at:24: -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 * @@ -6547,6 +6589,9 @@ tar -C t -xf a.tar find t -type f ) + +54. append05.at:32: ok + 67. exclude08.at:36: testing --exclude-tag option ... ./exclude08.at:39: mkdir v7 @@ -6563,8 +6608,40 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag=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 * -./exclude02.at:22: +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 +) +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 +) +./exclude04.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6578,41 +6655,82 @@ rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt +mkdir -p testdir/dir +touch testdir/file1 touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -tar cf archive --exclude="file1.txt" \ +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ testdir tar tf archive | sort echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +tar cf archive testdir +tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +rm -rf testdir -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +) + +65. exclude06.at:26: ok +55. xform-h.at:30: ok +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 * -rm -rf testdir file1.txt +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort +) +stderr: +./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 ) -65. exclude06.at:26: ok ./exclude07.at:22: mkdir ustar (cd ustar @@ -6631,11 +6749,11 @@ tar -v -c -f archive --exclude-backups dir ) ./exclude03.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -6674,9 +6792,103 @@ rm -rf testdir ) +./exclude01.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... -./exclude09.at:40: + +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 +./exclude02.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir +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 + +) + +68. exclude09.at:37: ok +./xform03.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6685,14 +6897,33 @@ 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 +) +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=excludeme --listed=snar -v etest | sort +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -69. exclude10.at:38: testing --exclude-tag option in incremental pass ... -./exclude10.at:41: +71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... +./exclude12.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6705,18 +6936,9 @@ 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 +tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort ) -55. xform-h.at:30: ok -stderr: + ./exclude07.at:22: mkdir posix (cd posix @@ -6735,11 +6957,11 @@ tar -v -c -f archive --exclude-backups dir ) ./exclude08.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -6749,11 +6971,8 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) - - -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... -./exclude12.at:40: +72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... +./exclude13.at:42: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6766,9 +6985,16 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort +rm 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 ) -58. xform03.at:21: ok ./exclude04.at:22: mkdir ustar (cd ustar @@ -6816,14 +7042,14 @@ rm -rf testdir ) -68. exclude09.at:37: ok -70. exclude11.at:36: testing --exclude-tag-under option ... +stderr: +69. exclude10.at:38: ok ./exclude11.at:39: -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 * @@ -6833,12 +7059,32 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -./exclude01.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +71. exclude12.at:37: ok +./exclude07.at:22: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +58. xform03.at:21: 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 * @@ -6848,6 +7094,7 @@ rm -rf testdir mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 touch testdir/dir1/file1 touch testdir/dir1/\* touch testdir/dir2/file2 @@ -6855,32 +7102,46 @@ touch testdir/dir3/file3 touch testdir/dir3/\* -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ testdir tar tf archive | sort echo "NEXT" tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +tar t --wildcards 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort rm -rf testdir + ) -71. exclude12.at:37: ok -./exclude03.at:22: +./exclude08.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) + +./exclude11.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6892,10 +7153,24 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +./exclude01.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + 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 @@ -6903,28 +7178,30 @@ 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' \ +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 --wildcards 'testdir/*f*1' -f archive | sort +tar t "testdir/dir1/*" -f archive | sort echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort rm -rf testdir - ) -./exclude07.at:22: +74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... +./exclude15.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6933,15 +7210,12 @@ 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 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort ) -69. exclude10.at:38: ok 73. exclude14.at:36: testing --exclude-tag-all option ... ./exclude14.at:39: mkdir v7 @@ -6958,23 +7232,56 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./exclude08.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude02.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort + +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + ) -72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... -./exclude13.at:42: +75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... +./exclude16.at:41: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6989,17 +7296,16 @@ 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 +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-under=excludeme --listed=snar-1 -v etest | sort +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort ) - -74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... -./exclude15.at:39: +72. exclude13.at:39: ok +./exclude08.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7012,7 +7318,22 @@ 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 +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +./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 ) ./exclude04.at:22: mkdir posix @@ -7061,71 +7382,89 @@ rm -rf testdir ) -./exclude02.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +66. exclude07.at:19: ok + +./exclude11.at:39: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +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 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +) -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 +77. exclude18.at:30: testing --exclude-vcs extract list compare ... +./exclude18.at:33: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +mkdir gitrepo +cd gitrepo -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +# Make an empty VCS directory: +mkdir .svn -rm -rf testdir file1.txt +# Make a VCS directory with a file: +mkdir .git +touch .git/_A -) -./exclude11.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +# Make a VCS file: +touch .gitignore +# Make non-VCS files: +touch .git_B +touch _C -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort -./exclude14.at:39: +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + +) +./exclude17.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7134,15 +7473,13 @@ 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 dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -66. exclude07.at:19: ok -75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... -./exclude16.at:41: +67. exclude08.at:36: ok +./exclude01.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7154,30 +7491,6 @@ 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 -) -74. exclude15.at:36: ok -./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 @@ -7210,25 +7523,8 @@ rm -rf testdir ) -./exclude08.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) - - -76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... -./exclude17.at:24: +78. delete01.at:23: testing deleting a member after a big one ... +./delete01.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7237,17 +7533,20 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) +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 ./exclude03.at:22: -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 * @@ -7286,21 +7585,7 @@ rm -rf testdir ) -./exclude17.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) -./exclude04.at:22: +./exclude11.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7312,87 +7597,8 @@ 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 - -) -77. exclude18.at:30: testing --exclude-vcs extract list compare ... -./exclude18.at:33: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 - +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) ./exclude14.at:39: mkdir ustar @@ -7409,7 +7615,7 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./exclude11.at:39: +./exclude17.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7418,19 +7624,17 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -72. exclude13.at:39: ok ./exclude02.at:22: -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 * @@ -7473,28 +7677,14 @@ rm -rf testdir file1.txt ) -./exclude17.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) -78. delete01.at:23: testing deleting a member after a big one ... ./delete01.at:26: -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 * @@ -7505,7 +7695,7 @@ tar tf archout tar f archive --delete file2 cmp archive archout) -./exclude08.at:39: +./exclude04.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7517,10 +7707,61 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort + +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 + ) -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) ./exclude17.at:24: mkdir posix (cd posix @@ -7535,7 +7776,8 @@ echo '*.o' >.cvsignore tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./exclude01.at:22: +80. delete03.at:21: testing deleting members with long names ... +./delete03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7545,39 +7787,14 @@ 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 +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 ) ./exclude14.at:39: mkdir posix @@ -7594,36 +7811,7 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./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 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -./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 - -) - +70. exclude11.at:36: ok ./exclude18.at:33: mkdir oldgnu (cd oldgnu @@ -7670,43 +7858,7 @@ tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) -63. exclude04.at:19: 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) -./exclude11.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) -./exclude03.at:22: +./exclude17.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7715,47 +7867,17 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/\*f\*1 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort - -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort - -rm -rf testdir - +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) ./delete01.at:26: -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 * @@ -7766,6 +7888,7 @@ tar tf archout tar f archive --delete file2 cmp archive archout) + ./exclude14.at:39: mkdir gnu (cd gnu @@ -7781,29 +7904,6 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -67. exclude08.at:36: ok - -76. exclude17.at:21: ok -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 * - - -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 -) ./delete02.at:26: mkdir oldgnu (cd oldgnu @@ -7823,55 +7923,7 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) - -./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 - -) +60. exclude01.at:19: ok 81. delete04.at:23: testing deleting a large last member ... ./delete04.at:26: mkdir v7 @@ -7896,13 +7948,34 @@ tar f archive --delete file10 tar tf archive ) +76. exclude17.at:21: ok + +62. exclude03.at:19: 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 +) ./delete01.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 * @@ -7913,6 +7986,7 @@ tar tf archout tar f archive --delete file2 cmp archive archout) + 82. delete05.at:27: testing deleting non-existing member ... ./delete05.at:30: mkdir v7 @@ -7932,8 +8006,29 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) +63. exclude04.at:19: ok +61. exclude02.at:19: ok 73. exclude14.at:36: ok -70. exclude11.at:36: ok +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 +) ./exclude18.at:33: mkdir ustar @@ -7981,44 +8076,6 @@ tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) -60. exclude01.at:19: ok - -./delete01.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -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) -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 -) ./delete02.at:26: mkdir ustar (cd ustar @@ -8038,6 +8095,9 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) + + + ./delete05.at:30: mkdir oldgnu (cd oldgnu @@ -8056,7 +8116,63 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) -./delete03.at:26: +./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) +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) +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 v7" +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 +) +./delete04.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8065,6 +8181,29 @@ 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 +) +./delete03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +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* @@ -8075,6 +8214,25 @@ tar --delete -f archive ./${prefix}5 && tar -tf archive ) +./delete06.at:28: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax +export TEST_TAR_FORMAT +TAR_OPTIONS="-H pax" +export TAR_OPTIONS +rm -rf * + +mkdir b +touch a b/1 c +tar -cf archive.tar a b/1 c +case $TEST_TAR_FORMAT in +gnu) size=1500;; +pax) size=3072;; +esac +dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null +tar --delete 'b/' -f trunc.tar +) 84. extrac01.at:23: testing extract over an existing directory ... ./extrac01.at:26: mkdir v7 @@ -8090,7 +8248,6 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) - 85. extrac02.at:23: testing extracting symlinks over an existing file ... ./extrac02.at:28: mkdir v7 @@ -8108,26 +8265,6 @@ touch link tar xf archive ) -62. exclude03.at:19: ok -./delete06.at:28: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - -mkdir b -touch a b/1 c -tar -cf archive.tar a b/1 c -case $TEST_TAR_FORMAT in -gnu) size=1500;; -pax) size=3072;; -esac -dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null -tar --delete 'b/' -f trunc.tar -) ./extrac01.at:26: mkdir oldgnu (cd oldgnu @@ -8142,22 +8279,6 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) -./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 ustar (cd ustar @@ -8176,6 +8297,27 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) +78. delete01.at:23: ok +83. delete06.at:25: ok +./delete02.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile -l 3073 -p zeros --file 1 +cp 1 2 +cp 2 3 +tar cf archive 1 2 3 +tar tf archive +cat archive | tar f - --delete 2 > archive2 +echo separator +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) ./extrac02.at:28: mkdir oldgnu (cd oldgnu @@ -8193,7 +8335,8 @@ tar xf archive ) -./delete04.at:26: + +./extrac04.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -8202,88 +8345,22 @@ 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 -) -./extrac01.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) -61. exclude02.at:19: ok -./delete03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -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 -) -./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) -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 * +test -z "`sort < /dev/null 2>&1`" || exit 77 +touch file1 mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -83. delete06.at:25: ok +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 +) ./exclude18.at:33: mkdir posix (cd posix @@ -8343,7 +8420,84 @@ tar -cPvf archive directory/../directory echo separator tar -xPvf archive --warning=no-timestamp) -78. delete01.at:23: ok +./extrac01.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +80. delete03.at:21: ok +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 .. +) +89. extrac06.at:34: testing mode of extracted directories ... +./extrac06.at:37: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +# Force umask +umask 022 + +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +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 +) ./delete05.at:30: mkdir posix (cd posix @@ -8362,19 +8516,28 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) -./extrac01.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./delete04.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 * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive ) ./extrac02.at:28: mkdir ustar @@ -8393,83 +8556,61 @@ tar xf archive ) - - -87. extrac04.at:23: testing extract + fnmatch ... -./extrac04.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./extrac03.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -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 -) -88. extrac05.at:30: testing extracting selected members from pax ... -./delete05.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +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 -) -./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 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -tar cf archive jeden dwa trzy cztery || exit 1 +echo Prepare the directory mkdir dir +genfile -f foo cd dir +ln -s ../foo . +cd .. +chmod a-w dir -tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 +echo Create the archive +tar cf archive dir || exit 1 -cd .. +chmod +w dir + +echo Extract +mkdir out +tar -C out -xvf archive ) ./extrac01.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -8478,49 +8619,47 @@ tar cf archive directory || exit 1 tar xf archive --warning=no-timestamp || exit 1 ) -./extrac03.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./delete02.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory +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 -xPvf archive --warning=no-timestamp) -./delete04.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +tar tf archive2 +tar f - --delete 2 < archive > archive3 +cmp archive2 archive3) +./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 * -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 +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive ) -89. extrac06.at:34: testing mode of extracted directories ... ./extrac06.at:37: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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 * @@ -8552,7 +8691,32 @@ # After both restores, the directory mode should be 755 ) -84. extrac01.at:23: ./extrac02.at:28: +./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 +) +./extrac03.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8561,15 +8725,11 @@ 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 -) - ok -./delete02.at:26: +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +./delete05.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8578,17 +8738,48 @@ export TAR_OPTIONS rm -rf * -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 +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 -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -./extrac03.at:26: +) +./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 +) +88. extrac05.at:30: 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 +) + +./delete04.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8597,12 +8788,33 @@ 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 +) +./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) -82. delete05.at:27: ok -80. delete03.at:21: ok ./exclude18.at:33: mkdir gnu (cd gnu @@ -8649,42 +8861,60 @@ tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort ) -./extrac02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +84. extrac01.at:23: ok +90. extrac07.at:27: ok +./extrac04.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 * -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 gnu -(cd gnu -TEST_TAR_FORMAT=gnu +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 +) +79. delete02.at:23: ok +82. delete05.at:27: ok +91. extrac08.at:33: testing restoring mode on existing directory ... +./extrac08.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) +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 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 * @@ -8716,69 +8946,12 @@ # After both restores, the directory mode should be 755 ) +85. extrac02.at:23: ok +86. extrac03.at:23: ok -./extrac04.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -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 -) -90. extrac07.at:27: testing extracting symlinks to a read-only dir ... -./extrac07.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod a-w dir - -echo Create the archive -tar cf archive dir || exit 1 -chmod +w dir -echo Extract -mkdir out -tar -C out -xvf archive -) 92. extrac09.at:34: testing extracting even when . and .. are unreadable ... ./extrac09.at:37: mkdir gnu @@ -8813,53 +8986,6 @@ cmp f extract/f || status=$? exit $status ) -91. extrac08.at:33: testing restoring mode on existing directory ... -./extrac08.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 -) -./delete04.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) -79. delete02.at:23: ok -86. extrac03.at:23: ok -88. extrac05.at:30: ok -85. extrac02.at:23: ok - ./extrac08.at:36: mkdir oldgnu @@ -8879,45 +9005,6 @@ tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ) -./extrac06.at:37: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -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 -) - -94. extrac11.at:25: testing scarce file descriptors ... 93. extrac10.at:29: testing -C and delayed setting of metadata ... ./extrac10.at:32: mkdir gnu @@ -8937,6 +9024,33 @@ diff -r d x/d && diff e x/y/e ) + +./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 +) +94. extrac11.at:25: testing scarce file descriptors ... ./extrac11.at:28: mkdir gnu (cd gnu @@ -9004,7 +9118,6 @@ diff -r a dest3/a >/dev/null 2>&1 ) || { diff -r a dest3/a; exit 1; } ) - 95. extrac12.at:25: testing extract dot permissions ... ./extrac12.at:28: mkdir gnu @@ -9025,43 +9138,6 @@ cmp src/file1 dst/file1 && cmp src/file2 dst/file2 ) -./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 -) 96. extrac13.at:26: testing extract over symlinks ... ./extrac13.at:29: mkdir gnu @@ -9095,53 +9171,23 @@ diff src/file1 dst3/file1 && diff src/file1 dst3/target1 ) -./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 -) -77. exclude18.at:30: ok -./extrac08.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir +mkdir 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 ) -93. extrac10.at:29: ok -90. extrac07.at:27: ok -95. extrac12.at:25: ok ./delete04.at:26: mkdir gnu (cd gnu @@ -9165,31 +9211,12 @@ tar f archive --delete file10 tar tf archive ) -92. extrac09.at:34: 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 -) ./extrac06.at:37: -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 * @@ -9221,6 +9248,31 @@ # After both restores, the directory mode should be 755 ) +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 +) +97. extrac14.at:25: ok +77. exclude18.at:30: ok + +87. extrac04.at:23: ok +92. extrac09.at:34: ok +95. extrac12.at:25: ok ./extrac08.at:36: mkdir posix (cd posix @@ -9240,11 +9292,6 @@ genfile --stat=mode.777 dir ) -96. extrac13.at:26: ok - -94. extrac11.at:25: ok - - 98. extrac15.at:25: testing extract parent mkdir failure ... ./extrac15.at:28: mkdir gnu @@ -9274,26 +9321,45 @@ else (exit 0) fi ) -97. extrac14.at:25: ok +94. extrac11.at:25: ok -100. extrac17.at:21: testing name matching/transformation ordering ... -./extrac17.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +./extrac06.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 -tar cf dir.tar dir +# Force umask +umask 022 -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +# Make sure user's umask is honored, even if we are superuser +TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" + +# Create a directory +mkdir directory +chmod 777 directory +genfile --stat=mode:777 directory + +# Archive it +tar cf arc directory + +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory + +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory + +# After both restores, the directory mode should be 755 ) 99. extrac16.at:26: testing extract empty directory with -C ... ./extrac16.at:29: @@ -9311,7 +9377,9 @@ tar -cf archive.tar -C src a && tar -xf archive.tar -C dest ) +96. extrac13.at:26: ok +81. delete04.at:23: ok 101. extrac18.at:34: testing keep-old-files ... ./extrac18.at:37: mkdir v7 @@ -9337,6 +9405,72 @@ cat a ) + +./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 +) + +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/ +) + +99. extrac16.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 * + +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 +) 103. extrac20.at:21: testing keep-directory-symlink ... ./extrac20.at:24: mkdir v7 @@ -9410,78 +9544,7 @@ clean done ) - -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 * - -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 -) -89. extrac06.at:34: ok -./extrac04.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort -) -99. extrac16.at:26: ok -81. delete04.at:23: 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 -) +98. extrac15.at:25: ok 104. extrac21.at:31: testing delay-directory-restore ... ./extrac21.at:33: mkdir ustar @@ -9512,50 +9575,6 @@ mkdir out tar -C out -v -x -f A.tar --delay-directory-restore ) -./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 -) - -./extrac17.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) - 105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... ./extrac22.at:29: mkdir v7 @@ -9605,6 +9624,56 @@ # tar: ./dir2/data2: Cannot unlink: Permission denied ) + +./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 +) +89. extrac06.at:34: ok +./extrac19.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) 106. extrac23.at:18: testing --no-overwrite-dir ... ./extrac23.at:32: mkdir v7 @@ -9634,7 +9703,8 @@ chmod 700 dir find dir ) -./extrac19.at:24: + +91. extrac08.at:33: ./extrac17.at:34: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9643,22 +9713,16 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -tar -x --skip-old-files -f ../archive -echo status=$? +tar cf dir.tar dir -cat a +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) -98. extrac15.at:25: ok + ok 107. extrac24.at:18: testing --to-stdout ... ./extrac24.at:29: mkdir v7 @@ -9701,8 +9765,41 @@ cat a ) -91. extrac08.at:33: ok +108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... +./extrac25.at:21: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +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 +) + +109. backup01.at:33: testing extracting existing dir with --backup ... +./backup01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) ./extrac17.at:34: mkdir ustar (cd ustar @@ -9721,22 +9818,6 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) -./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 -) ./extrac19.at:24: mkdir ustar (cd ustar @@ -9761,73 +9842,41 @@ 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 -) -108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... -./extrac25.at:21: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./extrac24.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 * -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 +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) 104. extrac21.at:31: ok -./extrac18.at:37: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +110. difflink.at:17: testing link mismatch ... +./difflink.at:19: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir 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 +mkdir a +genfile -f a/x +ln -s x a/y +ln a/x a/z +tar cf a.tar a/x a/y a/z +rm a/z +ln -s x a/z +tar df a.tar ) ./extrac22.at:29: mkdir oldgnu @@ -9876,22 +9925,6 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) -109. backup01.at:33: testing extracting existing dir with --backup ... -./backup01.at:36: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp -) ./extrac23.at:32: mkdir oldgnu (cd oldgnu @@ -9920,7 +9953,40 @@ chmod 700 dir find dir ) -./extrac19.at:24: +./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 +) + +./extrac18.at:37: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9939,12 +10005,12 @@ rm b echo 'File a' > a -tar -x --skip-old-files -f ../archive +tar -x -k -f ../archive echo status=$? cat a ) -./extrac17.at:34: +./extrac19.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9953,14 +10019,20 @@ export TAR_OPTIONS rm -rf * -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -tar cf dir.tar dir +tar cf ../archive . -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a ) ./extrac24.at:29: mkdir ustar @@ -9978,12 +10050,45 @@ tar --extract --to-stdout --file a.tar test -d dir ) +./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/ +) +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 +) ./backup01.at:36: -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 * @@ -9993,12 +10098,13 @@ tar cf test.tar dir1 dir2 tar xfv test.tar --backup --warning=no-timestamp ) +110. difflink.at:17: ok ./extrac25.at:21: -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 * @@ -10010,8 +10116,6 @@ ln -s does_not_exist subdir tar -xvf test.tar ) - -87. extrac04.at:23: ok ./extrac18.at:37: mkdir gnu (cd gnu @@ -10036,25 +10140,6 @@ cat a ) -110. difflink.at:17: testing link mismatch ... -./difflink.at:19: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir a -genfile -f a/x -ln -s x a/y -ln a/x a/z -tar cf a.tar a/x a/y a/z -rm a/z -ln -s x a/z -tar df a.tar -) ./extrac19.at:24: mkdir gnu (cd gnu @@ -10079,6 +10164,35 @@ cat a ) +./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 +) +./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 +) ./extrac23.at:32: mkdir ustar (cd ustar @@ -10142,29 +10256,12 @@ tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ dir/subdir1/ ) -./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 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 * @@ -10174,8 +10271,8 @@ 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: +112. label02.at:21: testing multi-volume label ... +./label02.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10184,12 +10281,63 @@ 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 +) +102. extrac19.at:21: ok +101. extrac18.at:34: ok +./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 ) -100. extrac17.at:21: ok +./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 +) +./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 +) + ./extrac22.at:29: mkdir ustar (cd ustar @@ -10237,23 +10385,9 @@ # 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 -) -101. extrac18.at:34: ok -./label01.at:24: +100. extrac17.at:21: + ok +./label02.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10262,64 +10396,13 @@ export TAR_OPTIONS rm -rf * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive -) -./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 -) -102. extrac19.at:21: 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 -) - -110. difflink.at:17: ok -./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 +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 ) -107. extrac24.at:18: ok - ./extrac23.at:32: mkdir posix (cd posix @@ -10348,55 +10431,6 @@ chmod 700 dir find dir ) -./label01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive -) - -112. label02.at:21: testing multi-volume label ... -./label02.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) - -./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 @@ -10430,7 +10464,46 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) +./extrac25.at:21: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir subdir +touch subdir/a.txt +tar -cf test.tar subdir/a.txt + +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar +) + +107. extrac24.at:18: ok +109. backup01.at:33: ok +111. label01.at:21: ok +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 gnu" +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 +) 114. label04.at:27: testing label with non-create option ... ./label04.at:30: mkdir gnu @@ -10450,6 +10523,50 @@ decho "# Update: right label" tar -rf archive --label='New volume' file ) + + + +./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 +) +117. incr01.at:27: testing restore broken symlinks from incremental ... +./incr01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +mkdir 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 +) 116. incremental.at:23: testing incremental ... ./incremental.at:26: mkdir gnu @@ -10489,80 +10606,54 @@ echo y >structure/file tar cfv archive --listed=list structure ) -./extrac20.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +118. incr02.at:32: testing restoring timestamps from incremental ... +./incr02.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file -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 +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts -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 -} +# 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. -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} +tar -cf archive -g db 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 -} +# Move away the directory +mv dir orig -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 +# Wait enough time for timestamps to differ in case of failure. +sleep 5 - # 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 +# Restore the directory +tar -xf archive dir - 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 +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - ) -115. label05.at:24: testing label with non-create option ... -./label05.at:27: +./extrac23.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10571,15 +10662,58 @@ 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 +) +./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 -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file +tar -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 $? ) +108. extrac25.at:18: ok ./extrac22.at:29: mkdir posix (cd posix @@ -10627,69 +10761,7 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) -109. backup01.at:33: ok -./extrac25.at:21: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir subdir -touch subdir/a.txt -tar -cf test.tar subdir/a.txt - -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar -) -./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 -) -111. label01.at:21: ok -./extrac23.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir -) +112. label02.at:21: ok ./label04.at:30: mkdir oldgnu (cd oldgnu @@ -10726,10 +10798,7 @@ decho "# Update: right label" tar -rf archive file ) -112. label02.at:21: ok - - -./label03.at:30: +./incr01.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10738,86 +10807,6 @@ 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 $? -) -118. incr02.at:32: testing restoring timestamps from incremental ... -./incr02.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -# Create directory structure -mkdir dir -mkdir dir/subdir1 -mkdir dir/subdir2 -genfile --length 10 --file dir/subdir1/file - -# Save mtime for later comparison -genfile --stat=mtime dir/subdir1 > ts - -# Create an archive. Using incremental mode makes sure the -# archive will have a directory-first member ordering, -# i.e.: -# dir/ -# dir/subdir1/ -# dir/subdir2/ -# dir/subdir1/foofile -# -# When restoring from this directory structure, 'dir/subdir2/' used to -# trigger apply_nonancestor_delayed_set_stat() which restored stats for -# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the -# latter clobbered the directory timestamp. - -tar -cf archive -g db dir - -# Move away the directory -mv dir orig - -# Wait enough time for timestamps to differ in case of failure. -sleep 5 - -# Restore the directory -tar -xf archive dir - -# Check the timestamp -genfile --stat=mtime dir/subdir1 | diff ts - -) -117. incr01.at:27: testing restore broken symlinks from incremental ... -./incr01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - ckmtime || exit 77 mkdir directory @@ -10833,64 +10822,81 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) -./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 -) -108. extrac25.at:18: ok -119. listed01.at:26: testing --listed for individual files ... -./listed01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac20.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 * -ckmtime || exit 77 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* -tar tf archive.1 || exit 1 +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 -sleep 2 +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 +} -genfile --length 10240 --pattern zeros --file directory/file2 +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -echo "separator" -cp listing listing.old -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 +# 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 tf archive.2 || exit 1 +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 ) -./label05.at:27: +./label04.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10902,86 +10908,12 @@ exec <&- genfile --file file decho "# Create volume" -tar -c -f archive file +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 file -) - -./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 -) -./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 +tar -rf archive --label='New volume' file ) -106. extrac23.at:18: ok -114. label04.at:27: ok 120. listed02.at:28: testing working --listed ... ./listed02.at:31: mkdir gnu @@ -11052,7 +10984,61 @@ echo Final files: find tart -print | sort 2>/dev/null ) -115. label05.at:24: ok +./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 +) +119. listed01.at:26: testing --listed for individual files ... +./listed01.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +mkdir 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 +) ./label03.at:30: mkdir posix (cd posix @@ -11085,9 +11071,6 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) - - - ./incr01.at:30: mkdir posix (cd posix @@ -11112,6 +11095,58 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) +106. extrac23.at:18: ok +./extrac22.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +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 +) +114. label04.at:27: ok +115. label05.at:24: ok + + 121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... ./listed03.at:27: mkdir gnu @@ -11149,6 +11184,8 @@ cat err >&2 exit $status ) + +117. incr01.at:27: ok 122. listed04.at:26: testing --listed-incremental and --one-file-system ... ./listed04.at:29: mkdir gnu @@ -11211,30 +11248,15 @@ umount tartest/subdir ) 113. label03.at:27: ok -105. extrac22.at:19: ok -121. listed03.at:24: ok ---- - 2024-12-24 08:19:56.668918069 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2024-12-24 08:19:56.656217632 +0000 +105. extrac22.at:19: ok +--- - 2024-12-24 08:22:50.034400367 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2024-12-24 08:22:50.027347644 +0000 @@ -1,4 +1 @@ -tar: .: Directory is new -tar: ./subdir: Directory is new -tar: ./subdir: directory is on a different filesystem; not dumped -122. listed04.at:26: ok ---- - 2024-12-24 08:19:56.674410303 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2024-12-24 08:19:56.672217729 +0000 -@@ -1,10 +1 @@ --# Level 0 --./ --./subdir/ --./top-level-file --./subdir/subdir-file --# Remount --# Level 1 --./ --./subdir/ - 124. incr03.at:28: testing renamed files in incrementals ... ./incr03.at:31: mkdir gnu @@ -11276,33 +11298,25 @@ tar -xf archive.2 -g db --warning=no-timestamp find directory | sort ) +--- - 2024-12-24 08:22:50.036477259 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2024-12-24 08:22:50.031347668 +0000 +@@ -1,10 +1 @@ +-# Level 0 +-./ +-./subdir/ +-./top-level-file +-./subdir/subdir-file +-# Remount +-# Level 1 +-./ +-./subdir/ + +122. listed04.at:26: ok - -117. incr01.at:27: ok 123. listed05.at:33: skipped (listed05.at:36) -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 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 . +121. listed03.at:24: ok -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -) 125. incr04.at:29: testing proper icontents initialization ... ./incr04.at:34: mkdir gnu @@ -11330,79 +11344,62 @@ tar cvf a1.tar -g a.sna a ) - -./extrac20.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +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 -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 -} +echo Level 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +) +127. incr06.at:21: testing incremental dumps of nested directories ... +./incr06.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -# 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 -} +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 -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 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 . - # 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 +mkdir dir/c +genfile --file dir/sub/b/file4 - 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 +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 @@ -11450,61 +11447,6 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -127. incr06.at:21: testing incremental dumps of nested directories ... -./incr06.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -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 . -) - -./incr05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 - -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 . -) 129. incr08.at:38: testing filename normalization ... ./incr08.at:41: mkdir gnu @@ -11534,11 +11476,11 @@ tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR ) ./incr05.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -11587,7 +11529,6 @@ tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) stderr: -126. incr05.at:21: ok A B tar: .: Directory is new @@ -11598,6 +11539,49 @@ 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 + +./incr05.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 +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 . +) +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr ./incr07.at:40: mkdir oldgnu (cd oldgnu @@ -11644,51 +11628,81 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -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 - - -130. incr09.at:26: testing incremental with alternating -C ... -./incr09.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./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 * -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 . +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 ) +129. incr08.at:38: ok +126. incr05.at:21: + ok ./incr06.at:24: mkdir posix (cd posix @@ -11720,13 +11734,8 @@ echo Level 1 sub . tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr -129. incr08.at:38: ok - -131. incr10.at:18: testing concatenated incremental archives (deletes) ... -./incr10.at:28: +130. incr09.at:26: testing incremental with alternating -C ... +./incr09.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11736,22 +11745,22 @@ rm -rf * ckmtime || exit 77 -mkdir in -mkdir in/dir -decho Level 0 -tar -cvf 1.tar -g snap -C in . -rmdir in/dir -decho Level 1 -tar -cvf 2.tar -g snap -C in . -cp 1.tar full.tar -decho Concat -tar -A 2.tar -f full.tar -g /dev/null -decho Extract -mkdir out -tar -xvf full.tar -g /dev/null -C out + +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 . ) -130. incr09.at:26: ok -127. incr06.at:21: ok + ./incr07.at:40: mkdir posix (cd posix @@ -11798,42 +11807,36 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) - -./exclude05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +131. incr10.at:18: testing concatenated incremental archives (deletes) ... +./incr10.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +ckmtime || exit 77 +mkdir in +mkdir in/dir +decho Level 0 +tar -cvf 1.tar -g snap -C in . +rmdir in/dir +decho Level 1 +tar -cvf 2.tar -g snap -C in . +cp 1.tar full.tar +decho Concat +tar -A 2.tar -f full.tar -g /dev/null +decho Extract +mkdir out +tar -xvf full.tar -g /dev/null -C out +) +130. incr09.at:26: ok +127. incr06.at:21: ok -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 -) +131. incr10.at:18: ok 132. incr11.at:25: testing concatenated incremental archives (renames) ... ./incr11.at:28: mkdir gnu @@ -11864,8 +11867,7 @@ decho List find out | sort ) - -133. filerem01.at:36: testing file removed as we read it ... +128. incr07.at:18: 133. filerem01.at:36: testing file removed as we read it ... ./filerem01.at:39: mkdir gnu (cd gnu @@ -11884,80 +11886,8 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v dir >/dev/null ) -131. incr10.at:18: ok - -./extrac20.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -for i in a b c -do - dir=in$i - mkdir -p $dir/root/dir $dir/root/dirsymlink - touch $dir/root/dirsymlink/file$i - test $i != a && touch $dir/root/dirsymlink/file.conflict - tar cf archive$i.tar -C $dir root -done - -prep() -{ - echo "== $1 ==" - echo "== $1 ==" >&2 - backup_dir=$1 - dir=out - mkdir -p $dir/root/dir - ln -s dir $dir/root/dirsymlink - test $round = normal && cd $dir >/dev/null -} - -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} - -# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable -file_spec() -{ - if test $round = normal - then - echo "-f ../$1" - else - echo "-f $1 -C $dir" - fi -} - -for round in normal dir -do - # Check that 'dirsymlink' replaces 'dir' - prep without_option_$round - tar -x `file_spec archivea.tar` || exit 1 - tar -x `file_spec archiveb.tar` || exit 1 - clean - - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean + 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 -) 134. filerem02.at:26: testing toplevel file removed ... ./filerem02.at:29: mkdir gnu @@ -11979,7 +11909,7 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -128. incr07.at:18: ok + stdout: ./filerem01.at:39: mkdir posix @@ -11999,7 +11929,6 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v dir >/dev/null ) - 135. dirrem01.at:38: testing directory removed before reading ... ./dirrem01.at:41: mkdir gnu @@ -12053,16 +11982,7 @@ --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) stdout: -133. filerem01.at:36: 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: -132. incr11.at:25: ok stdout: -134. filerem02.at:26: ok ./dirrem01.at:41: mkdir posix (cd posix @@ -12089,6 +12009,88 @@ --warning=no-file-changed \ -v dir >/dev/null ) +133. filerem01.at:36: ok +132. incr11.at:25: ok + +./extrac20.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done + +prep() +{ + echo "== $1 ==" + echo "== $1 ==" >&2 + backup_dir=$1 + dir=out + mkdir -p $dir/root/dir + ln -s dir $dir/root/dirsymlink + test $round = normal && cd $dir >/dev/null +} + +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} + +# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable +file_spec() +{ + if test $round = normal + then + echo "-f ../$1" + else + echo "-f $1 -C $dir" + fi +} + +for round in normal dir +do + # Check that 'dirsymlink' replaces 'dir' + prep without_option_$round + tar -x `file_spec archivea.tar` || exit 1 + tar -x `file_spec archiveb.tar` || exit 1 + clean + + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean + + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done +) + +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: +stdout: 136. dirrem02.at:31: testing explicitly named directory removed before reading ... ./dirrem02.at:34: mkdir gnu @@ -12116,8 +12118,7 @@ --warning=no-file-changed \ -v dir dir/sub >/dev/null ) - - +134. filerem02.at:26: ok 137. rename01.at:24: testing renamed dirs in incrementals ... ./rename01.at:27: mkdir gnu @@ -12159,7 +12160,9 @@ find foo | sort echo End directory listing 2 ) -stdout: +135. dirrem01.at:38: ok + + stdout: ./dirrem02.at:34: mkdir posix @@ -12187,7 +12190,6 @@ --warning=no-file-changed \ -v dir dir/sub >/dev/null ) -135. dirrem01.at:38: ok 138. rename02.at:24: testing move between hierarchies ... ./rename02.at:27: mkdir gnu @@ -12233,7 +12235,6 @@ find foo | sort echo End directory listing 2 ) - 139. rename03.at:23: testing cyclic renames ... ./rename03.at:26: mkdir gnu @@ -12292,7 +12293,6 @@ echo End directory listing 2 ) stdout: -136. dirrem02.at:31: ok ./rename01.at:27: mkdir oldgnu (cd oldgnu @@ -12333,6 +12333,7 @@ find foo | sort echo End directory listing 2 ) +136. dirrem02.at:31: ok 140. rename04.at:27: testing renamed directory containing subdirectories ... ./rename04.at:30: @@ -12413,6 +12414,44 @@ find foo | sort echo End directory listing 2 ) +./rename04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +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 +) ./extrac20.at:24: mkdir gnu (cd gnu @@ -12475,96 +12514,18 @@ # 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 -) -./rename04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -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 -) -137. rename01.at:24: ok - -141. rename05.at:24: testing renamed subdirectories ... -./rename05.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -decho Creating directory structure -mkdir directory -mkdir directory/subdir -genfile --file=directory/file - -decho Creating initial archive -tar -cf archive.1 -g db.1 directory - -decho Renaming -mv directory/subdir directory/subdir.0 -mv directory dir - -decho Creating incremental archive -cp db.1 db.2 -tar -cf archive.2 -g db.2 dir - -mv dir orig - -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done ) +137. rename01.at:24: ok + ./rename04.at:30: mkdir posix (cd posix @@ -12603,12 +12564,13 @@ tar -xf archive.2 -g db.2 find dir | sort ) +141. rename05.at:24: testing renamed subdirectories ... ./rename05.at:27: -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 * @@ -12643,13 +12605,12 @@ find dir | sort ) 140. rename04.at:27: ok - ./rename05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -12683,6 +12644,7 @@ tar -xf archive.2 -g db.2 --warning=no-timestamp find dir | sort ) + 142. rename06.at:19: testing chained renames ... ./rename06.at:29: mkdir gnu @@ -12724,49 +12686,46 @@ decho Resulting directory find test1 | sort ) -103. extrac20.at:21: ok -./incr03.at:31: -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 * -ckmtime || exit 77 test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir directory -genfile --file=directory/x -genfile --file=directory/y -sleep 1 +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file -tar -cf archive.1 -g db directory +decho Creating initial archive +tar -cf archive.1 -g db.1 directory -mv directory/x directory/z -cp db db.old -tar -cf archive.2 -g db directory +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir -mv directory orig +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir -echo Listing of archive.1 -tar -tf archive.1 | sort -echo Listing of archive.2 -tar -tf archive.2 | sort +mv dir orig -echo Directory after first restore -tar -xf archive.1 -g db --warning=no-timestamp +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp find directory | sort -echo Directory after second restore -tar -xf archive.2 -g db --warning=no-timestamp -find directory | sort +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort ) - -./incr04.at:34: +./rename06.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12775,22 +12734,40 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -install-sh -d a/b >/dev/null || exit 77 -awk 'BEGIN { - for (i=1;i<=142;i++) - printf("a/b/one_31_chars_long_file_name_%03d\n", i); - }' < /dev/null | genfile --files-from - +test -z "`sort < /dev/null 2>&1`" || exit 77 -sleep 1 +decho Creating directory structure +mkdir test test/d1 test/d2 +genfile --file test/d1/file1 +genfile --file test/d2/file2 -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 +decho First dump +tar -c -g 0.snar -C test -f backup0.tar . + +decho Altering directory structure +genfile --file test/d2/file3 +mv test/d1 test/d3 +mv test/d2 test/d1 + +decho Second dump +cp 0.snar 1.snar +tar -vc -g 1.snar -C test -f backup1.tar . + +mkdir test1 + +decho First extract +tar -C test1 -x -g /dev/null -f backup0.tar + +decho Second extract +tar -C test1 -x -g /dev/null -f backup1.tar + +decho Resulting directory +find test1 | sort ) +103. extrac20.at:21: ok + +141. rename05.at:24: ok 143. chtype.at:27: testing changed file types in incrementals ... ./chtype.at:30: mkdir gnu @@ -12832,8 +12809,47 @@ tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp find directory | sort ) -141. rename05.at:24: ok +./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 + +decho Resulting directory +find test1 | sort +) 144. ignfail.at:23: testing ignfail ... ./ignfail.at:26: mkdir v7 @@ -12886,46 +12902,7 @@ chmod 700 directory test $status = 0 ) -./rename06.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 - -decho Creating directory structure -mkdir test test/d1 test/d2 -genfile --file test/d1/file1 -genfile --file test/d2/file2 - -decho First dump -tar -c -g 0.snar -C test -f backup0.tar . - -decho Altering directory structure -genfile --file test/d2/file3 -mv test/d1 test/d3 -mv test/d2 test/d1 - -decho Second dump -cp 0.snar 1.snar -tar -vc -g 1.snar -C test -f backup1.tar . - -mkdir test1 - -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar - -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar - -decho Resulting directory -find test1 | sort -) +142. rename06.at:19: ok ./ignfail.at:26: mkdir oldgnu (cd oldgnu @@ -12977,45 +12954,30 @@ chmod 700 directory test $status = 0 ) -./rename06.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +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 posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -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 +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar +tar cf archive directory/test1/test.txt directory/test1/test.txt -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar +rm -r directory +tar xf archive --warning=no-timestamp -decho Resulting directory -find test1 | sort +ls directory/test1 ) ./ignfail.at:26: mkdir ustar @@ -13068,15 +13030,12 @@ chmod 700 directory test $status = 0 ) -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 +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 * @@ -13095,11 +13054,11 @@ ls directory/test1 ) ./link01.at:36: -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 * @@ -13169,11 +13128,11 @@ test $status = 0 ) ./link01.at:36: -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 * @@ -13191,49 +13150,28 @@ ls directory/test1 ) -./rename02.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./link01.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +mkdir directory +mkdir directory/test1 +mkdir directory/test2 -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 +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 +tar cf archive directory/test1/test.txt directory/test1/test.txt -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +rm -r directory +tar xf archive --warning=no-timestamp -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +ls directory/test1 ) ./ignfail.at:26: mkdir gnu @@ -13286,111 +13224,9 @@ chmod 700 directory test $status = 0 ) -./link01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) -./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 -) -./link01.at:36: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) -144. ignfail.at:23: ok 145. link01.at:33: ok +144. ignfail.at:23: ok 146. link02.at:32: testing preserve hard links with --remove-files ... ./link02.at:35: mkdir v7 @@ -13514,34 +13350,6 @@ 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 ustar" -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' -) ./link02.at:35: mkdir gnu (cd gnu @@ -13558,72 +13366,7 @@ tar -c -f archive --remove-files file1 file2 file3 file4 tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) -./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 -) -./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 -) -./exclude05.at:24: +./link03.at:34: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -13633,31 +13376,25 @@ 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 +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 -rm -rf testdir exclfile +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' ) +146. link02.at:32: ok ./link03.at:34: mkdir posix (cd posix @@ -13686,7 +13423,6 @@ echo testing archive.2 tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) -146. link02.at:32: ok 148. link04.at:29: testing link count is 1 but multiple occurrences ... ./link04.at:32: @@ -13720,37 +13456,6 @@ s,symlink,FOO,g ' | sort ) -./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 gnu (cd gnu @@ -13780,11 +13485,11 @@ tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) ./link04.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -13810,12 +13515,13 @@ s,symlink,FOO,g ' | sort ) +147. link03.at:24: ok ./link04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -13841,8 +13547,72 @@ s,symlink,FOO,g ' | sort ) -147. link03.at:24: ok +./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 +) +./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 +) 149. longv7.at:24: testing long names in V7 archives ... ./longv7.at:30: mkdir v7 @@ -13861,6 +13631,39 @@ tar tf archive ) ./link04.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo TEST > dir/file +ln -s file dir/symlink || exit 77 + +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort + +echo -- + +tar cfl archive dir dir + +echo == + +tar chf archive dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, + s,file,FOO,g + s,symlink,FOO,g +' | sort +) +149. longv7.at:24: ok + +./link04.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -13891,8 +13694,6 @@ s,symlink,FOO,g ' | sort ) -149. longv7.at:24: ok - 150. long01.at:28: testing long file names divisible by block size ... ./long01.at:36: mkdir gnu @@ -13909,7 +13710,7 @@ 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) -./incremental.at:26: +./exclude05.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13918,34 +13719,31 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -mkdir structure -echo x >structure/file +test -z "`sort < /dev/null 2>&1`" || exit 77 -# 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 +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile -tar 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 ) 148. link04.at:29: ok ./long01.at:36: @@ -13978,48 +13776,45 @@ 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 ) 151. lustar01.at:21: ok -./listed01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +150. long01.at:28: ok + +152. lustar02.at:21: testing ustar: unsplittable path name ... +./lustar02.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" 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 +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 +) -genfile --length 10240 --pattern zeros --file directory/file2 +153. lustar03.at:21: testing ustar: splitting long names ... +./lustar03.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -echo "separator" -cp listing listing.old -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 -tar tf archive.2 || exit 1 -) +install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 +echo "Create archive" +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be +echo "List archive" +tar tf archive) ./rename02.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -14058,45 +13853,13 @@ find foo | sort echo End directory listing 2 ) - -150. long01.at:28: ok -152. lustar02.at:21: testing ustar: unsplittable path name ... -./lustar02.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -) - -153. lustar03.at:21: testing ustar: splitting long names ... -./lustar03.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77 -echo "Create archive" -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be -echo "List archive" -tar tf archive) +152. lustar02.at:21: ok ./rename03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -14147,16 +13910,16 @@ find foo | sort echo End directory listing 2 ) -153. lustar03.at:21: ok -152. lustar02.at:21: ok - +153. lustar03.at:21: ok 154. old.at:23: testing old archives ... ./old.at:27: mkdir directory tar cfvo archive directory || exit 1 tar tf archive + +154. old.at:23: ok 155. time01.at:20: testing time: tricky time stamps ... ./time01.at:23: mkdir pax @@ -14209,7 +13972,6 @@ tar -c -f archive.tar dir tar -d -f archive.tar dir ) -154. old.at:23: ok 156. time02.at:20: testing time: clamping mtime ... ./time02.at:23: @@ -14235,46 +13997,6 @@ tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir tar -d -f archive.tar dir|sort ) -./chtype.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a - -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory - -sleep 2 - -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort -) 156. time02.at:20: ok 157. multiv01.at:23: testing multivolume dumps from pipes ... @@ -14392,11 +14114,71 @@ cmp file1 extract-dir-pipe/file1 cmp file2 extract-dir-pipe/file2 ) -124. incr03.at:28: ok -125. incr04.at:29: ok +157. multiv01.at:23: ok +158. multiv02.at:28: testing skipping a straddling member ... +./multiv02.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire + +exec <&- + +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +./multiv02.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 10240 --file en +genfile --length 20000 --file to +genfile --length 20000 --file tre +genfile --length 10240 --file fire + +exec <&- + +tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 +echo separator +tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +) +./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 +) +158. multiv02.at:28: ok -157. multiv01.at:23: ok 159. multiv03.at:30: testing MV archive & long filenames ... ./multiv03.at:33: mkdir gnu @@ -14438,27 +14220,47 @@ tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 cmp $BFILE bfile ) -158. multiv02.at:28: testing skipping a straddling member ... -./multiv02.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./multiv03.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire +AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` +BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` + +cat > ../experr < ../expout < ../experr </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 - -cat > ../expout <&1`" || exit 77 -echo separator-1 +mkdir directory +genfile --file=directory/x +genfile --file=directory/y -genfile --length 15360 --file $BFILE -tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1 +sleep 1 -echo separator-2 -mv $BFILE bfile -tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1 -cmp $BFILE bfile +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 ) -./multiv02.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./rename02.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 * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 +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 ) -./multiv02.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +./rename03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --length 10240 --file en -genfile --length 20000 --file to -genfile --length 20000 --file tre -genfile --length 10240 --file fire -exec <&- +test -z "`sort < /dev/null 2>&1`" || exit 77 -tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1 -echo separator -tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1 + +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 ) -159. multiv03.at:30: ok +155. time01.at:20: ok -158. multiv02.at:28: ok 161. multiv05.at:26: testing Restoring after an out of sync volume ... ./multiv05.at:30: mkdir gnu @@ -14609,6 +14495,7 @@ echo Diffing szesc cmp bak/szesc szesc || exit 1 ) +161. multiv05.at:26: ok 162. multiv06.at:27: testing Multivolumes with L=record_size ... ./multiv06.at:30: @@ -14643,8 +14530,48 @@ 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 +162. multiv06.at:27: 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 +) 163. multiv07.at:28: testing volumes split at an extended header ... ./multiv07.at:31: @@ -14660,9 +14587,8 @@ cd $TEST_DATA_DIR tar -t -M -fxsplit-1.tar -fxsplit-2.tar -162. multiv06.at:27: ok ---- - 2024-12-24 08:20:00.647629610 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2024-12-24 08:20:00.624241708 +0000 +--- - 2024-12-24 08:22:52.650941168 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/163/stdout 2024-12-24 08:22:52.643363483 +0000 @@ -1,4 +1 @@ -Archive volumes split at an extended header Volume 1 -foo @@ -14670,7 +14596,6 @@ 163. multiv07.at:28: skipped (multiv07.at:31) - 164. multiv08.at:25: testing multivolume header creation ... ./multiv08.at:28: mkdir gnu @@ -14688,6 +14613,8 @@ decho Testing tar -tMR -f A.tar -f B.tar -f C.tar ) +164. multiv08.at:25: ok + 165. multiv09.at:26: testing bad next volume ... ./multiv09.at:33: mkdir v7 @@ -14723,9 +14650,6 @@ q EOF ) -164. multiv08.at:25: ok -138. rename02.at:24: ok - ./multiv09.at:33: mkdir ustar (cd ustar @@ -14743,6 +14667,115 @@ q EOF ) +./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 <&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 + +) +165. multiv09.at:26: ok + +./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 +) 166. multiv10.at:37: testing file start at the beginning of a posix volume ... ./multiv10.at:40: mkdir posix @@ -14763,6 +14796,43 @@ cmp data1 out/data1 cmp data2 out/data2 ) +166. multiv10.at:37: 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 +) 167. owner.at:21: testing --owner and --group ... ./owner.at:24: @@ -14787,43 +14857,8 @@ tar -tvf arc tar --numeric-owner -tvf arc ) -./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 +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile ) +125. incr04.at:29: ok +124. incr03.at:28: ok -./exclude05.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir exclfile -mkdir -p testdir -awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ - while read name - do - genfile --file $name - done - -awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile - -tar cf archive --anchored --exclude-from=exclfile \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort - -rm -rf testdir exclfile - -) stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2024-12-24 08:20 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-12-24 08:22 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 end separator sparsefile 3102720 ./sparse01.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 * @@ -14983,18 +14994,22 @@ 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 +170. sparse02.at:21: testing extracting sparse file over a pipe ... +./sparse02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77 -tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf - +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 ) 171. sparse03.at:21: testing storing sparse files > 8G ... ./sparse03.at:29: @@ -15022,40 +15037,35 @@ ) stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2024-12-24 08:20 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-12-24 08:22 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 end separator sparsefile 3102720 -./sparse01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./sparse02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --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 +tar --hole-detection=raw -c -f archive --sparse sparsefile || 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 +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy ) -172. sparse04.at:21: ok +169. sparse01.at:21: ok + ./sparse02.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -15066,14 +15076,22 @@ tar xfO archive | cat - > sparsecopy || exit 1 cmp sparsefile sparsecopy ) -stdout: +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 * -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2024-12-24 08:20 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 end -separator -sparsefile 3102720 +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 173. sparse05.at:21: testing listing sparse files bigger than 2^33 B ... ./sparse05.at:31: mkdir pax @@ -16091,23 +16109,6 @@ genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77 tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print $3, $(NF) }' ) -./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 -) -169. sparse01.at:21: ok 174. sparse06.at:21: testing storing sparse file using seek method ... ./sparse06.at:32: @@ -16181,7 +16182,7 @@ ) -170. sparse02.at:21: ok +138. rename02.at:24: ok 175. sparse07.at:21: testing sparse files with unicode names ... ./sparse07.at:24: @@ -16198,6 +16199,8 @@ tar tf archive ) +139. rename03.at:23: ok + ./sparse07.at:24: mkdir gnu (cd gnu @@ -16212,6 +16215,36 @@ tar tf archive ) +176. sparsemv.at:21: testing sparse files in MV archives ... +./sparsemv.at:31: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" +genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 +echo "Pass 1: Split between data blocks" +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 + +echo "Pass 2: Split within a data block" +genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 +echo "Create archive" +tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 +echo "Test archive" +tar --record-size=512 -t -M -f arc.1 -f arc.2 +echo "Compare archive" +tar --record-size=512 -d -M -f arc.1 -f arc.2 +) ./sparse07.at:24: mkdir oldgnu (cd oldgnu @@ -16227,7 +16260,8 @@ tar tf archive ) 175. sparse07.at:21: ok -./incr02.at:35: + +./sparsemv.at:31: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16236,55 +16270,6 @@ 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 - -) -174. sparse06.at:21: ok - -176. sparsemv.at:21: testing sparse files in MV archives ... -./sparsemv.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - exec <&- TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 @@ -16305,7 +16290,6 @@ echo "Compare archive" tar --record-size=512 -d -M -f arc.1 -f arc.2 ) - 177. spmvp00.at:21: testing sparse files in PAX MV archives, v.0.0 ... ./spmvp00.at:24: mkdir pax @@ -16336,37 +16320,10 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -./sparsemv.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw" -genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77 -echo "Pass 1: Split between data blocks" -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 - -echo "Pass 2: Split within a data block" -genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77 -echo "Create archive" -tar --sparse -c --record-size=512 -M -L6 -f arc.1 -f arc.2 sparsefile || exit 1 -echo "Test archive" -tar --record-size=512 -t -M -f arc.1 -f arc.2 -echo "Compare archive" -tar --record-size=512 -d -M -f arc.1 -f arc.2 -) +176. sparsemv.at:21: ok 177. spmvp00.at:21: ok + 178. spmvp01.at:21: testing sparse files in PAX MV archives, v.0.1 ... ./spmvp01.at:24: mkdir pax @@ -16397,8 +16354,6 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -176. sparsemv.at:21: ok - 179. spmvp10.at:21: testing sparse files in PAX MV archives, v.1.0 ... ./spmvp10.at:24: mkdir pax @@ -16429,8 +16384,9 @@ echo "Compare archive" tar -d -M -f arc.1 -f arc.2 -f arc.3 ) -178. spmvp01.at:21: ok +174. sparse06.at:21: ok +178. spmvp01.at:21: ok 180. sptrcreat.at:33: testing sparse file truncated while archiving ... ./sptrcreat.at:36: mkdir posix @@ -16452,6 +16408,7 @@ 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 @@ -16471,7 +16428,8 @@ genfile --run --checkpoint 3 --length 200m --truncate foo -- \ tar --sparse -vdf bar ) -./chtype.at:30: +182. sptrdiff01.at:26: testing file truncated in data region while comparing ... +./sptrdiff01.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16480,36 +16438,14 @@ 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 +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ + tar --sparse -vdf bar ) ./sptrdiff00.at:30: mkdir gnu @@ -16529,43 +16465,23 @@ genfile --run --checkpoint 3 --length 200m --truncate foo -- \ tar --sparse -vdf bar ) -./incremental.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./sptrdiff01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -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 +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 ) ./sptrcreat.at:36: mkdir gnu @@ -16585,9 +16501,7 @@ echo separator genfile --file foo --seek 200m --length 11575296 --pattern=zeros tar dvf bar | sed '/foo: Mod time differs/d') -119. listed01.at:26: ok - -./sptrdiff00.at:30: +./sptrdiff01.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16602,16 +16516,15 @@ echo creating tar --sparse -vcf bar foo baz echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ tar --sparse -vdf bar ) -182. sptrdiff01.at:26: testing file truncated in data region while comparing ... -./sptrdiff01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./sptrdiff00.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -16621,7 +16534,7 @@ echo creating tar --sparse -vcf bar foo baz echo comparing -genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ tar --sparse -vdf bar ) ./sptrcreat.at:36: @@ -16642,39 +16555,78 @@ echo separator genfile --file foo --seek 200m --length 11575296 --pattern=zeros tar dvf bar | sed '/foo: Mod time differs/d') -./sptrdiff01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./chtype.at:30: +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 --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 + +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 ) 181. sptrdiff00.at:26: ok -stdout: -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 begin --rw-r--r-- pbuilder1/pbuilder1 8589935104 2024-12-24 08:20 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2024-12-24 08:20 end -separator -sparsefile 8589935104 +183. update.at:28: testing update unchanged directories ... +./update.at:31: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +182. sptrdiff01.at:26: ok ./exclude05.at:24: -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 * @@ -16704,30 +16656,6 @@ rm -rf testdir exclfile ) -183. update.at:28: testing update unchanged directories ... -./update.at:31: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 - -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) -180. sptrcreat.at:33: ok 184. update01.at:29: testing update directories ... ./update01.at:32: @@ -16756,8 +16684,6 @@ echo "separator" tar tf arc | sort || exit 1 ) -171. sparse03.at:21: ok - ./update.at:31: mkdir oldgnu (cd oldgnu @@ -16780,51 +16706,6 @@ echo separator tar tf archive | sort || exit 1 ) -./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 -) -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 @@ -16869,7 +16750,6 @@ echo separator tar tf archive | sort || exit 1 ) -155. time01.at:20: ok ./update.at:31: mkdir gnu (cd gnu @@ -16892,7 +16772,37 @@ echo separator tar tf archive | sort || exit 1 ) +180. sptrcreat.at:33: ok +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 @@ -16915,7 +16825,137 @@ echo Update tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 ) -183. update.at:28: ok +./update03.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +./update03.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +./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 - +) +./update03.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +./update03.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +186. update03.at:20: ok 187. update04.at:20: testing update with wildcards ... ./update04.at:23: @@ -16944,7 +16984,14 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -182. sptrdiff01.at:26: ok +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 begin +-rw-r--r-- pbuilder2/pbuilder2 8589935104 2024-12-24 08:22 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-12-24 08:22 end +separator +sparsefile 8589935104 +171. sparse03.at:21: ok 188. verify.at:25: testing verify ... ./verify.at:28: @@ -17008,54 +17055,7 @@ tar -cvf archive.tar --verify foo ) 188. verify.at:25: ok -./multiv04.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' 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 +) ./comprec.at:25: mkdir ustar (cd ustar @@ -17290,50 +17274,34 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) -193. shortupd.at:31: testing updating short archives ... -./shortupd.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./comprec.at:25: +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 * -touch foo -tar uf archive foo -) -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 -) -./shortupd.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -touch foo -tar uf archive foo +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 ) +119. listed01.at:26: ok + ./comprec.at:25: -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 * @@ -17348,7 +17316,22 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) +192. shortfile.at:26: testing short input files ... +./shortfile.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 511 --file foo || exit 5 +tar tf foo +) +192. shortfile.at:26: ok +191. comprec.at:21: ok ./update04.at:23: mkdir oldgnu (cd oldgnu @@ -17375,12 +17358,26 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) +193. shortupd.at:31: testing updating short archives ... ./shortupd.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) + +./shortupd.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -17405,26 +17402,47 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -./comprec.at:25: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./shortupd.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 * +touch foo +tar uf archive foo +) +./shortupd.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 +touch foo +tar uf archive foo ) +./truncate.at:32: +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 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') ./shortupd.at:34: mkdir gnu (cd gnu @@ -17438,12 +17456,13 @@ tar uf archive foo ) 193. shortupd.at:31: ok + ./truncate.at:32: -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 * @@ -17455,8 +17474,6 @@ 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 195. grow.at:24: testing grow ... ./grow.at:27: mkdir v7 @@ -17471,30 +17488,12 @@ 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: - -case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( -?*) exit 77;; -esac - - -genfile --length 2048 --file first -genfile --length 2048 --file second -genfile --length 2049 --file third - -tar cf archive first second third - -# Discard diagnostics that some shells generate about broken pipes. -(tar tf archive 2>&3 | :) 3>&2 2>/dev/null - ./truncate.at:32: -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 * @@ -17506,13 +17505,12 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -196. sigpipe.at:21: ok ./truncate.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -17524,6 +17522,26 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') +194. truncate.at:29: ok + +196. sigpipe.at:21: testing sigpipe handling ... +./sigpipe.at:30: + +case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #( +?*) exit 77;; +esac + + +genfile --length 2048 --file first +genfile --length 2048 --file second +genfile --length 2049 --file third + +tar cf archive first second third + +# Discard diagnostics that some shells generate about broken pipes. +(tar tf archive 2>&3 | :) 3>&2 2>/dev/null + +196. sigpipe.at:21: ok 197. comperr.at:18: testing compressor program failure ... ./comperr.at:28: @@ -17540,24 +17558,6 @@ sed -n '$p' err exit $rc ) -./truncate.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') -116. incremental.at:23: ok ./comperr.at:28: mkdir oldgnu (cd oldgnu @@ -17572,31 +17572,83 @@ sed -n '$p' err exit $rc ) -./update01.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./comperr.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) +./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 +) +./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 +) +197. comperr.at:18: ok +./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 -mkdir a -genfile --file a/b -tar cf arc a +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done -echo "separator" +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile -sleep 2 -genfile --file a/c +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 ) 198. remfiles01.at:28: testing remove-files with compression ... @@ -17645,20 +17697,8 @@ find . | sort exit $EC -./comperr.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * +198. remfiles01.at:28: ok -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc -) ./grow.at:27: mkdir oldgnu (cd oldgnu @@ -17672,48 +17712,6 @@ genfile --file baz genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -194. truncate.at:29: ok - -./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 -) -./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 -) 199. remfiles02.at:28: testing remove-files with compression: grand-child ... ./remfiles02.at:32: @@ -17736,52 +17734,8 @@ find . | sort exit $EC -./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 -) -197. comperr.at:18: ok -198. remfiles01.at:28: ok 199. remfiles02.at:28: ok - -./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: testing remove-files with symbolic links ... ./remfiles03.at:31: mkdir a @@ -17790,6 +17744,8 @@ tar --remove-files -cf a.tar a genfile --stat a +200. remfiles03.at:28: ok + 201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... ./remfiles04a.at:28: mkdir gnu @@ -17810,6 +17766,9 @@ echo A find . | sort ) +201. remfiles04a.at:25: ok + +143. chtype.at:27: ok 202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... ./remfiles04b.at:36: mkdir gnu @@ -17830,23 +17789,33 @@ echo A find . | sort ) -./grow.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +./update01.at:32: +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 * -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) -200. remfiles03.at:28: ok -202. remfiles04b.at:33: ok +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 +) 203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... ./remfiles04c.at:36: mkdir gnu @@ -17870,7 +17839,9 @@ echo B find . | sort ) -201. remfiles04a.at:25: ok +202. remfiles04b.at:33: 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 @@ -17895,7 +17866,7 @@ find . | sort ) -64. exclude05.at:21: ok +204. remfiles05a.at:34: ok 205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... ./remfiles05b.at:28: mkdir gnu @@ -17919,10 +17890,8 @@ decho B find . | sort ) -203. remfiles04c.at:33: ok - -204. remfiles05a.at:34: ok +205. remfiles05b.at:25: ok 206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... ./remfiles05c.at:28: mkdir gnu @@ -17949,51 +17918,19 @@ decho C find . | sort ) -./incr02.at:35: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./grow.at:27: +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 * -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 - +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) 207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... ./remfiles06a.at:28: @@ -18019,21 +17956,35 @@ decho B find . | sort ) -./grow.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +206. remfiles05c.at:25: ok +./update02.at:29: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz + +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 ) -205. remfiles05b.at:25: ok +207. remfiles06a.at:25: ok 208. remfiles06b.at:25: testing remove-files with -C:rel,abs in -c/incr. mode ... ./remfiles06b.at:28: mkdir gnu @@ -18059,7 +18010,6 @@ find . | sort ) -206. remfiles05c.at:25: ok 209. remfiles06c.at:25: testing remove-files with -C:rel,abs in -r mode ... ./remfiles06c.at:28: mkdir gnu @@ -18087,9 +18037,9 @@ decho C find . | sort ) +208. remfiles06b.at:25: ok -207. remfiles06a.at:25: ok -210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... +209. remfiles06c.at:25: 210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... ./remfiles07a.at:28: mkdir gnu (cd gnu @@ -18113,8 +18063,9 @@ decho B find . | sort ) + ok -208. remfiles06b.at:25: ok +210. remfiles07a.at:25: ok 211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... ./remfiles07b.at:28: mkdir gnu @@ -18140,7 +18091,7 @@ find . | sort ) -209. remfiles06c.at:25: ok +211. remfiles07b.at:25: ok 212. remfiles07c.at:25: testing remove-files with -C:abs,rel in -r mode ... ./remfiles07c.at:28: mkdir gnu @@ -18169,20 +18120,6 @@ find . | sort ) -210. remfiles07a.at:25: ./grow.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) - ok 213. remfiles08a.at:28: testing remove-files deleting two subdirs in -c/non-incr. mode ... ./remfiles08a.at:31: mkdir gnu @@ -18202,7 +18139,7 @@ decho B find . ) -211. remfiles07b.at:25: ok +212. remfiles07c.at:25: ok 213. remfiles08a.at:28: ok 214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... @@ -18225,7 +18162,7 @@ find . ) -215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... +214. remfiles08b.at:31: 215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... ./remfiles08c.at:31: mkdir gnu (cd gnu @@ -18250,8 +18187,33 @@ decho C find . ) -212. remfiles07c.at:25: ok + ok +./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 $? +) 216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... ./remfiles09a.at:28: @@ -18271,6 +18233,8 @@ find . ) 215. remfiles08c.at:28: ok + +216. remfiles09a.at:25: ok 217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... ./remfiles09b.at:32: mkdir gnu @@ -18288,8 +18252,7 @@ decho B find . ) - -./update04.at:23: +./grow.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -18298,25 +18261,10 @@ export TAR_OPTIONS rm -rf * -genfile --file file.a -genfile --file file.b -genfile --file file.c -echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' - -echo "Second update" -tar ufv archive --wildcards './file.*' - -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -214. remfiles08b.at:31: ok -217. remfiles09b.at:29: ok 218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... ./remfiles09c.at:28: @@ -18341,7 +18289,8 @@ decho C find . | sort ) -216. remfiles09a.at:25: ok +217. remfiles09b.at:29: ok + 219. remfiles10.at:20: testing remove-files ... ./remfiles10.at:23: mkdir gnu @@ -18361,9 +18310,15 @@ find foo exit $tar_status ) +218. remfiles09c.at:25: ok +stderr: +A +tar: .: Cannot rmdir: Invalid argument +tar: Exiting with failure status due to previous errors +B - -195. grow.at:24: ok +./remfiles10.at:44: sed '2s/:[^:]*$//' stderr +219. remfiles10.at:20: ok 220. xattr01.at:25: testing xattrs: basic functionality ... ./xattr01.at:28: mkdir v7 @@ -18412,19 +18367,14 @@ getfattr -h -d dir | grep -v -e '^#' -e ^$ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ ) -stderr: -A -tar: .: Cannot rmdir: Invalid argument -tar: Exiting with failure status due to previous errors -B -./remfiles10.at:44: sed '2s/:[^:]*$//' stderr -218. remfiles09c.at:25: ok ---- - 2024-12-24 08:20:07.544499856 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2024-12-24 08:20:07.540283671 +0000 + +--- - 2024-12-24 08:22:57.332593753 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2024-12-24 08:22:57.327391842 +0000 @@ -1,3 +1 @@ -user.test="OurDirValue" -user.test="OurFileValue" +220. xattr01.at:25: skipped (xattr01.at:28) 221. xattr02.at:25: testing xattrs: change directory with -C option ... ./xattr02.at:28: mkdir v7 @@ -18480,21 +18430,15 @@ getfattr -h -d file2 | grep -v -e '^#' -e ^$ getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ ) -220. xattr01.at:25: skipped (xattr01.at:28) ---- - 2024-12-24 08:20:07.567621237 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2024-12-24 08:20:07.564283816 +0000 + +--- - 2024-12-24 08:22:57.358822912 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2024-12-24 08:22:57.351391987 +0000 @@ -1,4 +1 @@ -user.test="OurFile1Value" -user.test="OurFile2Value" -user.test="OurDirValue" -219. remfiles10.at:20: ok -221. xattr02.at:25: - - skipped (xattr02.at:28) - - -222. xattr03.at:25: testing xattrs: trusted.* attributes ... +221. xattr02.at:25: 222. xattr03.at:25: testing xattrs: trusted.* attributes ... ./xattr03.at:28: mkdir v7 (cd v7 @@ -18557,8 +18501,19 @@ getfattr -mtrusted. -d file2 | grep -v -e '^#' -e ^$ getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ ) -224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... -./xattr05.at:31: + skipped (xattr02.at:28) + +--- - 2024-12-24 08:22:57.380638204 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2024-12-24 08:22:57.375392132 +0000 +@@ -1,4 +1 @@ +-trusted.test="OurFile1Value" +-trusted.test="OurFile2Value" +-trusted.test="OurDirValue" + +222. xattr03.at:25: skipped (xattr03.at:28) + +223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... +./xattr04.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18596,18 +18551,23 @@ mkdir output genfile --file dir/file -setfattr -n user.=NAME%3D= -v value dir/file -getfattr -d dir/file | grep -v '# ' > before +setfattr -n user.test -v value dir/file # archive whole directory including binary xattrs tar --xattrs -cf archive.tar -C dir . tar --xattrs -xf archive.tar -C output -getfattr -d output/file | grep -v '# ' > after -diff before after +ret=$? +getfattr -h -d output/file | grep -v -e '^#' -e ^$ +exit $ret ) -223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... -./xattr04.at:29: +--- - 2024-12-24 08:22:57.412461117 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2024-12-24 08:22:57.407392326 +0000 +@@ -1,2 +1 @@ +-user.test="value" + +223. xattr04.at:26: 224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... +./xattr05.at:31: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18645,16 +18605,19 @@ mkdir output genfile --file dir/file -setfattr -n user.test -v value dir/file +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before # archive whole directory including binary xattrs tar --xattrs -cf archive.tar -C dir . tar --xattrs -xf archive.tar -C output -ret=$? -getfattr -h -d output/file | grep -v -e '^#' -e ^$ -exit $ret +getfattr -d output/file | grep -v '# ' > after +diff before after ) + skipped (xattr04.at:29) + +224. xattr05.at:28: skipped (xattr05.at:31) 225. xattr06.at:27: testing xattrs: exclude xattrs on create ... ./xattr06.at:30: @@ -18711,15 +18674,6 @@ # if they differ then the attribute is still present diff filtered full ) -224. xattr05.at:28: skipped (xattr05.at:31) - ---- - 2024-12-24 08:20:07.647108719 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2024-12-24 08:20:07.640284277 +0000 -@@ -1,2 +1 @@ --user.test="value" - -223. xattr04.at:26: skipped (xattr04.at:29) -225. xattr06.at:27: skipped (xattr06.at:30) 226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... ./xattr07.at:29: mkdir v7 @@ -18776,6 +18730,33 @@ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ ) +225. xattr06.at:27: skipped (xattr06.at:30) + +--- - 2024-12-24 08:22:57.470790830 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2024-12-24 08:22:57.463392665 +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 + +--- - 2024-12-24 08:22:57.473745288 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2024-12-24 08:22:57.467392689 +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) + 227. xattr08.at:26: testing xattrs: xattrs and read-only files ... ./xattr08.at:29: mkdir v7 @@ -18819,28 +18800,7 @@ tar --xattrs -C dir -cf archive.tar file tar --xattrs -C dir2 -xf archive.tar ) ---- - 2024-12-24 08:20:07.663093696 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2024-12-24 08:20:07.656284375 +0000 -@@ -1,4 +1 @@ --trusted.test="OurFile1Value" --trusted.test="OurFile2Value" --trusted.test="OurDirValue" - - -222. xattr03.at:25: 227. xattr08.at:26: skipped (xattr03.at:28) - skipped (xattr08.at:29) - - ---- - 2024-12-24 08:20:07.685232630 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2024-12-24 08:20:07.680284520 +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 - +227. xattr08.at:26: skipped (xattr08.at:29) 228. acls01.at:25: testing acls: basic functionality ... ./acls01.at:28: mkdir v7 @@ -18912,6 +18872,8 @@ test "$?" = 0 ) +228. acls01.at:25: skipped (acls01.at:28) + 229. acls02.at:25: testing acls: work with -C ... ./acls02.at:28: mkdir v7 @@ -18988,20 +18950,7 @@ diff before after test "$?" = 0 ) ---- - 2024-12-24 08:20:07.699035594 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2024-12-24 08:20:07.688284569 +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) +229. acls02.at:25: skipped (acls02.at:28) 230. acls03.at:30: testing acls: default ACLs ... ./acls03.at:47: mkdir v7 @@ -19220,6 +19169,21 @@ fi ) + +./grow.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) +230. acls03.at:30: skipped (acls03.at:47) 231. selnx01.at:25: testing selinux: basic store/restore ... ./selnx01.at:28: mkdir v7 @@ -19330,9 +19294,14 @@ ) -229. acls02.at:25: 228. acls01.at:25: skipped (acls01.at:28) - skipped (acls02.at:28) -230. acls03.at:30: skipped (acls03.at:47) +--- - 2024-12-24 08:22:57.591324920 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2024-12-24 08:22:57.583393392 +0000 +@@ -1,4 +1 @@ +-security.selinux="system_u +-security.selinux="unconfined_u +-security.selinux="system_u + +231. selnx01.at:25: skipped (selnx01.at:28) 232. selacl01.at:25: testing acls/selinux: special files & fifos ... ./selacl01.at:28: mkdir v7 @@ -19442,45 +19411,13 @@ diff before after echo separator ) ---- - 2024-12-24 08:20:07.737207106 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2024-12-24 08:20:07.732284836 +0000 + +--- - 2024-12-24 08:22:57.619989173 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2024-12-24 08:22:57.611393561 +0000 @@ -1,2 +1 @@ -separator - -232. selacl01.at:25: --- - 2024-12-24 08:20:07.740653686 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2024-12-24 08:20:07.736284860 +0000 -@@ -1,4 +1 @@ --security.selinux="system_u --security.selinux="unconfined_u --security.selinux="system_u - -231. selnx01.at:25: skipped (selacl01.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 -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: skipped (selacl01.at:28) 233. capabs_raw01.at:25: testing capabilities: binary store/restore ... ./capabs_raw01.at:28: mkdir v7 @@ -19558,8 +19495,14 @@ getcap dir/file | sed 's/+/=/' ) -235. onetop02.at:21: testing tar --one-top-level --show-transformed ... -./onetop02.at:24: +--- - 2024-12-24 08:22:57.640533537 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2024-12-24 08:22:57.635393706 +0000 +@@ -1,2 +1 @@ +-dir/file = cap_chown=ei + +233. capabs_raw01.at:25: skipped (capabs_raw01.at:28) +234. onetop01.at:21: testing tar --one-top-level ... +./onetop01.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19577,17 +19520,12 @@ 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 ) ---- - 2024-12-24 08:20:07.803926270 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2024-12-24 08:20:07.792285200 +0000 -@@ -1,2 +1 @@ --dir/file = cap_chown=ei - -233. capabs_raw01.at:25: 236. onetop03.at:21: testing tar --one-top-level --transform ... -./onetop03.at:24: +235. onetop02.at:21: testing tar --one-top-level --show-transformed ... +./onetop02.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -19605,30 +19543,9 @@ 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 --show-transformed -v -x -f ../a.tar find . | sort ) - skipped (capabs_raw01.at:28) -237. onetop04.at:21: testing tar --one-top-level --transform ... -./onetop04.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -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 -) - ./onetop01.at:24: mkdir oldgnu (cd oldgnu @@ -19671,12 +19588,12 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop03.at:24: -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 * @@ -19689,63 +19606,36 @@ 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 ) -238. onetop05.at:21: testing tar --one-top-level restoring permissions ... -./onetop05.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./onetop02.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -orig_mode=3702 -mkdir d -chmod $orig_mode d - -mode=$(genfile --stat=mode.7777 d) -test $mode = $orig_mode || exit 77 - -genfile --file d/file -tar -cf d.tar -C d . -rm -rf d -(mkdir d1 -chmod 700 d1 -cd d1 -tar --one-top-level=top -xpf ../d.tar) -mode=$(genfile --stat=mode.777 d1) -if test 700 = $mode; then - echo "CWD: OK" -else - echo "CWD: mode changed: 700 != $mode" -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir d2 -chmod 700 d2 -tar -C d2 --one-top-level=top -xpf d.tar -mode=$(genfile --stat=mode.777 d2) -if test 700 = $mode; then - echo "DIR: OK" -else - echo "DIR: mode changed: 700 != $mode" -fi -mode=$(genfile --stat=mode.7777 d2/top) -if test $mode = $orig_mode; then - echo "TOP: OK" -else - echo "TOP: mode changed: $orig_mode != $mode" -fi +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 ) -./onetop04.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./onetop01.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 * @@ -19756,14 +19646,17 @@ genfile --file a/b genfile --file c tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort +mkdir out +cd out +tar --one-top-level -x -f ../a.tar +find . | sort ) -./update01.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop02.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -19772,24 +19665,19 @@ mkdir a genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level --show-transformed -v -x -f ../a.tar +find . | sort ) -./onetop03.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop01.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 * @@ -19802,15 +19690,15 @@ 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: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./onetop02.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 * @@ -19823,15 +19711,19 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop02.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +234. onetop01.at:21: ok + +235. onetop02.at:21: ok +236. onetop03.at:21: testing tar --one-top-level --transform ... +./onetop03.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 * @@ -19844,15 +19736,17 @@ 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 --transform 's/c/d/' -x -f ../a.tar find . | sort ) + +237. onetop04.at:21: testing tar --one-top-level --transform ... ./onetop04.at:24: -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 * @@ -19866,11 +19760,11 @@ tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) ./onetop03.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -19886,7 +19780,8 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop05.at:28: +195. grow.at:24: ok +./onetop04.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -19895,50 +19790,21 @@ export TAR_OPTIONS rm -rf * -orig_mode=3702 -mkdir d -chmod $orig_mode d - -mode=$(genfile --stat=mode.7777 d) -test $mode = $orig_mode || exit 77 - -genfile --file d/file -tar -cf d.tar -C d . -rm -rf d -(mkdir d1 -chmod 700 d1 -cd d1 -tar --one-top-level=top -xpf ../d.tar) -mode=$(genfile --stat=mode.777 d1) -if test 700 = $mode; then - echo "CWD: OK" -else - echo "CWD: mode changed: 700 != $mode" -fi +test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir d2 -chmod 700 d2 -tar -C d2 --one-top-level=top -xpf d.tar -mode=$(genfile --stat=mode.777 d2) -if test 700 = $mode; then - echo "DIR: OK" -else - echo "DIR: mode changed: 700 != $mode" -fi -mode=$(genfile --stat=mode.7777 d2/top) -if test $mode = $orig_mode; then - echo "TOP: OK" -else - echo "TOP: mode changed: $orig_mode != $mode" -fi +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 ) -./onetop01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./onetop03.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 * @@ -19951,15 +19817,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 ) ./onetop04.at:24: -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 * @@ -19972,59 +19838,12 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop05.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -orig_mode=3702 -mkdir d -chmod $orig_mode d - -mode=$(genfile --stat=mode.7777 d) -test $mode = $orig_mode || exit 77 - -genfile --file d/file -tar -cf d.tar -C d . -rm -rf d - -(mkdir d1 -chmod 700 d1 -cd d1 -tar --one-top-level=top -xpf ../d.tar) -mode=$(genfile --stat=mode.777 d1) -if test 700 = $mode; then - echo "CWD: OK" -else - echo "CWD: mode changed: 700 != $mode" -fi - -mkdir d2 -chmod 700 d2 -tar -C d2 --one-top-level=top -xpf d.tar -mode=$(genfile --stat=mode.777 d2) -if test 700 = $mode; then - echo "DIR: OK" -else - echo "DIR: mode changed: 700 != $mode" -fi -mode=$(genfile --stat=mode.7777 d2/top) -if test $mode = $orig_mode; then - echo "TOP: OK" -else - echo "TOP: mode changed: $orig_mode != $mode" -fi -) ./onetop03.at:24: -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 * @@ -20040,12 +19859,12 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop01.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./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 * @@ -20056,17 +19875,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 posix -(cd posix -TEST_TAR_FORMAT=posix +./onetop04.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 * @@ -20077,12 +19893,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 ) -./onetop04.at:24: +./onetop03.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20098,15 +19911,20 @@ 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 --transform 's/c/d/' -x -f ../a.tar +find . | sort ) -236. onetop03.at:21: ok + +237. onetop04.at:21: ok +238. onetop05.at:21: testing tar --one-top-level restoring permissions ... ./onetop05.at:28: -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 * @@ -20148,55 +19966,7 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./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 -) -234. onetop01.at:21: ok -237. onetop04.at:21: ok -./update02.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) +236. onetop03.at:21: ok 239. gtarfail.at:21: testing gtarfail ... @@ -20208,10 +19978,8 @@ tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar -235. onetop02.at:21: ok - ---- - 2024-12-24 08:20:08.148163999 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2024-12-24 08:20:08.144287335 +0000 +--- - 2024-12-24 08:22:58.022579771 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2024-12-24 08:22:58.015396007 +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 @@ -20229,29 +19997,12 @@ tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar ---- - 2024-12-24 08:20:08.154276916 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2024-12-24 08:20:08.148287360 +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) - - ./onetop05.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * @@ -20294,18 +20045,21 @@ fi ) -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 +--- - 2024-12-24 08:22:58.036233453 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2024-12-24 08:22:58.031396104 +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) 241. multi-fail.at:21: testing multi-fail ... ./multi-fail.at:26: @@ -20321,21 +20075,8 @@ tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- -244. pax-big-10g.at:21: testing pax-big-10g ... -./pax-big-10g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 - ---- - 2024-12-24 08:20:08.197624739 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2024-12-24 08:20:08.188287602 +0000 +--- - 2024-12-24 08:22:58.062639173 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2024-12-24 08:22:58.055396249 +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 @@ -20390,7 +20131,76 @@ --rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o --rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o +241. multi-fail.at:21: 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 + stderr: + +./onetop05.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +orig_mode=3702 +mkdir d +chmod $orig_mode d + +mode=$(genfile --stat=mode.7777 d) +test $mode = $orig_mode || exit 77 + +genfile --file d/file +tar -cf d.tar -C d . +rm -rf d + +(mkdir d1 +chmod 700 d1 +cd d1 +tar --one-top-level=top -xpf ../d.tar) +mode=$(genfile --stat=mode.777 d1) +if test 700 = $mode; then + echo "CWD: OK" +else + echo "CWD: mode changed: 700 != $mode" +fi + +mkdir d2 +chmod 700 d2 +tar -C d2 --one-top-level=top -xpf d.tar +mode=$(genfile --stat=mode.777 d2) +if test 700 = $mode; then + echo "DIR: OK" +else + echo "DIR: mode changed: 700 != $mode" +fi +mode=$(genfile --stat=mode.7777 d2/top) +if test $mode = $orig_mode; then + echo "TOP: OK" +else + echo "TOP: mode changed: $orig_mode != $mode" +fi +) +--- - 2024-12-24 08:22:58.082076611 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2024-12-24 08:22:58.075396370 +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) 243. ustar-big-8g.at:21: testing ustar-big-8g ... ./ustar-big-8g.at:26: test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 @@ -20404,33 +20214,84 @@ tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 -241. multi-fail.at:21: skipped (multi-fail.at:26) ---- - 2024-12-24 08:20:08.207262238 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2024-12-24 08:20:08.200287675 +0000 + +stderr: +--- - 2024-12-24 08:22:58.108549731 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2024-12-24 08:22:58.103396540 +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 -242. ustar-big-2g.at:21: skipped (ustar-big-2g.at:26) -stderr: +244. pax-big-10g.at:21: testing pax-big-10g ... +./pax-big-10g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 + +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 + + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 + +243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) stderr: ---- - 2024-12-24 08:20:08.219201310 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2024-12-24 08:20:08.212287748 +0000 +--- - 2024-12-24 08:22:58.123135819 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2024-12-24 08:22:58.115396613 +0000 @@ -1,3 +1 @@ --rw------- jes/glone 10737418240 2002-06-15 21:18 10g --rw-r--r-- jes/glone 0 2002-06-15 14:53 file -244. pax-big-10g.at:21: --- - 2024-12-24 08:20:08.222513770 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2024-12-24 08:20:08.216287772 +0000 -@@ -1,3 +1 @@ ---rw------- jes/glone 8589934591 2002-06-15 15:08 8gb-1 ---rw-r--r-- jes/glone 0 2002-06-15 14:53 file - - skipped (pax-big-10g.at:26) -243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) -238. onetop05.at:21: ok -160. multiv04.at:36: ok -./update04.at:23: +244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) +./onetop05.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +orig_mode=3702 +mkdir d +chmod $orig_mode d + +mode=$(genfile --stat=mode.7777 d) +test $mode = $orig_mode || exit 77 + +genfile --file d/file +tar -cf d.tar -C d . +rm -rf d + +(mkdir d1 +chmod 700 d1 +cd d1 +tar --one-top-level=top -xpf ../d.tar) +mode=$(genfile --stat=mode.777 d1) +if test 700 = $mode; then + echo "CWD: OK" +else + echo "CWD: mode changed: 700 != $mode" +fi + +mkdir d2 +chmod 700 d2 +tar -C d2 --one-top-level=top -xpf d.tar +mode=$(genfile --stat=mode.777 d2) +if test 700 = $mode; then + echo "DIR: OK" +else + echo "DIR: mode changed: 700 != $mode" +fi +mode=$(genfile --stat=mode.7777 d2/top) +if test $mode = $orig_mode; then + echo "TOP: OK" +else + echo "TOP: mode changed: $orig_mode != $mode" +fi +) +./onetop05.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20439,6 +20300,53 @@ export TAR_OPTIONS rm -rf * +orig_mode=3702 +mkdir d +chmod $orig_mode d + +mode=$(genfile --stat=mode.7777 d) +test $mode = $orig_mode || exit 77 + +genfile --file d/file +tar -cf d.tar -C d . +rm -rf d + +(mkdir d1 +chmod 700 d1 +cd d1 +tar --one-top-level=top -xpf ../d.tar) +mode=$(genfile --stat=mode.777 d1) +if test 700 = $mode; then + echo "CWD: OK" +else + echo "CWD: mode changed: 700 != $mode" +fi + +mkdir d2 +chmod 700 d2 +tar -C d2 --one-top-level=top -xpf d.tar +mode=$(genfile --stat=mode.777 d2) +if test 700 = $mode; then + echo "DIR: OK" +else + echo "DIR: mode changed: 700 != $mode" +fi +mode=$(genfile --stat=mode.7777 d2/top) +if test $mode = $orig_mode; then + echo "TOP: OK" +else + echo "TOP: mode changed: $orig_mode != $mode" +fi +) +./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 @@ -20456,76 +20364,135 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -187. update04.at:20: ok -./listed02.at:31: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +238. onetop05.at:21: ok +64. exclude05.at:21: ok +./update01.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Create directories +mkdir a +genfile --file a/b -mkdir tart -sleep 1 -mkdir tart/c0 -sleep 1 -mkdir tart/c1 -sleep 1 +tar cf arc a -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 +echo "separator" -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 +sleep 2 +genfile --file a/c -# 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 +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update02.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -sleep 1 -echo Modifying filesystem -rm tart/a1 -mv tart/b1 tart/b2 -mv tart/c1 tart/c2 -touch tart/c2/ca3 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo Directory contents -find tart -print | sort 2>/dev/null +mkdir a +genfile --file a/b -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 +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +116. incremental.at:23: ok +./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.*' -rm -rf tart/* -echo Extracting main archive -echo >&2 "Extracting main archive" -tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1 -echo Extracting incremental archive -# This command should produce three messages about deletion -# of the existing files, that may appear in any order. Piping -# to sort makes sure we don't depend on any particular ordering. -tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null +echo "Second update" +tar ufv archive --wildcards './file.*' -echo Final files: -find tart -print | sort 2>/dev/null +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? +) +160. multiv04.at:36: ok +./incr02.at:35: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 +# Create directory structure +mkdir dir +mkdir dir/subdir1 +mkdir dir/subdir2 +genfile --length 10 --file dir/subdir1/file + +# Save mtime for later comparison +genfile --stat=mtime dir/subdir1 > ts + +# Create an archive. Using incremental mode makes sure the +# archive will have a directory-first member ordering, +# i.e.: +# dir/ +# dir/subdir1/ +# dir/subdir2/ +# dir/subdir1/foofile +# +# When restoring from this directory structure, 'dir/subdir2/' used to +# trigger apply_nonancestor_delayed_set_stat() which restored stats for +# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the +# latter clobbered the directory timestamp. + +tar -cf archive -g db dir + +# Move away the directory +mv dir orig + +# Wait enough time for timestamps to differ in case of failure. +sleep 5 + +# Restore the directory +tar -xf archive dir + +# Check the timestamp +genfile --stat=mtime dir/subdir1 | diff ts - ) +187. update04.at:20: ok ./update01.at:32: mkdir posix (cd posix @@ -20578,7 +20545,6 @@ echo "separator" tar tf arc | sort || exit 1 ) -118. incr02.at:32: ok ./update01.at:32: mkdir gnu (cd gnu @@ -20631,10 +20597,80 @@ echo "separator" tar tf arc | sort || exit 1 ) +./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 +) 184. update01.at:29: ok +118. incr02.at:32: ok 185. update02.at:26: ok -120. listed02.at:28: ok 173. sparse05.at:21: ok +120. listed02.at:28: ok ## ------------- ## ## Test results. ## @@ -20690,17 +20726,17 @@ Making install in src make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/src' make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/src' - /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' make[3]: Nothing to be done for 'install-data-am'. + /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' /usr/bin/install -c tar '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/bin' make[3]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/src' make[2]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/src' Making install in scripts make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/scripts' make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/scripts' +make[3]: Nothing to be done for 'install-data-am'. /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' /usr/bin/mkdir -p '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' -make[3]: Nothing to be done for 'install-data-am'. /usr/bin/install -c backup.sh dump-remind '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' /usr/bin/install -c backup restore '/build/reproducible-path/tar-1.35+dfsg/debian/tmp/usr/sbin' make[3]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg/scripts' @@ -20790,17 +20826,14 @@ dh_perl dh_link dh_strip_nondeterminism - Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/tr/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/sl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo @@ -20809,26 +20842,29 @@ Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pl/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/hr/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pl/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/tr/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/sl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo dh_compress dh_fixperms dh_missing @@ -20855,12 +20891,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/3037335/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/3037335/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/652451 and its subdirectories -I: Current time: Mon Dec 23 20:20:52 -12 2024 -I: pbuilder-time-stamp: 1735028452 +I: removing directory /srv/workspace/pbuilder/3037335 and its subdirectories +I: Current time: Tue Dec 24 22:23:24 +14 2024 +I: pbuilder-time-stamp: 1735028604