Diff of the two buildlogs: -- --- b1/build.log 2024-05-30 11:23:12.259572729 +0000 +++ b2/build.log 2024-05-30 11:27:39.932160371 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Wed Jul 2 05:43:09 -12 2025 -I: pbuilder-time-stamp: 1751478189 +I: Current time: Fri May 31 01:23:15 +14 2024 +I: pbuilder-time-stamp: 1717068195 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -32,52 +32,84 @@ dpkg-source: info: applying exclude18.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/1366381/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/3335431/tmp/hooks/D01_modify_environment starting +debug: Running on ionos11-amd64. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 May 30 11:23 /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/3335431/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/3335431/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='amd64' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=42 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='amd64' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="x86_64-pc-linux-gnu") + BASH_VERSION='5.2.21(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=amd64 + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=20 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=x86_64 + HOST_ARCH=amd64 IFS=' ' - INVOCATION_ID='eb137a4e8f454fe6a830783b521b3ea2' - 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='1366381' - PS1='# ' - PS2='> ' + INVOCATION_ID=cb4881956ade4cb6811d2d001fd5a6d2 + LANG=C + LANGUAGE=et_EE:et + LC_ALL=C + MACHTYPE=x86_64-pc-linux-gnu + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnu + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=3335431 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.Pep4osCe/pbuilderrc_i5Fk --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.Pep4osCe/b1 --logfile b1/build.log tar_1.35+dfsg-3.dsc' - SUDO_GID='110' - SUDO_UID='105' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://213.165.73.152:3128' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.Pep4osCe/pbuilderrc_wB75 --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.Pep4osCe/b2 --logfile b2/build.log tar_1.35+dfsg-3.dsc' + SUDO_GID=111 + SUDO_UID=106 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://46.16.76.132:3128 I: uname -a - Linux ionos5-amd64 6.7.12+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.7.12-1~bpo12+1 (2024-05-06) x86_64 GNU/Linux + Linux i-capture-the-hostname 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux I: ls -l /bin - lrwxrwxrwx 1 root root 7 Jun 29 14:05 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/1366381/tmp/hooks/D02_print_environment finished + lrwxrwxrwx 1 root root 7 May 27 07:42 /bin -> usr/bin +I: user script /srv/workspace/pbuilder/3335431/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -168,7 +200,7 @@ Get: 37 http://deb.debian.org/debian unstable/main amd64 libpcre2-dev amd64 10.42-4+b1 [755 kB] Get: 38 http://deb.debian.org/debian unstable/main amd64 libsepol-dev amd64 3.5-2+b1 [351 kB] Get: 39 http://deb.debian.org/debian unstable/main amd64 libselinux1-dev amd64 3.5-2+b2 [158 kB] -Fetched 22.1 MB in 0s (70.4 MB/s) +Fetched 22.1 MB in 6s (3590 kB/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 ... 19716 files and directories currently installed.) @@ -340,7 +372,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_source.changes +I: user script /srv/workspace/pbuilder/3335431/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/3335431/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_source.changes dpkg-buildpackage: info: source package tar dpkg-buildpackage: info: source version 1.35+dfsg-3 dpkg-buildpackage: info: source distribution unstable @@ -379,8 +415,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 @@ -1035,7 +1071,7 @@ config.status: executing tests/atconfig commands make[1]: Leaving directory '/build/reproducible-path/tar-1.35+dfsg' dh_auto_build - make -j42 + make -j20 make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' make all-recursive make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' @@ -1173,11 +1209,13 @@ sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_SYS_CDEFS_H''@|1|g' \ ./getopt-cdefs.in.h > getopt-cdefs.h-t +/usr/bin/mkdir -p 'malloc' mv alloca.h-t alloca.h mv configmake.h-t configmake.h /usr/bin/mkdir -p 'malloc' -/usr/bin/mkdir -p 'malloc' -mv ctype.h-t ctype.h +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e '/libc_hidden_proto/d' \ + ./malloc/dynarray.h > malloc/dynarray.gl.h-t /usr/bin/mkdir -p 'malloc' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's/@''HAVE_INTTYPES_H''@/1/g' \ @@ -1208,12 +1246,7 @@ -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 getopt.h-t getopt.h -mv getopt-cdefs.h-t getopt-cdefs.h -mv error.h-t error.h -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ - -e '/libc_hidden_proto/d' \ - ./malloc/dynarray.h > malloc/dynarray.gl.h-t +mv ctype.h-t ctype.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' \ @@ -1222,13 +1255,14 @@ -e 's|__glibc_likely|_GL_LIKELY|g' \ -e 's|__glibc_unlikely|_GL_UNLIKELY|g' \ ./malloc/dynarray-skeleton.c > malloc/dynarray-skeleton.gl.h-t -mv dirent.h-t dirent.h +mv getopt-cdefs.h-t getopt-cdefs.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e '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 getopt.h-t getopt.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_LANGINFO_H''@|1|g' \ @@ -1247,7 +1281,7 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./langinfo.in.h > langinfo.h-t -mv fcntl.h-t fcntl.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' \ @@ -1255,6 +1289,7 @@ -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_LIMITS_H''@||g' \ ./limits.in.h > limits.h-t +mv malloc/dynarray.gl.h-t malloc/dynarray.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1281,7 +1316,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./locale.in.h > locale.h-t -mv malloc/dynarray.gl.h-t malloc/dynarray.gl.h /usr/bin/mkdir -p 'selinux' sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ @@ -1309,31 +1343,30 @@ -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 malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h -mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h +mv fcntl.h-t fcntl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ ./stdckdint.in.h > stdckdint.h-t +mv dirent.h-t dirent.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_SELINUX_SELINUX_H''@/1/g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ -e 's|@''PRAGMA_COLUMNS''@||g' \ - -e 's|@''NEXT_STDDEF_H''@||g' \ - -e 's|@''HAVE_MAX_ALIGN_T''@|1|g' \ - -e 's|@''HAVE_WCHAR_T''@|1|g' \ - -e 's|@''REPLACE_NULL''@|0|g' \ - ./stddef.in.h > stddef.h-t -mv langinfo.h-t langinfo.h -mv inttypes.h-t inttypes.h -mv limits.h-t limits.h + -e 's|@''NEXT_SELINUX_SELINUX_H''@||g' \ + ./se-selinux.in.h > selinux/selinux.h-t +mv malloc/dynarray-skeleton.gl.h-t malloc/dynarray-skeleton.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ - -e 's/@''HAVE_SELINUX_SELINUX_H''@/1/g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ -e 's|@''PRAGMA_COLUMNS''@||g' \ - -e 's|@''NEXT_SELINUX_SELINUX_H''@||g' \ - ./se-selinux.in.h > selinux/selinux.h-t + -e 's|@''NEXT_STDDEF_H''@||g' \ + -e 's|@''HAVE_MAX_ALIGN_T''@|1|g' \ + -e 's|@''HAVE_WCHAR_T''@|1|g' \ + -e 's|@''REPLACE_NULL''@|0|g' \ + ./stddef.in.h > stddef.h-t +mv malloc/scratch_buffer.gl.h-t malloc/scratch_buffer.gl.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1458,6 +1491,11 @@ -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 langinfo.h-t langinfo.h +mv limits.h-t limits.h +mv stdckdint.h-t stdckdint.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' \ @@ -1606,7 +1644,7 @@ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > stdlib.h-t mv locale.h-t locale.h -mv stdckdint.h-t stdckdint.h +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' \ @@ -1709,7 +1747,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > string.h-t -mv signal.h-t signal.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''HAVE_STRINGS_H''@|1|g' \ @@ -1725,7 +1762,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./strings.in.h > strings.h-t -mv selinux/selinux.h-t selinux/selinux.h /usr/bin/mkdir -p 'sys' /usr/bin/mkdir -p 'sys' /usr/bin/mkdir -p 'sys' @@ -1735,53 +1771,6 @@ -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' \ - -e 's/@''GNULIB_MKTIME''@/1/g' \ - -e 's/@''GNULIB_NANOSLEEP''@/0/g' \ - -e 's/@''GNULIB_STRFTIME''@/0/g' \ - -e 's/@''GNULIB_STRPTIME''@/0/g' \ - -e 's/@''GNULIB_TIME''@/0/g' \ - -e 's/@''GNULIB_TIMEGM''@/1/g' \ - -e 's/@''GNULIB_TIMESPEC_GET''@/0/g' \ - -e 's/@''GNULIB_TIMESPEC_GETRES''@/0/g' \ - -e 's/@''GNULIB_TIME_R''@/1/g' \ - -e 's/@''GNULIB_TIME_RZ''@/1/g' \ - -e 's/@''GNULIB_TZSET''@/1/g' \ - -e 's/@''GNULIB_MDA_TZSET''@/1/g' \ - -e 's|@''HAVE_DECL_LOCALTIME_R''@|1|g' \ - -e 's|@''HAVE_NANOSLEEP''@|1|g' \ - -e 's|@''HAVE_STRPTIME''@|1|g' \ - -e 's|@''HAVE_TIMEGM''@|1|g' \ - -e 's|@''HAVE_TIMESPEC_GET''@|1|g' \ - -e 's|@''HAVE_TIMESPEC_GETRES''@|1|g' \ - -e 's|@''HAVE_TIMEZONE_T''@|0|g' \ - -e 's|@''REPLACE_CTIME''@|GNULIB_PORTCHECK|g' \ - -e 's|@''REPLACE_GMTIME''@|0|g' \ - -e 's|@''REPLACE_LOCALTIME''@|0|g' \ - -e 's|@''REPLACE_LOCALTIME_R''@|0|g' \ - -e 's|@''REPLACE_MKTIME''@|0|g' \ - -e 's|@''REPLACE_NANOSLEEP''@|GNULIB_PORTCHECK|g' \ - -e 's|@''REPLACE_STRFTIME''@|GNULIB_PORTCHECK|g' \ - -e 's|@''REPLACE_TIME''@|0|g' \ - -e 's|@''REPLACE_TIMEGM''@|0|g' \ - -e 's|@''REPLACE_TIMESPEC_GET''@|GNULIB_PORTCHECK|g' \ - -e 's|@''REPLACE_TZSET''@|0|g' \ - -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ - -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ - -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|1|g' \ - -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ - -e 's|@''TIME_H_DEFINES_TIME_UTC''@|1|g' \ - -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ - -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ - -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ - ./time.in.h > time.h-t -sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ - -e 's|@''GUARD_PREFIX''@|GL|g' \ - -e 's|@''INCLUDE_NEXT''@|include_next|g' \ - -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ - -e 's|@''PRAGMA_COLUMNS''@||g' \ -e 's|@''NEXT_SYS_RANDOM_H''@||g' \ -e 's|@''HAVE_SYS_RANDOM_H''@|1|g' \ -e 's/@''GNULIB_GETRANDOM''@/1/g' \ @@ -1865,7 +1854,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./sys_time.in.h > sys/time.h-t -mv strings.h-t strings.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ @@ -1877,6 +1865,53 @@ ./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' \ + -e 's/@''GNULIB_MKTIME''@/1/g' \ + -e 's/@''GNULIB_NANOSLEEP''@/0/g' \ + -e 's/@''GNULIB_STRFTIME''@/0/g' \ + -e 's/@''GNULIB_STRPTIME''@/0/g' \ + -e 's/@''GNULIB_TIME''@/0/g' \ + -e 's/@''GNULIB_TIMEGM''@/1/g' \ + -e 's/@''GNULIB_TIMESPEC_GET''@/0/g' \ + -e 's/@''GNULIB_TIMESPEC_GETRES''@/0/g' \ + -e 's/@''GNULIB_TIME_R''@/1/g' \ + -e 's/@''GNULIB_TIME_RZ''@/1/g' \ + -e 's/@''GNULIB_TZSET''@/1/g' \ + -e 's/@''GNULIB_MDA_TZSET''@/1/g' \ + -e 's|@''HAVE_DECL_LOCALTIME_R''@|1|g' \ + -e 's|@''HAVE_NANOSLEEP''@|1|g' \ + -e 's|@''HAVE_STRPTIME''@|1|g' \ + -e 's|@''HAVE_TIMEGM''@|1|g' \ + -e 's|@''HAVE_TIMESPEC_GET''@|1|g' \ + -e 's|@''HAVE_TIMESPEC_GETRES''@|1|g' \ + -e 's|@''HAVE_TIMEZONE_T''@|0|g' \ + -e 's|@''REPLACE_CTIME''@|GNULIB_PORTCHECK|g' \ + -e 's|@''REPLACE_GMTIME''@|0|g' \ + -e 's|@''REPLACE_LOCALTIME''@|0|g' \ + -e 's|@''REPLACE_LOCALTIME_R''@|0|g' \ + -e 's|@''REPLACE_MKTIME''@|0|g' \ + -e 's|@''REPLACE_NANOSLEEP''@|GNULIB_PORTCHECK|g' \ + -e 's|@''REPLACE_STRFTIME''@|GNULIB_PORTCHECK|g' \ + -e 's|@''REPLACE_TIME''@|0|g' \ + -e 's|@''REPLACE_TIMEGM''@|0|g' \ + -e 's|@''REPLACE_TIMESPEC_GET''@|GNULIB_PORTCHECK|g' \ + -e 's|@''REPLACE_TZSET''@|0|g' \ + -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ + -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ + -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|1|g' \ + -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|0|g' \ + -e 's|@''TIME_H_DEFINES_TIME_UTC''@|1|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ + -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ + -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ + ./time.in.h > time.h-t +sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_UCHAR_H''@/1/g' \ -e 's|@''INCLUDE_NEXT''@|include_next|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \ @@ -2063,7 +2098,6 @@ -e 's/@''GNULIB_UNICTYPE_PROPERTY_IGNORABLE_CONTROL_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ -e 's/@''GNULIB_UNICTYPE_PROPERTY_REGIONAL_INDICATOR_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ > unictype.h-t -mv sys/random.h-t sys/random.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''HAVE_UNISTRING_WOE32DLL_H''@|0|g' \ -e 's/@''GNULIB_UNINORM_NFD_DLL_VARIABLE''@/LIBUNISTRING_DLL_VARIABLE/g' \ @@ -2269,7 +2303,17 @@ -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 strings.h-t strings.h +mv sys/random.h-t sys/random.h mv sys/types.h-t sys/types.h +mv stdio.h-t stdio.h +mv sys/stat.h-t sys/stat.h +mv sys/time.h-t sys/time.h +mv time.h-t time.h +mv uchar.h-t uchar.h +mv unicase.h-t unicase.h +mv uninorm.h-t uninorm.h +mv unitypes.h-t unitypes.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 'w uniwidth.h-t' ./uniwidth.in.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ @@ -2286,7 +2330,6 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./utime.in.h > utime.h-t -mv 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' \ @@ -2410,6 +2453,8 @@ -e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ > wchar.h-t +mv string.h-t string.h +mv uniwidth.h-t uniwidth.h sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \ -e 's|@''GUARD_PREFIX''@|GL|g' \ -e 's/@''HAVE_WCTYPE_H''@/1/g' \ @@ -2439,19 +2484,10 @@ -e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \ -e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \ ./wctype.in.h > wctype.h-t -mv unitypes.h-t unitypes.h -mv time.h-t time.h -mv unicase.h-t unicase.h -mv uninorm.h-t uninorm.h -mv uniwidth.h-t uniwidth.h mv utime.h-t utime.h -mv sys/stat.h-t sys/stat.h -mv uchar.h-t uchar.h -mv string.h-t string.h -mv stdio.h-t stdio.h mv wctype.h-t wctype.h -mv wchar.h-t wchar.h mv stdlib.h-t stdlib.h +mv wchar.h-t wchar.h mv unistd.h-t unistd.h mv unictype.h-t unictype.h make all-recursive @@ -2705,7 +2741,7 @@ make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' cp tests/testsuite debian/testsuite.orig dh_auto_test - make -j42 check "TESTSUITEFLAGS=-j42 --verbose" VERBOSE=1 + make -j20 check "TESTSUITEFLAGS=-j20 --verbose" VERBOSE=1 make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' Making check in doc make[3]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/doc' @@ -2757,9 +2793,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 -j42 --verbose +/bin/sh ./testsuite -j20 --verbose ## ------------------------ ## ## GNU tar 1.35 test suite. ## ## ------------------------ ## @@ -2778,16 +2814,19 @@ - 1. version.at:19: testing tar version ... ./version.at:21: tar --version | sed 1q -4. options02.at:26: testing interspersed options ... -./options02.at:29: + + +3. options.at:24: testing mixing options ... +./options.at:27: echo > file1 -tar c file1 -f archive +TAR_OPTIONS=--numeric-owner tar chof archive file1 tar tf archive + + 2. pipe.at:29: testing decompressing from stdin ... ./pipe.at:33: mkdir v7 @@ -2812,13 +2851,20 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) +8. opcomp03.at:21: testing --verify compatibility ... +./opcomp03.at:24: +tar -tWf test.tar . -3. options.at:24: testing mixing options ... -./options.at:27: +4. options02.at:26: testing interspersed options ... +./options02.at:29: echo > file1 -TAR_OPTIONS=--numeric-owner tar chof archive file1 +tar c file1 -f archive tar tf archive +6. opcomp01.at:21: testing occurrence compatibility ... +./opcomp01.at:24: +tar --occurrence=1 -cf test.tar . + 5. options03.at:21: testing TAR_OPTIONS with string arguments ... ./options03.at:31: echo dir/bar > exclude.list @@ -2828,41 +2874,46 @@ TAR_OPTIONS=--exclude-from=exclude.list tar cf arc.tar dir tar tf arc.tar +10. opcomp05.at:21: testing --pax-option compatibility ... +./opcomp05.at:24: +tar -Hgnu -cf test.tar --pax-option user:=root . -6. opcomp01.at:21: testing occurrence compatibility ... -./opcomp01.at:24: -tar --occurrence=1 -cf test.tar . - - - -9. opcomp04.at:21: testing compress option compatibility ... -./opcomp04.at:24: +7. opcomp02.at:21: testing occurrence compatibility ... +./opcomp02.at:24: +tar --occurrence=1 -tf test.tar -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +19. testsuite.at:244: testing compress: xz ... +./testsuite.at:244: -genfile --file file -tar czf test.tar file -genfile --file newfile -tar rzf test.tar newfile +cat /dev/null | xz - > /dev/null 2>&1 || exit 77 +unset TAR_OPTIONS -7. opcomp02.at:21: testing occurrence compatibility ... -./opcomp02.at:24: -tar --occurrence=1 -tf test.tar +touch empty +set -e +: create with --xz +tar --xz -cf k.tar.xz empty +tar tf k.tar.xz -8. opcomp03.at:21: testing --verify compatibility ... -./opcomp03.at:24: -tar -tWf test.tar . +echo testing .xz +tar -acf k2.tar.xz empty +cat k2.tar.xz | xz -d > k.xz.tar +tar tf k.xz.tar -10. opcomp05.at:21: testing --pax-option compatibility ... -./opcomp05.at:24: -tar -Hgnu -cf test.tar --pax-option user:=root . +echo testing .txz +tar -acf k2.tar.txz empty +cat k2.tar.txz | xz -d > k.txz.tar +tar tf k.txz.tar +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.xz +test -f empty -13. interval.at:16: testing checkpoint interval ... -./interval.at:18: +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 @@ -2872,7 +2923,7 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=2 -c -f ../a.tar . +tar --checkpoint=.2 -c -f ../a.tar . 11. opcomp06.at:21: testing --pax-option compatibility ... @@ -2904,11 +2955,9 @@ genfile --file file tar -cf test.tar --acls -Hgnu file - - - -15. dot-compat.at:16: testing dot action (compatibility syntax) ... -./dot-compat.at:18: +8. opcomp03.at:21: ok +13. interval.at:16: testing checkpoint interval ... +./interval.at:18: mkdir t cd t for i in 0 1 2 3 4 5 6 7 8 9 @@ -2918,8 +2967,38 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint=.2 -c -f ../a.tar . +tar --checkpoint=2 -c -f ../a.tar . + + +18. testsuite.at:243: testing compress: bzip2 ... +./testsuite.at:243: + +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 + +unset TAR_OPTIONS + +touch empty +set -e +: create with --bzip2 +tar --bzip2 -cf k.tar.bz2 empty +tar tf k.tar.bz2 + + +echo testing .bz2 +tar -acf k2.tar.bz2 empty +cat k2.tar.bz2 | bzip2 -d > k.bz2.tar +tar tf k.bz2.tar + +echo testing .tbz2 +tar -acf k2.tar.tbz2 empty +cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar +tar tf k.tbz2.tar + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.bz2 +test -f empty 12. defaults.at:16: testing checkpoint defaults ... ./defaults.at:18: @@ -2935,8 +3014,8 @@ tar --checkpoint -c -f ../a.tar . -14. dot.at:16: testing dot action ... -./dot.at:18: +3. options.at:24: 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 @@ -2946,12 +3025,45 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint-action=dot -c -f ../a.tar . +tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . -6. opcomp01.at:21: ok -16. dot-int.at:16: testing dot action and interval ... -./dot-int.at:18: + ok +10. opcomp05.at:21: ok +20. testsuite.at:246: testing compress: lzip ... +./testsuite.at:246: + +cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 + +unset TAR_OPTIONS + +touch empty +set -e +: create with --lzip +tar --lzip -cf k.tar.lz empty +tar tf k.tar.lz + + +echo testing .lz +tar -acf k2.tar.lz empty +cat k2.tar.lz | lzip -d > k.lz.tar +tar tf k.lz.tar + + +# Extraction: ensure compressed format is correctly recognized +rm -f empty +tar xf k.tar.lz +test -f empty + +--- - 2024-05-30 11:25:58.394806055 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2024-05-30 11:25:58.387225720 +0000 +@@ -1,3 +1 @@ +-tar: --acls can be used only on POSIX archives +-Try 'tar --help' or 'tar --usage' for more information. + +1. version.at:19: ok +14. dot.at:16: testing dot action ... +./dot.at:18: mkdir t cd t for i in 0 1 2 3 4 5 6 7 8 9 @@ -2961,12 +3073,28 @@ TAR_OPTIONS=-Hgnu export TAR_OPTIONS -tar --checkpoint-action=dot --checkpoint=2 -c -f ../a.tar . +tar --checkpoint-action=dot -c -f ../a.tar . +9. opcomp04.at:21: testing compress option compatibility ... +./opcomp04.at:24: -7. opcomp02.at:21: ok -17. testsuite.at:242: testing compress: gzip ... +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 + +genfile --file file +tar czf test.tar file +genfile --file newfile +tar rzf test.tar newfile + +--- - 2024-05-30 11:25:58.400571984 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2024-05-30 11:25:58.395225435 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lz +-empty + +4. options02.at:26: ok +11. opcomp06.at:21: 17. testsuite.at:242: testing compress: gzip ... ./testsuite.at:242: cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 @@ -2996,96 +3124,18 @@ tar xf k.tar.gz test -f empty +6. opcomp01.at:21: 20. testsuite.at:246: skipped (opcomp06.at:24) + ok + skipped (testsuite.at:246) +7. opcomp02.at:21: ok +5. options03.at:21: + ok -18. testsuite.at:243: testing compress: bzip2 ... -./testsuite.at:243: - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --bzip2 -tar --bzip2 -cf k.tar.bz2 empty -tar tf k.tar.bz2 - - -echo testing .bz2 -tar -acf k2.tar.bz2 empty -cat k2.tar.bz2 | bzip2 -d > k.bz2.tar -tar tf k.bz2.tar - -echo testing .tbz2 -tar -acf k2.tar.tbz2 empty -cat k2.tar.tbz2 | bzip2 -d > k.tbz2.tar -tar tf k.tbz2.tar - - -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.bz2 -test -f empty - -19. testsuite.at:244: testing compress: xz ... -./testsuite.at:244: - -cat /dev/null | xz - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --xz -tar --xz -cf k.tar.xz empty -tar tf k.tar.xz - - -echo testing .xz -tar -acf k2.tar.xz empty -cat k2.tar.xz | xz -d > k.xz.tar -tar tf k.xz.tar - -echo testing .txz -tar -acf k2.tar.txz empty -cat k2.tar.txz | xz -d > k.txz.tar -tar tf k.txz.tar - - -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.xz -test -f empty - -8. opcomp03.at:21: 20. testsuite.at:246: testing compress: lzip ... -./testsuite.at:246: - -cat /dev/null | lzip - > /dev/null 2>&1 || exit 77 - -unset TAR_OPTIONS - -touch empty -set -e -: create with --lzip -tar --lzip -cf k.tar.lz empty -tar tf k.tar.lz -echo testing .lz -tar -acf k2.tar.lz empty -cat k2.tar.lz | lzip -d > k.lz.tar -tar tf k.lz.tar -# Extraction: ensure compressed format is correctly recognized -rm -f empty -tar xf k.tar.lz -test -f empty - ok -1. version.at:19: ok -3. options.at:24: - ok 21. testsuite.at:247: testing compress: lzop ... ./testsuite.at:247: @@ -3111,14 +3161,39 @@ tar xf k.tar.lzo test -f empty -4. options02.at:26: --- - 2025-07-02 17:45:25.614404497 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/11/stderr 2025-07-02 17:45:25.605777485 +0000 -@@ -1,3 +1 @@ --tar: --acls can be used only on POSIX archives --Try 'tar --help' or 'tar --usage' for more information. - - ok -10. opcomp05.at:21: ok +23. positional01.at:21: testing Exclude ... +./positional01.at:24: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -cf a.tar --exclude '*.b' dir +echo $? +tar -tf a.tar | sort +tar -cf a.tar dir --exclude '*.b' +echo $? +tar -tf a.tar | sort + +9. opcomp04.at:21: ok + +24. positional02.at:21: testing Directory ... +./positional02.at:24: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +> dir/A.a +> dir/B.a +> dir/A.b +tar -cf a.tar -C dir . +echo $? +tar -tf a.tar | sort +tar -cf a.tar . -C dir + + 22. testsuite.at:248: testing compress: zstd ... ./testsuite.at:248: @@ -3149,40 +3224,53 @@ tar xf k.tar.zst test -f empty +--- - 2024-05-30 11:25:58.436638416 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2024-05-30 11:25:58.427224295 +0000 +@@ -1,4 +1 @@ +-empty +-testing .lzo +-empty + +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 -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 - +cat >F2 <<'_ATEOF' +file3 +file4 +_ATEOF -23. positional01.at:21: testing Exclude ... -./positional01.at:24: +tar cf archive -T F1 -T F2 +tar tf archive +) +25. positional03.at:21: testing Several options ... +./positional03.at:24: test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir t +cd t mkdir dir > dir/A.a > dir/B.a > dir/A.b -tar -cf a.tar --exclude '*.b' dir -echo $? -tar -tf a.tar | sort -tar -cf a.tar dir --exclude '*.b' -echo $? -tar -tf a.tar | sort +tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort -11. opcomp06.at:21: 26. add-file.at:21: testing The --add-file option ... ./add-file.at:33: mkdir v7 @@ -3214,49 +3302,22 @@ echo 3: tar -cvf arc.tar -T input ) ---- - 2025-07-02 17:45:25.618501322 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/20/stdout 2025-07-02 17:45:25.609777485 +0000 -@@ -1,4 +1 @@ --empty --testing .lz +21. testsuite.at:247: +13. interval.at:16: ok +15. dot-compat.at:16: ok +12. defaults.at:16: --- - 2024-05-30 11:25:58.439493410 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2024-05-30 11:25:58.431224153 +0000 +@@ -1,6 +1 @@ -empty - - ---- - 2025-07-02 17:45:25.619747020 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/21/stdout 2025-07-02 17:45:25.613777485 +0000 -@@ -1,4 +1 @@ +-testing .zst -empty --testing .lzo +-testing .tzst -empty -29. T-rec.at:21: testing recursive file lists ... -./T-rec.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - ->file1 ->file2 -cat >F1 <<'_ATEOF' -file1 --T F2 -_ATEOF - -cat >F2 <<'_ATEOF' -file2 --T F1 -_ATEOF - -tar cf archive -T F1 -echo $? -tar tf archive -) -27. T-mult.at:21: testing multiple file lists ... -./T-mult.at:24: + ok + skipped (testsuite.at:247) +28. T-nest.at:21: testing nested file lists ... +./T-nest.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3271,6 +3332,7 @@ >file4 cat >F1 <<'_ATEOF' file1 +-T F2 file2 _ATEOF @@ -3279,14 +3341,11 @@ file4 _ATEOF -tar cf archive -T F1 -T F2 +tar cf archive -T F1 tar tf archive ) - -5. options03.at:21: ok - skipped (opcomp06.at:24) -28. T-nest.at:21: testing nested file lists ... -./T-nest.at:24: +22. testsuite.at:248: 29. T-rec.at:21: testing recursive file lists ... +./T-rec.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3297,111 +3356,49 @@ >file1 >file2 ->file3 ->file4 cat >F1 <<'_ATEOF' file1 -T F2 -file2 _ATEOF cat >F2 <<'_ATEOF' -file3 -file4 +file2 +-T F1 _ATEOF tar cf archive -T F1 +echo $? tar tf archive ) -20. testsuite.at:246: - - -21. testsuite.at:247: ---- - 2025-07-02 17:45:25.623895416 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/22/stdout 2025-07-02 17:45:25.613777485 +0000 -@@ -1,6 +1 @@ --empty --testing .zst --empty --testing .tzst --empty - - - skipped (testsuite.at:246) -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 ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -echo jeden > temp -echo dwa >> temp -echo trzy >> temp -cat temp | tr '\n' '\0' > file-list - -genfile -f jeden -genfile -f dwa -genfile -f trzy - -tar cfTv archive file-list -) -32. T-cd.at:21: testing -C in file lists ... -./T-cd.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./pipe.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 ->file1 -mkdir dir ->dir/file2 ->dir/file3 -cat >F1 <<'_ATEOF' -file1 --C dir -. -_ATEOF - -tar cf archive -T F1 -tar tf archive | sort -) - -22. testsuite.at:248: -33. T-empty.at:26: testing empty entries ... -./T-empty.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file jeden -genfile --file dwa -genfile --file trzy +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) +16. dot-int.at:16: ok + skipped (testsuite.at:248) -tar cfvT archive ../file-list -) -9. opcomp04.at:21: ok -31. T-recurse.at:66: testing toggle --recursion (not) from -T ... -./T-recurse.at:69: +30. T-recurse.at:27: testing files-from & recurse: toggle ... +./T-recurse.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3416,21 +3413,35 @@ cat >F1 <<'_ATEOF' --no-recursion directory1/ +--recursion +directory2/ +_ATEOF + + +cat >F2A <<'_ATEOF' +directory1/ _ATEOF -cat >F2 <<'_ATEOF' +cat >F2B <<'_ATEOF' directory2/ _ATEOF -tar cf archive -T F1 --recursion -T F2 -tar tf archive +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" ) -30. T-recurse.at:27: testing files-from & recurse: toggle ... -./T-recurse.at:30: +14. dot.at:16: ok + + +31. T-recurse.at:66: testing toggle --recursion (not) from -T ... +./T-recurse.at:69: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3445,43 +3456,45 @@ cat >F1 <<'_ATEOF' --no-recursion directory1/ ---recursion -directory2/ -_ATEOF - - -cat >F2A <<'_ATEOF' -directory1/ _ATEOF -cat >F2B <<'_ATEOF' +cat >F2 <<'_ATEOF' directory2/ _ATEOF -a=archive -tar cf "$a" --files-from F1 -tar tf "$a" +tar cf archive -T F1 --recursion -T F2 +tar tf archive -a=archive2 -tar cf "$a" --no-recursion -T F2A --recursion -T F2B -tar tf "$a" ) - skipped (testsuite.at:247) -25. positional03.at:21: testing Several options ... -./positional03.at:24: +32. T-cd.at:21: testing -C in file lists ... +./T-cd.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir t -cd t +>file1 mkdir dir -> dir/A.a -> dir/B.a -> dir/A.b -tar -vcf ../a.tar --exclude '*.b' . -C dir --exclude '*.c' | sort +>dir/file2 +>dir/file3 +cat >F1 <<'_ATEOF' +file1 +-C dir +. +_ATEOF + +tar cf archive -T F1 +tar tf archive | sort +) 35. T-null2.at:17: testing --null enables verbatim reading ... ./T-null2.at:24: @@ -3508,10 +3521,9 @@ cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T - ) - - -36. T-zfile.at:26: testing empty file ... -./T-zfile.at:29: +27. T-mult.at:21: ok +33. T-empty.at:26: testing empty entries ... +./T-empty.at:36: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -3520,65 +3532,41 @@ export TAR_OPTIONS rm -rf * -genfile --length=0 --file empty -genfile --file a -genfile --file b -cat >valid <<'_ATEOF' -a -b -_ATEOF +genfile --file jeden +genfile --file dwa +genfile --file trzy -tar cf archive -T empty -T valid -tar tf archive -echo "==" -tar cf archive -T valid -T empty -tar tf archive +tar cfvT archive ../file-list ) +25. positional03.at:21: ok -39. T-dir01.at:28: testing trailing slash in --files-from ... -./T-dir01.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +24. positional02.at:21: ok +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 * 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 -) - skipped (testsuite.at:248) -40. indexfile.at:26: testing tar --index-file=FILE --file=- ... -./indexfile.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir directory -genfile --file=directory/a --length=1035 +echo jeden > temp +echo dwa >> temp +echo trzy >> temp +cat temp | tr '\n' '\0' > file-list -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +genfile -f jeden +genfile -f dwa +genfile -f trzy -echo "Testing the archive" -tar -tf archive +tar cfTv archive file-list ) - 37. T-nonl.at:27: testing entries with missing newlines ... ./T-nonl.at:30: mkdir ustar @@ -3605,6 +3593,64 @@ tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl tar tf archive ) +23. positional01.at:21: 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 + + +tar cf archive -T empty -T valid +tar tf archive +echo "==" +tar cf archive -T valid -T empty +tar tf archive +) +./add-file.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file -File +genfile --file foo +genfile --file bar + +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File + +echo 2: +tar -cvf arc.tar foo --add-file -File bar + + +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input +) + ok +29. T-rec.at:21: ok +19. testsuite.at:244: ok 38. T-dir00.at:28: testing recursive extraction from --files-from ... ./T-dir00.at:30: mkdir v7 @@ -3626,89 +3672,80 @@ echo dir > list tar xfTv archive list | sort ) -41. verbose.at:26: testing tar cvf - ... -./verbose.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -47. same-order01.at:26: testing working -C with --same-order ... -./same-order01.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + +17. testsuite.at:242: ok +28. T-nest.at:21: ok +./T-recurse.at:69: +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 directory1 directory2 +touch directory1/file directory2/file -test -z "`sort < /dev/null 2>&1`" || exit 77 +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +_ATEOF -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -ls directory|sort +tar cf archive -T F1 --recursion -T F2 +tar tf archive + ) -46. numeric.at:18: testing --numeric-owner basic tests ... -./numeric.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./T-recurse.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 * -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 - -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file +mkdir directory1 directory2 +touch directory1/file directory2/file +cat >F1 <<'_ATEOF' +--no-recursion +directory1/ +--recursion +directory2/ +_ATEOF -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +cat >F2A <<'_ATEOF' +directory1/ +_ATEOF -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +cat >F2B <<'_ATEOF' +directory2/ +_ATEOF -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +a=archive +tar cf "$a" --files-from F1 +tar tf "$a" +a=archive2 +tar cf "$a" --no-recursion -T F2A --recursion -T F2B +tar tf "$a" +) -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -) -44. recurs02.at:30: testing recurse: toggle ... -./recurs02.at:33: +33. T-empty.at:26: ok +40. indexfile.at:26: testing tar --index-file=FILE --file=- ... +./indexfile.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3717,22 +3754,18 @@ 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 -) -27. T-mult.at:21: ok +mkdir directory +genfile --file=directory/a --length=1035 -45. shortrec.at:25: testing short records ... -./shortrec.at:28: +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive + +echo "Testing the archive" +tar -tf archive +) +39. T-dir01.at:28: testing trailing slash in --files-from ... +./T-dir01.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3741,47 +3774,43 @@ export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null -rm -r directory +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort ) -43. recurse.at:21: testing recurse ... -./recurse.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +18. testsuite.at:243: ok + +./pipe.at:33: +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 + + mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -) -49. append.at:21: testing append ... -./append.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) +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) -13. interval.at:16: 24. positional02.at:21: ok - ok 42. gzip.at:23: testing gzip ... ./gzip.at:28: @@ -3792,8 +3821,10 @@ sed -n '/^tar:/p' err >&2 exit $RC -48. same-order02.at:25: testing multiple -C options ... -./same-order02.at:28: + + +41. verbose.at:26: testing tar cvf - ... +./verbose.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3802,24 +3833,15 @@ export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 - -mkdir en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 - -ls en -echo separator -ls to +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) -51. append02.at:54: testing append vs. create ... -./append02.at:57: +32. T-cd.at:21: ok +43. recurse.at:21: testing recurse ... +./recurse.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3828,77 +3850,85 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +35. T-null2.at:17: ok +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 * -echo Comparing archives -cmp archive.1 archive.2 +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 ) -./pipe.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./add-file.at:33: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +genfile --file -File +genfile --file foo +genfile --file bar + +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -test -z "`sort < /dev/null 2>&1`" || exit 77 +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) -14. dot.at:16: ok -16. dot-int.at:16: - ok -50. append01.at:29: testing appending files with long names ... -./append01.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +cat >input <<'_ATEOF' +foo +--add-file=-File +bar +_ATEOF + + +echo 3: +tar -cvf arc.tar -T input +) + +45. shortrec.at:25: testing short records ... +./shortrec.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir 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 +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 ) -29. T-rec.at:21: ok -28. T-nest.at:21: ok -33. T-empty.at:26: 23. positional01.at:21: ok - ok -12. defaults.at:16: ok -./indexfile.at:29: +./T-dir00.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -3908,67 +3938,60 @@ rm -rf * -mkdir directory -genfile --file=directory/a --length=1035 - -echo "Creating the archive" -tar -c -v -f - --index-file=idx directory > archive +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Testing the archive" -tar -tf archive +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 ) -52. append03.at:21: testing append with name transformation ... -./append03.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +46. numeric.at:18: testing --numeric-owner basic tests ... +./numeric.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --file file.1 -genfile --file file.2 +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive -) -54. append05.at:32: testing append after changed blocking ... -./append05.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file -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 --create +tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -decho '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 --list +tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --diff +tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --extract +tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -decho 'resulting archive' -tar tf archive ) -15. dot-compat.at:16: 53. append04.at:29: testing append with verify ... -./append04.at:32: +47. same-order01.at:26: testing working -C with --same-order ... +./same-order01.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -3977,26 +4000,20 @@ export TAR_OPTIONS rm -rf * -# Create two empty files: -touch file1 file2 -# Create an archive: -tar cpfW archive.tar file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 -# Append it to the already created archive: -tar rpfW archive.tar file3 +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -# Verify content of the new archive: -tar -tf archive.tar -) +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -./add-file.at:33: +ls directory|sort +) +./indexfile.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4005,33 +4022,24 @@ 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 +mkdir directory +genfile --file=directory/a --length=1035 +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -echo 3: -tar -cvf arc.tar -T input +echo "Testing the archive" +tar -tf archive ) +34. T-null.at:21: ok +37. T-nonl.at:27: ok ./T-recurse.at:69: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -4053,9 +4061,8 @@ tar tf archive ) - ok - -./verbose.at:29: +36. T-zfile.at:26: ok +./recurse.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4064,16 +4071,13 @@ export TAR_OPTIONS rm -rf * -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 tar tf archive ) -34. T-null.at:21: ok - -55. xform-h.at:30: testing transforming hard links on create ... -./xform-h.at:39: +48. same-order02.at:25: testing multiple -C options ... +./same-order02.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4082,39 +4086,30 @@ 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' +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 +mkdir en +mkdir to -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' +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 ) -25. positional03.at:21: ok -32. T-cd.at:21: - ok - - ./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 * @@ -4147,8 +4142,8 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) - -./recurse.at:24: +42. gzip.at:23: ok +./T-dir01.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4157,12 +4152,19 @@ 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 ) -./recurs02.at:33: + +./verbose.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4171,33 +4173,62 @@ 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 ) -17. testsuite.at:242: 56. xform01.at:26: testing transformations and GNU volume labels ... -./xform01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./add-file.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -genfile --file file -tar -cf archive.tar -V /label/ file -tar tf archive.tar +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 ) -57. xform02.at:21: testing transforming escaped delimiters on create ... -./xform02.at:24: +./shortrec.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +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 +) +49. append.at:21: testing append ... +./append.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4205,18 +4236,19 @@ TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) +50. append01.at:29: testing appending files with long names ... ./append01.at:34: -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 * @@ -4226,9 +4258,8 @@ 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 -35. T-null2.at:17: ./append02.at:57: +./recurs02.at:33: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4237,6 +4268,27 @@ 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 +) +51. append02.at:54: testing append vs. create ... +./append02.at:57: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + genfile --file file1 genfile --file file2 @@ -4260,29 +4312,43 @@ echo Comparing archives cmp archive.1 archive.2 ) - ok -36. T-zfile.at:26: ./same-order01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./recurse.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive +) +./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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 - -ls directory|sort -) +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 13 --file directory/file2 +tar cf archive directory +mv directory orig +cat archive | tar xfv - --warning=no-timestamp | sort +echo "separator" +cmp orig/file1 directory/file1 +echo "separator" +cmp orig/file2 directory/file2) ./indexfile.at:29: mkdir ustar (cd ustar @@ -4302,92 +4368,8 @@ echo "Testing the archive" tar -tf archive ) - ok -59. exclude.at:23: testing exclude ... -./exclude.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 - - -mkdir dir -echo blues > dir/blues -echo jazz > dir/jazz -mkdir dir/folk -echo tagfile > dir/folk/tagfile -echo sanjuan > dir/folk/sanjuan -mkdir dir/rock -echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG -echo "test" > dir/rock/file - -for option in exclude-caches exclude-caches-under exclude-caches-all -do - echo OPTION $option - tar -cf archive.tar --$option -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done - -for option in exclude-tag exclude-tag-under exclude-tag-all -do - echo OPTION $option - tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort - cat err - echo ARCHIVE - tar tf archive.tar | sort -done -) -42. gzip.at:23: ok -58. xform03.at:21: testing transforming hard link targets ... -./xform03.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) - -37. T-nonl.at:27: ./shortrec.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -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 -) - ok - -61. exclude02.at:19: testing exclude: anchoring ... -./exclude02.at:22: +52. append03.at:21: testing append with name transformation ... +./append03.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4396,61 +4378,18 @@ export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -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 - +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive ) -./append.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -64. exclude05.at:21: testing exclude: lots of excludes ... -./exclude05.at:24: +53. append04.at:29: testing append with verify ... +./append04.at:32: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -4459,84 +4398,50 @@ export TAR_OPTIONS rm -rf * +# Create two empty files: +touch file1 file2 -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 +# Create an archive: +tar cpfW archive.tar file1 file2 -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 -rm -rf testdir exclfile +# Append it to the already created archive: +tar rpfW archive.tar file3 +# Verify content of the new archive: +tar -tf archive.tar ) - -62. exclude03.at:19: testing exclude: wildcards match slash ... -./exclude03.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./T-dir00.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 - -rm -rf testdir -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 +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) ./T-recurse.at:69: -mkdir 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 * @@ -4558,156 +4463,6 @@ tar tf archive ) -60. exclude01.at:19: testing exclude wildcards ... -./exclude01.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 -touch testdir/dir1/file1 -touch testdir/dir1/\* -touch testdir/dir2/file2 -touch testdir/dir2/\* -touch testdir/dir3/file3 -touch testdir/dir3/\* - -tar cf archive --exclude=testdir/dir1/\* \ - --no-wildcards \ - --exclude=testdir/dir2/\* \ - --wildcards \ - --exclude=testdir/dir3/\* \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir/dir1 -tar t --no-wildcards "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort - -rm -rf testdir -) -./verbose.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file file --length 10240 -echo Creating the archive -tar cvf - file > archive -echo Testing the archive -tar tf archive -) -./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 -) -65. exclude06.at:26: testing exclude: long files in pax archives ... -./exclude06.at:31: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - - -install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt -genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c - -tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen -mkdir out -tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp -find out -type f -) -63. exclude04.at:19: testing exclude: case insensitive ... -./exclude04.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -touch testdir/file2 -touch testdir/file3 -touch testdir/file4 -touch testdir/dir/File1 -touch testdir/dir/File2 -touch testdir/dir/File3 -touch testdir/dir/File4 - -tar cf archive --exclude=FILE2 \ - --exclude=file1 \ - --ignore-case \ - --exclude=file3 \ - --no-ignore-case \ - --exclude=FILE2 \ - --exclude=file4 \ - testdir -tar tf archive | sort - -echo "SUB 1" -tar cf archive testdir -tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort - -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort - -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort - -rm -rf testdir - -) -19. testsuite.at:244: ok -18. testsuite.at:243: ./same-order02.at:28: mkdir oldgnu (cd oldgnu @@ -4733,7 +4488,7 @@ echo separator ls to ) -./T-dir01.at:30: +./same-order01.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4745,59 +4500,38 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort -) - ok -66. exclude07.at:19: testing exclude: --exclude-backups option ... -./exclude07.at:22: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -mkdir dir -genfile --file dir/file -genfile --file dir/file~ -genfile --file "dir/.#file" -genfile --file "dir/#file#" +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -tar -v -c -f archive --exclude-backups dir +ls directory|sort ) -./append03.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./verbose.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --file file.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 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive tar tf archive ) - +54. append05.at:32: testing append after changed blocking ... ./append05.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -4822,7 +4556,7 @@ decho 'resulting archive' tar tf archive ) -./xform02.at:24: +./append.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -4830,16 +4564,12 @@ TAR_OPTIONS="-H oldgnu" 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 - -68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... -./exclude09.at:40: +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./add-file.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -4848,108 +4578,34 @@ export TAR_OPTIONS rm -rf * +genfile --file -File +genfile --file foo +genfile --file bar -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo 1: +tar -cvf arc.tar --add-file foo --add-file -File -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort -) -67. exclude08.at:36: testing --exclude-tag option ... -./exclude08.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +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 -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort -) -./recurse.at:24: -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 --create --file archive --no-recursion directory || exit 1 -tar tf archive +echo 3: +tar -cvf arc.tar -T input ) -./append01.at:34: +./T-recurse.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS -69. exclude10.at:38: testing --exclude-tag option in incremental pass ... -./exclude10.at:41: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort -) -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 -) -./recurs02.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -) -./T-recurse.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS rm -rf * mkdir directory1 directory2 @@ -4981,7 +4637,7 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) -./add-file.at:33: +./shortrec.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -4990,58 +4646,49 @@ 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 - +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 -echo 3: -tar -cvf arc.tar -T input +rm -r directory ) -./xform-h.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./indexfile.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir 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' +mkdir directory +genfile --file=directory/a --length=1035 +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > 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' +echo "Testing the archive" +tar -tf archive +) +./recurse.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... -./exclude12.at:40: +./T-recurse.at:69: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5050,13 +4697,25 @@ 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 + + +cat >F2 <<'_ATEOF' +directory2/ +_ATEOF + + +tar cf archive -T F1 --recursion -T F2 +tar tf archive -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort ) -./append04.at:32: +./append02.at:57: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -5065,92 +4724,88 @@ export TAR_OPTIONS rm -rf * -# Create two empty files: -touch file1 file2 +genfile --file file1 +genfile --file file2 -# Create an archive: -tar cpfW archive.tar file1 file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 +# 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 -# Append it to the already created archive: -tar rpfW archive.tar file3 +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 -# Verify content of the new archive: -tar -tf archive.tar -) +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 -70. exclude11.at:36: testing --exclude-tag-under option ... -./exclude11.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +echo Comparing archives +cmp archive.1 archive.2 +) +./append03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive ) - -./indexfile.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./append01.at:34: +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 +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 ) - -72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... -./exclude13.at:42: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./recurs02.at:33: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -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 +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 ) ./pipe.at:33: -mkdir 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 * @@ -5168,23 +4823,7 @@ cmp orig/file1 directory/file1 echo "separator" cmp orig/file2 directory/file2) -73. exclude14.at:36: testing --exclude-tag-all option ... -./exclude14.at:39: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) -./append.at:24: +./T-dir01.at:30: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5192,37 +4831,17 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -touch file1 - touch file2 - tar cf archive file1 - tar rf archive file2 - tar tf archive) -./T-recurse.at:69: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF - - -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF -tar cf archive -T F1 --recursion -T F2 -tar tf archive +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort ) ./verbose.at:29: mkdir posix @@ -5239,25 +4858,34 @@ echo Testing the archive tar tf archive ) - -stderr: -74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... -./exclude15.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./append04.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * +# 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 -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort +# Verify created archive by listing its content: +tar -tf archive.tar +echo == +# Create another empty file: +touch file3 + +# Append it to the already created archive: +tar rpfW archive.tar file3 + +# Verify content of the new archive: +tar -tf archive.tar ) -./append03.at:26: +./append.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5265,51 +4893,37 @@ TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * - -genfile --file file.1 -genfile --file file.2 - -tar -c -f archive --transform 's/file/plik/' file.* -echo Appending -./shortrec.at:28: +touch file1 + touch file2 + tar cf archive file1 + tar rf archive file2 + tar tf archive) +./same-order02.at:28: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS -tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 -echo Testing -tar tf archive -) rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null +genfile -l 1024 -f file1 +genfile -l 1024 -f file2 +tar cf archive file1 file2 -rm -r directory -) -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 * +mkdir en +mkdir to -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +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 ) -75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... -./exclude16.at:41: +./indexfile.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5319,73 +4933,14 @@ rm -rf * -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -rm etest/subdir/excludeme -decho "# Level 0" -tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort -touch etest/subdir/excludeme -touch etest/subdir/otherfile - -decho "# Level 1" -cp snar-0 snar-1 -tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort -) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -./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 -) -./append02.at:57: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file file1 -genfile --file file2 - -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" - -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi - -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +genfile --file=directory/a --length=1035 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +echo "Creating the archive" +tar -c -v -f - --index-file=idx directory > archive -echo Comparing archives -cmp archive.1 archive.2 +echo "Testing the archive" +tar -tf archive ) ./numeric.at:29: mkdir gnu @@ -5428,117 +4983,7 @@ tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) -./recurse.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 -tar tf archive -./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 -) -) -./xform03.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -./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 -) -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 -) -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 - -) -./recurs02.at:33: +./T-dir00.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5547,26 +4992,6 @@ export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file -tar --create --file archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -tar tf archive -tar cf archive directory1 directory2 -tar tf archive \ - --no-recursion directory1 \ - --recursion directory2 || exit 1 -) -./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 @@ -5578,7 +5003,7 @@ echo dir > list tar xfTv archive list | sort ) -./T-dir01.at:30: +./append03.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5587,23 +5012,21 @@ export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive ) ./append05.at:35: -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 * @@ -5617,25 +5040,6 @@ tar tf archive -./indexfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) decho 'adding d e f' tar -vrf archive -b3 d e f echo == @@ -5647,27 +5051,13 @@ decho 'resulting archive' 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 -tar tf archive -) +26. add-file.at:21: ok ./append01.at:34: -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 * @@ -5677,7 +5067,7 @@ 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: +31. T-recurse.at:66: ./same-order01.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -5686,23 +5076,21 @@ 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 en -mkdir to - -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +mkdir directory +tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 -ls en -echo separator -ls to +ls directory|sort ) -./T-recurse.at:30: + ok +./shortrec.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -5711,6 +5099,24 @@ 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 +) +./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 @@ -5740,68 +5146,55 @@ tar cf "$a" --no-recursion -T F2A --recursion -T F2B tar tf "$a" ) -./add-file.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 * -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 +genfile --file file --length 10240 +echo Creating the archive +tar cvf - file > archive +echo Testing the archive +tar tf archive ) -65. exclude06.at:26: ok -71. exclude12.at:37: ./exclude11.at:39: -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 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +mkdir directory +touch directory/file +tar --create --file archive --no-recursion directory || exit 1 +tar tf archive ) -./exclude08.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./recurs02.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +mkdir directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 ) - ok ./append.at:24: mkdir posix (cd posix @@ -5815,42 +5208,39 @@ tar cf archive file1 tar rf archive file2 tar tf archive) -./exclude17.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./append02.at:57: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - -) -./xform02.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -./exclude14.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +genfile --file file1 +genfile --file file2 +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -test -z "`sort < /dev/null 2>&1`" || exit 77 +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 + +echo Comparing archives +cmp archive.1 archive.2 ) + ./append03.at:26: mkdir posix (cd posix @@ -5869,21 +5259,34 @@ echo Testing tar tf archive ) -rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name -) -./T-recurse.at:69: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +40. indexfile.at:26: ok +./same-order02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS -68. exclude09.at:37: ok +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 +) +2. pipe.at:29: ok ./append04.at:32: mkdir ustar (cd ustar @@ -5911,50 +5314,68 @@ # Verify content of the new archive: tar -tf archive.tar ) +./T-dir01.at:30: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS rm -rf * -mkdir directory1 directory2 -touch directory1/file directory2/file - -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ -_ATEOF - -cat >F2 <<'_ATEOF' -directory2/ -_ATEOF +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort +) +./append01.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -tar cf archive -T F1 --recursion -T F2 +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 - ) -./shortrec.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./T-dir00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -mkdir directory -(cd directory && touch a b c d e f g h i j k l m n o p q r) -tar -c -b 1 -f - directory | tar -t -f - > /dev/null -tar -c -b 1 -f archive directory -tar -t -f archive > /dev/null -tar -t -f - < archive > /dev/null -rm -r directory +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir > list +tar xfTv archive list | sort ) +55. xform-h.at:30: testing transforming hard links on create ... ./xform-h.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -5978,7 +5399,8 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) -./recurse.at:24: +56. xform01.at:26: testing transformations and GNU volume labels ... +./xform01.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -5987,98 +5409,225 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar --create --file archive --no-recursion directory || exit 1 +genfile --file file +tar -cf archive.tar -V /label/ file +tar tf archive.tar +) +./append05.at:35: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +for f in a b c d e f g h i +do + echo $f > $f +done + +decho 'creating archive' +tar -cf archive -b1 a b c + +tar tf archive + +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive + +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' tar tf archive ) -./pipe.at:33: +./same-order01.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS +rm -rf * -./exclude03.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +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: ./recurs02.at:33: +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 directory1 directory2 +touch directory1/file directory2/file +tar --create --file archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +tar tf archive +tar cf archive directory1 directory2 +tar tf archive \ + --no-recursion directory1 \ + --recursion directory2 || exit 1 +) + ok -test -z "`sort < /dev/null 2>&1`" || exit 77 +./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) +./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 -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/\* +rm -r directory +) -tar cf archive --exclude='testdir*f*1' \ - --no-wildcards-match-slash \ - --exclude='testdir*f*2' \ - --wildcards-match-slash \ - --exclude='testdir*f*3' \ - testdir -tar tf archive | sort +43. recurse.at:21: ok +./append02.at:57: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort +genfile --file file1 +genfile --file file2 -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +# For PAX archives, we need to make sure extended header names are +# reproducible and that their contents won't change with time +if test $TEST_TAR_FORMAT = posix; then + TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" +fi -rm -rf testdir +echo Creating archive.1 +tar $MTIME -cf archive.1 file1 file2 + +echo Creating archive.2 +tar $MTIME -cf archive.2 -T /dev/null +tar $MTIME -rf archive.2 file1 +tar $MTIME -rf archive.2 file2 +echo Comparing archives +cmp archive.1 archive.2 ) +./append03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS rm -rf * +genfile --file file.1 +genfile --file file.2 -test -z "`sort < /dev/null 2>&1`" || exit 77 +tar -c -f archive --transform 's/file/plik/' file.* +echo Appending +tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1 +echo Testing +tar tf archive +) +30. T-recurse.at:27: ok +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 +) +58. xform03.at:21: testing transforming hard link targets ... +./xform03.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -mkdir 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) -50. append01.at:29: ./exclude07.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 +) +56. xform01.at:26: ok +./T-dir01.at:30: +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 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir dir +genfile -f dir/file1 +genfile -f dir/file2 +tar cf archive dir +rm -rf dir +echo dir/ > list +tar xfTv archive list | sort ) - ok -./exclude17.at:24: + +./numeric.at:29: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6087,12 +5636,43 @@ export TAR_OPTIONS rm -rf * +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 + mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file + + + +decho --create +tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --list +tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --diff +tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + + +decho --extract +tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' + ) -./xform02.at:24: +50. append01.at:29: + ok +49. append.at:21: ok +38. T-dir00.at:28: ok +./same-order02.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6101,12 +5681,24 @@ export TAR_OPTIONS rm -rf * -genfile --file file -tar cvf /dev/null file \ - --transform='s/file/other\/name/' \ - --show-transformed-name +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 ) -74. exclude15.at:36: ./same-order01.at:29: + +./append04.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6115,53 +5707,142 @@ 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 +) +60. exclude01.at:19: testing exclude wildcards ... +./exclude01.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort -ls directory|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 ) +59. exclude.at:23: testing exclude ... +./exclude.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -./append02.at:57: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir dir +echo blues > dir/blues +echo jazz > dir/jazz +mkdir dir/folk +echo tagfile > dir/folk/tagfile +echo sanjuan > dir/folk/sanjuan +mkdir dir/rock +echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG +echo "test" > dir/rock/file + +for option in exclude-caches exclude-caches-under exclude-caches-all +do + echo OPTION $option + tar -cf archive.tar --$option -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done + +for option in exclude-tag exclude-tag-under exclude-tag-all +do + echo OPTION $option + tar -cf archive.tar --${option}=tagfile -v dir 2>err | sort + cat err + echo ARCHIVE + tar tf archive.tar | sort +done +) +52. append03.at:21: ok +./xform-h.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" -# For PAX archives, we need to make sure extended header names are -# reproducible and that their contents won't change with time -if test $TEST_TAR_FORMAT = posix; then - TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime" -fi +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 -echo Creating archive.2 -tar $MTIME -cf archive.2 -T /dev/null -tar $MTIME -rf archive.2 file1 -tar $MTIME -rf archive.2 file2 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -echo Comparing archives -cmp archive.1 archive.2 ) -./exclude02.at:22: +./xform02.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6170,6 +5851,22 @@ export TAR_OPTIONS rm -rf * +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 * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -6209,12 +5906,17 @@ rm -rf testdir file1.txt ) -./exclude01.at:22: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +45. shortrec.at:25: ok + +44. recurs02.at:30: ok + +62. exclude03.at:19: testing exclude: wildcards match slash ... +./exclude03.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -6224,6 +5926,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 @@ -6231,48 +5934,28 @@ 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 -) -72. exclude13.at:39: 78. delete01.at:23: testing deleting a member after a big one ... -./delete01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * -genfile -l 50000 --file file1 -genfile -l 1024 --file file2 -tar cf archive file1 file2 -tar -f - --delete file2 archout -tar tf archout -tar f archive --delete file2 -cmp archive archout) - ok - ok -./T-dir00.at:30: +) +./append05.at:35: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -6281,40 +5964,50 @@ 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 -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir > list -tar xfTv archive list | sort -) -40. indexfile.at:26: ok +decho 'adding d e f' +tar -vrf archive -b3 d e f +echo == +tar tf archive -./T-dir01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +decho 'adding g h i' +tar -vrf archive -b5 g h i + +decho 'resulting archive' +tar tf archive +) +./same-order01.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 * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -genfile -f dir/file1 -genfile -f dir/file2 -tar cf archive dir -rm -rf dir -echo dir/ > list -tar xfTv archive list | sort + +genfile -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 ) -./add-file.at:33: +./append02.at:57: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6323,50 +6016,85 @@ export TAR_OPTIONS rm -rf * -genfile --file -File -genfile --file foo -genfile --file bar +genfile --file file1 +genfile --file file2 -echo 1: -tar -cvf arc.tar --add-file foo --add-file -File +# Make sure file timestamps in the archive will not differ +MTIME="--mtime=@0" -echo 2: -tar -cvf arc.tar foo --add-file -File bar +# 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 -cat >input <<'_ATEOF' -foo ---add-file=-File -bar -_ATEOF +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 +) +stderr: +64. exclude05.at:21: testing exclude: lots of excludes ... +./exclude05.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile -echo 3: -tar -cvf arc.tar -T input ) -41. verbose.at:26: ok -./recurs02.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu + +./xform02.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -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 +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) -69. exclude10.at:38: ok -./exclude04.at:22: + +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr + +./xform03.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6375,6 +6103,27 @@ 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 +) + +39. T-dir01.at:28: ok +63. exclude04.at:19: testing exclude: case insensitive ... +./exclude04.at:22: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -6413,23 +6162,8 @@ rm -rf testdir ) -stderr: -31. T-recurse.at:66: 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) -79. delete02.at:23: testing deleting a member from stdin archive ... -./delete02.at:26: +66. exclude07.at:19: testing exclude: --exclude-backups option ... +./exclude07.at:22: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6438,75 +6172,93 @@ 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) -./same-order02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" + +tar -v -c -f archive --exclude-backups dir +) +48. same-order02.at:25: ok +65. exclude06.at:26: testing exclude: long files in pax archives ... +./exclude06.at:31: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 -mkdir en -mkdir to +install-sh -d one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen >/dev/null || exit 77 +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.txt +genfile --length 20 -f one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c -HERE=`pwd` -tar -xf archive --same-order --warning=no-timestamp \ - -C $HERE/en file1 \ - -C $HERE/to file2 || exit 1 +tar cf archive.tar one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen +mkdir out +tar -C out -xf archive.tar --exclude='*.txt' --warning=no-timestamp +find out -type f +) +./append04.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -ls en -echo separator -ls to +# 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 ) -./exclude17.at:24: +./xform02.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS +rm -rf * -./append03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name +) +67. exclude08.at:36: testing --exclude-tag option ... +./exclude08.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" 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 -) -rm -rf * +test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort ) -./exclude11.at:39: +./xform-h.at:39: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -6515,14 +6267,28 @@ export TAR_OPTIONS rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link + -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' + + +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' -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -75. exclude16.at:38: 80. delete03.at:21: testing deleting members with long names ... -./delete03.at:26: +68. exclude09.at:37: testing --exclude-tag option and --listed-incremental ... +./exclude09.at:40: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6532,74 +6298,34 @@ 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 -) - ok -./exclude14.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -rm -rf * - - test -z "`sort < /dev/null 2>&1`" || exit 77 mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort ) -57. xform02.at:21: - ok -./xform03.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * -mkdir d -mkdir d/a -genfile --file d/a/b -dir=$(pwd|sed s,^//*,,)/d -tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err -mkdir t -tar -C t -xf a.tar -find t -type f -) -./exclude08.at:39: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +51. append02.at:54: ok +./xform02.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 * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +genfile --file file +tar cvf /dev/null file \ + --transform='s/file/other\/name/' \ + --show-transformed-name ) ./append05.at:35: -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 * @@ -6624,14 +6350,14 @@ decho 'resulting archive' tar tf archive ) -43. recurse.at:21: ok - +47. same-order01.at:26: ok +stderr: ./exclude07.at:22: -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 * @@ -6643,7 +6369,7 @@ tar -v -c -f archive --exclude-backups dir ) -./exclude18.at:33: +./numeric.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6652,46 +6378,65 @@ export TAR_OPTIONS rm -rf * +MYUID=$(id -u) || exit 77 +MYGID=$(id -g) || exit 77 +MYUSR=$(id -un) || exit 77 +MYGRP=$(id -gn) || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 +mkdir dir +# Ensure correct group id on BSDs. +chown :$MYGID dir >/dev/null 2>/dev/null +genfile --file dir/file -mkdir gitrepo -cd gitrepo -# Make an empty VCS directory: -mkdir .svn -# Make a VCS directory with a file: -mkdir .git -touch .git/_A +decho --create +tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -# Make a VCS file: -touch .gitignore -# Make non-VCS files: -touch .git_B -touch _C +decho --list +tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort +decho --diff +tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +decho --extract +tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' +tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' ) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +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 * -81. delete04.at:23: testing deleting a large last member ... -./delete04.at:26: + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort +) +70. exclude11.at:36: testing --exclude-tag-under option ... +./exclude11.at:39: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6700,87 +6445,99 @@ export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -./T-recurse.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./xform03.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS -./append04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) +57. xform02.at:21: ok + +./exclude02.at:22: +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 -# Create an archive: -tar cpfW archive.tar file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 -# Append it to the already created archive: -tar rpfW archive.tar file3 +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 -# Verify content of the new archive: -tar -tf archive.tar -) -rm -rf * +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort -mkdir directory1 directory2 -touch directory1/file directory2/file +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort -cat >F1 <<'_ATEOF' ---no-recursion -directory1/ ---recursion -directory2/ -_ATEOF +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 -cat >F2A <<'_ATEOF' -directory1/ -_ATEOF +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort -cat >F2B <<'_ATEOF' -directory2/ -_ATEOF +rm -rf testdir file1.txt +) +71. exclude12.at:37: testing --exclude-tag-under and --listed-incremental ... +./exclude12.at:40: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -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" +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 ) -./shortrec.at:28: +72. exclude13.at:39: testing --exclude-tag-under option in incremental pass ... +./exclude13.at:42: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6789,36 +6546,37 @@ 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 -82. delete05.at:27: testing deleting non-existing member ... -./delete05.at:30: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort +) +./exclude08.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) -) +test -z "`sort < /dev/null 2>&1`" || exit 77 -./delete01.at:26: +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +68. exclude09.at:37: ok +./exclude01.at:22: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -6827,50 +6585,105 @@ 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 + +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 +) +./exclude03.at:22: +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 b -touch a b/1 c -tar -cf archive.tar a b/1 c -case $TEST_TAR_FORMAT in -gnu) size=1500;; -pax) size=3072;; -esac -dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null -tar --delete 'b/' -f trunc.tar + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +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 + ) -84. extrac01.at:23: testing extract over an existing directory ... -./extrac01.at:26: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +53. append04.at:29: ok +./exclude07.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) +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 +) +65. exclude06.at:26: ok ./xform-h.at:39: mkdir posix (cd posix @@ -6900,62 +6713,90 @@ tar tvf archive | sed -n 's/.*test_link link to //p' ) -./exclude17.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +54. append05.at:32: ok +73. exclude14.at:36: testing --exclude-tag-all option ... +./exclude14.at:39: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo '*.o' >.cvsignore -tar -cf - --exclude-vcs-ignores . | tar -tf - + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort ) -./numeric.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + + +./exclude11.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 * -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file +test -z "`sort < /dev/null 2>&1`" || exit 77 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort +) +./exclude04.at:22: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +test -z "`sort < /dev/null 2>&1`" || exit 77 -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +rm -rf testdir +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 -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +echo "SUB 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 -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +echo "SUB 3" +tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort + +rm -rf testdir ) -26. add-file.at:21: ./pipe.at:33: + +74. exclude15.at:36: testing --exclude-tag-all and --listed-incremental ... +./exclude15.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -6967,19 +6808,53 @@ 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 +./exclude07.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -mkdir 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) -86. extrac03.at:23: testing extraction loops ... -./extrac03.at:26: +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 +) +75. exclude16.at:38: testing --exclude-tag-all option in incremental pass ... +./exclude16.at:41: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +rm etest/subdir/excludeme +decho "# Level 0" +tar -c -f etest-0.tar --exclude-tag-all=excludeme --listed=snar-0 -v etest | sort +touch etest/subdir/excludeme +touch etest/subdir/otherfile + +decho "# Level 1" +cp snar-0 snar-1 +tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort +) +76. exclude17.at:21: testing --exclude-vcs-ignores memory allocation ... +./exclude17.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -6988,12 +6863,51 @@ 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 dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +) +stderr: +59. exclude.at:23: ok + +./exclude08.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +71. exclude12.at:37: ok +./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 +) +77. exclude18.at:30: testing --exclude-vcs extract list compare ... +./exclude18.at:33: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7005,27 +6919,59 @@ 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 +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 + ) -./same-order01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +46. numeric.at:18: ok + +./exclude14.at:39: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS -./T-dir01.at:30: +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 +) +72. exclude13.at:39: ok +./xform-h.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7034,35 +6980,43 @@ export TAR_OPTIONS rm -rf * +mkdir basedir +echo "hello" > basedir/test +ln basedir/test basedir/test_link -test -z "`sort < /dev/null 2>&1`" || exit 77 -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 -) -rm -rf * +echo "Default transform scope" +tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -test -z "`sort < /dev/null 2>&1`" || exit 77 +echo "Transforming hard links" +tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -genfile -l 1024 -f file1 -genfile -l 1024 -f file2 -tar cf archive file1 file2 +echo "Not transforming hard links" +tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link +tar tvf archive | sed -n 's/.*test_link link to //p' -mkdir directory -tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1 +) -ls directory|sort +./exclude17.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) - ok -./append02.at:57: +./exclude07.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7071,30 +7025,51 @@ export TAR_OPTIONS rm -rf * -genfile --file file1 -genfile --file file2 +mkdir dir +genfile --file dir/file +genfile --file dir/file~ +genfile --file "dir/.#file" +genfile --file "dir/#file#" -# Make sure file timestamps in the archive will not differ -MTIME="--mtime=@0" +tar -v -c -f archive --exclude-backups dir +) -# 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 +78. delete01.at:23: testing deleting a member after a big one ... +./delete01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -echo Creating archive.1 -tar $MTIME -cf archive.1 file1 file2 +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) +74. exclude15.at:36: ok +./exclude11.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -echo 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) -./T-dir00.at:30: + +80. delete03.at:21: testing deleting members with long names ... +./delete03.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7104,19 +7079,17 @@ 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 +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 ) -49. append.at:21: ok -85. extrac02.at:23: testing extracting symlinks over an existing file ... -./extrac02.at:28: +79. delete02.at:23: testing deleting a member from stdin archive ... +./delete02.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7125,41 +7098,152 @@ 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 +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) +81. delete04.at:23: testing deleting a large last member ... +./delete04.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile -l 3 -f file1 +genfile -l 5 -f file2 +genfile -l 3 -f file3 +genfile -l 6 -f file4 +genfile -l 24 -f file5 +genfile -l 13 -f file6 +genfile -l 1385 -f file7 +genfile -l 30 -f file8 +genfile -l 10 -f file9 +genfile -l 256000 -f file10 +tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 +tar f archive --delete file10 +tar tf archive ) -44. recurs02.at:30: ok -88. extrac05.at:30: testing extracting selected members from pax ... -./extrac05.at:38: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +stderr: +./exclude02.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -genfile --sparse --file 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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir dir -cd dir -tar xvfT ../archive ../../list --warning=no-timestamp || exit 1 +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 -cd .. ) -89. extrac06.at:34: testing mode of extracted directories ... -./extrac06.at:37: +75. exclude16.at:38: ok + +./exclude14.at:39: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +./exclude01.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/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 +) +82. delete05.at:27: testing deleting non-existing member ... +./delete05.at:30: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7168,35 +7252,75 @@ export TAR_OPTIONS rm -rf * +genfile -l 1024 -f en +genfile -l 1024 -f to -# Force umask -umask 022 +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 +) +./exclude03.at:22: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" -# Create a directory -mkdir directory -chmod 777 directory -genfile --stat=mode:777 directory +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Archive it -tar cf arc directory -# Change its permissions ... -chmod 755 directory -genfile --stat=mode:777 directory +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/\*f\*1 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* -# ... and attempt to restore it twice -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +tar cf archive --exclude='testdir*f*1' \ + --no-wildcards-match-slash \ + --exclude='testdir*f*2' \ + --wildcards-match-slash \ + --exclude='testdir*f*3' \ + testdir +tar tf archive | sort -tar xf arc directory --warning=no-timestamp -genfile --stat=mode:777 directory +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 -# After both restores, the directory mode should be 755 ) -52. append03.at:21: ./extrac01.at:26: +./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 - +) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./delete01.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7205,18 +7329,20 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) - ok +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +83. delete06.at:25: testing EOF detection ... ./delete06.at:28: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -7230,6 +7356,88 @@ dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null tar --delete 'b/' -f trunc.tar ) +66. exclude07.at:19: ok +./xform03.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir d +mkdir d/a +genfile --file d/a/b +dir=$(pwd|sed s,^//*,,)/d +tar -cf a.tar --xform="s|^$dir/a|dir/c|" /$dir/a/b /$dir/a/b 2>err +mkdir t +tar -C t -xf a.tar +find t -type f +) +./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 +) +./exclude18.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir gitrepo +cd gitrepo + +# Make an empty VCS directory: +mkdir .svn + +# Make a VCS directory with a file: +mkdir .git +touch .git/_A + +# Make a VCS file: +touch .gitignore + +# Make non-VCS files: +touch .git_B +touch _C + +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + +) + +55. xform-h.at:30: ok ./exclude14.at:39: mkdir posix (cd posix @@ -7245,6 +7453,53 @@ 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 posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - +) +./delete05.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 1024 -f en +genfile -l 1024 -f to + +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive +) ./delete02.at:26: mkdir oldgnu (cd oldgnu @@ -7264,8 +7519,27 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) -90. extrac07.at:27: testing extracting symlinks to a read-only dir ... -./extrac07.at:30: + +./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 +) +./exclude04.at:22: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7275,83 +7549,112 @@ 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 -echo Prepare the directory -mkdir dir -genfile -f foo -cd dir -ln -s ../foo . -cd .. -chmod a-w dir +rm -rf testdir +mkdir -p testdir/dir +touch testdir/file1 +touch testdir/file2 +touch testdir/file3 +touch testdir/file4 +touch testdir/dir/File1 +touch testdir/dir/File2 +touch testdir/dir/File3 +touch testdir/dir/File4 -echo Create the archive -tar cf archive dir || exit 1 +tar cf archive --exclude=FILE2 \ + --exclude=file1 \ + --ignore-case \ + --exclude=file3 \ + --no-ignore-case \ + --exclude=FILE2 \ + --exclude=file4 \ + testdir +tar tf archive | sort -chmod +w dir +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 -echo Extract -mkdir out -tar -C out -xvf archive ) -59. exclude.at:23: ok -./exclude08.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./delete06.at:28: +mkdir pax +(cd pax +TEST_TAR_FORMAT=pax export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H pax" export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort +mkdir b +touch a b/1 c +tar -cf archive.tar a b/1 c +case $TEST_TAR_FORMAT in +gnu) size=1500;; +pax) size=3072;; +esac +dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null +tar --delete 'b/' -f trunc.tar ) -45. shortrec.at:25: ./exclude07.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +84. extrac01.at:23: testing extract over an existing directory ... +./extrac01.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -mkdir dir -genfile --file dir/file -genfile --file dir/file~ -genfile --file "dir/.#file" -genfile --file "dir/#file#" - - ok -./append05.at:35: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +./delete01.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -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 +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +85. extrac02.at:23: testing extracting symlinks over an existing file ... +./extrac02.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -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 +) -./same-order02.at:28: +./exclude17.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7360,36 +7663,12 @@ 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 -) -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 -) -tar -v -c -f archive --exclude-backups dir +mkdir dir +cd dir +echo '*.o' >.cvsignore +tar -cf - --exclude-vcs-ignores . | tar -tf - ) -./delete03.at:26: +./extrac01.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7398,19 +7677,27 @@ export TAR_OPTIONS rm -rf * - -prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX -rm -f $prefix* -for i in 1 2 3 4 5 6 7 8 9 -do touch $prefix$i -done -tar -cf archive ./$prefix* && - tar --delete -f archive ./${prefix}5 && - tar -tf archive +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) +86. extrac03.at:23: testing extraction loops ... +./extrac03.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) stderr: -76. exclude17.at:21: ok -./delete05.at:30: +83. delete06.at:25: ./delete04.at:26: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -7419,6 +7706,45 @@ 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 +) +./exclude08.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=excludeme -v etest | sort +) + ok +./delete05.at:30: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + genfile -l 1024 -f en genfile -l 1024 -f to @@ -7428,12 +7754,33 @@ tar --file archive --blocking-factor=20 --delete tre tar tf archive ) +./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr +./delete02.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile -l 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) +76. exclude17.at:21: ok ./exclude11.at:39: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -7443,13 +7790,12 @@ mkexcltest etest tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort ) - ./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 * @@ -7460,8 +7806,7 @@ tar tf archout tar f archive --delete file2 cmp archive archout) - -./append04.at:32: +./exclude14.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7470,23 +7815,61 @@ export TAR_OPTIONS rm -rf * -# Create two empty files: -touch file1 file2 -# Create an archive: -tar cpfW archive.tar file1 file2 +test -z "`sort < /dev/null 2>&1`" || exit 77 -# Verify created archive by listing its content: -tar -tf archive.tar -echo == -# Create another empty file: -touch file3 +mkexcltest etest +tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort +) +58. xform03.at:21: 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 * -# Append it to the already created archive: -tar rpfW archive.tar file3 +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 +) +./delete03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -# Verify content of the new archive: -tar -tf archive.tar + +prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX +rm -f $prefix* +for i in 1 2 3 4 5 6 7 8 9 +do touch $prefix$i +done +tar -cf archive ./$prefix* && + tar --delete -f archive ./${prefix}5 && + tar -tf archive +) +./extrac02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive ) ./extrac03.at:26: mkdir oldgnu @@ -7501,14 +7884,12 @@ tar -cPvf archive directory/../directory echo separator tar -xPvf archive --warning=no-timestamp) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr - -30. T-recurse.at:27: ./exclude03.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude03.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 * @@ -7547,7 +7928,8 @@ rm -rf testdir ) -./xform03.at:24: + +./delete05.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -7556,63 +7938,171 @@ 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 -l 1024 -f en +genfile -l 1024 -f to + +tar cf archive en to +# Make sure we don't use bogus blocking factor. +# GNU tar up to and including 1.14.91 produced an empty archive this way: +tar --file archive --blocking-factor=20 --delete tre +tar tf archive ) - ok -./extrac02.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./extrac01.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive +mkdir directory +touch directory/file +tar cf archive directory || exit 1 +tar xf archive --warning=no-timestamp || exit 1 ) -./xform-h.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./exclude18.at:33: +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 basedir -echo "hello" > basedir/test -ln basedir/test basedir/test_link +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "Default transform scope" -tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +mkdir gitrepo +cd gitrepo +# Make an empty VCS directory: +mkdir .svn -echo "Transforming hard links" -tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +# Make a VCS directory with a file: +mkdir .git +touch .git/_A +# Make a VCS file: +touch .gitignore -echo "Not transforming hard links" -tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link -tar tvf archive | sed -n 's/.*test_link link to //p' +# Make 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 ) -91. extrac08.at:33: testing restoring mode on existing directory ... -./extrac08.at:36: +./exclude02.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir +touch file1.txt +touch testdir/file1.txt +touch testdir/file2 + +tar cf archive --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 1" +tar cf archive --no-anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 2" +tar cf archive --anchored \ + --exclude="file1.txt" \ + testdir +tar tf archive | sort + +echo "SUB 3" +tar cf archive testdir file1.txt +tar t "file1.txt" -f archive | sort + +echo "SUB 4" +tar t --no-anchored "file1.txt" -f archive | sort + +echo "SUB 5" +tar t --anchored "file1.txt" -f archive | sort + +rm -rf testdir file1.txt + +) + +./exclude01.at:22: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir +mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +touch testdir/dir1/file1 +touch testdir/dir1/\* +touch testdir/dir2/file2 +touch testdir/dir2/\* +touch testdir/dir3/file3 +touch testdir/dir3/\* + +tar cf archive --exclude=testdir/dir1/\* \ + --no-wildcards \ + --exclude=testdir/dir2/\* \ + --wildcards \ + --exclude=testdir/dir3/\* \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive testdir +tar t "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir/dir1 +tar t --no-wildcards "testdir/dir1/*" -f archive | sort + +echo "NEXT" +tar cf archive testdir +tar t --wildcards "testdir/dir1/*" -f archive | sort + +rm -rf testdir +) + +87. extrac04.at:23: testing extract + fnmatch ... +./extrac04.at:26: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -7621,16 +8111,23 @@ export TAR_OPTIONS rm -rf * -umask 000 -mkdir dir -chmod 755 dir -echo bla > dir/file -tar cf test.tar dir -chmod 700 dir -tar xfv test.tar --warning=no-timestamp -genfile --stat=mode.777 dir + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort ) -./extrac01.at:26: +./extrac03.at:26: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -7640,14 +8137,42 @@ rm -rf * mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) +67. exclude08.at:36: ok +./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 ) +./extrac02.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -47. same-order01.at:26: ok -93. extrac10.at:29: testing -C and delayed setting of metadata ... -./extrac10.at:32: +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +88. extrac05.at:30: testing extracting selected members from pax ... +./delete01.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7656,22 +8181,63 @@ export TAR_OPTIONS rm -rf * -mkdir d x x/y -echo foo >d/d1 -echo bar >e +genfile -l 50000 --file file1 +genfile -l 1024 --file file2 +tar cf archive file1 file2 +tar -f - --delete file2 archout +tar tf archout +tar f archive --delete file2 +cmp archive archout) +70. exclude11.at:36: ok +./extrac05.at:38: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -tar -cf archive.tar d e && -tar -xf archive.tar -C x d -C y e && -diff -r d x/d && -diff e x/y/e +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 .. ) -2. pipe.at:29: 88. extrac05.at:30: 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) ./delete04.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 * @@ -7689,98 +8255,51 @@ tar f archive --delete file10 tar tf archive ) -./exclude18.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +73. exclude14.at:36: ok +89. extrac06.at:34: testing mode of extracted directories ... +./extrac06.at:37: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -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 - -) - ok - - -66. exclude07.at:19: ok +# Force umask +umask 022 -92. extrac09.at:34: testing extracting even when . and .. are unreadable ... -./extrac09.at:37: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +# 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 -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +# Archive it +tar cf arc directory +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory -mkdir dir -mkdir dir/sub -mkdir dir/sub/extract -genfile --file dir/sub/f -cd dir/sub +# ... and attempt to restore it twice +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory -tar -cf archive.tar f +tar xf arc directory --warning=no-timestamp +genfile --stat=mode:777 directory -chmod a-r . .. -tar -xvf archive.tar -C extract f -status=$? -chmod a+r . .. -cmp f extract/f || status=$? -exit $status +# After both restores, the directory mode should be 755 ) -39. T-dir01.at:28: 38. T-dir00.at:28: ok -./exclude04.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +80. delete03.at:21: ./exclude04.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 * @@ -7824,11 +8343,11 @@ ) ok ./extrac03.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 * @@ -7836,57 +8355,91 @@ tar -cPvf archive directory/../directory echo separator tar -xPvf archive --warning=no-timestamp) -51. append02.at:54: ok -./exclude02.at:22: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./extrac02.at:28: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * +touch file +ln -s file link 2> /dev/null || ln file link +tar cf archive link +rm link +touch link +tar xf archive +) +84. extrac01.at:23: + ok -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 +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 * -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) +./extrac04.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -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 +test -z "`sort < /dev/null 2>&1`" || exit 77 -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +touch file1 +mkdir directory +mkdir directory/subdirectory +touch directory/file1 +touch directory/file2 +touch directory/subdirectory/file1 +touch directory/subdirectory/file2 +tar -cf archive ./file1 directory +tar -tf archive \ + --exclude='./*1' \ + --exclude='d*/*1' \ + --exclude='d*/s*/*2' | sort +) +./delete05.at:30: +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 +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 ) -94. extrac11.at:25: testing scarce file descriptors ... -./extrac11.at:28: +92. extrac09.at:34: testing extracting even when . and .. are unreadable ... +./extrac09.at:37: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7895,65 +8448,81 @@ export TAR_OPTIONS rm -rf * -exec $dir/$file || exit - files="$files $file" - done -done -# Check that "ulimit" itself works. Close file descriptors before -# invoking ulimit, to work around a bug (or a "feature") in some shells, -# where they squirrel away dups of file descriptors into FD 10 and up -# before closing the originals. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 100 && - tar -cf archive1.tar a && - tar -xf archive1.tar -C dest1 a - ) && - diff -r a dest1/a -) >/dev/null 2>&1 || - exit 77 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -# Another test that "ulimit" itself works: -# tar should fail when completely starved of file descriptors. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 4 && - tar -cf archive2.tar a && - tar -xf archive2.tar -C dest2 a - ) && - diff -r a dest2/a -) >/dev/null 2>&1 && - exit 77 -# Test if it is possible to limit the number of file descriptors to 10. -( ulimit -n 10 ) >/dev/null 2>&1 || exit 77 +mkdir dir +mkdir dir/sub +mkdir dir/sub/extract +genfile --file dir/sub/f +cd dir/sub -# Tar should work when there are few, but enough, file descriptors. -( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && - ulimit -n 10 && - tar -cf archive3.tar a && - tar -xf archive3.tar -C dest3 a - ) && - diff -r a dest3/a >/dev/null 2>&1 -) || { diff -r a dest3/a; exit 1; } +tar -cf archive.tar f + +chmod a-r . .. +tar -xvf archive.tar -C extract f +status=$? +chmod a+r . .. +cmp f extract/f || status=$? +exit $status ) -./exclude08.at:39: +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 +) +78. delete01.at:23: ./extrac03.at:26: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir directory +tar -cPvf archive directory/../directory +echo separator +tar -xPvf archive --warning=no-timestamp) + ok +./exclude03.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -7965,35 +8534,58 @@ 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/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 + ) -90. extrac07.at:27: ./extrac04.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +93. extrac10.at:29: testing -C and delayed setting of metadata ... +./extrac10.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +mkdir d x x/y +echo foo >d/d1 +echo bar >e -test -z "`sort < /dev/null 2>&1`" || exit 77 - -touch file1 -mkdir directory -mkdir directory/subdirectory -touch directory/file1 -touch directory/file2 -touch directory/subdirectory/file1 -touch directory/subdirectory/file2 -tar -cf archive ./file1 directory -tar -tf archive \ - --exclude='./*1' \ - --exclude='d*/*1' \ - --exclude='d*/s*/*2' | sort +tar -cf archive.tar d e && +tar -xf archive.tar -C x d -C y e && +diff -r d x/d && +diff e x/y/e ) -./extrac01.at:26: +./delete04.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8002,13 +8594,21 @@ 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 ) - ok -83. delete06.at:25: ok +88. extrac05.at:30: ok ./extrac06.at:37: mkdir oldgnu (cd oldgnu @@ -8046,12 +8646,94 @@ # After both restores, the directory mode should be 755 ) +./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 +) + + +./exclude18.at:33: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir gitrepo +cd gitrepo + +# Make an empty VCS directory: +mkdir .svn + +# Make a VCS directory with a file: +mkdir .git +touch .git/_A + +# Make a VCS file: +touch .gitignore + +# Make non-VCS files: +touch .git_B +touch _C + +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo + +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort + +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort + +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort + +) +./extrac08.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +umask 000 +mkdir dir +chmod 755 dir +echo bla > dir/file +tar cf test.tar dir +chmod 700 dir +tar xfv test.tar --warning=no-timestamp +genfile --stat=mode.777 dir +) ./delete02.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -8065,7 +8747,7 @@ tar tf archive2 tar f - --delete 2 < archive > archive3 cmp archive2 archive3) -95. extrac12.at:25: testing extract dot permissions ... +86. extrac03.at:23: 95. extrac12.at:25: testing extract dot permissions ... ./extrac12.at:28: mkdir gnu (cd gnu @@ -8085,26 +8767,8 @@ cmp src/file1 dst/file1 && cmp src/file2 dst/file2 ) -./delete05.at:30: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -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 -) -96. extrac13.at:26: testing extract over symlinks ... -./extrac13.at:29: + ok +./exclude01.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8113,71 +8777,6 @@ export TAR_OPTIONS rm -rf * -mkdir src dst1 dst2 dst3 -echo file1 >src/file1 -ln -s target1 dst1/file1 -echo target1 >dst1/target1 -echo target1 >target1 - -tar -cf archive.tar -C src . && -tar -xf archive.tar -C dst1 --warning=no-timestamp && -diff src/file1 dst1/file1 && -diff target1 dst1/target1 - -ln -s target1 dst2/file1 -echo target1 >dst2/target1 -tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp && -diff src/file1 dst2/file1 && -diff target1 dst2/target1 - -ln -s target1 dst3/file1 -echo target1 >dst3/target1 -tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp && -diff src/file1 dst3/file1 && -diff src/file1 dst3/target1 -) -./extrac02.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive -) -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 -) -./exclude01.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 @@ -8213,7 +8812,9 @@ rm -rf testdir ) -./exclude14.at:39: + +94. extrac11.at:25: testing scarce file descriptors ... +./extrac11.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8222,35 +8823,68 @@ export TAR_OPTIONS rm -rf * +exec $dir/$file || exit + files="$files $file" + done +done -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkexcltest etest -tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort -) - +# Check that "ulimit" itself works. Close file descriptors before +# invoking ulimit, to work around a bug (or a "feature") in some shells, +# where they squirrel away dups of file descriptors into FD 10 and up +# before closing the originals. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 100 && + tar -cf archive1.tar a && + tar -xf archive1.tar -C dest1 a + ) && + diff -r a dest1/a +) >/dev/null 2>&1 || + exit 77 -48. same-order02.at:25: -./delete03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +# Another test that "ulimit" itself works: +# tar should fail when completely starved of file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 4 && + tar -cf archive2.tar a && + tar -xf archive2.tar -C dest2 a + ) && + diff -r a dest2/a +) >/dev/null 2>&1 && + exit 77 +# Test if it is possible to limit the number of file descriptors to 10. +( ulimit -n 10 ) >/dev/null 2>&1 || exit 77 -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 +# Tar should work when there are few, but enough, file descriptors. +( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- && + ulimit -n 10 && + tar -cf archive3.tar a && + tar -xf archive3.tar -C dest3 a + ) && + diff -r a dest3/a >/dev/null 2>&1 +) || { diff -r a dest3/a; exit 1; } ) -./exclude11.at:39: +82. delete05.at:27: ok +93. extrac10.at:29: ok +90. extrac07.at:27: ok +./exclude02.at:22: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8262,62 +8896,146 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkexcltest etest -tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort -) - ok -stderr: +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 -./numeric.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +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 + +) +85. extrac02.at:23: 92. extrac09.at:34: ok + ok +./extrac06.at:37: +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 * -MYUID=$(id -u) || exit 77 -MYGID=$(id -g) || exit 77 -MYUSR=$(id -un) || exit 77 -MYGRP=$(id -gn) || exit 77 -mkdir dir -# Ensure correct group id on BSDs. -chown :$MYGID dir >/dev/null 2>/dev/null -genfile --file dir/file +# 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 -decho --create -tar --create -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --create -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +# Archive it +tar cf arc directory +# Change its permissions ... +chmod 755 directory +genfile --stat=mode:777 directory -decho --list -tar --list -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --list -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +# ... 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 -decho --diff -tar --diff -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --diff -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +# After both restores, the directory mode should be 755 +) +96. extrac13.at:26: testing extract over symlinks ... +./extrac13.at:29: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +mkdir src dst1 dst2 dst3 +echo file1 >src/file1 +ln -s target1 dst1/file1 +echo target1 >dst1/target1 +echo target1 >target1 +tar -cf archive.tar -C src . && +tar -xf archive.tar -C dst1 --warning=no-timestamp && +diff src/file1 dst1/file1 && +diff target1 dst1/target1 -decho --extract -tar --extract -vvf a dir --numeric-owner | awk '=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}' -tar --extract -vvf a dir | awk '=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}' +ln -s target1 dst2/file1 +echo target1 >dst2/target1 +tar --overwrite -xf archive.tar -C dst2 --warning=no-timestamp && +diff src/file1 dst2/file1 && +diff target1 dst2/target1 +ln -s target1 dst3/file1 +echo target1 >dst3/target1 +tar --overwrite -xhf archive.tar -C dst3 --warning=no-timestamp && +diff src/file1 dst3/file1 && +diff src/file1 dst3/target1 ) -54. append05.at:32: +./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 +) +95. extrac12.at:25: ok ./extrac08.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 * @@ -8330,59 +9048,60 @@ tar xfv test.tar --warning=no-timestamp genfile --stat=mode.777 dir ) -./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) -./extrac03.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) -93. extrac10.at:29: ok - ok -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr -100. extrac17.at:21: testing name matching/transformation ordering ... -./extrac17.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 + + +./exclude04.at:22: +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 +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 -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ ) -./xform03.at:24: + +./delete04.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8391,16 +9110,21 @@ 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 -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 98. extrac15.at:25: testing extract parent mkdir failure ... ./extrac15.at:28: mkdir gnu @@ -8430,9 +9154,8 @@ else (exit 0) fi ) - -99. extrac16.at:26: testing extract empty directory with -C ... -./extrac16.at:29: +97. extrac14.at:25: testing extract -C symlink ... +./extrac14.at:28: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8441,13 +9164,34 @@ export TAR_OPTIONS rm -rf * -mkdir src src/a src/a/b dest -touch src/a/c +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 +) +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 * -tar -cf archive.tar -C src a && -tar -xf archive.tar -C dest +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/ ) -./extrac01.at:26: +99. extrac16.at:26: testing extract empty directory with -C ... +./extrac16.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8456,28 +9200,13 @@ export TAR_OPTIONS rm -rf * -mkdir directory -touch directory/file -tar cf archive directory || exit 1 -tar xf archive --warning=no-timestamp || exit 1 -) -./extrac02.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +mkdir src src/a src/a/b dest +touch src/a/c -touch file -ln -s file link 2> /dev/null || ln file link -tar cf archive link -rm link -touch link -tar xf archive +tar -cf archive.tar -C src a && +tar -xf archive.tar -C dest ) -53. append04.at:29: 101. extrac18.at:34: testing keep-old-files ... +101. extrac18.at:34: testing keep-old-files ... ./extrac18.at:37: mkdir v7 (cd v7 @@ -8502,85 +9231,51 @@ cat a ) - ok -104. extrac21.at:31: testing delay-directory-restore ... -./extrac21.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./exclude18.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 * -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -mkdir a a/b a/c -genfile --file a/b/D -genfile --file a/c/A -cd a/b -ln -sf ../c/A -cd ../.. -chmod a-w a/b -tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A -mkdir out -tar -C out -v -x -f A.tar --delay-directory-restore -) +test -z "`sort < /dev/null 2>&1`" || exit 77 -105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... -./extrac22.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +mkdir gitrepo +cd gitrepo +# Make an empty VCS directory: +mkdir .svn -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +# Make a VCS directory with a file: +mkdir .git +touch .git/_A +# Make a VCS file: +touch .gitignore -test -z "`sort < /dev/null 2>&1`" || exit 77 +# Make non-VCS files: +touch .git_B +touch _C -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) +# Create an archive, include VCS: +cd .. +tar -cf gitrepo.tar gitrepo +rm -r gitrepo -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF +echo Extract: +tar -xvf gitrepo.tar --exclude-vcs | sort +echo +echo List: +tar -tf gitrepo.tar --exclude-vcs | sort -tar -C t -c -f a.tar --no-recursion -T filelist +echo +echo Diff: +tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort -mkdir restore -tar -x -p --delay-directory-restore -C restore -f a.tar -# Previous versions of tar would fail here with the following diagnostics: -# tar: ./dir2/data2: Cannot unlink: Permission denied ) 102. extrac19.at:21: testing skip-old-files ... ./extrac19.at:24: @@ -8607,7 +9302,9 @@ cat a ) -./delete05.at:30: + +62. exclude03.at:19: ok +./extrac08.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -8616,16 +9313,81 @@ export TAR_OPTIONS rm -rf * -genfile -l 1024 -f en -genfile -l 1024 -f to +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 +) -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 +96. extrac13.at:26: ok +./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 +) +./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 ) -55. xform-h.at:30: 103. extrac20.at:21: testing keep-directory-symlink ... +94. extrac11.at:25: ok +103. extrac20.at:21: testing keep-directory-symlink ... ./extrac20.at:24: mkdir v7 (cd v7 @@ -8698,14 +9460,130 @@ clean done ) -97. extrac14.at:25: 95. extrac12.at:25: ok - ok - ok +97. extrac14.at:25: ok +99. extrac16.at:26: ok +104. extrac21.at:31: testing delay-directory-restore ... +./extrac21.at:33: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -92. extrac09.at:34: - ok -107. extrac24.at:18: testing --to-stdout ... -./extrac24.at:29: + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +mkdir a a/b a/c +genfile --file a/b/D +genfile --file a/c/A +cd a/b +ln -sf ../c/A +cd ../.. +chmod a-w a/b +tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A +mkdir out +tar -C out -v -x -f A.tar --delay-directory-restore +) + +./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/ +) + +./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 +) +98. extrac15.at:25: ok +60. exclude01.at:19: ok +./extrac18.at:37: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b + +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) + +./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 +) + +105. extrac22.at:19: testing delay-directory-restore on reversed ordering ... +./extrac22.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -8714,13 +9592,46 @@ 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 + +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 ) + +81. delete04.at:23: ok 106. extrac23.at:18: testing --no-overwrite-dir ... ./extrac23.at:32: mkdir v7 @@ -8750,7 +9661,7 @@ chmod 700 dir find dir ) -./extrac06.at:37: +./extrac17.at:34: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -8759,6 +9670,42 @@ 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/ +) + +107. extrac24.at:18: testing --to-stdout ... +./extrac24.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +./extrac06.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + # Force umask umask 022 @@ -8787,19 +9734,9 @@ # After both restores, the directory mode should be 755 ) -./extrac03.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +61. exclude02.at:19: 104. extrac21.at:31: ok + ok -mkdir directory -tar -cPvf archive directory/../directory -echo separator -tar -xPvf archive --warning=no-timestamp) 108. extrac25.at:18: testing extract over parent dir that is dangling symlink ... ./extrac25.at:21: mkdir v7 @@ -8818,31 +9755,22 @@ ln -s does_not_exist subdir tar -xvf test.tar ) -67. exclude08.at:36: ./delete04.at:26: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) - - ok 110. difflink.at:17: testing link mismatch ... ./difflink.at:19: mkdir ustar @@ -8862,32 +9790,57 @@ ln -s x a/z tar df a.tar ) -./extrac17.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./extrac19.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -mkdir 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 ) -./extrac04.at:26: +63. exclude04.at:19: ok + +./extrac18.at:37: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT TAR_OPTIONS="-H ustar" export TAR_OPTIONS -./delete01.at:26: +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 +) +./extrac04.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -8896,15 +9849,6 @@ 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) -rm -rf * - test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -8921,92 +9865,8 @@ --exclude='d*/*1' \ --exclude='d*/s*/*2' | sort ) -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 -) -99. extrac16.at:26: ok - -84. extrac01.at:23: ./delete02.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS - ok -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -./exclude18.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir gitrepo -cd gitrepo - -# Make an empty VCS directory: -mkdir .svn - -# Make a VCS directory with a file: -mkdir .git -touch .git/_A - -# Make a VCS file: -touch .gitignore - -# Make non-VCS files: -touch .git_B -touch _C - -# Create an archive, include VCS: -cd .. -tar -cf gitrepo.tar gitrepo -rm -r gitrepo - -echo Extract: -tar -xvf gitrepo.tar --exclude-vcs | sort - -echo -echo List: -tar -tf gitrepo.tar --exclude-vcs | sort - -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort - -) -98. extrac15.at:25: ok -./exclude03.at:22: +91. extrac08.at:33: ok +./extrac17.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9015,66 +9875,17 @@ export TAR_OPTIONS rm -rf * +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -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 - -) -./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=$? +tar cf dir.tar dir -cat a +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) -70. exclude11.at:36: 111. label01.at:21: testing single-volume label ... +77. exclude18.at:30: ok +111. label01.at:21: testing single-volume label ... ./label01.at:24: mkdir gnu (cd gnu @@ -9089,8 +9900,8 @@ tar -cf archive --label=Test foo bar tar tf archive ) -73. exclude14.at:36: ok -./extrac18.at:37: + +./backup01.at:36: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9099,43 +9910,15 @@ 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 +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp ) - ok -96. extrac13.at:26: -./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 - ok -) -./extrac24.at:29: +./extrac25.at:21: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9144,35 +9927,14 @@ 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 -) -./extrac08.at:36: -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 -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 +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar ) -80. delete03.at:21: ok -stderr: -94. extrac11.at:25: ok - 112. label02.at:21: testing multi-volume label ... ./label02.at:24: @@ -9191,83 +9953,6 @@ 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 ) -./xform03.at:24: sed "/tar: Removing leading \`\/*\/' from/d" stderr - -114. label04.at:27: testing label with non-create option ... -./label04.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive --label='New volume' file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive --label='New volume' file -) -./delete05.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 1024 -f en -genfile -l 1024 -f to - -tar cf archive en to -# Make sure we don't use bogus blocking factor. -# GNU tar up to and including 1.14.91 produced an empty archive this way: -tar --file archive --blocking-factor=20 --delete tre -tar tf archive -) -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 -) - -./extrac17.at:34: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) 113. label03.at:27: testing test-label option ... ./label03.at:30: mkdir gnu @@ -9301,9 +9986,7 @@ decho "# Test label: wildcards" tar --test-label --file=iamanarchive --wildcards '*label'; echo $? ) - - -./backup01.at:36: +./extrac24.at:29: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -9312,70 +9995,51 @@ export TAR_OPTIONS rm -rf * -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir ) -86. extrac03.at:23: 58. xform03.at:21: ok - ok -./extrac25.at:21: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu + +114. label04.at:27: testing label with non-create option ... +./label04.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +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 +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 ) -./extrac06.at:37: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac17.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS - rm -rf * +mkdir dir dir/subdir1 dir/subdir2 out +genfile --file dir/subdir1/file1 +genfile --file dir/subdir2/file2 -# 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 +tar cf dir.tar dir -# After both restores, the directory mode should be 755 +tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ + dir/subdir1/ ) - 116. incremental.at:23: testing incremental ... ./incremental.at:26: mkdir gnu @@ -9415,13 +10079,60 @@ echo y >structure/file tar cfv archive --listed=list structure ) -78. delete01.at:23: 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 +) +110. difflink.at:17: ok +./extrac23.at:32: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) ./extrac19.at:24: -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 * @@ -9440,6 +10151,22 @@ cat a ) +89. extrac06.at:34: ok +./backup01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) 117. incr01.at:27: testing restore broken symlinks from incremental ... ./incr01.at:30: mkdir gnu @@ -9465,20 +10192,6 @@ echo separator tar xvfg archive.1 /dev/null --warning=no-timestamp ) -./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 -) ./extrac22.at:29: mkdir oldgnu (cd oldgnu @@ -9526,12 +10239,42 @@ # Previous versions of tar would fail here with the following diagnostics: # tar: ./dir2/data2: Cannot unlink: Permission denied ) +./label01.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo +genfile --file bar +tar -cf archive --label=Test foo bar +tar tf archive +) +./label02.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --length 0 --file foo +genfile --length 12288 --file bar +genfile --length 12288 --file baz +tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz +tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar +) ./extrac18.at:37: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -9550,7 +10293,90 @@ cat a ) +./extrac24.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +87. extrac04.at:23: ok + +./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 +) + +./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 +) +./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 +) +./label05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive file +) +100. extrac17.at:21: ok 118. incr02.at:32: testing restoring timestamps from incremental ... ./incr02.at:35: mkdir gnu @@ -9598,8 +10424,66 @@ # Check the timestamp genfile --stat=mtime dir/subdir1 | diff ts - ) -121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... -./listed03.at:27: + +./label04.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +decho "# Create volume" +tar -c -f archive --label='New volume' file +decho "# Update: wrong label" +tar -rf archive --label='My volume' file; echo $? +decho "# Update: right label" +tar -rf archive --label='New volume' file +) +./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 +) +./extrac24.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +mkdir dir/ +echo TEXT > dir/file +tar cf a.tar dir +rm -r dir +tar --extract --to-stdout --file a.tar +test -d dir +) +./extrac19.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -9608,35 +10492,62 @@ export TAR_OPTIONS rm -rf * -ckmtime || exit 77 +mkdir dir +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +tar cf ../archive . -test `uname` = "Linux" || exit 77 +rm b +echo 'File a' > a + +tar -x --skip-old-files -f ../archive +echo status=$? + +cat a +) +./extrac18.at:37: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * mkdir dir -mkdir dir/sub -mkdir dir/sub/a -genfile --file dir/sub/a/file -cd dir/sub +cd dir +echo 'Old file a' > a +echo 'Old file b' > b -chmod a-r .. -tar -c -f archive.tar --listed-incremental=db.1 -v a 2>err -status=$? -chmod a+r .. -if test $status -eq 2; then - grep '^tar: \.: Cannot getcwd' err >/dev/null 2>&1 && exit 77 -fi -cat err >&2 -exit $status +tar cf ../archive . + +rm b +echo 'File a' > a + +tar -x -k -f ../archive +echo status=$? + +cat a +) +./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 ) -104. extrac21.at:31: ok -110. difflink.at:17: 120. listed02.at:28: testing working --listed ... +120. listed02.at:28: testing working --listed ... ./listed02.at:31: mkdir gnu (cd gnu @@ -9706,63 +10617,96 @@ echo Final files: find tart -print | sort 2>/dev/null ) -./exclude02.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS - ok rm -rf * +ckmtime || exit 77 -test -z "`sort < /dev/null 2>&1`" || exit 77 - +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +# Let the things settle +sleep 1 -rm -rf testdir -mkdir -p testdir -touch file1.txt -touch testdir/file1.txt -touch testdir/file2 +tar --create \ + --file=archive.1 \ + --listed-incremental=listing \ + directory/file* -tar cf archive --exclude="file1.txt" \ - testdir -tar tf archive | sort +tar tf archive.1 || exit 1 -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +sleep 2 -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +genfile --length 10240 --pattern zeros --file directory/file2 -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +tar tf archive.2 || exit 1 +) +./backup01.at:36: +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 +unset VERSION_CONTROL +mkdir dir1 dir2 +echo bla > dir1/file1 +tar cf test.tar dir1 dir2 +tar xfv test.tar --backup --warning=no-timestamp +) -rm -rf testdir file1.txt +111. label01.at:21: 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 ) -./extrac08.at:36: +./extrac25.at:21: mkdir posix (cd posix TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT TAR_OPTIONS="-H posix" export TAR_OPTIONS -./delete04.at:26: +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 +) +./label04.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9771,26 +10715,90 @@ 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 +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 +) +./label03.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +exec <&- +genfile --file file +tar -c --label='iamalabel' --file iamanarchive file +tar -c --file unlabeled.tar file +decho "# Display label" +tar --test-label --file=iamanarchive; echo $? +decho "# Display label: unlabeled" +tar --test-label --file=unlabeled.tar; echo $? +decho "# Test label: success" +tar --test-label --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label: failure" +tar --test-label --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: unlabeled" +tar --test-label --file=unlabeled.tar 'amalabel'; echo $? +decho "# Test label, verbose: success" +tar --test-label --verbose --file=iamanarchive 'iamalabel'; echo $? +decho "# Test label, verbose: failure" +tar --test-label --verbose --file=iamanarchive 'amalabel'; echo $? +decho "# Test label: multiple arguments" +tar --test-label --file=iamanarchive a iamalabel b; echo $? +decho "# Test label: wildcards" +tar --test-label --file=iamanarchive --wildcards '*label'; echo $? +) +121. listed03.at:24: testing incremental dump when the parent directory is unreadable ... +./listed03.at:27: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + +test `uname` = "Linux" || exit 77 + +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +genfile --file dir/sub/a/file +cd dir/sub + +chmod a-r .. +tar -c -f archive.tar --listed-incremental=db.1 -v a 2>err +status=$? +chmod a+r .. +if test $status -eq 2; then + grep '^tar: \.: Cannot getcwd' err >/dev/null 2>&1 && exit 77 +fi +cat err >&2 +exit $status ) ./extrac24.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -9801,51 +10809,84 @@ tar --extract --to-stdout --file a.tar test -d dir ) -./exclude04.at:22: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -119. listed01.at:26: testing --listed for individual files ... -./listed01.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./extrac22.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -# Let the things settle -sleep 1 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -tar --create \ - --file=archive.1 \ - --listed-incremental=listing \ - directory/file* -tar tf archive.1 || exit 1 +test -z "`sort < /dev/null 2>&1`" || exit 77 -sleep 2 +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) -genfile --length 10240 --pattern zeros --file directory/file2 +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF -echo "separator" -cp listing listing.old -tar --create \ - --file=archive.2 \ - --listed-incremental=listing \ - directory/file* || exit 1 -tar tf archive.2 || exit 1 +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 ) -./exclude01.at:22: +./extrac23.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir + +# Test if temporary permissions are set correctly to allow the owner +# to write to the directory. +genfile --file dir/file +tar cf a.tar dir +rm dir/file +chmod 400 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir +chmod 700 dir +find dir +) + +109. backup01.at:33: ok +./incr01.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -9854,12 +10895,23 @@ export TAR_OPTIONS rm -rf * +ckmtime || exit 77 -test -z "`sort < /dev/null 2>&1`" || 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 -rm -rf testdir -mkdir -p testdir/dir1 testdir/dir2 testdir/dir3 +mv directory orig + +tar xvfg archive.0 /dev/null --warning=no-timestamp +echo separator +tar xvfg archive.1 /dev/null --warning=no-timestamp +) +102. extrac19.at:21: ok +112. label02.at:21: ok 122. listed04.at:26: testing --listed-incremental and --one-file-system ... ./listed04.at:29: mkdir gnu @@ -9878,47 +10930,30 @@ tar --one-file-system -cvf archive.tar -g archive.incr dir || exit tar -tf archive.tar || exit ) -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 +101. extrac18.at:34: ok +114. label04.at:27: 115. label05.at:24: ok + ok -echo "NEXT" -tar cf archive testdir -tar t "testdir/dir1/*" -f archive | sort +107. extrac24.at:18: ok -echo "NEXT" -tar cf archive testdir/dir1 +./extrac25.at:21: +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 -) - -tar t --no-wildcards "testdir/dir1/*" -f archive | sort - -echo "NEXT" -tar cf archive testdir -tar t --wildcards "testdir/dir1/*" -f archive | sort +mkdir subdir +touch subdir/a.txt +tar -cf test.tar subdir/a.txt -rm -rf testdir +rm -rf subdir +ln -s does_not_exist subdir +tar -xvf test.tar ) + 123. listed05.at:33: testing --listed-incremental and remounted directories ... ./listed05.at:36: mkdir gnu @@ -9962,141 +10997,10 @@ umount tartest/subdir ) -./delete02.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 3073 -p zeros --file 1 -cp 1 2 -cp 2 3 -tar cf archive 1 2 3 -tar tf archive -cat archive | tar f - --delete 2 > archive2 -echo separator -tar tf archive2 -tar f - --delete 2 < archive > archive3 -cmp archive2 archive3) -./backup01.at:36: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -unset VERSION_CONTROL -mkdir dir1 dir2 -echo bla > dir1/file1 -tar cf test.tar dir1 dir2 -tar xfv test.tar --backup --warning=no-timestamp -) -85. extrac02.at:23: ok -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 - -) -./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 -) -./label05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) -./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 -) 124. incr03.at:28: testing renamed files in incrementals ... ./incr03.at:31: mkdir gnu @@ -10138,75 +11042,10 @@ tar -xf archive.2 -g db --warning=no-timestamp find directory | sort ) -./label04.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive --label='New volume' file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive --label='New volume' file -) -./extrac23.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir -) -./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/ -) - -46. numeric.at:18: ok - -82. delete05.at:27: ok -./label01.at:24: +121. listed03.at:24: ok +122. listed04.at:26: ok +117. incr01.at:27: ok +./label03.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10215,12 +11054,31 @@ export TAR_OPTIONS rm -rf * -genfile --file foo -genfile --file bar -tar -cf archive --label=Test foo bar -tar tf archive +exec <&- +genfile --file file +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 $? ) -./exclude18.at:33: +127. incr06.at:21: testing incremental dumps of nested directories ... +./incr06.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10229,42 +11087,27 @@ 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 -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 Level 0 . sub +tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 0 sub . +tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . -echo -echo Diff: -tar -dvf gitrepo.tar --exclude-vcs gitrepo | sort +mkdir dir/c +genfile --file dir/sub/b/file4 +echo Level 1 . sub +tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub +echo Level 1 sub . +tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) 125. incr04.at:29: testing proper icontents initialization ... ./incr04.at:34: @@ -10292,38 +11135,7 @@ echo "Incremental dump" tar cvf a1.tar -g a.sna a ) -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 . - -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -) - ---- - 2025-07-02 17:45:25.973947241 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2025-07-02 17:45:25.965777485 +0000 -@@ -1,4 +1 @@ --tar: .: Directory is new --tar: ./subdir: Directory is new --tar: ./subdir: directory is on a different filesystem; not dumped - -./extrac19.at:24: +./extrac22.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10332,43 +11144,46 @@ export TAR_OPTIONS rm -rf * -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b -tar cf ../archive . +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -rm b -echo 'File a' > a -tar -x --skip-old-files -f ../archive -echo status=$? +test -z "`sort < /dev/null 2>&1`" || exit 77 -cat a +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 ) ---- - 2025-07-02 17:45:25.976656168 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2025-07-02 17:45:25.969777485 +0000 -@@ -1,10 +1 @@ --# Level 0 --./ --./subdir/ --./top-level-file --./subdir/subdir-file --# Remount --# Level 1 --./ --./subdir/ - -./extrac25.at:21: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -127. incr06.at:21: testing incremental dumps of nested directories ... -./incr06.at:24: +126. incr05.at:21: testing incremental dumps with -C ... +./incr05.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10380,41 +11195,17 @@ 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 0 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . -echo Level 1 . sub -tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 1 sub . -tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . +genfile --file dir/file3 +echo Level 1 +tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . ) - -./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 -./extrac24.at:29: +./extrac23.at:32: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -10423,58 +11214,25 @@ export TAR_OPTIONS rm -rf * -mkdir dir/ -echo TEXT > dir/file +# Test if the directory permissions are restored properly. +mkdir dir +chmod 755 dir tar cf a.tar dir -rm -r dir -tar --extract --to-stdout --file a.tar -test -d dir -) -122. listed04.at:26: 123. listed05.at:33: ok -rm -rf * - -mkdir subdir -touch subdir/a.txt -tar -cf test.tar subdir/a.txt +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar -) +# 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 ) -./extrac06.at:37: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -# Force umask -umask 022 - -# Make sure user's umask is honored, even if we are superuser -TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions" - -# Create a directory -mkdir directory -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 128. incr07.at:18: testing incremental restores with -C ... ./incr07.at:40: mkdir gnu @@ -10522,54 +11280,6 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -genfile --stat=mode:777 directory - -# After both restores, the directory mode should be 755 -) - skipped (listed05.at:36) -./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 -) - -./extrac18.at:37: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir -cd dir -echo 'Old file a' > a -echo 'Old file b' > b - -tar cf ../archive . - -rm b -echo 'File a' > a - -tar -x -k -f ../archive -echo status=$? - -cat a -) 129. incr08.at:38: testing filename normalization ... ./incr08.at:41: mkdir gnu @@ -10598,79 +11308,14 @@ DIR=`pwd` tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR ) - -./extrac17.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir dir/subdir1 dir/subdir2 out -genfile --file dir/subdir1/file1 -genfile --file dir/subdir2/file2 - -tar cf dir.tar dir - -tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \ - dir/subdir1/ -) -./label02.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -./label05.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive file -) -./label04.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --file file -decho "# Create volume" -tar -c -f archive --label='New volume' file -decho "# Update: wrong label" -tar -rf archive --label='My volume' file; echo $? -decho "# Update: right label" -tar -rf archive --label='New volume' file -) -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 -) - -./incr01.at:30: +--- - 2024-05-30 11:25:59.727550705 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stderr 2024-05-30 11:25:59.719178295 +0000 +@@ -1,4 +1 @@ +-tar: .: Directory is new +-tar: ./subdir: Directory is new +-tar: ./subdir: directory is on a different filesystem; not dumped + +./extrac20.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -10679,118 +11324,87 @@ 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 -) -130. incr09.at:26: testing incremental with alternating -C ... -./incr09.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo bar middle -echo foo/foo_file > foo/foo_file -echo bar/bar_file > bar/bar_file -echo middle/file > middle/middle_file -decho A -tar -cvf foo.tar --incremental -C foo . -C `pwd` middle -C bar . -rm foo.tar ->toplevel_file -decho B -tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . -) -./exclude03.at:22: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -121. listed03.at:24: 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/\* +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done -tar 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 +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 "NEXT" -tar cf archive testdir -tar t --wildcards 'testdir/*f*1' -f archive | sort +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -echo "NEXT" -tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort +# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable +file_spec() +{ + if test $round = normal + then + echo "-f ../$1" + else + echo "-f $1 -C $dir" + fi +} -echo "NEXT" -tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort +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 -rm -rf testdir + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean + prep collision_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 + tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 + clean +done ) - ok -111. label01.at:21: ok - -./extrac19.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 '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=$? +--- - 2024-05-30 11:25:59.730597821 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/123/stdout 2024-05-30 11:25:59.723178153 +0000 +@@ -1,10 +1 @@ +-# Level 0 +-./ +-./subdir/ +-./top-level-file +-./subdir/subdir-file +-# Remount +-# Level 1 +-./ +-./subdir/ + -cat a -) +108. extrac25.at:18: ok +123. listed05.at:33: skipped (listed05.at:36) 131. incr10.at:18: testing concatenated incremental archives (deletes) ... ./incr10.at:28: mkdir gnu @@ -10816,7 +11430,8 @@ mkdir out tar -xvf full.tar -g /dev/null -C out ) -./backup01.at:36: +130. incr09.at:26: testing incremental with alternating -C ... +./incr09.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -10825,112 +11440,21 @@ 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 -) -./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 . -) -./extrac22.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir t -(cd t - genfile --length 100 --file data1 - mkdir dir1 - cp data1 dir1 - mkdir dir2 - cd dir2 - ln -s ../dir1/data1 data2 - cd .. - chmod -w dir2) - -cat >filelist <<'_ATEOF' -./dir2/data2 -./dir2 -./dir1/data1 -./dir1 -./data1 -_ATEOF - - -tar -C t -c -f a.tar --no-recursion -T filelist - -mkdir restore -tar -x -p --delay-directory-restore -C restore -f a.tar -# Previous versions of tar would fail here with the following diagnostics: -# tar: ./dir2/data2: Cannot unlink: Permission denied -) -./label03.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +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 . -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 $? +rm foo.tar +>toplevel_file +decho B +tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file -C bar . ) 132. incr11.at:25: testing concatenated incremental archives (renames) ... ./incr11.at:28: @@ -10962,159 +11486,32 @@ decho List find out | sort ) -./delete04.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile -l 3 -f file1 -genfile -l 5 -f file2 -genfile -l 3 -f file3 -genfile -l 6 -f file4 -genfile -l 24 -f file5 -genfile -l 13 -f file6 -genfile -l 1385 -f file7 -genfile -l 30 -f file8 -genfile -l 10 -f file9 -genfile -l 256000 -f file10 -tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10 -tar f archive --delete file10 -tar tf archive -) -./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 -) -133. filerem01.at:36: testing file removed as we read it ... -./filerem01.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 - -genfile --run --checkpoint=3 --unlink dir/file1 -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v dir >/dev/null -) -./extrac25.at:21: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -./extrac04.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -rm -rf * - -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 -) -79. delete02.at:23: ok - - -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 -) -./extrac23.at:32: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir - -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir -) -134. filerem02.at:26: testing toplevel file removed ... -./filerem02.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./incr05.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 dir mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 -mkdir dir2 -genfile --file dir2/file1 -genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null +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 . ) -./extrac18.at:37: +133. filerem01.at:36: testing file removed as we read it ... +./filerem01.at:39: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11124,31 +11521,16 @@ 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=$? +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -cat a +genfile --run --checkpoint=3 --unlink dir/file1 -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v dir >/dev/null ) -112. label02.at:21: 100. extrac17.at:21: ok - ok -114. label04.at:27: ok -91. extrac08.at:33: ok -89. extrac06.at:34: ok -115. label05.at:24: ok -109. backup01.at:33: ok - -102. extrac19.at:21: ok -136. dirrem02.at:31: testing explicitly named directory removed before reading ... -./dirrem02.at:34: +134. filerem02.at:26: testing toplevel file removed ... +./filerem02.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11161,21 +11543,15 @@ mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac - -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir dir/sub >/dev/null + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -135. dirrem01.at:38: testing directory removed before reading ... -./dirrem01.at:41: +stderr: +./extrac23.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11184,47 +11560,81 @@ export TAR_OPTIONS rm -rf * +# Test if the directory permissions are restored properly. mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 - -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac +chmod 755 dir +tar cf a.tar dir +chmod 777 dir +tar -xf a.tar --no-overwrite-dir +genfile --stat=mode.777 dir -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir >/dev/null +# 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 ) -./incr01.at:30: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./incr07.at:40: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * ckmtime || exit 77 +mkdir dirA +echo 'a' > dirA/a +echo 'a' > dirA/b -mkdir directory -$as_ln_s foo directory/bar +decho C0 +tar -g test.snar -vcf test.0.tar dirA -tar -cf archive.0 -g db directory -rm directory/bar -tar -cf archive.1 -g db directory +echo 'a' > dirA/c +decho C1 +tar -g test.snar -vcf test.1.tar dirA -mv directory orig +rm -f dirA/a +decho C2 +tar -g test.snar -vcf test.2.tar dirA -tar xvfg archive.0 /dev/null --warning=no-timestamp -echo separator -tar xvfg archive.1 /dev/null --warning=no-timestamp +mkdir ext +rm -rf dirA + +decho E0 +tar -g test.snar -vxf test.0.tar -C ext/ +decho E1 +tar -g test.snar -vxf test.1.tar -C ext/ + +decho E2 +tar -g test.snar -vxf test.2.tar -C ext/ + +mkdir ext/dirA/dirB +touch ext/dirA/dirB/file + +decho E3 +tar -g test.snar -vxf test.2.tar -C ext/ + +echo FIN +test -d dirA && echo >&2 "toplevel dirA exists" +exit 0 ) +A +B +tar: .: Directory is new +tar: ./subdir: Directory is new +tar: ./subdir/dir1: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir: Directory is new +tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2: Directory is new +tar: Removing leading `/' from member names +stdout: ./incr06.at:24: mkdir oldgnu (cd oldgnu @@ -11256,11 +11666,28 @@ echo Level 1 sub . tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . ) -stderr: -77. exclude18.at:30: stdout: - ok +A +. +./foo +./foo/subdir +./foo/subdir/dir1 +./subdir +./subdir/dir2 +B +./ +./subdir/ +./subdir/dir1/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/ +/build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2/ +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "s|$DIR|ABSPATH|" stdout -./exclude04.at:22: +130. incr09.at:26: ok +113. label03.at:27: ok +131. incr10.at:18: ok +./extrac22.at:29: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11270,53 +11697,74 @@ 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) -rm -rf testdir -mkdir -p testdir/dir -touch testdir/file1 -touch testdir/file2 -touch testdir/file3 -touch testdir/file4 -touch testdir/dir/File1 -touch testdir/dir/File2 -touch testdir/dir/File3 -touch testdir/dir/File4 +cat >filelist <<'_ATEOF' +./dir2/data2 +./dir2 +./dir1/data1 +./dir1 +./data1 +_ATEOF -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 +tar -C t -c -f a.tar --no-recursion -T filelist -echo "SUB 2" -tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort +mkdir restore +tar -x -p --delay-directory-restore -C restore -f a.tar +# Previous versions of tar would fail here with the following diagnostics: +# tar: ./dir2/data2: Cannot unlink: Permission denied +) +./incr08.at:41: +DIR=`pwd`/gnu/tartest +sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr +./incr05.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -echo "SUB 3" -tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort +ckmtime || exit 77 +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -rm -rf testdir +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 . ) -A -B -tar: .: Directory is new -tar: ./subdir: Directory is new -tar: ./subdir/dir1: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir: Directory is new -tar: /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/129/gnu/tartest/subdir/dir2: Directory is new -tar: Removing leading `/' from member names +129. incr08.at:38: + + ok + stdout: +stderr: ./filerem01.at:39: mkdir posix (cd posix @@ -11335,24 +11783,12 @@ tar --blocking-factor=1 -c -f archive.tar \ --listed-incremental db -v dir >/dev/null ) - -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/ -130. incr09.at:26: - ok -./exclude01.at:22: +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: +135. dirrem01.at:38: testing directory removed before reading ... +./dirrem01.at:41: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11361,86 +11797,69 @@ export TAR_OPTIONS rm -rf * +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -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 +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -rm -rf testdir +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir >/dev/null ) -./extrac25.at:21: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./filerem02.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * -mkdir subdir -touch subdir/a.txt -tar -cf test.tar subdir/a.txt +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 +mkdir dir2 +genfile --file dir2/file1 -rm -rf subdir -ln -s does_not_exist subdir -tar -xvf test.tar +genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null ) -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "s|$DIR|ABSPATH|" stdout - -107. extrac24.at:18: ok - - -./incr05.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +136. dirrem02.at:31: testing explicitly named directory removed before reading ... +./dirrem02.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -ckmtime || exit 77 mkdir dir mkdir dir/sub genfile --file dir/file1 genfile --file dir/sub/file2 -echo Level 0 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -genfile --file dir/file3 -echo Level 1 -tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir . +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir dir/sub >/dev/null ) 137. rename01.at:24: testing renamed dirs in incrementals ... ./rename01.at:27: @@ -11484,9 +11903,42 @@ echo End directory listing 2 ) +126. incr05.at:21: 106. extrac23.at:18: ok +132. incr11.at:25: ok + ok +./incr06.at:24: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * +ckmtime || exit 77 +mkdir dir +mkdir dir/sub +mkdir dir/sub/a +mkdir dir/sub/b +genfile --file dir/file1 +genfile --file dir/sub/file2 +genfile --file dir/sub/a/file3 -./exclude02.at:22: +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 . +) +138. rename02.at:24: testing move between hierarchies ... +./rename02.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11498,48 +11950,44 @@ 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 -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 +sleep 1 -echo "SUB 1" -tar cf archive --no-anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -echo "SUB 2" -tar cf archive --anchored \ - --exclude="file1.txt" \ - testdir -tar tf archive | sort +mv foo/bar/baz foo -echo "SUB 3" -tar cf archive testdir file1.txt -tar t "file1.txt" -f archive | sort +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -echo "SUB 4" -tar t --no-anchored "file1.txt" -f archive | sort +mv foo old -echo "SUB 5" -tar t --anchored "file1.txt" -f archive | sort +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 -rm -rf testdir file1.txt +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 ) ./incr07.at:40: -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 * @@ -11580,58 +12028,71 @@ test -d dirA && echo >&2 "toplevel dirA exists" exit 0 ) -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: -138. rename02.at:24: testing move between hierarchies ... -./rename02.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +stdout: +stdout: +./dirrem02.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 * +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -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 +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir dir/sub >/dev/null +) +./dirrem01.at:41: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -mv foo/bar/baz foo +mkdir dir +mkdir dir/sub +genfile --file dir/file1 +genfile --file dir/sub/file2 -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +case "$TEST_TAR_FORMAT" in +posix) CPT=5;; +gnu) CPT=3;; +*) exit 77 +esac -mv foo old +genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ + tar --blocking-factor=1 -c -f archive.tar \ + --listed-incremental db \ + --warning=no-file-changed \ + -v dir >/dev/null +) +133. filerem01.at:36: ok +105. extrac22.at:19: ok -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 -) -131. incr10.at:18: ok -101. extrac18.at:34: 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: 140. rename04.at:27: testing renamed directory containing subdirectories ... ./rename04.at:30: mkdir gnu @@ -11671,30 +12132,6 @@ tar -xf archive.2 -g db.2 find dir | sort ) - -./filerem02.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -mkdir dir2 -genfile --file dir2/file1 - -genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null -) -./incr08.at:41: -DIR=`pwd`/gnu/tartest -sed "/tar: Removing leading \`\/*\/' from/d;s|$DIR|ABSPATH|" stderr 139. rename03.at:23: testing cyclic renames ... ./rename03.at:26: mkdir gnu @@ -11752,6 +12189,47 @@ find foo | sort echo End directory listing 2 ) +134. filerem02.at:26: 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 + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) 142. rename06.at:19: testing chained renames ... @@ -11795,8 +12273,52 @@ decho Resulting directory find test1 | sort ) -141. rename05.at:24: testing renamed subdirectories ... -./rename05.at:27: +stdout: +stdout: +./rename01.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar foo/baz + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +136. dirrem02.at:31: ok +135. dirrem01.at:38: ok +143. chtype.at:27: testing changed file types in incrementals ... +./chtype.at:30: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -11809,6 +12331,145 @@ 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 +) +127. incr06.at:21: ok + + + +128. incr07.at:18: ok + +146. link02.at:32: testing preserve hard links with --remove-files ... +./link02.at:35: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +145. link01.at:33: testing link count gt 2 ... +./link01.at:36: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +144. ignfail.at:23: testing ignfail ... +./ignfail.at:26: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +./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 @@ -11818,7 +12479,6 @@ tar -cf archive.1 -g db.1 directory decho Renaming -mv directory/subdir directory/subdir.0 mv directory dir decho Creating incremental archive @@ -11828,62 +12488,172 @@ mv dir orig decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp +tar -xf archive.1 -g db.1 find directory | sort decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp +tar -xf archive.2 -g db.2 find dir | sort ) -./extrac22.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +147. link03.at:24: testing working -l with --remove-files ... +./link03.at:34: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 +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' +) + +./extrac20.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir 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 +for i in a b c +do + dir=in$i + mkdir -p $dir/root/dir $dir/root/dirsymlink + touch $dir/root/dirsymlink/file$i + test $i != a && touch $dir/root/dirsymlink/file.conflict + tar cf archive$i.tar -C $dir root +done +prep() +{ + echo "== $1 ==" + echo "== $1 ==" >&2 + backup_dir=$1 + dir=out + mkdir -p $dir/root/dir + ln -s dir $dir/root/dirsymlink + test $round = normal && cd $dir >/dev/null +} -tar -C t -c -f a.tar --no-recursion -T filelist +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -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 +# 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 ) -145. link01.at:33: testing link count gt 2 ... -./link01.at:36: +./rename05.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort +) +./link02.at:35: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +148. link04.at:29: testing link count is 1 but multiple occurrences ... +./link04.at:32: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -11892,6 +12662,77 @@ 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 +) +./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 +) +./link01.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + mkdir directory mkdir directory/test1 mkdir directory/test2 @@ -11906,13 +12747,12 @@ ls directory/test1 ) -143. chtype.at:27: testing changed file types in incrementals ... -./chtype.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./rename01.at:27: +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 * @@ -11920,40 +12760,83 @@ 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 +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo -sleep 2 +mv foo/bar foo/baz -# 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 "Creating incremental archive" +tar -g incr -cf arch.2 -v foo -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory +mv foo old -# Delete a -rm -r directory +tar xfg arch.1 /dev/null -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfg arch.2 /dev/null +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./link03.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.1 +tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +echo archive.2 +tar -c -f archive.2 -l --remove-files file1 file2 file3 +echo testing archive.2 +tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' +) +./link02.at:35: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) -81. delete04.at:23: 144. ignfail.at:23: testing ignfail ... ./ignfail.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 * @@ -11999,37 +12882,61 @@ chmod 700 directory test $status = 0 ) - ok -stdout: -129. incr08.at:38: ./dirrem01.at:41: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./link04.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 * mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 +echo TEST > dir/file +ln -s file dir/symlink || exit 77 -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac +tar cf archive dir dir +tar tvf archive | sed ' + s,.*[0-9] dir/,dir/, +' | sort -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ - ok - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir >/dev/null +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 ) -stdout: -./extrac23.at:32: +./link01.at:36: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir directory +mkdir directory/test1 +mkdir directory/test2 + +echo TEST > directory/test1/test.txt +ln directory/test1/test.txt directory/test2/test.txt || exit 77 + +tar cf archive directory/test1/test.txt directory/test1/test.txt + +rm -r directory +tar xf archive --warning=no-timestamp + +ls directory/test1 +) +./rename04.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12038,32 +12945,41 @@ export TAR_OPTIONS rm -rf * -# Test if the directory permissions are restored properly. -mkdir dir -chmod 755 dir -tar cf a.tar dir -chmod 777 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +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 ) -146. link02.at:32: testing preserve hard links with --remove-files ... ./link02.at:35: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -12074,8 +12990,7 @@ tar -c -f archive --remove-files file1 file2 file3 file4 tar tfv archive | sed -n 's/.*file[2-4] link to //p' ) - -87. extrac04.at:23: ./dirrem02.at:34: +./rename05.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12084,31 +12999,42 @@ export TAR_OPTIONS rm -rf * -mkdir dir -mkdir dir/sub -genfile --file dir/file1 -genfile --file dir/sub/file2 -case "$TEST_TAR_FORMAT" in -posix) CPT=5;; -gnu) CPT=3;; -*) exit 77 -esac +test -z "`sort < /dev/null 2>&1`" || exit 77 -genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \ - tar --blocking-factor=1 -c -f archive.tar \ - --listed-incremental db \ - --warning=no-file-changed \ - -v dir dir/sub >/dev/null + +decho Creating directory structure +mkdir directory +mkdir directory/subdir +genfile --file=directory/file + +decho Creating initial archive +tar -cf archive.1 -g db.1 directory + +decho Renaming +mv directory/subdir directory/subdir.0 +mv directory dir + +decho Creating incremental archive +cp db.1 db.2 +tar -cf archive.2 -g db.2 dir + +mv dir orig + +decho First restore +tar -xf archive.1 -g db.1 --warning=no-timestamp +find directory | sort + +decho Second restore +tar -xf archive.2 -g db.2 --warning=no-timestamp +find dir | sort ) - ok -147. link03.at:24: testing working -l with --remove-files ... ./link03.at:34: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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 * @@ -12131,7 +13057,7 @@ echo testing archive.2 tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' ) -./label03.at:30: +./link01.at:36: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12140,38 +13066,219 @@ 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 $? +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 ) +./rename06.at:29: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -stdout: -148. link04.at:29: testing link count is 1 but multiple occurrences ... + +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 +) ./link04.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +mkdir dir +echo 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 +) +./link02.at:35: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 +tar -c -f archive --remove-files file1 file2 file3 file4 +tar tfv archive | sed -n 's/.*file[2-4] link to //p' +) +137. rename01.at:24: ok +./ignfail.at:26: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +# The test is meaningless for super-user. + +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 + + +touch file +mkdir directory +touch directory/file + +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 +) +./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 +) + +146. link02.at:32: ok +./link03.at:34: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +genfile -l 64 -f file1 +ln file1 file2 +ln file2 file3 +ln file3 file4 + +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' +) +140. rename04.at:27: ok +./link04.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -12197,10 +13304,6 @@ s,symlink,FOO,g ' | sort ) -108. extrac25.at:18: ok -133. filerem01.at:36: ok -117. incr01.at:27: ok -62. exclude03.at:19: ok 149. longv7.at:24: testing long names in V7 archives ... ./longv7.at:30: mkdir v7 @@ -12219,9 +13322,10 @@ tar tf archive ) +141. rename05.at:24: ok -126. incr05.at:21: ok - +142. rename06.at:19: 145. link01.at:33: ok + ok 150. long01.at:28: testing long file names divisible by block size ... ./long01.at:36: mkdir gnu @@ -12238,7 +13342,22 @@ 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) -./incr06.at:24: +151. lustar01.at:21: testing ustar: unsplittable file name ... +./lustar01.at:27: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 +tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix +) + +149. longv7.at:24: ok +./ignfail.at:26: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -12247,89 +13366,109 @@ 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 . +# The test is meaningless for super-user. -mkdir dir/c -genfile --file dir/sub/b/file4 +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && exit 77 -echo Level 1 . sub -tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub -echo Level 1 sub . -tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub . -) -./link01.at:36: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +touch file mkdir directory -mkdir directory/test1 -mkdir directory/test2 +touch directory/file -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -tar cf archive directory/test1/test.txt directory/test1/test.txt +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 -rm -r directory -tar xf archive --warning=no-timestamp +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 -ls directory/test1 +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) -stdout: - -stderr: -./link02.at:35: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./link03.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * + genfile -l 64 -f file1 ln file1 file2 ln file2 file3 ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' + +echo 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' ) -151. lustar01.at:21: testing ustar: unsplittable file name ... -./lustar01.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./link04.at:32: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --file=this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix || exit 77 -tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_between_name_and_prefix +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 ) -135. dirrem01.at:38: 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 - ok 152. lustar02.at:21: testing ustar: unsplittable path name ... ./lustar02.at:32: mkdir ustar @@ -12344,8 +13483,8 @@ 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 ) -stdout: -153. lustar03.at:21: testing ustar: splitting long names ... + +151. lustar01.at:21: 153. lustar03.at:21: testing ustar: splitting long names ... ./lustar03.at:29: mkdir ustar (cd ustar @@ -12361,11 +13500,7 @@ tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be echo "List archive" tar tf archive) -132. incr11.at:25: - ok -134. filerem02.at:26: ok -stdout: 154. old.at:23: testing old archives ... ./old.at:27: mkdir directory @@ -12424,57 +13559,8 @@ tar -c -f archive.tar dir tar -d -f archive.tar dir ) -./incr07.at:40: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 -mkdir dirA -echo 'a' > dirA/a -echo 'a' > dirA/b - -decho C0 -tar -g test.snar -vcf test.0.tar dirA - -echo 'a' > dirA/c -decho C1 -tar -g test.snar -vcf test.1.tar dirA - -rm -f dirA/a -decho C2 -tar -g test.snar -vcf test.2.tar dirA - -mkdir ext -rm -rf dirA - -decho E0 -tar -g test.snar -vxf test.0.tar -C ext/ -decho E1 -tar -g test.snar -vxf test.1.tar -C ext/ - -decho E2 -tar -g test.snar -vxf test.2.tar -C ext/ - -mkdir ext/dirA/dirB -touch ext/dirA/dirB/file - -decho E3 -tar -g test.snar -vxf test.2.tar -C ext/ - -echo FIN -test -d dirA && echo >&2 "toplevel dirA exists" -exit 0 -) -149. longv7.at:24: ok -136. dirrem02.at:31: ok -63. exclude04.at:19: ok -./link04.at:32: +./long01.at:36: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -12483,28 +13569,13 @@ export TAR_OPTIONS rm -rf * -mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, -' | sort - -echo -- - -tar cfl archive dir dir -echo == +install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 +echo test > endfile -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort -) +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) +154. old.at:23: ok 156. time02.at:20: testing time: clamping mtime ... ./time02.at:23: mkdir pax @@ -12529,44 +13600,10 @@ tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir tar -d -f archive.tar dir|sort ) -./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 -) +148. link04.at:29: ok +152. lustar02.at:21: ok +147. link03.at:24: ok 157. multiv01.at:23: testing multivolume dumps from pipes ... ./multiv01.at:30: mkdir gnu @@ -12606,76 +13643,7 @@ cmp file1 extract-dir-pipe/file1 cmp file2 extract-dir-pipe/file2 ) -./link03.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' -) -./rename01.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar foo/baz - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -158. multiv02.at:28: testing skipping a straddling member ... -./multiv02.at:31: +./ignfail.at:26: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12684,54 +13652,56 @@ 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 +# The test is meaningless for super-user. -exec <&- +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 && 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 -) -151. lustar01.at:21: ./extrac23.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +touch file +mkdir directory +touch directory/file -# 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 +echo 1>&2 ----- +chmod 000 file +tar cf archive file +status=$? +chmod 600 file +test $status = 2 || exit 1 -# Test if temporary permissions are set correctly to allow the owner -# to write to the directory. -genfile --file dir/file -tar cf a.tar dir -rm dir/file -chmod 400 dir -tar -xf a.tar --no-overwrite-dir -genfile --stat=mode.777 dir -chmod 700 dir -find dir +echo 1>&2 ----- +chmod 000 file +tar cf archive --ignore-failed-read file || exit 1 +status=$? +chmod 600 file +test $status = 0 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive directory +status=$? +chmod 700 directory +test $status = 2 || exit 1 + +echo 1>&2 ----- +chmod 000 directory +tar cf archive --ignore-failed-read directory || exit 1 +status=$? +chmod 700 directory +test $status = 0 ) - ok +153. lustar03.at:21: ok ./extrac20.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -12798,7 +13768,12 @@ clean done ) -./extrac22.at:29: + + + +150. long01.at:28: ok +158. multiv02.at:28: testing skipping a straddling member ... +./multiv02.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -12807,194 +13782,45 @@ 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 -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 -) -./ignfail.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) -./link02.at:35: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 -tar -c -f archive --remove-files file1 file2 file3 file4 -tar tfv archive | sed -n 's/.*file[2-4] link to //p' -) -./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 +exec <&- -decho Resulting directory -find test1 | sort +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 ) -154. old.at:23: 60. exclude01.at:19: ok - ok - -./rename05.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +156. time02.at:20: ok +160. multiv04.at:36: testing split directory members in a MV archive ... +./multiv04.at:39: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +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 +awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt - -rm -r directory -tar xf archive --warning=no-timestamp - -ls directory/test1 -) - -./long01.at:36: +./multiv01.at:30: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -13069,12 +13871,35 @@ export TAR_OPTIONS rm -rf * +exec <&- +genfile --length 7168 --file file1 -install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77 -echo test > endfile +for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ + " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ + echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + for count in 2 3 4 5 6 7 8 ; do + echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" + done +done >file2 -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) +if test $TEST_TAR_FORMAT = pax; then + TAPE_LENGTH=11 +else + TAPE_LENGTH=10 +fi + +tar -c --multi-volume --tape-length=$TAPE_LENGTH \ + -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 + +mkdir extract-dir-pipe +dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | +PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ + -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ + --tape-length=$TAPE_LENGTH --read-full-records || exit 1 + +cmp file1 extract-dir-pipe/file1 +cmp file2 extract-dir-pipe/file2 +) 161. multiv05.at:26: testing Restoring after an out of sync volume ... ./multiv05.at:30: mkdir gnu @@ -13114,37 +13939,8 @@ echo Diffing szesc cmp bak/szesc szesc || exit 1 ) -61. exclude02.at:19: ok -113. label03.at:27: 160. multiv04.at:36: testing split directory members in a MV archive ... -./multiv04.at:39: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' ../experr < ../expout < 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 -) - -163. multiv07.at:28: skipped (multiv07.at:31) -./multiv06.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - -exec <&- -decho Creating file -genfile --length 20139 --file file -decho Creating archive -tar -c -M -L10 -b20 -farc.1 -farc.2 -farc.3 file -decho Testing archive -tar -t -M -farc.1 -farc.2 -farc.3) -./link01.at:36: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +159. multiv03.at:30: ok +167. owner.at:21: testing --owner and --group ... +./owner.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +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 +export TZ=UTC0 -tar cf archive directory/test1/test.txt directory/test1/test.txt +genfile --file a -rm -r directory -tar xf archive --warning=no-timestamp +tar --owner="Joe the Plumber:1234" \ + --group="Plumber's Union:5678" \ + --mtime='@0' \ + --mode='u=rw,go=r' \ + -cf arc a -ls directory/test1 +tar -tvf arc +tar --numeric-owner -tvf arc ) -./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 +164. multiv08.at:25: + ok -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' -) 168. map.at:21: testing --owner-map and --group-map ... ./map.at:24: mkdir gnu @@ -13492,8 +14255,26 @@ tar -tvf 2.tar tar --numeric-owner -tvf 2.tar ) -169. sparse01.at:21: testing sparse files ... -./sparse01.at:24: + +./multiv09.at:33: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null < sparsecopy || exit 1 +cmp sparsefile sparsecopy ) - -164. multiv08.at:25: ok -170. sparse02.at:21: testing extracting sparse file over a pipe ... -./sparse02.at:28: +169. sparse01.at:21: testing sparse files ... +./sparse01.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -13527,15 +14300,21 @@ 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 --hole-detection=raw -c -f archive --sparse sparsefile || exit 1 +tar -c -f archive --sparse begin sparsefile end || exit 1 echo separator -tar xfO archive | cat - > 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 ) -106. extrac23.at:18: ok - +167. owner.at:21: ok +166. multiv10.at:37: ok 171. sparse03.at:21: testing storing sparse files > 8G ... ./sparse03.at:29: mkdir posix @@ -13561,46 +14340,10 @@ cmp sparsefile directory/sparsefile ) -128. incr07.at:18: ok -./multiv01.at:30: -mkdir pax -(cd pax -TEST_TAR_FORMAT=pax -export TEST_TAR_FORMAT -TAR_OPTIONS="-H pax" -export TAR_OPTIONS -rm -rf * - -exec <&- -genfile --length 7168 --file file1 - -for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \ - " 9" "10" "11" "12" "13" "14" "15" "16" ; do \ - echo "file2 block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - for count in 2 3 4 5 6 7 8 ; do - echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla" - done -done >file2 - -if test $TEST_TAR_FORMAT = pax; then - TAPE_LENGTH=11 -else - TAPE_LENGTH=10 -fi - -tar -c --multi-volume --tape-length=$TAPE_LENGTH \ - -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1 - -mkdir extract-dir-pipe -dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null | -PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \ - -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \ - --tape-length=$TAPE_LENGTH --read-full-records || exit 1 -cmp file1 extract-dir-pipe/file1 -cmp file2 extract-dir-pipe/file2 -) -./multiv02.at:31: +168. map.at:21: ok +172. sparse04.at:21: testing storing long sparse file names ... +./sparse04.at:35: mkdir pax (cd pax TEST_TAR_FORMAT=pax @@ -13609,59 +14352,10 @@ 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 -) -105. extrac22.at:19: ok -./multiv03.at:33: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'` -BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'` - -cat > ../experr < ../expout < $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null <&1`" || exit 77 - +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -decho Creating directory structure +tar tfv archive +echo separator 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 +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile ) 173. sparse05.at:21: testing listing sparse files bigger than 2^33 B ... ./sparse05.at:31: @@ -14585,8 +15204,7 @@ 10M =2560 10M =2560 10M =2560 -10M -=2560 +10M =2560 10M =2560 10M =2560 10M =2560 @@ -14800,46 +15418,24 @@ genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77 tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print $3, $(NF) }' ) -./rename06.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix + +./sparse02.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1 +echo separator -test -z "`sort < /dev/null 2>&1`" || exit 77 - -decho Creating directory structure -mkdir test test/d1 test/d2 -genfile --file test/d1/file1 -genfile --file test/d2/file2 - -decho First dump -tar -c -g 0.snar -C test -f backup0.tar . - -decho Altering directory structure -genfile --file test/d2/file3 -mv test/d1 test/d3 -mv test/d2 test/d1 - -decho Second dump -cp 0.snar 1.snar -tar -vc -g 1.snar -C test -f backup1.tar . - -mkdir test1 - -decho First extract -tar -C test1 -x -g /dev/null -f backup0.tar - -decho Second extract -tar -C test1 -x -g /dev/null -f backup1.tar - -decho Resulting directory -find test1 | sort +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy ) +172. sparse04.at:21: ok 174. sparse06.at:21: testing storing sparse file using seek method ... ./sparse06.at:32: mkdir posix @@ -14912,13 +15508,12 @@ ) - -./rename01.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./extrac20.at:24: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * @@ -14926,39 +15521,79 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo +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 -mv foo/bar foo/baz +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 "Creating incremental archive" -tar -g incr -cf arch.2 -v foo +clean() +{ + test $round = normal && cd .. >/dev/null + find $dir | sort + mv $dir $backup_dir +} -mv foo old +# 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 xfg arch.1 /dev/null +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 "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" + # Keep directory symlink must keep root/dirsymlink + prep with_option_$round + tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 + tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 + clean -tar xfg arch.2 /dev/null -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 + 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 ) + +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-05-30 11:26 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 end +separator +sparsefile 3102720 ./multiv09.at:33: -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 * @@ -14970,41 +15605,30 @@ q EOF ) -162. multiv06.at:27: ok -166. multiv10.at:37: ok - -./link04.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./sparse01.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 * -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 == +genfile --length 1000 -f begin +genfile --length 1000 -f end +genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse begin sparsefile end || exit 1 +echo separator -tar chf archive dir -tar tvf archive | sed ' - s,.*[0-9] dir/,dir/, - s,file,FOO,g - s,symlink,FOO,g -' | sort +tar tfv archive +echo separator +mkdir directory +tar Cxf directory archive --warning=no-timestamp +genfile --stat=name,size sparsefile +cmp sparsefile directory/sparsefile ) -./rename05.at:27: +175. sparse07.at:21: testing sparse files with unicode names ... +./sparse07.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15013,38 +15637,35 @@ export TAR_OPTIONS rm -rf * +genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 +tar -c -f archive --sparse žluť || exit 1 -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -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 +tar tf archive +) +./sparse02.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -decho First restore -tar -xf archive.1 -g db.1 --warning=no-timestamp -find directory | sort +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 -decho Second restore -tar -xf archive.2 -g db.2 --warning=no-timestamp -find dir | sort +tar xfO archive | cat - > sparsecopy || exit 1 +cmp sparsefile sparsecopy ) -172. sparse04.at:21: ok -./link01.at:36: +stdout: +separator +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 begin +-rw-r--r-- pbuilder2/pbuilder2 3102720 2024-05-30 11:26 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 end +separator +sparsefile 3102720 +./multiv09.at:33: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -15053,28 +15674,34 @@ export TAR_OPTIONS rm -rf * -mkdir directory -mkdir directory/test1 -mkdir directory/test2 - -echo TEST > directory/test1/test.txt -ln directory/test1/test.txt directory/test2/test.txt || exit 77 - -tar cf archive directory/test1/test.txt directory/test1/test.txt +genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? +echo "created" +tar --format=gnu -xM -f A.tar 2>/dev/null <&1`" || exit 77 + +mkdir directory +genfile --file=directory/x +genfile --file=directory/y + +sleep 1 + +tar -cf archive.1 -g db directory + +mv directory/x directory/z +cp db db.old +tar -cf archive.2 -g db directory + +mv directory orig + +echo Listing of archive.1 +tar -tf archive.1 | sort +echo Listing of archive.2 +tar -tf archive.2 | sort + +echo Directory after first restore +tar -xf archive.1 -g db --warning=no-timestamp +find directory | sort + +echo Directory after second restore +tar -xf archive.2 -g db --warning=no-timestamp +find directory | sort +) +./incr04.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +ckmtime || exit 77 + +install-sh -d a/b >/dev/null || exit 77 +awk 'BEGIN { + for (i=1;i<=142;i++) + printf("a/b/one_31_chars_long_file_name_%03d\n", i); + }' < /dev/null | genfile --files-from - + +sleep 1 + +echo "Initial dump" +tar cvf a0.tar -g a.sna a +mv a/b a/c +echo "Incremental dump" +tar cvf a1.tar -g a.sna a +) +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 +) + +184. update01.at:29: testing update directories ... +./update01.at:32: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a + +echo "separator" + +sleep 2 +genfile --file a/c + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +./update.at:31: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +./update.at:31: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +./rename02.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./update.at:31: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir directory +genfile --length 10240 --pattern zeros --file directory/file1 +genfile --length 10240 --pattern default --file directory/file2 + +tar cf archive directory || exit 1 +echo separator +tar uf archive directory || exit 1 +echo separator +tar tf archive | sort || exit 1 +) +./update.at:31: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -15310,18 +16168,171 @@ 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 + +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 +) +./rename03.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy + +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 ) +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 -181. sptrdiff00.at:26: testing file truncated in sparse region while comparing ... -./sptrdiff00.at:30: +tar cf arc a + +echo "separator" + +sleep 2 +touch a/b + +tar ufv arc a +echo "separator" +tar tf arc | sort || exit 1 +) +174. sparse06.at:21: ok + +186. update03.at:20: testing update with chdir ... +./update03.at:27: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +mkdir dir1 +mkdir dir2 +mkdir dir1/subdir1 dir2/subdir2 +genfile --file dir1/subdir1/a +genfile --file dir2/subdir2/a +echo Create +tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +genfile --file dir1/subdir1/b +genfile --file dir2/subdir2/c +echo Update +tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +) +./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 +) +./update03.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15330,6 +16341,49 @@ 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 +./sptrdiff00.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + genfile --sparse --block-size=1024 --file foo \ 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 genfile --file baz @@ -15339,26 +16393,231 @@ genfile --run --checkpoint 3 --length 200m --truncate foo -- \ tar --sparse -vdf bar ) -./multiv09.at:33: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar + +187. update04.at:20: testing update with wildcards ... +./update04.at:23: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null < 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 $? ) +./sptrcreat.at:36: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -182. sptrdiff01.at:26: testing file truncated in data region while comparing ... +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') ./sptrdiff01.at:30: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ + tar --sparse -vdf bar +) +155. time01.at:20: ok + +188. verify.at:25: testing verify ... +./verify.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo +) +./exclude05.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +./sptrdiff00.at:30: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +echo creating +tar --sparse -vcf bar foo baz +echo comparing +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vdf bar +) +./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 +) +./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 +) +./verify.at:28: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo +) +./incr04.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -15367,6 +16626,31 @@ 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 +) +./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 @@ -15376,11 +16660,107 @@ genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ tar --sparse -vdf bar ) +./rename02.at:27: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * -159. multiv03.at:30: ok -145. link01.at:33: ok -./sparse07.at:24: +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 +mkdir foo/bar +genfile --file foo/bar/file.r +mkdir foo/bar/baz +genfile --file foo/bar/baz/file.z + +sleep 1 + +echo "Creating base archive" +tar -g incr -cf arch.1 -v foo + +mv foo/bar/baz foo + +echo "Creating incremental archive" +tar -g incr -cf arch.2 -v foo + +mv foo old + +tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr +sort tmperr >&2 + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./rename03.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +mkdir foo +genfile --file foo/file1 +genfile --file foo/file2 + +mkdir foo/a +genfile --file foo/a/filea + +mkdir foo/b +genfile --file foo/b/fileb + +mkdir foo/c +genfile --file foo/c/filec + +sleep 1 + +echo "First dump" +echo "First dump">&2 +tar -g incr -cf arch.1 -v foo 2>tmperr +sort tmperr >&2 + +# Shuffle directories: +(cd foo +mv a $$ +mv c a +mv b c +mv $$ b) + +echo "Second dump" +echo "Second dump" >&2 +tar -g incr -cf arch.2 -v foo 2>tmperr +sort tmperr >&2 + +tar xfg arch.1 /dev/null --warning=no-timestamp + +echo "Begin directory listing 1" +find foo | sort +echo "End directory listing 1" + +tar xfgv arch.2 /dev/null --warning=no-timestamp +echo Begin directory listing 2 +find foo | sort +echo End directory listing 2 +) +./update04.at:23: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -15389,106 +16769,121 @@ export TAR_OPTIONS rm -rf * -genfile --sparse --file žluť --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse žluť || exit 1 +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.*' -tar tf archive +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? ) -183. update.at:28: testing update unchanged directories ... -./update.at:31: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./listed01.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 * +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 -test -z "`sort < /dev/null 2>&1`" || exit 77 +sleep 2 -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 +genfile --length 10240 --pattern zeros --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 +echo "separator" +cp listing listing.old +tar --create \ + --file=archive.2 \ + --listed-incremental=listing \ + directory/file* || exit 1 + +tar tf archive.2 || exit 1 ) -./link04.at:32: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +./sptrcreat.at:36: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -mkdir dir -echo TEST > dir/file -ln -s file dir/symlink || exit 77 - -tar cf archive dir dir -tar tvf archive | sed ' -./ignfail.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +genfile --sparse --block-size=1024 --file foo \ + 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 +genfile --file baz +genfile --run --checkpoint 3 --length 200m --truncate foo -- \ + tar --sparse -vcf bar foo baz +echo Exit status: $? +echo separator +genfile --file foo --seek 200m --length 11575296 --pattern=zeros +tar dvf bar | sed '/foo: Mod time differs/d') +./incremental.at:26: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file +ckmtime || exit 77 -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 +mkdir structure +echo x >structure/file -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 +# On Nextstep (and perhaps other 4.3BSD systems), +# a newly created file's ctime isn't updated +# until the next sync or stat operation on the file. +ls -l structure/file >/dev/null -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 +# 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 -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -185. update02.at:26: testing update changed files ... -./update02.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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 +) +./update01.at:32: +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 * @@ -15503,20 +16898,30 @@ echo "separator" sleep 2 -touch a/b +genfile --file a/c tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) +./verify.at:28: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + +touch foo +tar -cvf archive.tar --verify foo ) -184. update01.at:29: testing update directories ... -./update01.at:32: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +./update02.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 * @@ -15531,70 +16936,33 @@ echo "separator" sleep 2 -genfile --file a/c +touch a/b tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -188. verify.at:25: testing verify ... +182. sptrdiff01.at:26: 181. sptrdiff00.at:26: ok + ok +180. sptrcreat.at:33: ok ./verify.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * touch foo tar -cvf archive.tar --verify foo ) -186. update03.at:20: testing update with chdir ... -./update03.at:27: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -echo Create -tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -genfile --file dir1/subdir1/b -genfile --file dir2/subdir2/c -echo Update -tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -) - 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 -) -187. update04.at:20: testing update with wildcards ... ./update04.at:23: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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 * @@ -15615,116 +16983,8 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -stdout: - -separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-07-02 17:45 begin --rw-r--r-- pbuilder1/pbuilder1 3102720 2025-07-02 17:45 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-07-02 17:45 end -separator -sparsefile 3102720 -./sparse01.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --length 1000 -f begin -genfile --length 1000 -f end -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar -c -f archive --sparse begin sparsefile end || exit 1 -echo separator - -tar tfv archive -echo separator -mkdir directory -tar Cxf directory archive --warning=no-timestamp -genfile --stat=name,size sparsefile -cmp sparsefile directory/sparsefile -) - -./link03.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.1 -tar -c -f archive.1 -l --remove-files file1 file2 file3 file4 - -genfile -l 64 -f file1 -ln file1 file2 -ln file2 file3 -ln file3 file4 - -echo archive.2 -tar -c -f archive.2 -l --remove-files file1 file2 file3 -echo testing archive.2 -tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p' -) -177. spmvp00.at:21: 140. rename04.at:27: ok - ok -137. rename01.at:24: ./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 -) - ok -142. rename06.at:19: ok -175. sparse07.at:21: ok -./multiv09.at:33: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null <&2 ----- +tar xfV archive lab +test $? = 2 || exit 1 +echo 1>&2 ----- +tar xfV archive bel +test $? = 2 || exit 1 +echo 1>&2 ----- +tar xfV archive babel +test $? = 2 ) -./sparse02.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +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 oldgnu" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77 -tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1 -echo separator - -tar xfO archive | cat - > sparsecopy || exit 1 -cmp sparsefile sparsecopy +genfile --length 511 --file foo || exit 5 +tar tf foo ) +191. comprec.at:21: testing compressed format recognition ... +./comprec.at:25: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -./update.at:31: +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 +) +192. shortfile.at:26: ok + +./comprec.at:25: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -15842,44 +17123,49 @@ 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 +cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 +genfile --length 10240 --file file1 +echo "separator" +tar cfz archive file1 +echo "separator" +mv file1 orig +tar xfv archive --warning=no-timestamp +cmp orig file1 ) +190. volsize.at:29: 193. shortupd.at:31: testing updating short archives ... +./shortupd.at:34: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * - - - -148. link04.at:29: ok -stdout: -192. shortfile.at:26: testing short input files ... -./shortfile.at:29: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu +touch foo +tar uf archive foo +) + skipped (volsize.at:32) +125. incr04.at:29: ok +./shortupd.at:34: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" +TAR_OPTIONS="-H oldgnu" export TAR_OPTIONS rm -rf * -genfile --length 511 --file foo || exit 5 -tar tf foo +touch foo +tar uf archive foo ) -191. comprec.at:21: testing compressed format recognition ... ./comprec.at:25: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +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 * @@ -15894,6 +17180,23 @@ tar xfv archive --warning=no-timestamp cmp orig file1 ) +189. volume.at:23: ok + + +195. grow.at:24: testing grow ... +./grow.at:27: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) 194. truncate.at:29: testing truncate ... ./truncate.at:32: mkdir v7 @@ -15912,65 +17215,83 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -./verify.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +./truncate.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 * -touch foo -tar -cvf archive.tar --verify foo -) -193. shortupd.at:31: testing updating short archives ... +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') +./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); }' /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 ) -147. link03.at:24: ok 196. sigpipe.at:21: testing sigpipe handling ... ./sigpipe.at:30: @@ -15988,31 +17309,27 @@ # Discard diagnostics that some shells generate about broken pipes. (tar tf archive 2>&3 | :) 3>&2 2>/dev/null -190. volsize.at:29: ./volume.at:26: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +./truncate.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 * -tar -cf archive -V label -T /dev/null || exit 1 +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') +138. rename02.at:24: ok -tar xfV archive label || exit 1 -tar xfV archive 'la?el' || exit 1 -tar xfV archive 'l*l' || exit 1 +196. sigpipe.at:21: ok -echo 1>&2 ----- -tar xfV archive lab -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive bel -test $? = 2 || exit 1 -echo 1>&2 ----- -tar xfV archive babel -test $? = 2 -) 197. comperr.at:18: testing compressor program failure ... ./comperr.at:28: mkdir v7 @@ -16028,75 +17345,7 @@ sed -n '$p' err exit $rc ) -./ignfail.at:26: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -# The test is meaningless for super-user. - -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 && exit 77 - - -touch file -mkdir directory -touch directory/file - -echo 1>&2 ----- -chmod 000 file -tar cf archive file -status=$? -chmod 600 file -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 file -tar cf archive --ignore-failed-read file || exit 1 -status=$? -chmod 600 file -test $status = 0 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive directory -status=$? -chmod 700 directory -test $status = 2 || exit 1 - -echo 1>&2 ----- -chmod 000 directory -tar cf archive --ignore-failed-read directory || exit 1 -status=$? -chmod 700 directory -test $status = 0 -) - skipped (volsize.at:32) -./multiv09.at:33: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * -genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $? -echo "created" -tar --format=gnu -xM -f A.tar 2>/dev/null <&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 -) - -169. sparse01.at:21: ok -196. sigpipe.at:21: ok 199. remfiles02.at:28: testing remove-files with compression: grand-child ... ./remfiles02.at:32: @@ -16266,7 +17428,7 @@ find . | sort exit $EC -./truncate.at:32: +./incr02.at:35: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -16275,14 +17437,47 @@ export TAR_OPTIONS rm -rf * -genfile --file foo --length 200k -genfile --file baz -genfile --run --checkpoint 10 --length 195k --truncate foo -- \ - tar -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 195k --length 5k --pattern=zeros -tar dvf bar|sed '/foo: Mod time differs/d') +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 - +) +199. remfiles02.at:28: ok +198. remfiles01.at:28: ok + + 200. remfiles03.at:28: testing remove-files with symbolic links ... ./remfiles03.at:31: mkdir a @@ -16291,26 +17486,6 @@ tar --remove-files -cf a.tar a genfile --stat a -./comprec.at:25: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -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 -) 201. remfiles04a.at:25: testing remove-files with -C:rel in -c/non-incr. mode ... ./remfiles04a.at:28: mkdir gnu @@ -16331,105 +17506,9 @@ echo A find . | sort ) -./extrac20.at:24: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -for i in a b c -do - dir=in$i - mkdir -p $dir/root/dir $dir/root/dirsymlink - touch $dir/root/dirsymlink/file$i - test $i != a && touch $dir/root/dirsymlink/file.conflict - tar cf archive$i.tar -C $dir root -done - -prep() -{ - echo "== $1 ==" - echo "== $1 ==" >&2 - backup_dir=$1 - dir=out - mkdir -p $dir/root/dir - ln -s dir $dir/root/dirsymlink - test $round = normal && cd $dir >/dev/null -} - -clean() -{ - test $round = normal && cd .. >/dev/null - find $dir | sort - mv $dir $backup_dir -} - -# Expand to '-f ../$1' or '-f $1 -C $dir' depending on $round variable -file_spec() -{ - if test $round = normal - then - echo "-f ../$1" - else - echo "-f $1 -C $dir" - fi -} - -for round in normal dir -do - # Check that 'dirsymlink' replaces 'dir' - prep without_option_$round - tar -x `file_spec archivea.tar` || exit 1 - tar -x `file_spec archiveb.tar` || exit 1 - clean - - # Keep directory symlink must keep root/dirsymlink - prep with_option_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` || exit 1 - clean - - prep collision_$round - tar -x --keep-directory-symlink `file_spec archivea.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archiveb.tar` --keep-old-files || exit 1 - tar -x --keep-directory-symlink `file_spec archivec.tar` --keep-old-files && exit 1 - clean -done -) -./shortupd.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -touch foo -tar uf archive foo -) - -189. volume.at:23: ok -./verify.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * +200. remfiles03.at:28: ok -touch foo -tar -cvf archive.tar --verify foo -) -170. sparse02.at:21: ok +201. remfiles04a.at:25: ok 202. remfiles04b.at:33: testing remove-files with -C:rel in -c/incr. mode ... ./remfiles04b.at:36: mkdir gnu @@ -16450,35 +17529,6 @@ echo A find . | sort ) -./comperr.at:28: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -tar --use-compress-program false -cf a.tar . 2>err -rc=$? -sed -n '$p' err -exit $rc -) - -165. multiv09.at:26: ok -200. remfiles03.at:28: ok -./shortupd.at:34: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -touch foo -tar uf archive foo -) 203. remfiles04c.at:33: testing remove-files with -C:rel in -r mode ... ./remfiles04c.at:36: @@ -16503,7 +17553,9 @@ echo B find . | sort ) -./update03.at:27: +202. remfiles04b.at:33: ok + +./shortupd.at:34: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16512,19 +17564,9 @@ export TAR_OPTIONS rm -rf * -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -echo Create -tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -genfile --file dir1/subdir1/b -genfile --file dir2/subdir2/c -echo Update -tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 +touch foo +tar uf archive foo ) - 204. remfiles05a.at:34: testing remove-files with -C:rel,rel in -c/non-incr. mode ... ./remfiles05a.at:37: mkdir gnu @@ -16548,36 +17590,12 @@ decho B find . | sort ) - -205. remfiles05b.at:25: testing remove-files with -C:rel,rel in -c/incr. mode ... -./remfiles05b.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -mkdir bar -echo file > file -echo foo/file > foo/file -echo bar/file > bar/file -decho A -tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file -decho B -find . | sort -) ./comperr.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 * @@ -16586,8 +17604,7 @@ sed -n '$p' err exit $rc ) -193. shortupd.at:31: ok -./update.at:31: +./chtype.at:30: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16599,25 +17616,61 @@ 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 +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 ) +203. remfiles04c.at:33: ok +./comprec.at:25: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -201. remfiles04a.at:25: ok -198. remfiles01.at:28: ok + +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 +) ./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 * @@ -16629,29 +17682,32 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') -144. ignfail.at:23: ok -188. verify.at:25: ok -./comprec.at:25: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +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 +(cd gnu +TEST_TAR_FORMAT=gnu export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H gnu" export TAR_OPTIONS rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +test -z "`sort < /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 +mkdir foo +mkdir bar +echo file > file +echo foo/file > foo/file +echo bar/file > bar/file +decho A +tar -cvf foo.tar --incremental --remove-files -C foo file -C ../bar file +decho B +find . | sort ) + 206. remfiles05c.at:25: testing remove-files with -C:rel,rel in -r mode ... ./remfiles05c.at:28: mkdir gnu @@ -16678,8 +17734,9 @@ decho C find . | sort ) -202. remfiles04b.at:33: ok -199. remfiles02.at:28: ok +205. remfiles05b.at:25: ok + +206. remfiles05c.at:25: ok 207. remfiles06a.at:25: testing remove-files with -C:rel,abs in -c/non-incr. mode ... ./remfiles06a.at:28: mkdir gnu @@ -16704,6 +17761,7 @@ decho B find . | sort ) + 208. remfiles06b.at:25: testing remove-files with -C:rel,abs in -c/incr. mode ... ./remfiles06b.at:28: mkdir gnu @@ -16728,24 +17786,7 @@ decho B find . | sort ) - - -./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 -) - - +207. remfiles06a.at:25: ok 209. remfiles06c.at:25: testing remove-files with -C:rel,abs in -r mode ... ./remfiles06c.at:28: @@ -16774,30 +17815,8 @@ decho C find . | sort ) +208. remfiles06b.at:25: ok -./update03.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -mkdir dir1 -mkdir dir2 -mkdir dir1/subdir1 dir2/subdir2 -genfile --file dir1/subdir1/a -genfile --file dir2/subdir2/a -echo Create -tar -vcf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -genfile --file dir1/subdir1/b -genfile --file dir2/subdir2/c -echo Update -tar -vuf arc.tar -C dir1 subdir1 -C ../dir2 subdir2 -) - -203. remfiles04c.at:33: ok 210. remfiles07a.at:25: testing remove-files with -C:abs,rel in -c/non-incr. mode ... ./remfiles07a.at:28: mkdir gnu @@ -16822,7 +17841,21 @@ decho B find . | sort ) -205. remfiles05b.at:25: ok +209. remfiles06c.at:25: ok + +210. remfiles07a.at:25: ok +./shortupd.at:34: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +touch foo +tar uf archive foo +) 211. remfiles07b.at:25: testing remove-files with -C:abs,rel in -c/incr. mode ... ./remfiles07b.at:28: mkdir gnu @@ -16847,6 +17880,9 @@ decho B find . | sort ) + +193. shortupd.at:31: ok +191. comprec.at:21: ok 212. remfiles07c.at:25: testing remove-files with -C:abs,rel in -r mode ... ./remfiles07c.at:28: mkdir gnu @@ -16874,7 +17910,7 @@ decho C find . | sort ) -204. remfiles05a.at:34: ./truncate.at:32: +./comperr.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -16883,6 +17919,69 @@ export TAR_OPTIONS rm -rf * +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) +./exclude05.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * + + +test -z "`sort < /dev/null 2>&1`" || exit 77 + + +rm -rf testdir exclfile +mkdir -p testdir +awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ + while read name + do + genfile --file $name + done + +awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile + +tar cf archive --anchored --exclude-from=exclfile \ + testdir +tar tf archive | sort + +echo "NEXT" +tar cf archive --exclude-from=exclfile \ + testdir +tar tf archive | sort + +rm -rf testdir exclfile + +) +211. remfiles07b.at:25: ok +./grow.at:27: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +) +./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 -- \ @@ -16891,7 +17990,8 @@ echo separator genfile --file foo --seek 195k --length 5k --pattern=zeros tar dvf bar|sed '/foo: Mod time differs/d') - ok + +212. remfiles07c.at:25: ok 213. remfiles08a.at:28: testing remove-files deleting two subdirs in -c/non-incr. mode ... ./remfiles08a.at:31: mkdir gnu @@ -16911,6 +18011,9 @@ decho B find . ) + + + 214. remfiles08b.at:31: testing remove-files deleting two subdirs in -c/incr. mode ... ./remfiles08b.at:34: mkdir gnu @@ -16930,28 +18033,6 @@ decho B find . ) -./update.at:31: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir directory -genfile --length 10240 --pattern zeros --file directory/file1 -genfile --length 10240 --pattern default --file directory/file2 - -tar cf archive directory || exit 1 -echo separator -tar uf archive directory || exit 1 -echo separator -tar tf archive | sort || exit 1 -) 215. remfiles08c.at:28: testing remove-files deleting two subdirs in -r mode ... ./remfiles08c.at:31: mkdir gnu @@ -16977,6 +18058,7 @@ decho C find . ) +213. remfiles08a.at:28: ok 216. remfiles09a.at:25: testing remove-files on full directory in -c/non-incr. mode ... ./remfiles09a.at:28: mkdir gnu @@ -16994,33 +18076,73 @@ decho B find . ) -197. comperr.at:18: ok -./comprec.at:25: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +./update02.at:29: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 +test -z "`sort < /dev/null 2>&1`" || exit 77 + +mkdir a +genfile --file a/b + +tar cf arc a -genfile --length 10240 --file file1 echo "separator" -tar cfz archive file1 + +sleep 2 +touch a/b + +tar ufv arc a echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 +tar tf arc | sort || exit 1 ) +216. remfiles09a.at:25: ok +./verify.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * -207. remfiles06a.at:25: ok +touch foo +tar -cvf archive.tar --verify foo +) +214. remfiles08b.at:31: ok +./update01.at:32: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar +export TEST_TAR_FORMAT +TAR_OPTIONS="-H ustar" +export TAR_OPTIONS +rm -rf * -208. remfiles06b.at:25: ok -206. remfiles05c.at:25: 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 +) 217. remfiles09b.at:29: testing remove-files on full directory in -c/incr. mode ... ./remfiles09b.at:32: mkdir gnu @@ -17039,7 +18161,22 @@ find . ) -214. remfiles08b.at:31: ok +./comperr.at:28: +mkdir gnu +(cd gnu +TEST_TAR_FORMAT=gnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H gnu" +export TAR_OPTIONS +rm -rf * + +tar --use-compress-program false -cf a.tar . 2>err +rc=$? +sed -n '$p' err +exit $rc +) + +215. remfiles08c.at:28: ok 218. remfiles09c.at:25: testing remove-files on full directory in -r mode ... ./remfiles09c.at:28: mkdir gnu @@ -17063,11 +18200,6 @@ decho C find . | sort ) -186. update03.at:20: 216. remfiles09a.at:25: ok - ok -213. remfiles08a.at:28: ok - -210. remfiles07a.at:25: ok 219. remfiles10.at:20: testing remove-files ... ./remfiles10.at:23: mkdir gnu @@ -17087,26 +18219,9 @@ find foo exit $tar_status ) +217. remfiles09b.at:29: ok -./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') -211. remfiles07b.at:25: ok - +194. truncate.at:29: ok 220. xattr01.at:25: testing xattrs: basic functionality ... ./xattr01.at:28: mkdir v7 @@ -17155,34 +18270,21 @@ getfattr -h -d dir | grep -v -e '^#' -e ^$ getfattr -h -d dir/file | grep -v -e '^#' -e ^$ ) -209. remfiles06c.at:25: ok - -./comprec.at:25: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -cat /dev/null | gzip - > /dev/null 2>&1 || exit 77 - -genfile --length 10240 --file file1 -echo "separator" -tar cfz archive file1 -echo "separator" -mv file1 orig -tar xfv archive --warning=no-timestamp -cmp orig file1 -) -183. update.at:28: ok +stderr: +A +tar: .: Cannot rmdir: Invalid argument +tar: Exiting with failure status due to previous errors +B +./remfiles10.at:44: sed '2s/:[^:]*$//' stderr -217. remfiles09b.at:29: - ok -215. remfiles08c.at:28: ok +--- - 2024-05-30 11:26:05.309137291 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2024-05-30 11:26:05.302979483 +0000 +@@ -1,3 +1 @@ +-user.test="OurDirValue" +-user.test="OurFileValue" + +218. remfiles09c.at:25: ok 221. xattr02.at:25: testing xattrs: change directory with -C option ... ./xattr02.at:28: mkdir v7 @@ -17238,57 +18340,6 @@ getfattr -h -d file2 | grep -v -e '^#' -e ^$ getfattr -h -d subsubdir | grep -v -e '^#' -e ^$ ) - -stderr: -223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... -./xattr04.at:29: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * - - - - file=$(TMPDIR=. mktemp fiXXXXXX) - - setfattr -n user.test -v test $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - getfattr $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi - - - file=$(TMPDIR=. mktemp fiXXXXXX) - setfattr -n user.test -v ahoj $file - # check whether tar fails to store xattrs - err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi - - -mkdir dir -mkdir output -genfile --file dir/file - -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 -ret=$? -getfattr -h -d output/file | grep -v -e '^#' -e ^$ -exit $ret -) 222. xattr03.at:25: testing xattrs: trusted.* attributes ... ./xattr03.at:28: mkdir v7 @@ -17353,20 +18404,22 @@ getfattr -mtrusted. -d subsubdir | grep -v -e '^#' -e ^$ ) -A -tar: .: Cannot rmdir: Invalid argument -tar: Exiting with failure status due to previous errors -B ---- - 2025-07-02 17:45:26.387155260 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/220/stdout 2025-07-02 17:45:26.377777485 +0000 -@@ -1,3 +1 @@ +--- - 2024-05-30 11:26:05.329287652 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2024-05-30 11:26:05.322978771 +0000 +@@ -1,4 +1 @@ +-user.test="OurFile1Value" +-user.test="OurFile2Value" -user.test="OurDirValue" --user.test="OurFileValue" -212. remfiles07c.at:25: ok - -220. xattr01.at:25: 224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... -./xattr05.at:31: +--- - 2024-05-30 11:26:05.335635523 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2024-05-30 11:26:05.326978628 +0000 +@@ -1,4 +1 @@ +-trusted.test="OurFile1Value" +-trusted.test="OurFile2Value" +-trusted.test="OurDirValue" + +223. xattr04.at:26: testing xattrs: s/open/openat/ regression ... +./xattr04.at:29: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17404,21 +18457,60 @@ 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 ) -./remfiles10.at:44: sed '2s/:[^:]*$//' stderr +--- - 2024-05-30 11:26:05.355453209 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2024-05-30 11:26:05.346977917 +0000 +@@ -1,2 +1 @@ +-user.test="value" + +222. xattr03.at:25: 221. xattr02.at:25: 220. xattr01.at:25: skipped (xattr02.at:28) skipped (xattr01.at:28) + skipped (xattr03.at:28) +223. xattr04.at:26: skipped (xattr04.at:29) +219. remfiles10.at:20: ok -226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... -./xattr07.at:29: + + + + +./update04.at:23: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix +export TEST_TAR_FORMAT +TAR_OPTIONS="-H posix" +export TAR_OPTIONS +rm -rf * + +genfile --file file.a +genfile --file file.b +genfile --file file.c +echo Create +tar cf archive ./file.* +sleep 1 +echo "update" > file.b +echo First update +tar ufv archive --wildcards './file.*' + +echo "Second update" +tar ufv archive --wildcards './file.*' + +echo "Non-matching pattern" +tar ufv archive --wildcards './file.*' './foo.*' +echo $? +) +197. comperr.at:18: ok +224. xattr05.at:28: testing xattrs: keywords with '=' and '%' ... +./xattr05.at:31: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17451,27 +18543,20 @@ exit 77 fi + mkdir dir +mkdir output genfile --file dir/file -genfile --file dir/file2 - -setfattr -n user.test -v OurDirValue dir -setfattr -n user.test -v OurFileValue dir/file -setfattr -n user.test -v OurFileValue dir/file2 - -tar --xattrs --no-recursion -cf archive.tar dir dir/file dir/file2 -setfattr -n user.test -v OurDirValue2 dir -setfattr -n user.test -v OurFileValue2 dir/file -setfattr -n user.test -v OurFileValue2 dir/file2 +setfattr -n user.=NAME%3D= -v value dir/file +getfattr -d dir/file | grep -v '# ' > before -# Check that tar continues to file2 too! -tar --xattrs -xvf archive.tar --skip-old-files -tar --xattrs -xvf archive.tar --keep-old-files +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar -C dir . -getfattr -h -d dir | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file | grep -v -e '^#' -e ^$ -getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ +tar --xattrs -xf archive.tar -C output +getfattr -d output/file | grep -v '# ' > after +diff before after ) 225. xattr06.at:27: testing xattrs: exclude xattrs on create ... ./xattr06.at:30: @@ -17528,14 +18613,6 @@ # if they differ then the attribute is still present diff filtered full ) ---- - 2025-07-02 17:45:26.394651806 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/221/stdout 2025-07-02 17:45:26.385777485 +0000 -@@ -1,4 +1 @@ --user.test="OurFile1Value" --user.test="OurFile2Value" --user.test="OurDirValue" - - 227. xattr08.at:26: testing xattrs: xattrs and read-only files ... ./xattr08.at:29: mkdir v7 @@ -17579,7 +18656,62 @@ tar --xattrs -C dir -cf archive.tar file tar --xattrs -C dir2 -xf archive.tar ) +226. xattr07.at:26: testing xattrs: xattrs and --skip-old-files ... +./xattr07.at:29: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * + + + + file=$(TMPDIR=. mktemp fiXXXXXX) + + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + + + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi + +mkdir dir +genfile --file dir/file +genfile --file dir/file2 +setfattr -n user.test -v OurDirValue dir +setfattr -n user.test -v OurFileValue dir/file +setfattr -n user.test -v OurFileValue dir/file2 + +tar --xattrs --no-recursion -cf archive.tar dir dir/file dir/file2 + +setfattr -n user.test -v OurDirValue2 dir +setfattr -n user.test -v OurFileValue2 dir/file +setfattr -n user.test -v OurFileValue2 dir/file2 + +# Check that tar continues to file2 too! +tar --xattrs -xvf archive.tar --skip-old-files +tar --xattrs -xvf archive.tar --keep-old-files + +getfattr -h -d dir | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file | grep -v -e '^#' -e ^$ +getfattr -h -d dir/file2 | grep -v -e '^#' -e ^$ +) 228. acls01.at:25: testing acls: basic functionality ... ./acls01.at:28: mkdir v7 @@ -17650,22 +18782,39 @@ diff before after test "$?" = 0 ) -221. xattr02.at:25: --- - 2025-07-02 17:45:26.398335779 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/223/stdout 2025-07-02 17:45:26.389777485 +0000 -@@ -1,2 +1 @@ --user.test="value" +--- - 2024-05-30 11:26:05.474348369 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2024-05-30 11:26:05.466973644 +0000 +@@ -1,7 +1 @@ +-tar: dir: skipping existing file +-tar: dir/file: skipping existing file +-tar: dir/file2: skipping existing file +-tar: dir/file: Cannot open: File exists +-tar: dir/file2: Cannot open: File exists +-tar: Exiting with failure status due to previous errors ---- - 2025-07-02 17:45:26.398774843 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/222/stdout 2025-07-02 17:45:26.389777485 +0000 -@@ -1,4 +1 @@ --trusted.test="OurFile1Value" --trusted.test="OurFile2Value" --trusted.test="OurDirValue" +--- - 2024-05-30 11:26:05.480408817 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2024-05-30 11:26:05.474973359 +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: 225. xattr06.at:27: 224. xattr05.at:28: 227. xattr08.at:26: 228. acls01.at:25: skipped (xattr06.at:30) + skipped (xattr05.at:31) + skipped (acls01.at:28) + skipped (xattr07.at:29) + skipped (xattr08.at:29) + + + + -219. remfiles10.at:20: 222. xattr03.at:25: ok - skipped (xattr02.at:28) -223. xattr04.at:26: 229. acls02.at:25: testing acls: work with -C ... ./acls02.at:28: mkdir v7 @@ -17742,36 +18891,9 @@ diff before after test "$?" = 0 ) -224. xattr05.at:28: skipped (xattr04.at:29) ---- - 2025-07-02 17:45:26.404309967 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stderr 2025-07-02 17:45:26.397777485 +0000 -@@ -1,7 +1 @@ --tar: dir: skipping existing file --tar: dir/file: skipping existing file --tar: dir/file2: skipping existing file --tar: dir/file: Cannot open: File exists --tar: dir/file2: Cannot open: File exists --tar: Exiting with failure status due to previous errors - - skipped (xattr03.at:28) -225. xattr06.at:27: 227. xattr08.at:26: skipped (xattr05.at:31) -194. truncate.at:29: ok -218. remfiles09c.at:25: ok ---- - 2025-07-02 17:45:26.406782283 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/226/stdout 2025-07-02 17:45:26.397777485 +0000 -@@ -1,10 +1 @@ --dir/ --dir/file --dir/file2 --dir/ --dir/file --dir/file2 --user.test="OurDirValue2" --user.test="OurFileValue2" --user.test="OurFileValue2" - -230. acls03.at:30: testing acls: default ACLs ... -./acls03.at:47: + +232. selacl01.at:25: testing acls/selinux: special files & fifos ... +./selacl01.at:28: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -17781,6 +18903,14 @@ rm -rf * +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 + + file=$(TMPDIR=. mktemp fiXXXXXX) setfattr -n user.test -v test $file &> /dev/null @@ -17799,13 +18929,13 @@ file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file &> /dev/null + restorecon $file &> /dev/null if test "$?" != 0; then exit 77 fi - getfacl $file &> /dev/null + chcon -h --user=unconfined_u $file &> /dev/null if test "$?" != 0; then exit 77 fi @@ -17813,180 +18943,139 @@ rm -rf $file file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file - err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) if test "$err" != "0"; then exit 77 fi -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -MYNAME=$( id -un ) -MYGROUP=$( id -gn ) - -# Prepare directory structure with default ACLs -mkdir -p pure/d1/d2 -genfile --file pure/d1/f2a -genfile --file pure/d1/f2b -genfile --file pure/d1/d2/f3a -genfile --file pure/d1/d2/f3b -setfacl -m g:$MYGROUP:r-x pure/d1 -setfacl -d -m g:$MYGROUP:rwx pure/d1 -setfacl -d -m u:$MYNAME:rwx pure/d1 -# "*a" files have "some" additional ACLs -setfacl -m u:$MYNAME:--- pure/d1/d2/f3a -setfacl -m u:$MYNAME:--- pure/d1/f2a - -# use default format (no acls stored) -tar -cf noacl.tar -C pure d1 - -# use posix format, acls stored -tar --acls -cf acl.tar -C pure d1 - -# Directory names are chosen based on "how the files were extracted from -# archive". Equivalent no* tags are used also: -# ^sacl_ — extracted archive has stored ACLs -# _def_ — target directory (-C) has default ACLs -# _optacl$ — extraction was done with --acls option - -mkdir sacl_def_optacl -mkdir sacl_def_optnoacl -mkdir sacl_nodef_optacl -mkdir sacl_nodef_optnoacl -mkdir nosacl_def_optacl -mkdir nosacl_def_optnoacl -mkdir nosacl_nodef_optacl -mkdir nosacl_nodef_optnoacl - -setfacl -d -m u:$MYNAME:--- nosacl_def_optnoacl sacl_def_optnoacl sacl_def_optacl nosacl_def_optacl -setfacl -d -m g:$MYGROUP:--- nosacl_def_optnoacl sacl_def_optnoacl sacl_def_optacl nosacl_def_optacl - -tar -xf acl.tar -C sacl_nodef_optnoacl -tar --acls -xf acl.tar -C sacl_nodef_optacl -tar -xf acl.tar -C sacl_def_optnoacl -tar --acls -xf acl.tar -C sacl_def_optacl -tar -xf noacl.tar -C nosacl_def_optnoacl -# _NO_ ACLs in output -tar -xf noacl.tar -C nosacl_nodef_optnoacl -tar -xf noacl.tar -C nosacl_nodef_optacl -tar -cf noacl_repackaged.tar -C nosacl_nodef_optnoacl d1 -# _NO_ ACLs in output (even when default ACLs exist) -tar --acls -xf noacl_repackaged.tar -C nosacl_def_optacl - - - cd pure - pure="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. - + file=$(TMPDIR=. mktemp fiXXXXXX) - cd sacl_def_optacl - sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. + setfacl -m u:$UID:rwx $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - cd sacl_def_optnoacl - sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. + getfacl $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file - cd sacl_nodef_optacl - sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - cd sacl_nodef_optnoacl - sacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. +mkdir dir +mkfifo dir/fifo +MAJOR=$( stat /dev/urandom --printf="%t" ) +MINOR=$( stat /dev/urandom --printf="%T" ) +mknod dir/chartype c $MAJOR $MINOR +# setup attributes +restorecon -R dir +chcon -h --user=system_u dir/fifo +chcon -h --user=system_u dir/chartype +setfacl -m u:$UID:--- dir/fifo +setfacl -m u:$UID:rwx dir/chartype - cd nosacl_def_optacl - nosacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. +getfacl dir/fifo >> before +getfattr -msecurity.selinux dir/chartype >> before +tar --xattrs --selinux --acls -cf archive.tar dir - cd nosacl_def_optnoacl - nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. +mv dir olddir +tar --xattrs --selinux --acls -xf archive.tar - cd nosacl_nodef_optacl - nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. +getfacl dir/fifo >> after +getfattr -msecurity.selinux dir/chartype >> after +diff before after +echo separator +) +233. capabs_raw01.at:25: testing capabilities: binary store/restore ... +./capabs_raw01.at:28: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * - cd nosacl_nodef_optnoacl - nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" - cd .. +echo "test" > $$ +chmod 0 $$ +cat $$ > /dev/null 2>&1 +result=$? +rm -f $$ +test $result -eq 0 || exit 77 - echo "$pure" > pure.log - echo "$sacl_def_optacl" > sacl_def_optacl.log - if test ! "$pure" "=" "$sacl_def_optacl"; then - echo "bad 'pure' against 'sacl_def_optacl' output" - fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v test $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo "$sacl_def_optacl" > sacl_def_optacl.log - echo "$sacl_nodef_optacl" > sacl_nodef_optacl.log - if test ! "$sacl_def_optacl" "=" "$sacl_nodef_optacl"; then - echo "bad 'sacl_def_optacl' against 'sacl_nodef_optacl' output" - fi + getfattr $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo "$sacl_def_optnoacl" > sacl_def_optnoacl.log - echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log - if test ! "$sacl_def_optnoacl" "=" "$nosacl_def_optnoacl"; then - echo "bad 'sacl_def_optnoacl' against 'nosacl_def_optnoacl' output" - fi + file=$(TMPDIR=. mktemp fiXXXXXX) + setfattr -n user.test -v ahoj $file + # check whether tar fails to store xattrs + err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi - echo "$sacl_nodef_optnoacl" > sacl_nodef_optnoacl.log - echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log - if test ! "$sacl_nodef_optnoacl" "=" "$nosacl_nodef_optnoacl"; then - echo "bad 'sacl_nodef_optnoacl' against 'nosacl_nodef_optnoacl' output" - fi + file=$(TMPDIR=. mktemp fiXXXXXX) - echo "$nosacl_def_optacl" > nosacl_def_optacl.log - echo "$nosacl_nodef_optacl" > nosacl_nodef_optacl.log - if test ! "$nosacl_def_optacl" "=" "$nosacl_nodef_optacl"; then - echo "bad 'nosacl_def_optacl' against 'nosacl_nodef_optacl' output" - fi + setcap "= cap_chown=ei" $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi - echo "$nosacl_def_optacl" > nosacl_def_optacl.log - echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log - if test ! "$nosacl_def_optacl" "=" "$nosacl_nodef_optnoacl"; then - echo "bad 'nosacl_def_optacl' against 'nosacl_nodef_optnoacl' output" - fi + getcap $file &> /dev/null + if test "$?" != 0; then + exit 77 + fi + rm -rf $file - echo "$sacl_def_optacl" > sacl_def_optacl.log - echo "$sacl_def_optnoacl" > sacl_def_optnoacl.log - if test ! "$sacl_def_optacl" "!=" "$sacl_def_optnoacl"; then - echo "bad 'sacl_def_optacl' against 'sacl_def_optnoacl' output" - fi +mkdir dir +genfile --file dir/file +setcap "= cap_chown=ei" dir/file - echo "$sacl_def_optacl" > sacl_def_optacl.log - echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log - if test ! "$sacl_def_optacl" "!=" "$nosacl_def_optnoacl"; then - echo "bad 'sacl_def_optacl' against 'nosacl_def_optnoacl' output" - fi +# archive whole directory including binary xattrs +tar --xattrs -cf archive.tar dir +# clear the directory +rm -rf dir - echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log - echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log - if test ! "$nosacl_def_optnoacl" "!=" "$nosacl_nodef_optnoacl"; then - echo "bad 'nosacl_def_optnoacl' against 'nosacl_nodef_optnoacl' output" - fi +# restore _all_ xattrs (not just the user.* domain) +tar --xattrs --xattrs-include='*' -xf archive.tar +# Newer systems print = instead of + here +getcap dir/file | sed 's/+/=/' ) 231. selnx01.at:25: testing selinux: basic store/restore ... ./selnx01.at:28: @@ -18097,12 +19186,8 @@ fi ) -228. acls01.at:25: skipped (xattr06.at:30) - skipped (xattr08.at:29) -191. comprec.at:21: ok -226. xattr07.at:26: -233. capabs_raw01.at:25: testing capabilities: binary store/restore ... -./capabs_raw01.at:28: +230. acls03.at:30: testing acls: default ACLs ... +./acls03.at:47: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18112,15 +19197,6 @@ rm -rf * -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 || exit 77 - - - file=$(TMPDIR=. mktemp fiXXXXXX) setfattr -n user.test -v test $file &> /dev/null @@ -18135,163 +19211,201 @@ fi - file=$(TMPDIR=. mktemp fiXXXXXX) - setfattr -n user.test -v ahoj $file - # check whether tar fails to store xattrs - err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi file=$(TMPDIR=. mktemp fiXXXXXX) - setcap "= cap_chown=ei" $file &> /dev/null + setfacl -m u:$UID:rwx $file &> /dev/null if test "$?" != 0; then exit 77 fi - getcap $file &> /dev/null + getfacl $file &> /dev/null if test "$?" != 0; then exit 77 fi rm -rf $file + file=$(TMPDIR=. mktemp fiXXXXXX) + setfacl -m u:$UID:rwx $file + err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) + if test "$err" != "0"; then + exit 77 + fi -mkdir dir -genfile --file dir/file -setcap "= cap_chown=ei" dir/file +test -z "`sort < /dev/null 2>&1`" || exit 77 -# archive whole directory including binary xattrs -tar --xattrs -cf archive.tar dir -# clear the directory -rm -rf dir +MYNAME=$( id -un ) +MYGROUP=$( id -gn ) -# restore _all_ xattrs (not just the user.* domain) -tar --xattrs --xattrs-include='*' -xf archive.tar +# Prepare directory structure with default ACLs +mkdir -p pure/d1/d2 +genfile --file pure/d1/f2a +genfile --file pure/d1/f2b +genfile --file pure/d1/d2/f3a +genfile --file pure/d1/d2/f3b +setfacl -m g:$MYGROUP:r-x pure/d1 +setfacl -d -m g:$MYGROUP:rwx pure/d1 +setfacl -d -m u:$MYNAME:rwx pure/d1 +# "*a" files have "some" additional ACLs +setfacl -m u:$MYNAME:--- pure/d1/d2/f3a +setfacl -m u:$MYNAME:--- pure/d1/f2a -# Newer systems print = instead of + here -getcap dir/file | sed 's/+/=/' -) - skipped (acls01.at:28) -232. selacl01.at:25: testing acls/selinux: special files & fifos ... -./selacl01.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -export TAR_OPTIONS -rm -rf * +# use default format (no acls stored) +tar -cf noacl.tar -C pure d1 +# use posix format, acls stored +tar --acls -cf acl.tar -C pure d1 -echo "test" > $$ -chmod 0 $$ -cat $$ > /dev/null 2>&1 -result=$? -rm -f $$ -test $result -eq 0 || exit 77 +# Directory names are chosen based on "how the files were extracted from +# archive". Equivalent no* tags are used also: +# ^sacl_ — extracted archive has stored ACLs +# _def_ — target directory (-C) has default ACLs +# _optacl$ — extraction was done with --acls option +mkdir sacl_def_optacl +mkdir sacl_def_optnoacl +mkdir sacl_nodef_optacl +mkdir sacl_nodef_optnoacl +mkdir nosacl_def_optacl +mkdir nosacl_def_optnoacl +mkdir nosacl_nodef_optacl +mkdir nosacl_nodef_optnoacl - file=$(TMPDIR=. mktemp fiXXXXXX) +setfacl -d -m u:$MYNAME:--- nosacl_def_optnoacl sacl_def_optnoacl sacl_def_optacl nosacl_def_optacl +setfacl -d -m g:$MYGROUP:--- nosacl_def_optnoacl sacl_def_optnoacl sacl_def_optacl nosacl_def_optacl - setfattr -n user.test -v test $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi +tar -xf acl.tar -C sacl_nodef_optnoacl +tar --acls -xf acl.tar -C sacl_nodef_optacl +tar -xf acl.tar -C sacl_def_optnoacl +tar --acls -xf acl.tar -C sacl_def_optacl +tar -xf noacl.tar -C nosacl_def_optnoacl +# _NO_ ACLs in output +tar -xf noacl.tar -C nosacl_nodef_optnoacl +tar -xf noacl.tar -C nosacl_nodef_optacl +tar -cf noacl_repackaged.tar -C nosacl_nodef_optnoacl d1 +# _NO_ ACLs in output (even when default ACLs exist) +tar --acls -xf noacl_repackaged.tar -C nosacl_def_optacl - getfattr $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi + cd pure + pure="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. + cd sacl_def_optacl + sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - file=$(TMPDIR=. mktemp fiXXXXXX) - restorecon $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi + cd sacl_def_optnoacl + sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - chcon -h --user=unconfined_u $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi + cd sacl_nodef_optacl + sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - rm -rf $file - file=$(TMPDIR=. mktemp fiXXXXXX) - err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi + cd sacl_nodef_optnoacl + sacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. + cd nosacl_def_optacl + nosacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi + cd nosacl_def_optnoacl + nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - getfacl $file &> /dev/null - if test "$?" != 0; then - exit 77 - fi + cd nosacl_nodef_optacl + nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. - rm -rf $file - file=$(TMPDIR=. mktemp fiXXXXXX) - setfacl -m u:$UID:rwx $file - err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l ) - if test "$err" != "0"; then - exit 77 - fi + cd nosacl_nodef_optnoacl + nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)" + cd .. -mkdir dir -mkfifo dir/fifo -MAJOR=$( stat /dev/urandom --printf="%t" ) -MINOR=$( stat /dev/urandom --printf="%T" ) -mknod dir/chartype c $MAJOR $MINOR -# setup attributes -restorecon -R dir -chcon -h --user=system_u dir/fifo -chcon -h --user=system_u dir/chartype -setfacl -m u:$UID:--- dir/fifo -setfacl -m u:$UID:rwx dir/chartype + echo "$pure" > pure.log + echo "$sacl_def_optacl" > sacl_def_optacl.log + if test ! "$pure" "=" "$sacl_def_optacl"; then + echo "bad 'pure' against 'sacl_def_optacl' output" + fi -getfacl dir/fifo >> before -getfattr -msecurity.selinux dir/chartype >> before -tar --xattrs --selinux --acls -cf archive.tar dir -mv dir olddir + echo "$sacl_def_optacl" > sacl_def_optacl.log + echo "$sacl_nodef_optacl" > sacl_nodef_optacl.log + if test ! "$sacl_def_optacl" "=" "$sacl_nodef_optacl"; then + echo "bad 'sacl_def_optacl' against 'sacl_nodef_optacl' output" + fi -tar --xattrs --selinux --acls -xf archive.tar -getfacl dir/fifo >> after -getfattr -msecurity.selinux dir/chartype >> after + echo "$sacl_def_optnoacl" > sacl_def_optnoacl.log + echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log + if test ! "$sacl_def_optnoacl" "=" "$nosacl_def_optnoacl"; then + echo "bad 'sacl_def_optnoacl' against 'nosacl_def_optnoacl' output" + fi -diff before after -echo separator -) -229. acls02.at:25: skipped (xattr07.at:29) + echo "$sacl_nodef_optnoacl" > sacl_nodef_optnoacl.log + echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log + if test ! "$sacl_nodef_optnoacl" "=" "$nosacl_nodef_optnoacl"; then + echo "bad 'sacl_nodef_optnoacl' against 'nosacl_nodef_optnoacl' output" + fi + -235. onetop02.at:21: testing tar --one-top-level --show-transformed ... -./onetop02.at:24: + echo "$nosacl_def_optacl" > nosacl_def_optacl.log + echo "$nosacl_nodef_optacl" > nosacl_nodef_optacl.log + if test ! "$nosacl_def_optacl" "=" "$nosacl_nodef_optacl"; then + echo "bad 'nosacl_def_optacl' against 'nosacl_nodef_optacl' output" + fi + + + echo "$nosacl_def_optacl" > nosacl_def_optacl.log + echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log + if test ! "$nosacl_def_optacl" "=" "$nosacl_nodef_optnoacl"; then + echo "bad 'nosacl_def_optacl' against 'nosacl_nodef_optnoacl' output" + fi + + + + echo "$sacl_def_optacl" > sacl_def_optacl.log + echo "$sacl_def_optnoacl" > sacl_def_optnoacl.log + if test ! "$sacl_def_optacl" "!=" "$sacl_def_optnoacl"; then + echo "bad 'sacl_def_optacl' against 'sacl_def_optnoacl' output" + fi + + + echo "$sacl_def_optacl" > sacl_def_optacl.log + echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log + if test ! "$sacl_def_optacl" "!=" "$nosacl_def_optnoacl"; then + echo "bad 'sacl_def_optacl' against 'nosacl_def_optnoacl' output" + fi + + + echo "$nosacl_def_optnoacl" > nosacl_def_optnoacl.log + echo "$nosacl_nodef_optnoacl" > nosacl_nodef_optnoacl.log + if test ! "$nosacl_def_optnoacl" "!=" "$nosacl_nodef_optnoacl"; then + echo "bad 'nosacl_def_optnoacl' against 'nosacl_nodef_optnoacl' output" + fi + +) +234. onetop01.at:21: testing tar --one-top-level ... +./onetop01.at:24: mkdir v7 (cd v7 TEST_TAR_FORMAT=v7 @@ -18309,16 +19423,34 @@ 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 ) -234. onetop01.at:21: testing tar --one-top-level ... -./onetop01.at:24: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 +--- - 2024-05-30 11:26:05.618642403 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2024-05-30 11:26:05.610968516 +0000 +@@ -1,4 +1 @@ +-security.selinux="system_u +-security.selinux="unconfined_u +-security.selinux="system_u + +--- - 2024-05-30 11:26:05.619032254 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2024-05-30 11:26:05.610968516 +0000 +@@ -1,2 +1 @@ +-separator + +--- - 2024-05-30 11:26:05.619785370 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2024-05-30 11:26:05.610968516 +0000 +@@ -1,2 +1 @@ +-dir/file = cap_chown=ei + +188. verify.at:25: ok +231. selnx01.at:25: skipped (selnx01.at:28) +232. selacl01.at:25: 229. acls02.at:25: 230. acls03.at:30: 233. capabs_raw01.at:25: ./onetop01.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 * @@ -18334,22 +19466,26 @@ tar --one-top-level -x -f ../a.tar find . | sort ) - + skipped (capabs_raw01.at:28) skipped (acls02.at:28) + skipped (selacl01.at:28) + skipped (acls03.at:47) -230. acls03.at:30: --- - 2025-07-02 17:45:26.419542351 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/231/stdout 2025-07-02 17:45:26.409777485 +0000 -@@ -1,4 +1 @@ --security.selinux="system_u --security.selinux="unconfined_u --security.selinux="system_u - - skipped (acls03.at:47) -231. selnx01.at:25: 236. onetop03.at:21: testing tar --one-top-level --transform ... + +239. gtarfail.at:21: testing gtarfail ... +./gtarfail.at:26: + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar + +236. onetop03.at:21: testing tar --one-top-level --transform ... ./onetop03.at:24: mkdir v7 (cd v7 @@ -18390,100 +19526,6 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) ---- - 2025-07-02 17:45:26.425422994 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/233/stdout 2025-07-02 17:45:26.417777485 +0000 -@@ -1,2 +1 @@ --dir/file = cap_chown=ei - ---- - 2025-07-02 17:45:26.425907994 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/232/stdout 2025-07-02 17:45:26.417777485 +0000 -@@ -1,2 +1 @@ --separator - -238. onetop05.at:21: testing tar --one-top-level restoring permissions ... -./onetop05.at:28: -mkdir v7 -(cd v7 -TEST_TAR_FORMAT=v7 -export TEST_TAR_FORMAT -TAR_OPTIONS="-H v7" -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 -) -239. gtarfail.at:21: testing gtarfail ... -./gtarfail.at:26: - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail.tar - - skipped (selnx01.at:28) -243. ustar-big-8g.at:21: testing ustar-big-8g ... -./ustar-big-8g.at:26: -test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 - -cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 - -232. selacl01.at:25: 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 - 240. gtarfail2.at:21: testing gtarfail2 ... ./gtarfail2.at:26: @@ -18492,37 +19534,40 @@ tar --utc -tvf $STAR_TESTSCRIPTS/gtarfail2.tar -233. capabs_raw01.at:25: 241. multi-fail.at:21: testing multi-fail ... -./multi-fail.at:26: - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -test -z "$STAR_TESTSCRIPTS" && exit 77 -tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 - - -tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ - -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- - - skipped (selacl01.at:28) - skipped (capabs_raw01.at:28) -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 +235. onetop02.at:21: testing tar --one-top-level --show-transformed ... +./onetop02.at:24: +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 +export TEST_TAR_FORMAT +TAR_OPTIONS="-H v7" +export TAR_OPTIONS +rm -rf * -tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 +test -z "`sort < /dev/null 2>&1`" || exit 77 ---- - 2025-07-02 17:45:26.436777725 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2025-07-02 17:45:26.429777485 +0000 +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 +) +--- - 2024-05-30 11:26:05.838832897 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2024-05-30 11:26:05.830960684 +0000 +@@ -1,7 +1 @@ +--rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif +--rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif +--rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG +--rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg +--rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif +--rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg + +--- - 2024-05-30 11:26:05.889185031 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/240/stdout 2024-05-30 11:26:05.834960542 +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 @@ -18535,100 +19580,7 @@ -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 ---- - 2025-07-02 17:45:26.437099509 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/239/stdout 2025-07-02 17:45:26.429777485 +0000 -@@ -1,7 +1 @@ ---rw-r--r-- jes/glone 518 2001-05-25 14:41 vedpowered.gif ---rw-r--r-- jes/glone 6825 1997-04-29 00:19 cd.gif ---rw-r--r-- jes/glone 33354 1999-06-22 12:17 DSCN0049c.JPG ---rw-r--r-- jes/glone 86159 2001-06-05 18:16 Window1.jpg ---rw-r--r-- jes/glone 1310 2001-05-25 13:05 vipower.gif ---rw-rw-rw- jes/glone 148753 1998-09-15 13:08 billyboy.jpg - ---- - 2025-07-02 17:45:26.438386174 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2025-07-02 17:45:26.429777485 +0000 -@@ -1,53 +1 @@ --drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ ---rw-r--r-- joerg/bs 1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull ---rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d ---rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d ---rw-r--r-- joerg/bs 1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d ---rw-r--r-- joerg/bs 2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d ---rw-r--r-- joerg/bs 1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d ---rw-r--r-- joerg/bs 1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d ---rw-r--r-- joerg/bs 1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d ---rw-r--r-- joerg/bs 1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d ---rw-r--r-- joerg/bs 1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d ---rw-r--r-- joerg/bs 1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d ---rw-r--r-- joerg/bs 1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d ---rw-r--r-- joerg/bs 1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d ---rw-r--r-- joerg/bs 1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d ---rw-r--r-- joerg/bs 1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d ---rw-r--r-- joerg/bs 2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d ---rw-r--r-- joerg/bs 969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d ---rw-r--r-- joerg/bs 1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d ---rw-r--r-- joerg/bs 1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d ---rw-r--r-- joerg/bs 1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d ---rw-r--r-- joerg/bs 1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d ---rw-r--r-- joerg/bs 1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d ---rw-r--r-- joerg/bs 961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d ---rw-r--r-- joerg/bs 1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d ---rw-r--r-- joerg/bs 2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d ---rw-r--r-- joerg/bs 1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d ---rw-r--r-- joerg/bs 1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d ---rw-r--r-- joerg/bs 2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d ---rw-r--r-- joerg/bs 1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d ---rw-r--r-- joerg/bs 42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o ---rw-r--r-- joerg/bs 22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o ---rw-r--r-- joerg/bs 7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o ---rw-r--r-- joerg/bs 14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o ---rw-r--r-- joerg/bs 924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o ---rw-r--r-- joerg/bs 6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o ---rw-r--r-- joerg/bs 12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o ---rw-r--r-- joerg/bs 14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o ---rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o ---rw-r--r-- joerg/bs 7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o ---rw-r--r-- joerg/bs 3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o ---rw-r--r-- joerg/bs 5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o ---rw-r--r-- joerg/bs 6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o ---rw-r--r-- joerg/bs 1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o ---rw-r--r-- joerg/bs 20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o ---rw-r--r-- joerg/bs 2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o ---rw-r--r-- joerg/bs 1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o ---rw-r--r-- joerg/bs 10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o ---rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o ---rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o ---rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o ---rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o - -stderr: -stderr: -239. gtarfail.at:21: 240. gtarfail2.at:21: 241. multi-fail.at:21: stderr: - skipped (gtarfail2.at:26) - skipped (gtarfail.at:26) ---- - 2025-07-02 17:45:26.441899492 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2025-07-02 17:45:26.433777485 +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 (multi-fail.at:26) ---- - 2025-07-02 17:45:26.443517695 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2025-07-02 17:45:26.437777485 +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 - -243. ustar-big-8g.at:21: --- - 2025-07-02 17:45:26.446019989 +0000 -+++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2025-07-02 17:45:26.437777485 +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 - -242. ustar-big-2g.at:21: skipped (ustar-big-8g.at:26) -244. pax-big-10g.at:21: skipped (ustar-big-2g.at:26) - skipped (pax-big-10g.at:26) -./onetop01.at:24: +./onetop03.at:24: mkdir oldgnu (cd oldgnu TEST_TAR_FORMAT=oldgnu @@ -18646,7 +19598,7 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ./onetop02.at:24: @@ -18670,123 +19622,13 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop04.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort -) -./onetop03.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level --transform 's/c/d/' -x -f ../a.tar -find . | sort -) -./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 -) +238. onetop05.at:21: testing tar --one-top-level restoring permissions ... ./onetop05.at:28: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +mkdir v7 +(cd v7 +TEST_TAR_FORMAT=v7 export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H v7" export TAR_OPTIONS rm -rf * @@ -18828,7 +19670,8 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop04.at:24: +240. gtarfail2.at:21: skipped (gtarfail2.at:26) +./grow.at:27: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18837,6 +19680,19 @@ 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 +) +./onetop04.at:24: +mkdir oldgnu +(cd oldgnu +TEST_TAR_FORMAT=oldgnu +export TEST_TAR_FORMAT +TAR_OPTIONS="-H oldgnu" +export TAR_OPTIONS +rm -rf * + test -z "`sort < /dev/null 2>&1`" || exit 77 @@ -18846,7 +19702,8 @@ tar cf a.tar a c tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./onetop01.at:24: + +./onetop03.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18864,7 +19721,7 @@ tar cf a.tar a c mkdir out cd out -tar --one-top-level -x -f ../a.tar +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) ./onetop02.at:24: @@ -18888,7 +19745,21 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop03.at:24: +241. multi-fail.at:21: testing multi-fail ... +./multi-fail.at:26: + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +tar --utc -tvM -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \ + -f $STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&- + +./onetop01.at:24: mkdir ustar (cd ustar TEST_TAR_FORMAT=ustar @@ -18906,33 +19777,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 ) -./onetop04.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -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 +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 * @@ -18974,33 +19827,85 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop01.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +--- - 2024-05-30 11:26:05.988079692 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/241/stdout 2024-05-30 11:26:05.982955272 +0000 +@@ -1,53 +1 @@ +-drwxrwsr-x joerg/bs 0 2003-10-11 14:32 OBJ/i386-sunos5-gcc/ +--rw-r--r-- joerg/bs 1 2003-10-11 14:32 OBJ/i386-sunos5-gcc/Dnull +--rw-r--r-- joerg/bs 1743 2003-10-10 18:06 OBJ/i386-sunos5-gcc/star.d +--rw-r--r-- joerg/bs 1460 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.d +--rw-r--r-- joerg/bs 1540 2003-10-10 18:06 OBJ/i386-sunos5-gcc/cpiohdr.d +--rw-r--r-- joerg/bs 2245 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xheader.d +--rw-r--r-- joerg/bs 1254 2003-10-10 18:06 OBJ/i386-sunos5-gcc/xattr.d +--rw-r--r-- joerg/bs 1330 2003-10-10 18:06 OBJ/i386-sunos5-gcc/list.d +--rw-r--r-- joerg/bs 1745 2003-10-10 18:06 OBJ/i386-sunos5-gcc/extract.d +--rw-r--r-- joerg/bs 1518 2003-10-10 18:06 OBJ/i386-sunos5-gcc/create.d +--rw-r--r-- joerg/bs 1235 2003-10-10 18:06 OBJ/i386-sunos5-gcc/append.d +--rw-r--r-- joerg/bs 1368 2003-10-10 18:06 OBJ/i386-sunos5-gcc/diff.d +--rw-r--r-- joerg/bs 1423 2003-10-10 18:06 OBJ/i386-sunos5-gcc/remove.d +--rw-r--r-- joerg/bs 1493 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.d +--rw-r--r-- joerg/bs 1572 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.d +--rw-r--r-- joerg/bs 1453 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.d +--rw-r--r-- joerg/bs 2257 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.d +--rw-r--r-- joerg/bs 969 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.d +--rw-r--r-- joerg/bs 1308 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.d +--rw-r--r-- joerg/bs 1287 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.d +--rw-r--r-- joerg/bs 1105 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.d +--rw-r--r-- joerg/bs 1230 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.d +--rw-r--r-- joerg/bs 1091 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.d +--rw-r--r-- joerg/bs 961 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.d +--rw-r--r-- joerg/bs 1113 2003-10-10 18:07 OBJ/i386-sunos5-gcc/props.d +--rw-r--r-- joerg/bs 2146 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fetchdir.d +--rw-r--r-- joerg/bs 1093 2003-10-10 18:07 OBJ/i386-sunos5-gcc/unicode.d +--rw-r--r-- joerg/bs 1211 2003-10-10 18:07 OBJ/i386-sunos5-gcc/subst.d +--rw-r--r-- joerg/bs 2076 2003-10-11 11:53 OBJ/i386-sunos5-gcc/volhdr.d +--rw-r--r-- joerg/bs 1480 2003-10-10 18:07 OBJ/i386-sunos5-gcc/chdir.d +--rw-r--r-- joerg/bs 42460 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star.o +--rw-r--r-- joerg/bs 22564 2003-10-11 11:53 OBJ/i386-sunos5-gcc/header.o +--rw-r--r-- joerg/bs 7880 2003-10-10 18:07 OBJ/i386-sunos5-gcc/cpiohdr.o +--rw-r--r-- joerg/bs 14624 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xheader.o +--rw-r--r-- joerg/bs 924 2003-10-10 18:07 OBJ/i386-sunos5-gcc/xattr.o +--rw-r--r-- joerg/bs 6120 2003-10-10 18:07 OBJ/i386-sunos5-gcc/list.o +--rw-r--r-- joerg/bs 12764 2003-10-10 18:07 OBJ/i386-sunos5-gcc/extract.o +--rw-r--r-- joerg/bs 14668 2003-10-10 18:07 OBJ/i386-sunos5-gcc/create.o +--rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/append.o +--rw-r--r-- joerg/bs 7636 2003-10-10 18:07 OBJ/i386-sunos5-gcc/diff.o +--rw-r--r-- joerg/bs 3072 2003-10-10 18:07 OBJ/i386-sunos5-gcc/remove.o +--rw-r--r-- joerg/bs 5612 2003-10-10 18:07 OBJ/i386-sunos5-gcc/star_unix.o +--rw-r--r-- joerg/bs 6220 2003-10-10 18:07 OBJ/i386-sunos5-gcc/acl_unix.o +--rw-r--r-- joerg/bs 1092 2003-10-10 18:07 OBJ/i386-sunos5-gcc/fflags.o +--rw-r--r-- joerg/bs 20996 2003-10-11 14:32 OBJ/i386-sunos5-gcc/buffer.o +--rw-r--r-- joerg/bs 2060 2003-10-07 17:53 OBJ/i386-sunos5-gcc/dirtime.o +--rw-r--r-- joerg/bs 1664 2003-10-10 18:07 OBJ/i386-sunos5-gcc/lhash.o +--rw-r--r-- joerg/bs 10564 2003-10-10 18:07 OBJ/i386-sunos5-gcc/hole.o +--rw-r--r-- joerg/bs 3864 2003-10-10 18:07 OBJ/i386-sunos5-gcc/longnames.o +--rw-r--r-- joerg/bs 2576 2003-10-10 18:07 OBJ/i386-sunos5-gcc/names.o +--rw-r--r-- joerg/bs 952 2003-10-10 18:07 OBJ/i386-sunos5-gcc/movearch.o +--rw-r--r-- joerg/bs 2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o + +241. multi-fail.at:21: skipped (multi-fail.at:26) +239. gtarfail.at:21: skipped (gtarfail.at:26) -test -z "`sort < /dev/null 2>&1`" || exit 77 +242. ustar-big-2g.at:21: testing ustar-big-2g ... +./ustar-big-2g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -mkdir out -cd out -tar --one-top-level -x -f ../a.tar -find . | sort -) -./onetop02.at:24: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +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 + +./onetop04.at:24: +mkdir ustar +(cd ustar +TEST_TAR_FORMAT=ustar export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" +TAR_OPTIONS="-H ustar" export TAR_OPTIONS rm -rf * @@ -19011,11 +19916,21 @@ 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 ) +243. ustar-big-8g.at:21: testing ustar-big-8g ... +./ustar-big-8g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 + +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 + + +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f $STAR_TESTSCRIPTS $STAR_DATA_URL || exit 77 + + +tar --utc -tvjf $STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2 + ./onetop03.at:24: mkdir posix (cd posix @@ -19037,30 +19952,12 @@ tar --one-top-level --transform 's/c/d/' -x -f ../a.tar find . | sort ) -./onetop04.at:24: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b -genfile --file c -tar cf a.tar a c -tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort -) ./onetop01.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 * @@ -19077,11 +19974,11 @@ find . | sort ) ./onetop02.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 * @@ -19097,12 +19994,26 @@ tar --one-top-level --show-transformed -v -x -f ../a.tar find . | sort ) -./onetop05.at:28: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix +stderr: +stderr: +--- - 2024-05-30 11:26:06.173390261 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/242/stdout 2024-05-30 11:26:06.166948721 +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 + +--- - 2024-05-30 11:26:06.177019022 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/243/stdout 2024-05-30 11:26:06.170948579 +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 + +242. ustar-big-2g.at:21: ./onetop05.at:28: +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 * @@ -19144,7 +20055,7 @@ echo "TOP: mode changed: $orig_mode != $mode" fi ) -./onetop03.at:24: +./onetop02.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19162,61 +20073,10 @@ 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 ) -237. onetop04.at:21: ok -234. onetop01.at:21: ok -235. onetop02.at:21: ok -236. onetop03.at:21: ok -./onetop05.at:28: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -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 -) -./extrac20.at:24: +./onetop03.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19228,133 +20088,16 @@ 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 -) -./grow.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) -238. onetop05.at:21: ok -174. sparse06.at:21: ok -103. extrac20.at:21: ok -./grow.at:27: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar -export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) -155. time01.at:20: ok -./sptrdiff01.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 5 --length 221278210 --truncate foo -- \ - tar --sparse -vdf bar -) -./sptrdiff00.at:30: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar +mkdir a +genfile --file a/b +genfile --file c +tar cf a.tar a c +mkdir out +cd out +tar --one-top-level --transform 's/c/d/' -x -f ../a.tar +find . | sort ) -./sptrcreat.at:36: +./onetop01.at:24: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -19363,199 +20106,64 @@ export TAR_OPTIONS rm -rf * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') -./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 +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 ) -./incr04.at:34: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +119. listed01.at:26: ok + skipped (ustar-big-2g.at:26) +./incremental.at:26: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * 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 -) -./rename02.at:27: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 -mkdir foo/bar -genfile --file foo/bar/file.r -mkdir foo/bar/baz -genfile --file foo/bar/baz/file.z - -sleep 1 - -echo "Creating base archive" -tar -g incr -cf arch.1 -v foo - -mv foo/bar/baz foo - -echo "Creating incremental archive" -tar -g incr -cf arch.2 -v foo - -mv foo old - -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -./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 structure +echo x >structure/file -mkdir foo/c -genfile --file foo/c/filec +# 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 -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 - -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) - -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 - -tar xfg arch.1 /dev/null --warning=no-timestamp - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -./grow.at:27: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz +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 ) ./update04.at:23: -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 * @@ -19576,100 +20184,24 @@ tar ufv archive --wildcards './file.*' './foo.*' echo $? ) -./grow.at:27: -mkdir gnu -(cd gnu -TEST_TAR_FORMAT=gnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H gnu" -export TAR_OPTIONS -rm -rf * - -genfile --file foo --length 50000k -genfile --file baz -genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz -) -./sptrdiff00.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -echo creating -tar --sparse -vcf bar foo baz -echo comparing -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vdf bar -) -./sptrdiff01.at:30: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +234. onetop01.at:21: ok +235. onetop02.at:21: ok +244. pax-big-10g.at:21: testing pax-big-10g ... +./pax-big-10g.at:26: +test "${TARTEST_SKIP_LARGE_FILES:-0}" != 0 && exit 77 -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 oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * +cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77 -genfile --sparse --block-size=1024 --file foo \ - 0 ABCDEFGHIJ 1M ABCDEFGHIJ 10M ABCDEFGHIJ 200M ABCDEFGHIJ || exit 77 -genfile --file baz -genfile --run --checkpoint 3 --length 200m --truncate foo -- \ - tar --sparse -vcf bar foo baz -echo Exit status: $? -echo separator -genfile --file foo --seek 200m --length 11575296 --pattern=zeros -tar dvf bar | sed '/foo: Mod time differs/d') -195. grow.at:24: ok -./incr04.at:34: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * -ckmtime || exit 77 +test -z "$STAR_TESTSCRIPTS" && exit 77 +tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff $STAR_TESTSCRIPTS $STAR_DATA_URL || 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 +tar --utc -tvjf $STAR_TESTSCRIPTS/pax-big-10g.tar.bz2 -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: +stderr: +./onetop04.at:24: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19678,80 +20210,22 @@ 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 -) -181. sptrdiff00.at:26: 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 +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 ) -182. sptrdiff01.at:26: ok -./rename02.at:27: +--- - 2024-05-30 11:26:06.751565832 +0000 ++++ /build/reproducible-path/tar-1.35+dfsg/tests/testsuite.dir/at-groups/244/stdout 2024-05-30 11:26:06.742928213 +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 + +./onetop05.at:28: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19760,43 +20234,45 @@ export TAR_OPTIONS rm -rf * +orig_mode=3702 +mkdir d +chmod $orig_mode d -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 +mode=$(genfile --stat=mode.7777 d) +test $mode = $orig_mode || exit 77 -tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr -sort tmperr >&2 +genfile --file d/file +tar -cf d.tar -C d . +rm -rf d -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" +(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 -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 +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 ) -180. sptrcreat.at:33: ok -./rename03.at:26: +./grow.at:27: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -19805,85 +20281,18 @@ export TAR_OPTIONS rm -rf * - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -mkdir foo -genfile --file foo/file1 -genfile --file foo/file2 - -mkdir foo/a -genfile --file foo/a/filea - -mkdir foo/b -genfile --file foo/b/fileb - -mkdir foo/c -genfile --file foo/c/filec - -sleep 1 - -echo "First dump" -echo "First dump">&2 -tar -g incr -cf arch.1 -v foo 2>tmperr -sort tmperr >&2 - -# Shuffle directories: -(cd foo -mv a $$ -mv c a -mv b c -mv $$ b) - -echo "Second dump" -echo "Second dump" >&2 -tar -g incr -cf arch.2 -v foo 2>tmperr -sort tmperr >&2 - -tar xfg arch.1 /dev/null --warning=no-timestamp - -echo "Begin directory listing 1" -find foo | sort -echo "End directory listing 1" - -tar xfgv arch.2 /dev/null --warning=no-timestamp -echo Begin directory listing 2 -find foo | sort -echo End directory listing 2 -) -./update01.at:32: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -./update02.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +244. pax-big-10g.at:21: skipped (pax-big-10g.at:26) +243. ustar-big-8g.at:21: skipped (ustar-big-8g.at:26) +./onetop04.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 * @@ -19892,184 +20301,59 @@ mkdir a genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./update04.at:23: -mkdir 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 $? -) -./exclude05.at:24: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - - -rm -rf testdir exclfile -mkdir -p testdir -awk 'BEGIN {for (i=9; i < 100; ++i ) { print "testdir/file" i; }}' < /dev/null | \ - while read name - do - genfile --file $name - done - -awk 'BEGIN {for (i=1000000; i >= 12; --i ) { print "testdir/file" i }}' < /dev/null > exclfile - -tar cf archive --anchored --exclude-from=exclfile \ - testdir -tar tf archive | sort - -echo "NEXT" -tar cf archive --exclude-from=exclfile \ - testdir -tar tf archive | sort - -rm -rf testdir exclfile - -) -./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 +genfile --file c +tar cf a.tar a c +tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort ) -./listed01.at:29: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu +236. onetop03.at:21: ok +./onetop05.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 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 +orig_mode=3702 +mkdir d +chmod $orig_mode d -tar tf archive.2 || exit 1 -) -125. incr04.at:29: ok -124. incr03.at:28: ok -138. rename02.at:24: ok -139. rename03.at:23: ok -./update04.at:23: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * +mode=$(genfile --stat=mode.7777 d) +test $mode = $orig_mode || exit 77 -genfile --file file.a -genfile --file file.b -genfile --file file.c -echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' +genfile --file d/file +tar -cf d.tar -C d . +rm -rf d -echo "Second update" -tar ufv archive --wildcards './file.*' +(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 -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? +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 ) -./chtype.at:30: +./update02.at:29: mkdir posix (cd posix TEST_TAR_FORMAT=posix @@ -20081,72 +20365,6 @@ test -z "`sort < /dev/null 2>&1`" || exit 77 - -install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77 -mkdir directory/a -genfile --file directory/a/a - -echo First backup -tar --create --file=archive.1 --listed-incremental=db.1 directory - -sleep 2 - -# Remove directory b and create a file with this name. -# Previous versions were not able to restore over this file. -rm -r directory/b -genfile --file directory/b -genfile --file directory/a/b - -echo Second backup -tar --create --file=archive.2 --listed-incremental=db.2 directory - -# Delete a -rm -r directory - -echo Restore archive.1 -tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp -echo Restore archive.2 -tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp -find directory | sort -) -./multiv04.at:39: -mkdir oldgnu -(cd oldgnu -TEST_TAR_FORMAT=oldgnu -export TEST_TAR_FORMAT -TAR_OPTIONS="-H oldgnu" -export TAR_OPTIONS -rm -rf * - - -mkdir directory -awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' &1`" || exit 77 - mkdir a genfile --file a/b @@ -20155,18 +20373,20 @@ echo "separator" sleep 2 -genfile --file a/c +touch a/b tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -./update02.at:29: -mkdir ustar -(cd ustar -TEST_TAR_FORMAT=ustar +237. onetop04.at:21: ok +143. chtype.at:27: ok +./update01.at:32: +mkdir posix +(cd posix +TEST_TAR_FORMAT=posix export TEST_TAR_FORMAT -TAR_OPTIONS="-H ustar" +TAR_OPTIONS="-H posix" export TAR_OPTIONS rm -rf * @@ -20181,13 +20401,14 @@ echo "separator" sleep 2 -touch a/b +genfile --file a/c tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -./update04.at:23: +238. onetop05.at:21: ok +./grow.at:27: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20196,76 +20417,16 @@ export TAR_OPTIONS rm -rf * -genfile --file file.a -genfile --file file.b -genfile --file file.c -echo Create -tar cf archive ./file.* -sleep 1 -echo "update" > file.b -echo First update -tar ufv archive --wildcards './file.*' - -echo "Second update" -tar ufv archive --wildcards './file.*' - -echo "Non-matching pattern" -tar ufv archive --wildcards './file.*' './foo.*' -echo $? -) -./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 - +genfile --file foo --length 50000k +genfile --file baz +genfile --run=10 --checkpoint 10 --length 1024 --append foo -- tar -vcf bar foo baz ) -187. update04.at:20: ok ./exclude05.at:24: -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 * @@ -20295,99 +20456,10 @@ rm -rf testdir exclfile ) -./incremental.at:26: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - -ckmtime || exit 77 - -mkdir structure -echo x >structure/file - -# On Nextstep (and perhaps other 4.3BSD systems), -# a newly created file's ctime isn't updated -# until the next sync or stat operation on the file. -ls -l structure/file >/dev/null - -# If the time of an initial backup and the creation time of a file contained -# in that backup are the same, the file will be backed up again when an -# incremental backup is done, because the incremental backup backs up -# files created "on or after" the initial backup time. Without the sleep -# command, behaviour of tar becomes variable, depending whether the system -# clock ticked over to the next second between creating the file and -# backing it up. -sleep 1 - -tar cf archive --listed=list structure -tar cfv archive --listed=list structure -echo separator -# ReiserFS often offsets the timestamps of newly created files -# 1 second to the past. Try to compensate for it, until a better -# solution is found. -sleep 2 -echo y >structure/file -tar cfv archive --listed=list structure -) -119. listed01.at:26: ok -143. chtype.at:27: ok -./update01.at:32: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -genfile --file a/c - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) +187. update04.at:20: ok +195. grow.at:24: ok +160. multiv04.at:36: ok ./update02.at:29: -mkdir posix -(cd posix -TEST_TAR_FORMAT=posix -export TEST_TAR_FORMAT -TAR_OPTIONS="-H posix" -export TAR_OPTIONS -rm -rf * - - -test -z "`sort < /dev/null 2>&1`" || exit 77 - -mkdir a -genfile --file a/b - -tar cf arc a - -echo "separator" - -sleep 2 -touch a/b - -tar ufv arc a -echo "separator" -tar tf arc | sort || exit 1 -) -./update01.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20407,13 +20479,13 @@ echo "separator" sleep 2 -genfile --file a/c +touch a/b tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -./update02.at:29: +./update01.at:32: mkdir gnu (cd gnu TEST_TAR_FORMAT=gnu @@ -20433,49 +20505,12 @@ echo "separator" sleep 2 -touch a/b +genfile --file a/c tar ufv arc a echo "separator" tar tf arc | sort || exit 1 ) -160. multiv04.at:36: 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 - -) -116. incremental.at:23: ok ./incr02.at:35: mkdir posix (cd posix @@ -20522,8 +20557,7 @@ # Check the timestamp genfile --stat=mtime dir/subdir1 | diff ts - ) -184. update01.at:29: ok -185. update02.at:26: ok +116. incremental.at:23: ok ./exclude05.at:24: mkdir gnu (cd gnu @@ -20559,6 +20593,8 @@ rm -rf testdir exclfile ) +185. update02.at:26: ok +184. update01.at:29: ok ./listed02.at:31: mkdir oldgnu (cd oldgnu @@ -20628,16 +20664,16 @@ echo Final files: find tart -print | sort 2>/dev/null ) +64. exclude05.at:21: ok +118. incr02.at:32: ok stdout: separator --rw-r--r-- pbuilder1/pbuilder1 1000 2025-07-02 17:45 begin --rw-r--r-- pbuilder1/pbuilder1 8589935104 2025-07-02 17:45 sparsefile --rw-r--r-- pbuilder1/pbuilder1 1000 2025-07-02 17:45 end +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 begin +-rw-r--r-- pbuilder2/pbuilder2 8589935104 2024-05-30 11:26 sparsefile +-rw-r--r-- pbuilder2/pbuilder2 1000 2024-05-30 11:26 end separator sparsefile 8589935104 171. sparse03.at:21: ok -64. exclude05.at:21: ok -118. incr02.at:32: ok 120. listed02.at:28: ok 173. sparse05.at:21: ok @@ -20656,7 +20692,7 @@ create-stamp debian/debhelper-build-stamp dh_prep dh_auto_install - make -j42 install DESTDIR=/build/reproducible-path/tar-1.35\+dfsg/debian/tmp AM_UPDATE_INFO_DIR=no + make -j20 install DESTDIR=/build/reproducible-path/tar-1.35\+dfsg/debian/tmp AM_UPDATE_INFO_DIR=no make[1]: Entering directory '/build/reproducible-path/tar-1.35+dfsg' Making install in doc make[2]: Entering directory '/build/reproducible-path/tar-1.35+dfsg/doc' @@ -20795,45 +20831,45 @@ dh_perl dh_link dh_strip_nondeterminism - Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/sv/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/id/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/gl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hu/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ky/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/vi/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/es/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/eu/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/zh_TW/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/eo/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/fi/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/et/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/hr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ka/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/da/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/cs/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/fr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/el/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/zh_CN/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/pt/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ko/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/nl/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/bg/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/tr/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/nb/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/pt_BR/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/sl/LC_MESSAGES/tar.mo - Normalized debian/tar/usr/share/locale/ja/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/de/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/ms/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ga/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/uk/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/it/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sk/LC_MESSAGES/tar.mo Normalized debian/tar/usr/share/locale/pl/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ca/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ru/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/sr/LC_MESSAGES/tar.mo + Normalized debian/tar/usr/share/locale/ro/LC_MESSAGES/tar.mo dh_compress dh_fixperms dh_missing @@ -20847,8 +20883,8 @@ dh_md5sums dh_builddeb dpkg-deb: building package 'tar' in '../tar_1.35+dfsg-3_amd64.deb'. -dpkg-deb: building package 'tar-dbgsym' in '../tar-dbgsym_1.35+dfsg-3_amd64.deb'. dpkg-deb: building package 'tar-scripts' in '../tar-scripts_1.35+dfsg-3_all.deb'. +dpkg-deb: building package 'tar-dbgsym' in '../tar-dbgsym_1.35+dfsg-3_amd64.deb'. dpkg-genbuildinfo --build=binary -O../tar_1.35+dfsg-3_amd64.buildinfo dpkg-genchanges --build=binary -O../tar_1.35+dfsg-3_amd64.changes dpkg-genchanges: info: binary-only upload (no source code included) @@ -20856,12 +20892,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/3335431/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/3335431/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/1366381 and its subdirectories -I: Current time: Wed Jul 2 05:46:11 -12 2025 -I: pbuilder-time-stamp: 1751478371 +I: removing directory /srv/workspace/pbuilder/3335431 and its subdirectories +I: Current time: Fri May 31 01:27:39 +14 2024 +I: pbuilder-time-stamp: 1717068459