Elide non-DFSG compliant upstream components
[debian/tar] / tests / testsuite
index 907e52032e759945c49eccdd8cede6784991d1db..4c0d7bec0a863789e50b3266a8ecc587953bf93d 100755 (executable)
@@ -590,10 +590,10 @@ at_tested='tar'
 # numerical order.
 at_format='???'
 # Description of all the test groups.
-at_help_all="1;version.at:19;tar version;;
+at_help_all="1;version.at:20;tar version;;
 2;pipe.at:29;decompressing from stdin;pipe;
-3;options.at:24;mixing options;options options00;
-4;options02.at:26;interspersed options;options options02;
+3;options.at:25;mixing options;options options00;
+4;options02.at:27;interspersed options;options options02;
 5;opcomp01.at:21;occurrence compatibility;opcomp opcomp01;
 6;opcomp02.at:21;occurrence compatibility;opcomp opcomp02;
 7;opcomp03.at:21;--verify compatibility;opcomp opcomp03;
@@ -603,173 +603,197 @@ at_help_all="1;version.at:19;tar version;;
 11;T-mult.at:21;multiple file lists;files-from t-mult;
 12;T-nest.at:21;nested file lists;files-from t-nest;
 13;T-rec.at:21;recursive file lists;files-from t-rec;
-14;T-cd.at:21;-C in file lists;files-from t-cd;
-15;T-empty.at:26;empty entries;files-from empty-line;
-16;T-null.at:21;0-separated file without -0;files-from null t-null;
-17;T-zfile.at:26;empty file;files-from empty-file;
-18;T-nonl.at:27;entries with missing newlines;files-from nonewline nonl t-nonl;
-19;indexfile.at:26;tar --index-file=FILE --file=-;stdout indexfile;
-20;verbose.at:26;tar cvf -;stdout verbose;
-21;gzip.at:23;gzip;gzip;
-22;recurse.at:21;recurse;recurse;
-23;shortrec.at:25;short records;shortrec;
-24;same-order01.at:26;working -C with --same-order;same-order same-order01;
-25;same-order02.at:25;multiple -C options;same-order same-order02;
-26;append.at:21;append;append append00;
-27;append01.at:29;appending files with long names;append append01;
-28;append02.at:54;append vs. create;append append02 append-gnu;
-29;append03.at:21;append with name transformation;append append03;
-30;append04.at:29;append with verify;append append04 verify append-verify;
-31;xform-h.at:30;transforming hard links on create;transform xform xform-h;
-32;xform01.at:26;transformations and GNU volume labels;transform xform xform01 volume;
-33;exclude.at:23;exclude;exclude;
-34;exclude01.at:19;exclude wildcards;exclude exclude01;
-35;exclude02.at:19;exclude: anchoring;exclude exclude02;
-36;exclude03.at:19;exclude: wildcards match slash;exclude exclude03;
-37;exclude04.at:19;exclude: case insensitive;exclude exclude04;
-38;exclude05.at:21;exclude: lots of excludes;exclude exclude05;
-39;exclude06.at:26;exclude: long files in pax archives;exclude exclude06;
-40;exclude07.at:19;exclude: --exclude-backups option;exclude exclude07;
-41;exclude08.at:36;--exclude-tag option;exclude exclude-tag exclude08;
-42;exclude09.at:37;--exclude-tag option and --listed-incremental;exclude exclude-tag listed incremental exclude09;
-43;exclude10.at:38;--exclude-tag option in incremental pass;exclude exclude-tag listed incremental exclude10;
-44;exclude11.at:36;--exclude-tag-under option;exclude exclude-tag exclude-tag-under exclude11;
-45;exclude12.at:37;--exclude-tag-under and --listed-incremental;exclude exclude-tag exclude-tag-under listed incremental exclude12;
-46;exclude13.at:39;--exclude-tag-under option in incremental pass;exclude exclude-tag exclude-tag-under listed incremental exclude13;
-47;exclude14.at:36;--exclude-tag-all option;exclude exclude-tag exclude-tag-all exclude14;
-48;exclude15.at:36;--exclude-tag-all and --listed-incremental;exclude exclude-tag exclude-tag-all listed incremental exclude15;
-49;exclude16.at:38;--exclude-tag-all option in incremental pass;exclude exclude-tag exclude-tag-all listed incremental exclude16;
-50;delete01.at:23;deleting a member after a big one;delete delete01;
-51;delete02.at:23;deleting a member from stdin archive;delete delete02;
-52;delete03.at:21;deleting members with long names;delete delete03;
-53;delete04.at:23;deleting a large last member;delete delete04;
-54;delete05.at:27;deleting non-existing member;delete delete05;
-55;extrac01.at:23;extract over an existing directory;extract extract01;
-56;extrac02.at:23;extracting symlinks over an existing file;extract extract02 symlink;
-57;extrac03.at:23;extraction loops;extract extract03;
-58;extrac04.at:23;extract + fnmatch;extract extract04 fnmatch;
-59;extrac05.at:30;extracting selected members from pax;extract extract05;
-60;extrac06.at:34;mode of extracted directories;extract extract06 directory mode;
-61;extrac07.at:27;extracting symlinks to a read-only dir;extract extract07 read-only symlink;
-62;extrac08.at:33;restoring mode on existing directory;extract extrac08;
-63;extrac09.at:24;no need to save dir with unreadable . and ..;extract extrac09;
-64;extrac10.at:29;-C and delayed setting of metadata;extract extrac10;
-65;extrac11.at:25;scarce file descriptors;extract extrac11;
-66;extrac12.at:25;extract dot permissions;extract extrac12;
-67;extrac13.at:26;extract over symlinks;extract extrac13;
-68;extrac14.at:25;extract -C symlink;extract extrac14;
-69;extrac15.at:25;extract parent mkdir failure;extract extrac15;
-70;extrac16.at:26;extract empty directory with -C;extract extrac16;
-71;extrac17.at:21;name matching/transformation ordering;extract extrac17;
-72;extrac18.at:34;keep-old-files;extract extrac18 old-files keep-old-files;
-73;extrac19.at:21;skip-old-files;extract extrac19 old-files skip-old-files;
-74;backup01.at:33;extracting existing dir with --backup;extract backup backup01;
-75;label01.at:21;single-volume label;label label01;
-76;label02.at:21;multi-volume label;label label02 multi-label multivolume multiv;
-77;label03.at:27;test-label option;label label03 test-label;
-78;label04.at:27;label with non-create option;label label04;
-79;label05.at:24;label with non-create option;label label05;
-80;incremental.at:23;incremental;incremental listed incr00;
-81;incr01.at:27;restore broken symlinks from incremental;incremental incr01;
-82;incr02.at:32;restoring timestamps from incremental;incremental timestamp restore incr02;
-83;listed01.at:26;--listed for individual files;listed incremental listed01;
-84;listed02.at:28;working --listed;listed incremental listed02;
-85;listed03.at:24;incremental dump when the parent directory is unreadable;listed incremental listed03;
-86;listed04.at:26;--listed-incremental and --one-file-system;listed incremental listed04;
-87;listed05.at:33;--listed-incremental and remounted directories;listed incremental listed05;
-88;incr03.at:28;renamed files in incrementals;incremental incr03 rename;
-89;incr04.at:29;proper icontents initialization;incremental incr04 icontents;
-90;incr05.at:21;incremental dumps with -C;incremental incr05;
-91;incr06.at:21;incremental dumps of nested directories;incremental incr06;
-92;incr07.at:18;incremental restores with -C;incremental extract incr07;
-93;incr08.at:38;filename normalization;incremental create incr08;
-94;incr09.at:26;incremental with alternating -C;incremental create incr09;
-95;filerem01.at:36;file removed as we read it (ca. 22 seconds);create incremental listed filechange filerem filerem01;
-96;filerem02.at:26;toplevel file removed (ca. 24 seconds);create incremental listed filechange filerem filerem02;
-97;rename01.at:24;renamed dirs in incrementals;incremental rename rename01;
-98;rename02.at:24;move between hierarchies;incremental rename rename02;
-99;rename03.at:23;cyclic renames;incremental rename rename03 cyclic-rename;
-100;rename04.at:27;renamed directory containing subdirectories;incremental rename04 rename;
-101;rename05.at:24;renamed subdirectories;incremental rename05 rename;
-102;chtype.at:27;changed file types in incrementals;incremental listed chtype;
-103;ignfail.at:23;ignfail;ignfail;
-104;link01.at:33;link count gt 2;hardlinks link01;
-105;link02.at:32;preserve hard links with --remove-files;hardlinks link02;
-106;link03.at:24;working -l with --remove-files;hardlinks link03;
-107;link04.at:29;link count is 1 but multiple occurrences;hardlinks link04;
-108;longv7.at:24;long names in V7 archives;longname longv7;
-109;long01.at:28;long file names divisible by block size;longname long512;
-110;lustar01.at:21;ustar: unsplittable file name;longname ustar lustar01;
-111;lustar02.at:21;ustar: unsplittable path name;longname ustar lustar02;
-112;lustar03.at:21;ustar: splitting long names;longname ustar lustar03;
-113;old.at:23;old archives;old;
-114;time01.at:20;time: tricky time stamps;time time01;
-115;multiv01.at:23;multivolume dumps from pipes;multivolume multiv multiv01;
-116;multiv02.at:28;skipping a straddling member;multivolume multiv multiv02;
-117;multiv03.at:30;MV archive & long filenames;multivolume multiv multiv03;
-118;multiv04.at:36;split directory members in a MV archive;multivolume multiv incremental listed multiv04;
-119;multiv05.at:26;Restoring after an out of sync volume;multivolume multiv multiv05 sync;
-120;multiv06.at:27;Multivolumes with L=record_size;multivolume multiv multiv06;
-121;multiv07.at:28;volumes split at an extended header;multivolume multiv multiv07 xsplit;
-122;multiv08.at:25;multivolume header creation;multivolume multiv multiv08;
-123;owner.at:21;--owner and --group;owner;
-124;sparse01.at:21;sparse files;sparse sparse01;
-125;sparse02.at:21;extracting sparse file over a pipe;sparse sparse02;
-126;sparse03.at:21;storing sparse files > 8G;sparse sparse03;
-127;sparse04.at:21;storing long sparse file names;sparse sparse04;
-128;sparsemv.at:21;sparse files in MV archives;sparse multiv sparsemv;
-129;spmvp00.at:21;sparse files in PAX MV archives, v.0.0;sparse multivolume multiv sparsemvp sparsemvp00;
-130;spmvp01.at:21;sparse files in PAX MV archives, v.0.1;sparse multiv sparsemvp sparsemvp01;
-131;spmvp10.at:21;sparse files in PAX MV archives, v.1.0;sparse multivolume multiv sparsemvp sparsemvp10;
-132;update.at:28;update unchanged directories;update update00;
-133;update01.at:29;update directories;update update01;
-134;update02.at:26;update changed files;update update02;
-135;verify.at:25;verify;verify;
-136;volume.at:23;volume;volume volcheck;
-137;volsize.at:29;volume header size;volume volsize;
-138;comprec.at:21;compressed format recognition;comprec;
-139;shortfile.at:26;short input files;shortfile shortfile0;
-140;shortupd.at:31;updating short archives;shortfile shortfile1 shortupd;
-141;truncate.at:29;truncate;truncate filechange;
-142;grow.at:24;grow;grow filechange;
-143;sigpipe.at:21;sigpipe handling;sigpipe;
-144;remfiles01.at:28;remove-files with compression;create remove-files remfiles01 gzip;
-145;remfiles02.at:28;remove-files with compression: grand-child;create remove-files remfiles02 gzip;
-146;remfiles03.at:28;remove-files with symbolic links;create remove-files remfiles03;
-147;remfiles04a.at:25;remove-files with -C:rel in -c/non-incr. mode;create remove-files remfiles04 remfiles04a;
-148;remfiles04b.at:33;remove-files with -C:rel in -c/incr. mode;create incremental remove-files remfiles04 remfiles04b;
-149;remfiles04c.at:33;remove-files with -C:rel in -r mode;create append remove-files remfiles04 remfiles04c;
-150;remfiles05a.at:34;remove-files with -C:rel,rel in -c/non-incr. mode;create remove-files remfiles05 remfiles05a;
-151;remfiles05b.at:25;remove-files with -C:rel,rel in -c/incr. mode;create incremental remove-files remfiles05 remfiles05b;
-152;remfiles05c.at:25;remove-files with -C:rel,rel in -r mode;create append remove-files remfiles05 remfiles05c;
-153;remfiles06a.at:25;remove-files with -C:rel,abs in -c/non-incr. mode;create remove-files remfiles06 remfiles06a;
-154;remfiles06b.at:25;remove-files with -C:rel,abs in -c/incr. mode;create incremental remove-files remfiles06 remfiles06b;
-155;remfiles06c.at:25;remove-files with -C:rel,abs in -r mode;create append remove-files remfiles06 remfiles06c;
-156;remfiles07a.at:25;remove-files with -C:rel,abs in -c/non-incr. mode;create remove-files remfiles07 remfiles07a;
-157;remfiles07b.at:25;remove-files with -C:rel,abs in -c/incr. mode;create incremental remove-files remfiles07 remfiles07b;
-158;remfiles07c.at:25;remove-files with -C:rel,abs in -r mode;create append remove-files remfiles07 remfiles07c;
-159;remfiles08a.at:25;remove-files with -C:abs,rel in -c/non-incr. mode;create remove-files remfiles08 remfiles08a;
-160;remfiles08b.at:25;remove-files with -C:abs,rel in -c/incr. mode;create incremental remove-files remfiles08 remfiles08b;
-161;remfiles08c.at:25;remove-files with -C:abs,rel in -r mode;create append remove-files remfiles08 remfiles08c;
-162;remfiles09a.at:25;remove-files on full directory in -c/non-incr. mode;create remove-files remfiles09 remfiles09a;
-163;remfiles09b.at:29;remove-files on full directory in -c/incr. mode;create incremental remove-files remfiles09 remfiles09b;
-164;remfiles09c.at:25;remove-files on full directory in -r mode;create append remove-files remfiles09 remfiles09c;
-165;xattr01.at:25;xattrs: basic functionality;xattrs xattr01;
-166;xattr02.at:25;xattrs: change directory with -C option;xattrs xattr02;
-167;xattr03.at:25;xattrs: trusted.* attributes;xattrs xattr03;
-168;xattr04.at:26;xattrs: s/open/openat/ regression;xattrs xattr04;
-169;xattr05.at:28;xattrs: keywords with '=' and '%';xattrs xattr05;
-170;acls01.at:25;acls: basic functionality;xattrs acls acls01;
-171;acls02.at:25;acls: work with -C;xattrs acls acls02;
-172;selnx01.at:25;selinux: basic store/restore;xattrs selinux selnx01;
-173;selacl01.at:25;acls/selinux: special files & fifos;xattrs selinux acls selacls01;
-174;capabs_raw01.at:25;capabilities: binary store/restore;xattrs capabilities capabs_raw01;
-175;gtarfail.at:21;gtarfail;star gtarfail;
-176;gtarfail2.at:21;gtarfail2;star gtarfail2;
-177;multi-fail.at:21;multi-fail;star multivolume multiv multi-fail;
-178;ustar-big-2g.at:21;ustar-big-2g;star ustar-big-2g;
-179;ustar-big-8g.at:21;ustar-big-8g;star ustar-big-8g;
-180;pax-big-10g.at:21;pax-big-10g;star pax-big-10g;
+14;T-recurse.at:27;files-from & recurse: toggle;recurse t-recurse files-from;
+15;T-recurse.at:66;toggle --recursion (not) from -T;recurse t-recurse t-recurse2 files-from;
+16;T-cd.at:21;-C in file lists;files-from t-cd;
+17;T-empty.at:26;empty entries;files-from empty-line;
+18;T-null.at:21;0-separated file without -0;files-from null t-null;
+19;T-null2.at:17;--null enables verbatim reading;files-from null t-null2 t-verbatim;
+20;T-zfile.at:26;empty file;files-from empty-file;
+21;T-nonl.at:27;entries with missing newlines;files-from nonewline nonl t-nonl;
+22;T-dir00.at:28;recursive extraction from --files-from;files-from extract t-dir t-dir00;
+23;T-dir01.at:28;trailing slash in --files-from;files-from extract t-dir t-dir01;
+24;indexfile.at:26;tar --index-file=FILE --file=-;stdout indexfile;
+25;verbose.at:26;tar cvf -;stdout verbose;
+26;gzip.at:24;gzip;gzip;
+27;recurse.at:21;recurse;recurse;
+28;recurs02.at:30;recurse: toggle;recurse options recurse02;
+29;shortrec.at:26;short records;shortrec;
+30;numeric.at:18;--numeric-owner basic tests;options numeric numeric-owner;
+31;same-order01.at:27;working -C with --same-order;same-order same-order01;
+32;same-order02.at:26;multiple -C options;same-order same-order02;
+33;append.at:22;append;append append00;
+34;append01.at:29;appending files with long names;append append01;
+35;append02.at:55;append vs. create;append append02 append-gnu;
+36;append03.at:21;append with name transformation;append append03;
+37;append04.at:29;append with verify;append append04 verify append-verify;
+38;append05.at:32;append after changed blocking;append append05 blocking;
+39;xform-h.at:30;transforming hard links on create;transform xform xform-h;
+40;xform01.at:26;transformations and GNU volume labels;transform xform xform01 volume;
+41;xform02.at:21;transforming escaped delimiters on create;transform xform delimiter;
+42;exclude.at:23;exclude;exclude;
+43;exclude01.at:19;exclude wildcards;exclude exclude01;
+44;exclude02.at:19;exclude: anchoring;exclude exclude02;
+45;exclude03.at:19;exclude: wildcards match slash;exclude exclude03;
+46;exclude04.at:19;exclude: case insensitive;exclude exclude04;
+47;exclude05.at:21;exclude: lots of excludes;exclude exclude05;
+48;exclude06.at:26;exclude: long files in pax archives;exclude exclude06;
+49;exclude07.at:19;exclude: --exclude-backups option;exclude exclude07;
+50;exclude08.at:36;--exclude-tag option;exclude exclude-tag exclude08;
+51;exclude09.at:37;--exclude-tag option and --listed-incremental;exclude exclude-tag listed incremental exclude09;
+52;exclude10.at:38;--exclude-tag option in incremental pass;exclude exclude-tag listed incremental exclude10;
+53;exclude11.at:36;--exclude-tag-under option;exclude exclude-tag exclude-tag-under exclude11;
+54;exclude12.at:37;--exclude-tag-under and --listed-incremental;exclude exclude-tag exclude-tag-under listed incremental exclude12;
+55;exclude13.at:39;--exclude-tag-under option in incremental pass;exclude exclude-tag exclude-tag-under listed incremental exclude13;
+56;exclude14.at:36;--exclude-tag-all option;exclude exclude-tag exclude-tag-all exclude14;
+57;exclude15.at:36;--exclude-tag-all and --listed-incremental;exclude exclude-tag exclude-tag-all listed incremental exclude15;
+58;exclude16.at:38;--exclude-tag-all option in incremental pass;exclude exclude-tag exclude-tag-all listed incremental exclude16;
+59;delete01.at:24;deleting a member after a big one;delete delete01;
+60;delete02.at:24;deleting a member from stdin archive;delete delete02;
+61;delete03.at:21;deleting members with long names;delete delete03;
+62;delete04.at:24;deleting a large last member;delete delete04;
+63;delete05.at:28;deleting non-existing member;delete delete05;
+64;extrac01.at:24;extract over an existing directory;extract extract01;
+65;extrac02.at:24;extracting symlinks over an existing file;extract extract02 symlink;
+66;extrac03.at:23;extraction loops;extract extract03;
+67;extrac04.at:24;extract + fnmatch;extract extract04 fnmatch;
+68;extrac05.at:31;extracting selected members from pax;extract extract05;
+69;extrac06.at:34;mode of extracted directories;extract extract06 directory mode;
+70;extrac07.at:27;extracting symlinks to a read-only dir;extract extract07 read-only symlink;
+71;extrac08.at:33;restoring mode on existing directory;extract extrac08;
+72;extrac09.at:34;extracting even when . and .. are unreadable;extract extrac09;
+73;extrac10.at:29;-C and delayed setting of metadata;extract extrac10;
+74;extrac11.at:25;scarce file descriptors;extract extrac11;
+75;extrac12.at:25;extract dot permissions;extract extrac12;
+76;extrac13.at:26;extract over symlinks;extract extrac13;
+77;extrac14.at:25;extract -C symlink;extract extrac14;
+78;extrac15.at:25;extract parent mkdir failure;extract extrac15;
+79;extrac16.at:26;extract empty directory with -C;extract extrac16;
+80;extrac17.at:21;name matching/transformation ordering;extract extrac17;
+81;extrac18.at:34;keep-old-files;extract extrac18 old-files keep-old-files;
+82;extrac19.at:21;skip-old-files;extract extrac19 old-files skip-old-files;
+83;backup01.at:33;extracting existing dir with --backup;extract backup backup01;
+84;label01.at:21;single-volume label;label label01;
+85;label02.at:21;multi-volume label;label label02 multi-label multivolume multiv;
+86;label03.at:27;test-label option;label label03 test-label;
+87;label04.at:27;label with non-create option;label label04;
+88;label05.at:24;label with non-create option;label label05;
+89;incremental.at:23;incremental;incremental listed incr00;
+90;incr01.at:27;restore broken symlinks from incremental;incremental incr01;
+91;incr02.at:32;restoring timestamps from incremental;incremental timestamp restore incr02;
+92;listed01.at:27;--listed for individual files;listed incremental listed01;
+93;listed02.at:29;working --listed;listed incremental listed02;
+94;listed03.at:24;incremental dump when the parent directory is unreadable;listed incremental listed03;
+95;listed04.at:26;--listed-incremental and --one-file-system;listed incremental listed04;
+96;listed05.at:33;--listed-incremental and remounted directories;listed incremental listed05;
+97;incr03.at:29;renamed files in incrementals;incremental incr03 rename;
+98;incr04.at:30;proper icontents initialization;incremental incr04 icontents;
+99;incr05.at:21;incremental dumps with -C;incremental incr05;
+100;incr06.at:21;incremental dumps of nested directories;incremental incr06;
+101;incr07.at:18;incremental restores with -C;incremental extract incr07;
+102;incr08.at:38;filename normalization;incremental create incr08;
+103;incr09.at:26;incremental with alternating -C;incremental create incr09;
+104;incr10.at:18;concatenated incremental archives (deletes);incremental concat cat incr10;
+105;incr11.at:25;concatenated incremental archives (renames);incremental concat cat incr11;
+106;filerem01.at:36;file removed as we read it (ca. 22 seconds);create incremental listed filechange filerem filerem01;
+107;filerem02.at:26;toplevel file removed (ca. 24 seconds);create incremental listed filechange filerem filerem02;
+108;rename01.at:25;renamed dirs in incrementals;incremental rename rename01;
+109;rename02.at:25;move between hierarchies;incremental rename rename02;
+110;rename03.at:24;cyclic renames;incremental rename rename03 cyclic-rename;
+111;rename04.at:27;renamed directory containing subdirectories;incremental rename04 rename;
+112;rename05.at:24;renamed subdirectories;incremental rename05 rename;
+113;chtype.at:27;changed file types in incrementals;incremental listed chtype;
+114;ignfail.at:24;ignfail;ignfail;
+115;link01.at:34;link count gt 2;hardlinks link01;
+116;link02.at:32;preserve hard links with --remove-files;hardlinks link02;
+117;link03.at:24;working -l with --remove-files;hardlinks link03;
+118;link04.at:29;link count is 1 but multiple occurrences;hardlinks link04;
+119;longv7.at:25;long names in V7 archives;longname longv7;
+120;long01.at:28;long file names divisible by block size;longname long512;
+121;lustar01.at:21;ustar: unsplittable file name;longname ustar lustar01;
+122;lustar02.at:21;ustar: unsplittable path name;longname ustar lustar02;
+123;lustar03.at:21;ustar: splitting long names;longname ustar lustar03;
+124;old.at:23;old archives;old;
+125;time01.at:20;time: tricky time stamps;time time01;
+126;time02.at:20;time: clamping mtime;time time02;
+127;multiv01.at:24;multivolume dumps from pipes;multivolume multiv multiv01;
+128;multiv02.at:29;skipping a straddling member;multivolume multiv multiv02;
+129;multiv03.at:30;MV archive & long filenames;multivolume multiv multiv03;
+130;multiv04.at:36;split directory members in a MV archive;multivolume multiv incremental listed multiv04;
+131;multiv05.at:26;Restoring after an out of sync volume;multivolume multiv multiv05 sync;
+132;multiv06.at:27;Multivolumes with L=record_size;multivolume multiv multiv06;
+133;multiv07.at:28;volumes split at an extended header;multivolume multiv multiv07 xsplit;
+134;multiv08.at:25;multivolume header creation;multivolume multiv multiv08;
+135;multiv09.at:26;bad next volume;multivolume multiv multiv09;
+136;owner.at:21;--owner and --group;owner;
+137;map.at:21;--owner-map and --group-map;owner map;
+138;sparse01.at:22;sparse files;sparse sparse01;
+139;sparse02.at:22;extracting sparse file over a pipe;sparse sparse02;
+140;sparse03.at:21;storing sparse files > 8G;sparse sparse03;
+141;sparse04.at:21;storing long sparse file names;sparse sparse04;
+142;sparse05.at:21;listing sparse files bigger than 2^33 B;sparse sparse05;
+143;sparse06.at:21;storing sparse file using seek method;sparse sparse06;
+144;sparsemv.at:21;sparse files in MV archives;sparse multiv sparsemv;
+145;spmvp00.at:21;sparse files in PAX MV archives, v.0.0;sparse multivolume multiv sparsemvp sparsemvp00;
+146;spmvp01.at:21;sparse files in PAX MV archives, v.0.1;sparse multiv sparsemvp sparsemvp01;
+147;spmvp10.at:21;sparse files in PAX MV archives, v.1.0;sparse multivolume multiv sparsemvp sparsemvp10;
+148;update.at:28;update unchanged directories;update update00;
+149;update01.at:29;update directories;update update01;
+150;update02.at:26;update changed files;update update02;
+151;verify.at:25;verify;verify;
+152;volume.at:24;volume;volume volcheck;
+153;volsize.at:29;volume header size;volume volsize;
+154;comprec.at:22;compressed format recognition;comprec;
+155;shortfile.at:26;short input files;shortfile shortfile0;
+156;shortupd.at:31;updating short archives;shortfile shortfile1 shortupd;
+157;truncate.at:29;truncate;truncate filechange;
+158;grow.at:24;grow;grow filechange;
+159;sigpipe.at:21;sigpipe handling;sigpipe;
+160;comperr.at:18;compressor program failure;compress comperr;
+161;remfiles01.at:28;remove-files with compression;create remove-files remfiles01 gzip;
+162;remfiles02.at:28;remove-files with compression: grand-child;create remove-files remfiles02 gzip;
+163;remfiles03.at:28;remove-files with symbolic links;create remove-files remfiles03;
+164;remfiles04a.at:25;remove-files with -C:rel in -c/non-incr. mode;create remove-files remfiles04 remfiles04a;
+165;remfiles04b.at:33;remove-files with -C:rel in -c/incr. mode;create incremental remove-files remfiles04 remfiles04b;
+166;remfiles04c.at:33;remove-files with -C:rel in -r mode;create append remove-files remfiles04 remfiles04c;
+167;remfiles05a.at:34;remove-files with -C:rel,rel in -c/non-incr. mode;create remove-files remfiles05 remfiles05a;
+168;remfiles05b.at:25;remove-files with -C:rel,rel in -c/incr. mode;create incremental remove-files remfiles05 remfiles05b;
+169;remfiles05c.at:25;remove-files with -C:rel,rel in -r mode;create append remove-files remfiles05 remfiles05c;
+170;remfiles06a.at:25;remove-files with -C:rel,abs in -c/non-incr. mode;create remove-files remfiles06 remfiles06a;
+171;remfiles06b.at:25;remove-files with -C:rel,abs in -c/incr. mode;create incremental remove-files remfiles06 remfiles06b;
+172;remfiles06c.at:25;remove-files with -C:rel,abs in -r mode;create append remove-files remfiles06 remfiles06c;
+173;remfiles07a.at:25;remove-files with -C:abs,rel in -c/non-incr. mode;create remove-files remfiles07 remfiles07a;
+174;remfiles07b.at:25;remove-files with -C:abs,rel in -c/incr. mode;create incremental remove-files remfiles07 remfiles07b;
+175;remfiles07c.at:25;remove-files with -C:abs,rel in -r mode;create append remove-files remfiles07 remfiles07c;
+176;remfiles08a.at:28;remove-files deleting two subdirs in -c/non-incr. mode;create remove-files remfiles08 remfiles08a;
+177;remfiles08b.at:31;remove-files deleting two subdirs in -c/incr. mode;create incremental remove-files remfiles08 remfiles08b;
+178;remfiles08c.at:28;remove-files deleting two subdirs in -r mode;create append remove-files remfiles08 remfiles08c;
+179;remfiles09a.at:25;remove-files on full directory in -c/non-incr. mode;create remove-files remfiles09 remfiles09a;
+180;remfiles09b.at:29;remove-files on full directory in -c/incr. mode;create incremental remove-files remfiles09 remfiles09b;
+181;remfiles09c.at:25;remove-files on full directory in -r mode;create append remove-files remfiles09 remfiles09c;
+182;remfiles10.at:20;remove-files;create remove-files remfiles10;
+183;xattr01.at:25;xattrs: basic functionality;xattrs xattr01;
+184;xattr02.at:25;xattrs: change directory with -C option;xattrs xattr02;
+185;xattr03.at:25;xattrs: trusted.* attributes;xattrs xattr03;
+186;xattr04.at:26;xattrs: s/open/openat/ regression;xattrs xattr04;
+187;xattr05.at:28;xattrs: keywords with '=' and '%';xattrs xattr05;
+188;acls01.at:25;acls: basic functionality;xattrs acls acls01;
+189;acls02.at:25;acls: work with -C;xattrs acls acls02;
+190;acls03.at:30;acls: default ACLs;xattrs acls acls03;
+191;selnx01.at:25;selinux: basic store/restore;xattrs selinux selnx01;
+192;selacl01.at:25;acls/selinux: special files & fifos;xattrs selinux acls selacls01;
+193;capabs_raw01.at:25;capabilities: binary store/restore;xattrs capabilities capabs_raw01;
+194;onetop01.at:21;tar --one-top-level;extract onetop onetop01;
+195;onetop02.at:21;tar --one-top-level --show-transformed;extract onetop onetop02;
+196;onetop03.at:21;tar --one-top-level --transform;extract onetop onetop03;
+197;onetop04.at:21;tar --one-top-level --transform;extract onetop onetop04;
+198;onetop05.at:21;tar --one-top-level restoring permissions;extract onetop onetop05;
+199;gtarfail.at:22;gtarfail;star gtarfail;
+200;gtarfail2.at:22;gtarfail2;star gtarfail2;
+201;multi-fail.at:22;multi-fail;star multivolume multiv multi-fail;
+202;ustar-big-2g.at:22;ustar-big-2g;star ustar-big-2g;
+203;ustar-big-8g.at:22;ustar-big-8g;star ustar-big-8g;
+204;pax-big-10g.at:22;pax-big-10g;star pax-big-10g;
 "
 # List of the all the test groups.
 at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'`
@@ -783,7 +807,7 @@ at_fn_validate_ranges ()
   for at_grp
   do
     eval at_value=\$$at_grp
-    if test $at_value -lt 1 || test $at_value -gt 180; then
+    if test $at_value -lt 1 || test $at_value -gt 204; then
       $as_echo "invalid test group: $at_value" >&2
       exit 1
     fi
@@ -1082,7 +1106,7 @@ fi
 # List of tests.
 if $at_list_p; then
   cat <<_ATEOF || at_write_fail=1
-GNU tar 1.27.1 test suite test groups:
+GNU tar 1.29 test suite test groups:
 
  NUM: FILE-NAME:LINE     TEST-GROUP-NAME
       KEYWORDS
@@ -1123,7 +1147,7 @@ _ATEOF
   exit $at_write_fail
 fi
 if $at_version_p; then
-  $as_echo "$as_me (GNU tar 1.27.1)" &&
+  $as_echo "$as_me (GNU tar 1.29)" &&
   cat <<\_ATEOF || at_write_fail=1
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1140,84 +1164,87 @@ case $at_groups in #(
   * ) at_print_banners=false ;;
 esac
 # Text for banner N, set to a single space once printed.
-# Banner 1. testsuite.at:191
+# Banner 1. testsuite.at:208
 # Category starts at test group 5.
 at_banner_text_1="Option compatibility"
-# Banner 2. testsuite.at:199
+# Banner 2. testsuite.at:216
 # Category starts at test group 11.
 at_banner_text_2="The -T option"
-# Banner 3. testsuite.at:209
-# Category starts at test group 19.
-at_banner_text_3="Various options"
-# Banner 4. testsuite.at:216
+# Banner 3. testsuite.at:230
 # Category starts at test group 24.
+at_banner_text_3="Various options"
+# Banner 4. testsuite.at:239
+# Category starts at test group 31.
 at_banner_text_4="The --same-order option"
-# Banner 5. testsuite.at:220
-# Category starts at test group 26.
+# Banner 5. testsuite.at:243
+# Category starts at test group 33.
 at_banner_text_5="Append"
-# Banner 6. testsuite.at:227
-# Category starts at test group 31.
+# Banner 6. testsuite.at:251
+# Category starts at test group 39.
 at_banner_text_6="Transforms"
-# Banner 7. testsuite.at:231
-# Category starts at test group 33.
+# Banner 7. testsuite.at:256
+# Category starts at test group 42.
 at_banner_text_7="Exclude"
-# Banner 8. testsuite.at:250
-# Category starts at test group 50.
+# Banner 8. testsuite.at:275
+# Category starts at test group 59.
 at_banner_text_8="Deletions"
-# Banner 9. testsuite.at:257
-# Category starts at test group 55.
+# Banner 9. testsuite.at:282
+# Category starts at test group 64.
 at_banner_text_9="Extracting"
-# Banner 10. testsuite.at:279
-# Category starts at test group 75.
+# Banner 10. testsuite.at:304
+# Category starts at test group 84.
 at_banner_text_10="Volume label operations"
-# Banner 11. testsuite.at:286
-# Category starts at test group 80.
+# Banner 11. testsuite.at:311
+# Category starts at test group 89.
 at_banner_text_11="Incremental archives"
-# Banner 12. testsuite.at:303
-# Category starts at test group 95.
+# Banner 12. testsuite.at:330
+# Category starts at test group 106.
 at_banner_text_12="Files removed while archiving"
-# Banner 13. testsuite.at:307
-# Category starts at test group 97.
+# Banner 13. testsuite.at:334
+# Category starts at test group 108.
 at_banner_text_13="Renames"
-# Banner 14. testsuite.at:315
-# Category starts at test group 103.
+# Banner 14. testsuite.at:342
+# Category starts at test group 114.
 at_banner_text_14="Ignore failing reads"
-# Banner 15. testsuite.at:318
-# Category starts at test group 104.
+# Banner 15. testsuite.at:345
+# Category starts at test group 115.
 at_banner_text_15="Link handling"
-# Banner 16. testsuite.at:324
-# Category starts at test group 108.
+# Banner 16. testsuite.at:351
+# Category starts at test group 119.
 at_banner_text_16="Specific archive formats"
-# Banner 17. testsuite.at:334
-# Category starts at test group 115.
+# Banner 17. testsuite.at:362
+# Category starts at test group 127.
 at_banner_text_17="Multivolume archives"
-# Banner 18. testsuite.at:344
-# Category starts at test group 123.
+# Banner 18. testsuite.at:373
+# Category starts at test group 136.
 at_banner_text_18="Owner and Groups"
-# Banner 19. testsuite.at:347
-# Category starts at test group 124.
+# Banner 19. testsuite.at:377
+# Category starts at test group 138.
 at_banner_text_19="Sparse files"
-# Banner 20. testsuite.at:357
-# Category starts at test group 132.
+# Banner 20. testsuite.at:389
+# Category starts at test group 148.
 at_banner_text_20="Updates"
-# Banner 21. testsuite.at:362
-# Category starts at test group 135.
+# Banner 21. testsuite.at:394
+# Category starts at test group 151.
 at_banner_text_21="Verifying the archive"
-# Banner 22. testsuite.at:365
-# Category starts at test group 136.
+# Banner 22. testsuite.at:397
+# Category starts at test group 152.
 at_banner_text_22="Volume operations"
-# Banner 23. testsuite.at:369
-# Category starts at test group 138.
+# Banner 23. testsuite.at:401
+# Category starts at test group 154.
 at_banner_text_23=""
-# Banner 24. testsuite.at:378
-# Category starts at test group 144.
+# Banner 24. testsuite.at:411
+# Category starts at test group 161.
 at_banner_text_24="Removing files after archiving"
-# Banner 25. testsuite.at:401
-# Category starts at test group 165.
+# Banner 25. testsuite.at:435
+# Category starts at test group 183.
 at_banner_text_25="Extended attributes"
-# Banner 26. testsuite.at:416
-# Category starts at test group 175.
-at_banner_text_26="Star tests"
+# Banner 26. testsuite.at:451
+# Category starts at test group 194.
+at_banner_text_26="One top level"
+# Banner 27. testsuite.at:458
+# Category starts at test group 199.
+at_banner_text_27="Star tests"
 
 # Take any -C into account.
 if $at_change_dir ; then
@@ -1377,13 +1404,13 @@ fi
 exec 5>>"$at_suite_log"
 
 # Banners and logs.
-$as_echo "## -------------------------- ##
-## GNU tar 1.27.1 test suite. ##
-## -------------------------- ##"
+$as_echo "## ------------------------ ##
+## GNU tar 1.29 test suite. ##
+## ------------------------ ##"
 {
-  $as_echo "## -------------------------- ##
-## GNU tar 1.27.1 test suite. ##
-## -------------------------- ##"
+  $as_echo "## ------------------------ ##
+## GNU tar 1.29 test suite. ##
+## ------------------------ ##"
   echo
 
   $as_echo "$as_me: command line was:"
@@ -1627,7 +1654,7 @@ IFS=$as_save_IFS
   esac
   if test -f "$at_program_"; then
     {
-      $as_echo "$at_srcdir/testsuite.at:180: $at_program_ --version"
+      $as_echo "$at_srcdir/testsuite.at:197: $at_program_ --version"
       "$at_program_" --version </dev/null
       echo
     } >&5 2>&1
@@ -2226,7 +2253,7 @@ _ASBOX
   $as_echo "Please send $at_msg and all information you think might help:
 
    To: <bug-tar@gnu.org>
-   Subject: [GNU tar 1.27.1] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
+   Subject: [GNU tar 1.29] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly}
 
 You may investigate any problem if you feel able to do so, in which
 case the test suite provides a good starting point.  Its output may
@@ -2241,7 +2268,7 @@ exit 0
 ## Actual tests. ##
 ## ------------- ##
 #AT_START_1
-at_fn_group_banner 1 'version.at:19' \
+at_fn_group_banner 1 'version.at:20' \
   "tar version" "                                    "
 at_xfail=no
 (
@@ -2250,17 +2277,17 @@ at_xfail=no
 
 
 { set +x
-$as_echo "$at_srcdir/version.at:21: tar --version | sed 1q"
-at_fn_check_prepare_notrace 'a shell pipeline' "version.at:21"
+$as_echo "$at_srcdir/version.at:22: tar --version | sed 1q"
+at_fn_check_prepare_notrace 'a shell pipeline' "version.at:22"
 ( $at_check_trace; tar --version | sed 1q
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "tar (GNU tar) 1.27.1
+echo >>"$at_stdout"; $as_echo "tar (GNU tar) 1.29
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/version.at:21"
+at_fn_check_status 0 $at_status "$at_srcdir/version.at:22"
 if $at_failed; then :
   cat >$XFAILFILE <<'_EOT'
 
@@ -2619,7 +2646,7 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_2
 #AT_START_3
-at_fn_group_banner 3 'options.at:24' \
+at_fn_group_banner 3 'options.at:25' \
   "mixing options" "                                 "
 at_xfail=no
 (
@@ -2629,12 +2656,12 @@ at_xfail=no
 
 
 { set +x
-$as_echo "$at_srcdir/options.at:27:
+$as_echo "$at_srcdir/options.at:28:
 echo > file1
 TAR_OPTIONS=--numeric-owner tar chof archive file1
 tar tf archive
 "
-at_fn_check_prepare_notrace 'an embedded newline' "options.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "options.at:28"
 ( $at_check_trace;
 echo > file1
 TAR_OPTIONS=--numeric-owner tar chof archive file1
@@ -2647,7 +2674,7 @@ at_fn_diff_devnull "$at_stderr" || at_failed=:
 echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/options.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/options.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -2658,7 +2685,7 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_3
 #AT_START_4
-at_fn_group_banner 4 'options02.at:26' \
+at_fn_group_banner 4 'options02.at:27' \
   "interspersed options" "                           "
 at_xfail=no
 (
@@ -2668,12 +2695,12 @@ at_xfail=no
 
 
 { set +x
-$as_echo "$at_srcdir/options02.at:29:
+$as_echo "$at_srcdir/options02.at:30:
 echo > file1
 tar c file1 -f archive
 tar tf archive
 "
-at_fn_check_prepare_notrace 'an embedded newline' "options02.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "options02.at:30"
 ( $at_check_trace;
 echo > file1
 tar c file1 -f archive
@@ -2686,7 +2713,7 @@ at_fn_diff_devnull "$at_stderr" || at_failed=:
 echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/options02.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/options02.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -2717,7 +2744,7 @@ tar --occurrence=1 -cf test.tar .
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: --occurrence cannot be used with -c
+echo >>"$at_stderr"; $as_echo "tar: '--occurrence' cannot be used with '-c'
 Try 'tar --help' or 'tar --usage' for more information.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
@@ -2789,7 +2816,7 @@ tar -tWf test.tar .
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: --verify cannot be used with -t
+echo >>"$at_stderr"; $as_echo "tar: '--verify' cannot be used with '-t'
 Try 'tar --help' or 'tar --usage' for more information.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
@@ -3244,8 +3271,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_13
 #AT_START_14
-at_fn_group_banner 14 'T-cd.at:21' \
-  "-C in file lists" "                               " 2
+at_fn_group_banner 14 'T-recurse.at:27' \
+  "files-from & recurse: toggle" "                   " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -3257,170 +3284,195 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/T-cd.at:24:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+$as_echo "$at_srcdir/T-recurse.at:30:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
->file1
-mkdir dir
->dir/file2
->dir/file3
 cat >F1 <<'_ATEOF'
-file1
--C dir
-.
+--no-recursion
+directory1/
+--recursion
+directory2/
 _ATEOF
 
-tar cf archive -T F1
-tar tf archive | sort
+
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
+
+
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf \"\$a\" --files-from F1
+tar tf \"\$a\"
+
+a=archive2
+tar cf \"\$a\" --no-recursion -T F2A --recursion -T F2B
+tar tf \"\$a\"
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "T-cd.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:30"
 ( $at_check_trace;
-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 *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
->file1
-mkdir dir
->dir/file2
->dir/file3
 cat >F1 <<'_ATEOF'
-file1
--C dir
-.
+--no-recursion
+directory1/
+--recursion
+directory2/
 _ATEOF
 
-tar cf archive -T F1
-tar tf archive | sort
+
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
+
+
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf "$a" --files-from F1
+tar tf "$a"
+
+a=archive2
+tar cf "$a" --no-recursion -T F2A --recursion -T F2B
+tar tf "$a"
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "./
-./file2
-./file3
-file1
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/T-cd.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/T-recurse.at:30:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_14
-#AT_START_15
-at_fn_group_banner 15 'T-empty.at:26' \
-  "empty entries" "                                  " 2
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "15. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
 
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
-cat >file-list <<'_ATEOF'
-jeden
-dwa
 
-trzy
+cat >F2B <<'_ATEOF'
+directory2/
 _ATEOF
 
 
+a=archive
+tar cf \"\$a\" --files-from F1
+tar tf \"\$a\"
 
-
-  { set +x
-$as_echo "$at_srcdir/T-empty.at:36:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+a=archive2
+tar cf \"\$a\" --no-recursion -T F2A --recursion -T F2B
+tar tf \"\$a\"
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:30"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-genfile --file jeden
-genfile --file dwa
-genfile --file trzy
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
-tar cfvT archive ../file-list
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "T-empty.at:36"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
+
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
 
-genfile --file jeden
-genfile --file dwa
-genfile --file trzy
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
 
-tar cfvT archive ../file-list
+
+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"
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "jeden
-dwa
-trzy
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/T-empty.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
- # Testing one format is enough
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_15
-#AT_START_16
-at_fn_group_banner 16 'T-null.at:21' \
-  "0-separated file without -0" "                    " 2
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "16. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/T-null.at:24:
+              { set +x
+$as_echo "$at_srcdir/T-recurse.at:30:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -3429,22 +3481,36 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
 
-echo jeden > temp
-echo dwa >> temp
-echo trzy >> temp
-cat temp | tr '\\n' '\\0' > file-list
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
-genfile -f jeden
-genfile -f dwa
-genfile -f trzy
 
-tar cfTv archive file-list
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf \"\$a\" --files-from F1
+tar tf \"\$a\"
+
+a=archive2
+tar cf \"\$a\" --no-recursion -T F2A --recursion -T F2B
+tar tf \"\$a\"
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "T-null.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:30"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -3454,215 +3520,236 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
 
-echo jeden > temp
-echo dwa >> temp
-echo trzy >> temp
-cat temp | tr '\n' '\0' > file-list
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
-genfile -f jeden
-genfile -f dwa
-genfile -f trzy
 
-tar cfTv archive file-list
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf "$a" --files-from F1
+tar tf "$a"
+
+a=archive2
+tar cf "$a" --no-recursion -T F2A --recursion -T F2B
+tar tf "$a"
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: file-list: file name read contains nul character
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "jeden
-dwa
-trzy
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/T-null.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/T-recurse.at:30:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
- # Testing one format is enough
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_16
-#AT_START_17
-at_fn_group_banner 17 'T-zfile.at:26' \
-  "empty file" "                                     " 2
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "17. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
 
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
-  { set +x
-$as_echo "$at_srcdir/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
+cat >F2B <<'_ATEOF'
+directory2/
 _ATEOF
 
 
-tar cf archive -T empty -T valid
-tar tf archive
-echo \"==\"
-tar cf archive -T valid -T empty
-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\"
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "T-zfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:30"
 ( $at_check_trace;
-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 *
 
-genfile --length=0 --file empty
-genfile --file a
-genfile --file b
-cat >valid <<'_ATEOF'
-a
-b
+mkdir directory1 directory2
+touch directory1/file directory2/file
+
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
 _ATEOF
 
 
-tar cf archive -T empty -T valid
-tar tf archive
-echo "=="
-tar cf archive -T valid -T empty
-tar tf archive
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
+
+
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf "$a" --files-from F1
+tar tf "$a"
+
+a=archive2
+tar cf "$a" --no-recursion -T F2A --recursion -T F2B
+tar tf "$a"
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "a
-b
-==
-a
-b
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/T-zfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/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 *
 
- # Testing one format is enough
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_17
-#AT_START_18
-at_fn_group_banner 18 'T-nonl.at:27' \
-  "entries with missing newlines" "                  " 2
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "18. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
+_ATEOF
 
 
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
 
-  { set +x
-$as_echo "$at_srcdir/T-nonl.at:30:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
 
-genfile --length=0 --file empty
-\$as_echo_n c > 1.nonl
-echo d > 2.nonl
-\$as_echo_n e >> 2.nonl
-touch a b c d e
-cat >filelist <<'_ATEOF'
-a
-b
+cat >F2B <<'_ATEOF'
+directory2/
 _ATEOF
 
 
-tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist
-tar tf archive
-echo ==
-tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl
-tar tf archive
+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\"
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "T-nonl.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:30"
 ( $at_check_trace;
-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 *
 
-genfile --length=0 --file empty
-$as_echo_n c > 1.nonl
-echo d > 2.nonl
-$as_echo_n e >> 2.nonl
-touch a b c d e
-cat >filelist <<'_ATEOF'
-a
-b
+mkdir directory1 directory2
+touch directory1/file directory2/file
+
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+--recursion
+directory2/
 _ATEOF
 
 
-tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist
-tar tf archive
-echo ==
-tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl
-tar tf archive
+cat >F2A <<'_ATEOF'
+directory1/
+_ATEOF
+
+
+cat >F2B <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+a=archive
+tar cf "$a" --files-from F1
+tar tf "$a"
+
+a=archive2
+tar cf "$a" --no-recursion -T F2A --recursion -T F2B
+tar tf "$a"
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "c
-d
-e
-a
-b
-==
-d
-e
-a
-b
-c
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/T-nonl.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -3673,14 +3760,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_18
-#AT_START_19
-at_fn_group_banner 19 'indexfile.at:26' \
-  "tar --index-file=FILE --file=-" "                 " 3
+#AT_STOP_14
+#AT_START_15
+at_fn_group_banner 15 'T-recurse.at:66' \
+  "toggle --recursion (not) from -T" "               " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "19. $at_setup_line: testing $at_desc ..."
+  $as_echo "15. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -3688,7 +3775,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/indexfile.at:29:
+$as_echo "$at_srcdir/T-recurse.at:69:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -3697,17 +3784,25 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo \"Creating the archive\"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo \"Testing the archive\"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:69"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -3717,32 +3812,39 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo "Creating the archive"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo "Testing the archive"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-directory/
-directory/a
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:69"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/indexfile.at:29:
+$as_echo "$at_srcdir/T-recurse.at:69:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -3751,17 +3853,25 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo \"Creating the archive\"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo \"Testing the archive\"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:69"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -3771,32 +3881,39 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo "Creating the archive"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo "Testing the archive"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-directory/
-directory/a
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:69"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/indexfile.at:29:
+$as_echo "$at_srcdir/T-recurse.at:69:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -3805,17 +3922,25 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo \"Creating the archive\"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo \"Testing the archive\"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:69"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -3825,32 +3950,39 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo "Creating the archive"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo "Testing the archive"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-directory/
-directory/a
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:69"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/indexfile.at:29:
+$as_echo "$at_srcdir/T-recurse.at:69:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -3859,52 +3991,67 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo \"Creating the archive\"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo \"Testing the archive\"
-tar -tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
-( $at_check_trace;
-mkdir posix
-(cd posix
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:69"
+( $at_check_trace;
+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
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo "Creating the archive"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo "Testing the archive"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-directory/
-directory/a
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:69"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/indexfile.at:29:
+$as_echo "$at_srcdir/T-recurse.at:69:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -3913,17 +4060,25 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo \"Creating the archive\"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo \"Testing the archive\"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-recurse.at:69"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -3933,27 +4088,34 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir directory1 directory2
+touch directory1/file directory2/file
 
-mkdir directory
-genfile --file=directory/a --length=1035
+cat >F1 <<'_ATEOF'
+--no-recursion
+directory1/
+_ATEOF
 
-echo "Creating the archive"
-tar -c -v -f - --index-file=idx directory > archive
 
-echo "Testing the archive"
-tar -tf archive
+cat >F2 <<'_ATEOF'
+directory2/
+_ATEOF
+
+
+tar cf archive -T F1 --recursion -T F2
+tar tf archive
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-directory/
-directory/a
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-recurse.at:69"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -3964,14 +4126,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_19
-#AT_START_20
-at_fn_group_banner 20 'verbose.at:26' \
-  "tar cvf -" "                                      " 3
+#AT_STOP_15
+#AT_START_16
+at_fn_group_banner 16 'T-cd.at:21' \
+  "-C in file lists" "                               " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "20. $at_setup_line: testing $at_desc ..."
+  $as_echo "16. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -3979,101 +4141,102 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/verbose.at:29:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/T-cd.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 *
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "file
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-              { set +x
-$as_echo "$at_srcdir/verbose.at:29:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+>file1
+mkdir dir
+>dir/file2
+>dir/file3
+cat >F1 <<'_ATEOF'
+file1
+-C dir
+.
+_ATEOF
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
+tar cf archive -T F1
+tar tf archive | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-cd.at:24"
 ( $at_check_trace;
-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 *
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+>file1
+mkdir dir
+>dir/file2
+>dir/file3
+cat >F1 <<'_ATEOF'
+file1
+-C dir
+.
+_ATEOF
+
+tar cf archive -T F1
+tar tf archive | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "file
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "./
+./file2
+./file3
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-cd.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/verbose.at:29:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_16
+#AT_START_17
+at_fn_group_banner 17 'T-empty.at:26' \
+  "empty entries" "                                  " 2
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "17. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+cat >file-list <<'_ATEOF'
+jeden
+dwa
+
+trzy
+_ATEOF
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/T-empty.at:36:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -4082,13 +4245,14 @@ 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
+
+genfile --file jeden
+genfile --file dwa
+genfile --file trzy
+
+tar cfvT archive ../file-list
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "T-empty.at:36"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -4098,186 +4262,211 @@ 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
+
+genfile --file jeden
+genfile --file dwa
+genfile --file trzy
+
+tar cfvT archive ../file-list
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "file
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "jeden
+dwa
+trzy
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-empty.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/verbose.at:29:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
+ # Testing one format is enough
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "file
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_17
+#AT_START_18
+at_fn_group_banner 18 'T-null.at:21' \
+  "0-separated file without -0" "                    " 2
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "18. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-              { set +x
-$as_echo "$at_srcdir/verbose.at:29:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/T-null.at:24:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-null.at:24"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file --length 10240
-echo Creating the archive
-tar cvf - file > archive
-echo Testing the archive
-tar tf archive
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "file
+echo >>"$at_stderr"; $as_echo "tar: file-list: file name read contains nul character
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating the archive
-Testing the archive
-file
+echo >>"$at_stdout"; $as_echo "jeden
+dwa
+trzy
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-null.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
-
+ # Testing one format is enough
 
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_20
-#AT_START_21
-at_fn_group_banner 21 'gzip.at:23' \
-  "gzip" "                                           " 3
+#AT_STOP_18
+#AT_START_19
+at_fn_group_banner 19 'T-null2.at:17' \
+  "--null enables verbatim reading" "                " 2
 at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "21. $at_setup_line: testing $at_desc ..."
+  $as_echo "19. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-unset TAR_OPTIONS
+# According to the docs, --null should read each line from the file
+# list verbatim.  This feature was broken by commit 26538c9b (tar version
+# 1.27).
 
-{ set +x
-$as_echo "$at_srcdir/gzip.at:28:
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-tar xfvz /dev/null 2>err
-RC=\$?
-sed -n '/^tar:/p' err >&2
-exit \$RC
-"
-at_fn_check_prepare_notrace 'an embedded newline' "gzip.at:28"
+  { set +x
+$as_echo "$at_srcdir/T-null2.at:24:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
+
+cat >file-list <<'_ATEOF'
+a
+-b
+--c d
+_ATEOF
+
+
+genfile -f a
+genfile -f -b
+genfile -f '--c d'
+
+cat file-list | tr '\\n' '\\0' | tar -c -f archive -v --null -T -
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "T-null2.at:24"
 ( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
+cat >file-list <<'_ATEOF'
+a
+-b
+--c d
+_ATEOF
 
-tar xfvz /dev/null 2>err
-RC=$?
-sed -n '/^tar:/p' err >&2
-exit $RC
 
+genfile -f a
+genfile -f -b
+genfile -f '--c d'
+
+cat file-list | tr '\n' '\0' | tar -c -f archive -v --null -T -
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Child returned status 1
-tar: Error is not recoverable: exiting now
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a
+-b
+--c d
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/gzip.at:28"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-null2.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
+ # Testing one format is enough
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_21
-#AT_START_22
-at_fn_group_banner 22 'recurse.at:21' \
-  "recurse" "                                        " 3
+#AT_STOP_19
+#AT_START_20
+at_fn_group_banner 20 'T-zfile.at:26' \
+  "empty file" "                                     " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "22. $at_setup_line: testing $at_desc ..."
+  $as_echo "20. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -4285,89 +4474,93 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/recurse.at:24:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/T-zfile.at:29:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "T-zfile.at:29"
 ( $at_check_trace;
-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 directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
+echo >>"$at_stdout"; $as_echo "a
+b
+==
+a
+b
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/T-zfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/recurse.at:24:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
 
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
-tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
+ # Testing one format is enough
 
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_20
+#AT_START_21
+at_fn_group_banner 21 'T-nonl.at:27' \
+  "entries with missing newlines" "                  " 2
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "21. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-              { set +x
-$as_echo "$at_srcdir/recurse.at:24:
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/T-nonl.at:30:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -4376,12 +4569,24 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
+genfile --length=0 --file empty
+\$as_echo_n c > 1.nonl
+echo d > 2.nonl
+\$as_echo_n e >> 2.nonl
+touch a b c d e
+cat >filelist <<'_ATEOF'
+a
+b
+_ATEOF
+
+
+tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist
+tar tf archive
+echo ==
+tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl
 tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "T-nonl.at:30"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -4391,101 +4596,41 @@ 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+genfile --length=0 --file empty
+$as_echo_n c > 1.nonl
+echo d > 2.nonl
+$as_echo_n e >> 2.nonl
+touch a b c d e
+cat >filelist <<'_ATEOF'
+a
+b
+_ATEOF
 
-              { set +x
-$as_echo "$at_srcdir/recurse.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
 
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
+tar cf archive -T empty -T 1.nonl -T 2.nonl -T filelist
 tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
-
-mkdir directory
-touch directory/file
-tar --create --file archive --no-recursion directory || exit 1
+echo ==
+tar cf archive -T 2.nonl -T empty -T filelist -T 1.nonl
 tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
+echo >>"$at_stdout"; $as_echo "c
+d
+e
+a
+b
+==
+d
+e
+a
+b
+c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/T-nonl.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -4496,22 +4641,21 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_22
-#AT_START_23
-at_fn_group_banner 23 'shortrec.at:25' \
-  "short records" "                                  " 3
+#AT_STOP_21
+#AT_START_22
+at_fn_group_banner 22 'T-dir00.at:28' \
+  "recursive extraction from --files-from" "         " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "23. $at_setup_line: testing $at_desc ..."
+  $as_echo "22. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
-
   { set +x
-$as_echo "$at_srcdir/shortrec.at:28:
+$as_echo "$at_srcdir/T-dir00.at:30:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -4520,16 +4664,18 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir00.at:30"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -4539,26 +4685,32 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28"
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir00.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/shortrec.at:28:
+$as_echo "$at_srcdir/T-dir00.at:30:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -4567,16 +4719,18 @@ 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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir00.at:30"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -4586,26 +4740,32 @@ 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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28"
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir00.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/shortrec.at:28:
+$as_echo "$at_srcdir/T-dir00.at:30:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -4614,16 +4774,18 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir00.at:30"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -4633,26 +4795,32 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28"
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir00.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/shortrec.at:28:
+$as_echo "$at_srcdir/T-dir00.at:30:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -4661,16 +4829,18 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir00.at:30"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -4680,26 +4850,32 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-(cd directory && touch a b c d e f g h i j k l m n o p q r)
-tar -c -b 1 -f - directory | tar -t -f - > /dev/null
-tar -c -b 1 -f archive directory
-tar -t -f archive > /dev/null
-tar -t -f - < archive > /dev/null
 
-rm -r directory
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28"
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir00.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/shortrec.at:28:
+$as_echo "$at_srcdir/T-dir00.at:30:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -4708,16 +4884,18 @@ 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir00.at:30"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -4727,47 +4905,51 @@ 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:28"
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir00.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_23
-#AT_START_24
-at_fn_group_banner 24 'same-order01.at:26' \
-  "working -C with --same-order" "                   " 4
+#AT_STOP_22
+#AT_START_23
+at_fn_group_banner 23 'T-dir01.at:28' \
+  "trailing slash in --files-from" "                 " 2
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "24. $at_setup_line: testing $at_desc ..."
+  $as_echo "23. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
-
   { set +x
-$as_echo "$at_srcdir/same-order01.at:29:
+$as_echo "$at_srcdir/T-dir01.at:30:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -4779,17 +4961,15 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir01.at:30"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -4802,30 +4982,29 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order01.at:29:
+$as_echo "$at_srcdir/T-dir01.at:30:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -4837,17 +5016,15 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir01.at:30"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -4860,30 +5037,29 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order01.at:29:
+$as_echo "$at_srcdir/T-dir01.at:30:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -4895,17 +5071,15 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir01.at:30"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -4918,30 +5092,29 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order01.at:29:
+$as_echo "$at_srcdir/T-dir01.at:30:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -4953,17 +5126,15 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir01.at:30"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -4976,30 +5147,29 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order01.at:29:
+$as_echo "$at_srcdir/T-dir01.at:30:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -5011,17 +5181,15 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "T-dir01.at:30"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -5034,43 +5202,41 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
-
-mkdir directory
-tar -xf archive --same-order -C directory --warning=no-timestamp || exit 1
-
-ls directory|sort
+mkdir dir
+genfile -f dir/file1
+genfile -f dir/file2
+tar cf archive dir
+rm -rf dir
+echo dir/ > list
+tar xfTv archive list | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file1
+dir/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/T-dir01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_24
-#AT_START_25
-at_fn_group_banner 25 'same-order02.at:25' \
-  "multiple -C options" "                            " 4
+#AT_STOP_23
+#AT_START_24
+at_fn_group_banner 24 'indexfile.at:26' \
+  "tar --index-file=FILE --file=-" "                 " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "25. $at_setup_line: testing $at_desc ..."
+  $as_echo "24. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -5078,7 +5244,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/same-order02.at:28:
+$as_echo "$at_srcdir/indexfile.at:29:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -5087,23 +5253,17 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=\`pwd\`
-tar -xf archive --same-order --warning=no-timestamp \\
-  -C \$HERE/en file1 \\
-  -C \$HERE/to file2 || exit 1
+echo \"Creating the archive\"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo \"Testing the archive\"
+tar -tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -5113,37 +5273,32 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=`pwd`
-tar -xf archive --same-order --warning=no-timestamp \
-  -C $HERE/en file1 \
-  -C $HERE/to file2 || exit 1
+echo "Creating the archive"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo "Testing the archive"
+tar -tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-separator
-file2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28"
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+directory/
+directory/a
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order02.at:28:
+$as_echo "$at_srcdir/indexfile.at:29:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -5152,23 +5307,17 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=\`pwd\`
-tar -xf archive --same-order --warning=no-timestamp \\
-  -C \$HERE/en file1 \\
-  -C \$HERE/to file2 || exit 1
+echo \"Creating the archive\"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo \"Testing the archive\"
+tar -tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -5178,37 +5327,32 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=`pwd`
-tar -xf archive --same-order --warning=no-timestamp \
-  -C $HERE/en file1 \
-  -C $HERE/to file2 || exit 1
+echo "Creating the archive"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo "Testing the archive"
+tar -tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-separator
-file2
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+directory/
+directory/a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order02.at:28:
+$as_echo "$at_srcdir/indexfile.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -5217,23 +5361,17 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=\`pwd\`
-tar -xf archive --same-order --warning=no-timestamp \\
-  -C \$HERE/en file1 \\
-  -C \$HERE/to file2 || exit 1
+echo \"Creating the archive\"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo \"Testing the archive\"
+tar -tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -5243,37 +5381,32 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=`pwd`
-tar -xf archive --same-order --warning=no-timestamp \
-  -C $HERE/en file1 \
-  -C $HERE/to file2 || exit 1
+echo "Creating the archive"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo "Testing the archive"
+tar -tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-separator
-file2
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+directory/
+directory/a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order02.at:28:
+$as_echo "$at_srcdir/indexfile.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -5282,23 +5415,17 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=\`pwd\`
-tar -xf archive --same-order --warning=no-timestamp \\
-  -C \$HERE/en file1 \\
-  -C \$HERE/to file2 || exit 1
+echo \"Creating the archive\"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo \"Testing the archive\"
+tar -tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -5308,37 +5435,32 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=`pwd`
-tar -xf archive --same-order --warning=no-timestamp \
-  -C $HERE/en file1 \
-  -C $HERE/to file2 || exit 1
+echo "Creating the archive"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo "Testing the archive"
+tar -tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-separator
-file2
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+directory/
+directory/a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/same-order02.at:28:
+$as_echo "$at_srcdir/indexfile.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -5347,23 +5469,17 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=\`pwd\`
-tar -xf archive --same-order --warning=no-timestamp \\
-  -C \$HERE/en file1 \\
-  -C \$HERE/to file2 || exit 1
+echo \"Creating the archive\"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo \"Testing the archive\"
+tar -tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "indexfile.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -5373,32 +5489,27 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f file1
-genfile -l 1024 -f file2
-tar cf archive file1 file2
 
-mkdir en
-mkdir to
+mkdir directory
+genfile --file=directory/a --length=1035
 
-HERE=`pwd`
-tar -xf archive --same-order --warning=no-timestamp \
-  -C $HERE/en file1 \
-  -C $HERE/to file2 || exit 1
+echo "Creating the archive"
+tar -c -v -f - --index-file=idx directory > archive
 
-ls en
-echo separator
-ls to
+echo "Testing the archive"
+tar -tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-separator
-file2
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+directory/
+directory/a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/indexfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -5409,14 +5520,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_25
-#AT_START_26
-at_fn_group_banner 26 'append.at:21' \
-  "append" "                                         " 5
+#AT_STOP_24
+#AT_START_25
+at_fn_group_banner 25 'verbose.at:26' \
+  "tar cvf -" "                                      " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "26. $at_setup_line: testing $at_desc ..."
+  $as_echo "25. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -5424,7 +5535,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/append.at:24:
+$as_echo "$at_srcdir/verbose.at:29:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -5432,12 +5543,14 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "append.at:24"
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -5446,25 +5559,30 @@ 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 --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stderr"; $as_echo "file
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append.at:24:
+$as_echo "$at_srcdir/verbose.at:29:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -5472,12 +5590,14 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "append.at:24"
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -5486,25 +5606,30 @@ 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)
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stderr"; $as_echo "file
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append.at:24:
+$as_echo "$at_srcdir/verbose.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -5512,12 +5637,14 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
-touch file1
-          touch file2
-          tar cf archive file1
-          tar rf archive file2
-          tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "append.at:24"
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -5526,25 +5653,30 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
-touch file1
-          touch file2
-          tar cf archive file1
-          tar rf archive file2
-          tar tf archive)
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stderr"; $as_echo "file
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append.at:24:
+$as_echo "$at_srcdir/verbose.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -5552,12 +5684,14 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
-touch file1
-          touch file2
-          tar cf archive file1
-          tar rf archive file2
-          tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "append.at:24"
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -5566,25 +5700,30 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
-touch file1
-          touch file2
-          tar cf archive file1
-          tar rf archive file2
-          tar tf archive)
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stderr"; $as_echo "file
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append.at:24:
+$as_echo "$at_srcdir/verbose.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -5592,12 +5731,14 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "append.at:24"
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "verbose.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -5606,34 +5747,89 @@ 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)
+
+genfile --file file --length 10240
+echo Creating the archive
+tar cvf - file > archive
+echo Testing the archive
+tar tf archive
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
+echo >>"$at_stderr"; $as_echo "file
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating the archive
+Testing the archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/verbose.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_25
+#AT_START_26
+at_fn_group_banner 26 'gzip.at:24' \
+  "gzip" "                                           " 3
+at_xfail=no
+(
+  $as_echo "26. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+unset TAR_OPTIONS
+
+{ set +x
+$as_echo "$at_srcdir/gzip.at:29:
+
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
+
+tar xfvz /dev/null 2>err
+RC=\$?
+sed -n '/^tar:/p' err >&2
+exit \$RC
+"
+at_fn_check_prepare_notrace 'an embedded newline' "gzip.at:29"
+( $at_check_trace;
+
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
+
+tar xfvz /dev/null 2>err
+RC=$?
+sed -n '/^tar:/p' err >&2
+exit $RC
+
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: Child returned status 1
+tar: Error is not recoverable: exiting now
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/gzip.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
 #AT_STOP_26
 #AT_START_27
-at_fn_group_banner 27 'append01.at:29' \
-  "appending files with long names" "                " 5
+at_fn_group_banner 27 'recurse.at:21' \
+  "recurse" "                                        " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -5644,10 +5840,49 @@ at_xfail=no
 
 
 
+  { set +x
+$as_echo "$at_srcdir/recurse.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
+( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H v7"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
+tar tf archive
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/append01.at:34:
+              { set +x
+$as_echo "$at_srcdir/recurse.at:24:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -5656,13 +5891,12 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -5672,26 +5906,24 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "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
+echo >>"$at_stdout"; $as_echo "directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append01.at:34:
+$as_echo "$at_srcdir/recurse.at:24:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -5700,13 +5932,12 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -5716,26 +5947,24 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "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
+echo >>"$at_stdout"; $as_echo "directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append01.at:34:
+$as_echo "$at_srcdir/recurse.at:24:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -5744,13 +5973,12 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -5760,26 +5988,24 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "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
+echo >>"$at_stdout"; $as_echo "directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append01.at:34:
+$as_echo "$at_srcdir/recurse.at:24:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -5788,13 +6014,12 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "recurse.at:24"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -5804,36 +6029,33 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
-touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
-tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
-tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+mkdir directory
+touch directory/file
+tar --create --file archive --no-recursion directory || exit 1
 tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "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
+echo >>"$at_stdout"; $as_echo "directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/recurse.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
 #AT_STOP_27
 #AT_START_28
-at_fn_group_banner 28 'append02.at:54' \
-  "append vs. create" "                              " 5
+at_fn_group_banner 28 'recurs02.at:30' \
+  "recurse: toggle" "                                " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -5845,7 +6067,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/append02.at:57:
+$as_echo "$at_srcdir/recurs02.at:33:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -5854,30 +6076,18 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME=\"--mtime=@0\"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test \$TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\"
-fi
-
-echo Creating archive.1
-tar \$MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar \$MTIME -cf archive.2 -T /dev/null
-tar \$MTIME -rf archive.2 file1
-tar \$MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57"
+at_fn_check_prepare_notrace 'an embedded newline' "recurs02.at:33"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -5887,44 +6097,35 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME="--mtime=@0"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test $TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime"
-fi
-
-echo Creating archive.1
-tar $MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar $MTIME -cf archive.2 -T /dev/null
-tar $MTIME -rf archive.2 file1
-tar $MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive.1
-Creating archive.2
-Comparing archives
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57"
+at_fn_check_status 0 $at_status "$at_srcdir/recurs02.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append02.at:57:
+$as_echo "$at_srcdir/recurs02.at:33:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -5933,30 +6134,18 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME=\"--mtime=@0\"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test \$TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\"
-fi
-
-echo Creating archive.1
-tar \$MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar \$MTIME -cf archive.2 -T /dev/null
-tar \$MTIME -rf archive.2 file1
-tar \$MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57"
+at_fn_check_prepare_notrace 'an embedded newline' "recurs02.at:33"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -5966,44 +6155,35 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME="--mtime=@0"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test $TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime"
-fi
-
-echo Creating archive.1
-tar $MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar $MTIME -cf archive.2 -T /dev/null
-tar $MTIME -rf archive.2 file1
-tar $MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive.1
-Creating archive.2
-Comparing archives
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57"
+at_fn_check_status 0 $at_status "$at_srcdir/recurs02.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append02.at:57:
+$as_echo "$at_srcdir/recurs02.at:33:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -6012,30 +6192,18 @@ 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
-
-echo Creating archive.2
-tar \$MTIME -cf archive.2 -T /dev/null
-tar \$MTIME -rf archive.2 file1
-tar \$MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57"
+at_fn_check_prepare_notrace 'an embedded newline' "recurs02.at:33"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -6045,44 +6213,35 @@ 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
-
-echo Creating archive.2
-tar $MTIME -cf archive.2 -T /dev/null
-tar $MTIME -rf archive.2 file1
-tar $MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive.1
-Creating archive.2
-Comparing archives
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57"
+at_fn_check_status 0 $at_status "$at_srcdir/recurs02.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append02.at:57:
+$as_echo "$at_srcdir/recurs02.at:33:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -6091,30 +6250,18 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME=\"--mtime=@0\"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test \$TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\"
-fi
-
-echo Creating archive.1
-tar \$MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar \$MTIME -cf archive.2 -T /dev/null
-tar \$MTIME -rf archive.2 file1
-tar \$MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57"
+at_fn_check_prepare_notrace 'an embedded newline' "recurs02.at:33"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -6124,44 +6271,35 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME="--mtime=@0"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test $TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime"
-fi
-
-echo Creating archive.1
-tar $MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar $MTIME -cf archive.2 -T /dev/null
-tar $MTIME -rf archive.2 file1
-tar $MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+mkdir 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive.1
-Creating archive.2
-Comparing archives
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57"
+at_fn_check_status 0 $at_status "$at_srcdir/recurs02.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append02.at:57:
+$as_echo "$at_srcdir/recurs02.at:33:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -6170,30 +6308,18 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME=\"--mtime=@0\"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test \$TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS=\"\$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime\"
-fi
-
-echo Creating archive.1
-tar \$MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar \$MTIME -cf archive.2 -T /dev/null
-tar \$MTIME -rf archive.2 file1
-tar \$MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append02.at:57"
+at_fn_check_prepare_notrace 'an embedded newline' "recurs02.at:33"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -6203,39 +6329,30 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file1
-genfile --file file2
-
-# Make sure file timestamps in the archive will not differ
-MTIME="--mtime=@0"
-
-# For PAX archives, we need to make sure extended header names are
-# reproducible and that their contents won't change with time
-if test $TEST_TAR_FORMAT = posix; then
-  TAR_OPTIONS="$TAR_OPTIONS --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=mtime,delete=atime,delete=ctime"
-fi
-
-echo Creating archive.1
-tar $MTIME -cf archive.1 file1 file2
-
-echo Creating archive.2
-tar $MTIME -cf archive.2 -T /dev/null
-tar $MTIME -rf archive.2 file1
-tar $MTIME -rf archive.2 file2
-
-echo Comparing archives
-cmp archive.1 archive.2
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive.1
-Creating archive.2
-Comparing archives
+echo >>"$at_stdout"; $as_echo "directory1/
+directory2/
+directory2/file
+directory1/
+directory2/
+directory2/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append02.at:57"
+at_fn_check_status 0 $at_status "$at_srcdir/recurs02.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -6248,8 +6365,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_28
 #AT_START_29
-at_fn_group_banner 29 'append03.at:21' \
-  "append with name transformation" "                " 5
+at_fn_group_banner 29 'shortrec.at:26' \
+  "short records" "                                  " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -6258,12 +6375,10 @@ at_xfail=no
 
 
 
-# Description: Make sure filenames are transformed during append.
-
 
 
   { set +x
-$as_echo "$at_srcdir/append03.at:26:
+$as_echo "$at_srcdir/shortrec.at:29:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -6272,16 +6387,16 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:29"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -6291,33 +6406,26 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Appending
-plik.1
-Testing
-plik.1
-plik.2
-plik.1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append03.at:26:
+$as_echo "$at_srcdir/shortrec.at:29:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -6326,16 +6434,16 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:29"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -6345,33 +6453,26 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Appending
-plik.1
-Testing
-plik.1
-plik.2
-plik.1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append03.at:26:
+$as_echo "$at_srcdir/shortrec.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -6380,16 +6481,16 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -6399,33 +6500,26 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Appending
-plik.1
-Testing
-plik.1
-plik.2
-plik.1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append03.at:26:
+$as_echo "$at_srcdir/shortrec.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -6434,16 +6528,16 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -6453,33 +6547,26 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Appending
-plik.1
-Testing
-plik.1
-plik.2
-plik.1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append03.at:26:
+$as_echo "$at_srcdir/shortrec.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -6488,16 +6575,16 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "shortrec.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -6507,28 +6594,21 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file.1
-genfile --file file.2
+mkdir directory
+(cd directory && touch a b c d e f g h i j k l m n o p q r)
+tar -c -b 1 -f - directory | tar -t -f - > /dev/null
+tar -c -b 1 -f archive directory
+tar -t -f archive > /dev/null
+tar -t -f - < archive > /dev/null
 
-tar -c -f archive --transform 's/file/plik/' file.*
-echo Appending
-tar -r -f archive --transform 's/file/plik/' -v --show-transformed-names file.1
-echo Testing
-tar tf archive
+rm -r directory
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Appending
-plik.1
-Testing
-plik.1
-plik.2
-plik.1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortrec.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -6541,8 +6621,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_29
 #AT_START_30
-at_fn_group_banner 30 'append04.at:29' \
-  "append with verify" "                             " 5
+at_fn_group_banner 30 'numeric.at:18' \
+  "--numeric-owner basic tests" "                    " 3
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -6553,152 +6633,236 @@ at_xfail=no
 
 
 
+
+
   { set +x
-$as_echo "$at_srcdir/append04.at:32:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/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 *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=\$(id -u) || exit 77
+MYGID=\$(id -g) || exit 77
+MYUSR=\$(id -un) || exit 77
+MYGRP=\$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --create -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --list -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --diff -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --extract -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "numeric.at:29"
 ( $at_check_trace;
-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 *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=$(id -u) || exit 77
+MYGID=$(id -g) || exit 77
+MYUSR=$(id -un) || exit 77
+MYGRP=$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --create -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --list -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --diff -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --extract -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-==
-file1
-file2
-file3
+echo >>"$at_stderr"; $as_echo "--create
+--list
+--diff
+--extract
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "--create
+OK
+OK
+OK
+OK
+--list
+OK
+OK
+OK
+OK
+--diff
+OK
+OK
+OK
+OK
+--extract
+OK
+OK
+OK
+OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/numeric.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/append04.at:32:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/numeric.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 *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=\$(id -u) || exit 77
+MYGID=\$(id -g) || exit 77
+MYUSR=\$(id -un) || exit 77
+MYGRP=\$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --create -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --list -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --diff -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --extract -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "numeric.at:29"
 ( $at_check_trace;
-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 *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=$(id -u) || exit 77
+MYGID=$(id -g) || exit 77
+MYUSR=$(id -un) || exit 77
+MYGRP=$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --create -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --list -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --diff -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --extract -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-==
-file1
-file2
-file3
+echo >>"$at_stderr"; $as_echo "--create
+--list
+--diff
+--extract
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/append04.at:32:
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "--create
+OK
+OK
+OK
+OK
+--list
+OK
+OK
+OK
+OK
+--diff
+OK
+OK
+OK
+OK
+--extract
+OK
+OK
+OK
+OK
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/numeric.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/numeric.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -6707,25 +6871,36 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=\$(id -u) || exit 77
+MYGID=\$(id -g) || exit 77
+MYUSR=\$(id -un) || exit 77
+MYGRP=\$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --create -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --list -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --diff -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --extract -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "numeric.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -6735,181 +6910,180 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=$(id -u) || exit 77
+MYGID=$(id -g) || exit 77
+MYUSR=$(id -un) || exit 77
+MYGRP=$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --create -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --list -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --diff -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
+
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --extract -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-==
-file1
-file2
-file3
+echo >>"$at_stderr"; $as_echo "--create
+--list
+--diff
+--extract
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/append04.at:32:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "--create
+OK
+OK
+OK
+OK
+--list
+OK
+OK
+OK
+OK
+--diff
+OK
+OK
+OK
+OK
+--extract
+OK
+OK
+OK
+OK
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/numeric.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/numeric.at:29:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-# Create two empty files:
-touch file1 file2
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=\$(id -u) || exit 77
+MYGID=\$(id -g) || exit 77
+MYUSR=\$(id -un) || exit 77
+MYGRP=\$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --create -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
 
-# Create two empty files:
-touch file1 file2
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --list -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# 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
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --diff -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-# Append it to the already created archive:
-tar rpfW archive.tar file3
 
-# Verify content of the new archive:
-tar -tf archive.tar
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-==
-file1
-file2
-file3
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2==\"'\"\$MYUID/\$MYGID\"'\" {print \"OK\"; next} {print}'
+tar --extract -vvf a dir | awk '$2==\"'\"\$MYUSR/\$MYGRP\"'\" {print \"OK\"; next} {print}'
 
-              { set +x
-$as_echo "$at_srcdir/append04.at:32:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+)"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "numeric.at:29"
+( $at_check_trace;
+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
+mkdir dir
+genfile --file dir/file
 
-# Create an archive:
-tar cpfW archive.tar file1 file2
+MYUID=$(id -u) || exit 77
+MYGID=$(id -g) || exit 77
+MYUSR=$(id -un) || exit 77
+MYGRP=$(id -gn) || 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
+decho --create
+tar --create -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --create -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# Verify content of the new archive:
-tar -tf archive.tar
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
 
-# Create two empty files:
-touch file1 file2
+decho --list
+tar --list -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --list -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# 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
+decho --diff
+tar --diff -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --diff -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
 
-# Append it to the already created archive:
-tar rpfW archive.tar file3
 
-# Verify content of the new archive:
-tar -tf archive.tar
+decho --extract
+tar --extract -vvf a dir --numeric-owner | awk '$2=="'"$MYUID/$MYGID"'" {print "OK"; next} {print}'
+tar --extract -vvf a dir | awk '$2=="'"$MYUSR/$MYGRP"'" {print "OK"; next} {print}'
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-==
-file1
-file2
-file3
+echo >>"$at_stderr"; $as_echo "--create
+--list
+--diff
+--extract
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "--create
+OK
+OK
+OK
+OK
+--list
+OK
+OK
+OK
+OK
+--diff
+OK
+OK
+OK
+OK
+--extract
+OK
+OK
+OK
+OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/numeric.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -6922,8 +7096,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_30
 #AT_START_31
-at_fn_group_banner 31 'xform-h.at:30' \
-  "transforming hard links on create" "              " 6
+at_fn_group_banner 31 'same-order01.at:27' \
+  "working -C with --same-order" "                   " 4
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -6934,10 +7108,8 @@ at_xfail=no
 
 
 
-
-
   { set +x
-$as_echo "$at_srcdir/xform-h.at:39:
+$as_echo "$at_srcdir/same-order01.at:30:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -6946,27 +7118,20 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo \"hello\" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo \"Default transform scope\"
-tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:30"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -6976,44 +7141,33 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo "hello" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo "Default transform scope"
-tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Default transform scope
-test
-Transforming hard links
-test
-Not transforming hard links
-basedir/test
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xform-h.at:39:
+$as_echo "$at_srcdir/same-order01.at:30:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -7022,27 +7176,20 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo \"hello\" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo \"Default transform scope\"
-tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo \"Transforming hard links\"
-tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:30"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -7052,44 +7199,33 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo "hello" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo "Default transform scope"
-tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo "Transforming hard links"
-tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Default transform scope
-test
-Transforming hard links
-test
-Not transforming hard links
-basedir/test
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xform-h.at:39:
+$as_echo "$at_srcdir/same-order01.at:30:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -7098,27 +7234,20 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo \"hello\" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo \"Default transform scope\"
-tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo \"Transforming hard links\"
-tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:30"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -7128,44 +7257,33 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo "hello" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo "Default transform scope"
-tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo "Transforming hard links"
-tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Default transform scope
-test
-Transforming hard links
-test
-Not transforming hard links
-basedir/test
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xform-h.at:39:
+$as_echo "$at_srcdir/same-order01.at:30:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -7174,27 +7292,20 @@ 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'
 
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:30"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -7204,44 +7315,33 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo "hello" > basedir/test
-ln basedir/test basedir/test_link
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo "Default transform scope"
-tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-echo "Transforming hard links"
-tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
-
-
-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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Default transform scope
-test
-Transforming hard links
-test
-Not transforming hard links
-basedir/test
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xform-h.at:39:
+$as_echo "$at_srcdir/same-order01.at:30:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -7250,27 +7350,20 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo \"hello\" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo \"Default transform scope\"
-tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order01.at:30"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -7280,55 +7373,42 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir basedir
-echo "hello" > basedir/test
-ln basedir/test basedir/test_link
-
-
-echo "Default transform scope"
-tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
-tar tvf archive | sed -n 's/.*test_link link to //p'
 
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Default transform scope
-test
-Transforming hard links
-test
-Not transforming hard links
-basedir/test
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order01.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
 #AT_STOP_31
 #AT_START_32
-at_fn_group_banner 32 'xform01.at:26' \
-  "transformations and GNU volume labels" "          " 6
+at_fn_group_banner 32 'same-order02.at:26' \
+  "multiple -C options" "                            " 4
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -7340,68 +7420,137 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/xform01.at:29:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/same-order02.at:29:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file
-tar -cf archive.tar -V /label/ file
-tar tf archive.tar
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "xform01.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:29"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file file
-tar -cf archive.tar -V /label/ file
-tar tf archive.tar
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "/label/
-file
+echo >>"$at_stdout"; $as_echo "file1
+separator
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xform01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/same-order02.at:29:
+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 file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
+mkdir en
+mkdir to
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_32
-#AT_START_33
-at_fn_group_banner 33 'exclude.at:23' \
-  "exclude" "                                        " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "33. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:29"
+( $at_check_trace;
+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 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
 
-  { set +x
-$as_echo "$at_srcdir/exclude.at:26:
+ls en
+echo separator
+ls to
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+separator
+file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/same-order02.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -7410,39 +7559,23 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-mkdir dir
-echo blues > dir/blues
-echo jazz > dir/jazz
-mkdir dir/folk
-echo tagfile > dir/folk/tagfile
-echo sanjuan > dir/folk/sanjuan
-mkdir dir/rock
-echo \"Signature: 8a477f597d28d172789f06886806bc55\" > dir/rock/CACHEDIR.TAG
-echo \"test\" > dir/rock/file
+mkdir en
+mkdir to
 
-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
+HERE=\`pwd\`
+tar -xf archive --same-order --warning=no-timestamp \\
+  -C \$HERE/en file1 \\
+  -C \$HERE/to file2 || exit 1
 
-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
+ls en
+echo separator
+ls to
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -7452,285 +7585,228 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-mkdir dir
-echo blues > dir/blues
-echo jazz > dir/jazz
-mkdir dir/folk
-echo tagfile > dir/folk/tagfile
-echo sanjuan > dir/folk/sanjuan
-mkdir dir/rock
-echo "Signature: 8a477f597d28d172789f06886806bc55" > dir/rock/CACHEDIR.TAG
-echo "test" > dir/rock/file
+mkdir en
+mkdir to
 
-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
+HERE=`pwd`
+tar -xf archive --same-order --warning=no-timestamp \
+  -C $HERE/en file1 \
+  -C $HERE/to file2 || exit 1
 
-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
+ls en
+echo separator
+ls to
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "OPTION exclude-caches
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-OPTION exclude-caches-under
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-OPTION exclude-caches-all
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/folk/
-dir/folk/sanjuan
-dir/folk/tagfile
-dir/jazz
-OPTION exclude-tag
-dir/
-dir/blues
-dir/folk/
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
-tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/folk/
-dir/folk/tagfile
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
-OPTION exclude-tag-under
-dir/
-dir/blues
-dir/folk/
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
-tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/folk/
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
-OPTION exclude-tag-all
-dir/
-dir/blues
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
-tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped
-ARCHIVE
-dir/
-dir/blues
-dir/jazz
-dir/rock/
-dir/rock/CACHEDIR.TAG
-dir/rock/file
+echo >>"$at_stdout"; $as_echo "file1
+separator
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/same-order02.at:29:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
+mkdir en
+mkdir to
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_33
-#AT_START_34
-at_fn_group_banner 34 'exclude01.at:19' \
-  "exclude wildcards" "                              " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "34. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
+HERE=\`pwd\`
+tar -xf archive --same-order --warning=no-timestamp \\
+  -C \$HERE/en file1 \\
+  -C \$HERE/to file2 || exit 1
 
-  { set +x
-$as_echo "$at_srcdir/exclude01.at:22:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+ls en
+echo separator
+ls to
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:29"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+mkdir en
+mkdir to
 
+HERE=`pwd`
+tar -xf archive --same-order --warning=no-timestamp \
+  -C $HERE/en file1 \
+  -C $HERE/to file2 || exit 1
 
-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/\\*
+ls en
+echo separator
+ls to
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+separator
+file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-tar cf archive --exclude=testdir/dir1/\\* \\
-               --no-wildcards \\
-               --exclude=testdir/dir2/\\* \\
-               --wildcards \\
-               --exclude=testdir/dir3/\\* \\
-               testdir
-tar tf archive | sort
+              { set +x
+$as_echo "$at_srcdir/same-order02.at:29:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"NEXT\"
-tar cf archive testdir
-tar t \"testdir/dir1/*\" -f archive | sort
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-echo \"NEXT\"
-tar cf archive testdir/dir1
-tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort
+mkdir en
+mkdir to
 
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards \"testdir/dir1/*\" -f archive | sort
+HERE=\`pwd\`
+tar -xf archive --same-order --warning=no-timestamp \\
+  -C \$HERE/en file1 \\
+  -C \$HERE/to file2 || exit 1
 
-rm -rf testdir
+ls en
+echo separator
+ls to
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
+at_fn_check_prepare_notrace 'a `...` command substitution' "same-order02.at:29"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f file1
+genfile -l 1024 -f file2
+tar cf archive file1 file2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+mkdir en
+mkdir to
 
+HERE=`pwd`
+tar -xf archive --same-order --warning=no-timestamp \
+  -C $HERE/en file1 \
+  -C $HERE/to file2 || exit 1
 
-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/\*
+ls en
+echo separator
+ls to
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+separator
+file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/same-order02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_32
+#AT_START_33
+at_fn_group_banner 33 'append.at:22' \
+  "append" "                                         " 5
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "33. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-rm -rf testdir
-)
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/append.at:25:
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "append.at:25"
+( $at_check_trace;
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir2/
-testdir/dir2/file2
-testdir/dir3/
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude01.at:22:
+$as_echo "$at_srcdir/append.at:25:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -7738,43 +7814,12 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "append.at:25"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -7783,66 +7828,25 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/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
-)
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir2/
-testdir/dir2/file2
-testdir/dir3/
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude01.at:22:
+$as_echo "$at_srcdir/append.at:25:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -7850,43 +7854,12 @@ 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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "append.at:25"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -7895,66 +7868,25 @@ 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
-)
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir2/
-testdir/dir2/file2
-testdir/dir3/
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude01.at:22:
+$as_echo "$at_srcdir/append.at:25:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -7962,43 +7894,12 @@ 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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "append.at:25"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -8007,66 +7908,25 @@ 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
-)
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir2/
-testdir/dir2/file2
-testdir/dir3/
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude01.at:22:
+$as_echo "$at_srcdir/append.at:25:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -8074,43 +7934,12 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "append.at:25"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -8119,61 +7948,20 @@ export TEST_TAR_FORMAT
 TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/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
-)
+touch file1
+          touch file2
+          tar cf archive file1
+          tar rf archive file2
+          tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir2/
-testdir/dir2/file2
-testdir/dir3/
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-NEXT
-testdir/dir1/*
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "file1
+file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -8184,146 +7972,301 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_34
-#AT_START_35
-at_fn_group_banner 35 'exclude02.at:19' \
-  "exclude: anchoring" "                             " 7
+#AT_STOP_33
+#AT_START_34
+at_fn_group_banner 34 'append01.at:29' \
+  "appending files with long names" "                " 5
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "35. $at_setup_line: testing $at_desc ..."
+  $as_echo "34. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
+
+
   { set +x
-$as_echo "$at_srcdir/exclude02.at:22:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/append01.at:34:
+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 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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir
-touch file1.txt
-touch testdir/file1.txt
-touch testdir/file2
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "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
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-tar cf archive --exclude=\"file1.txt\" \\
-               testdir
-tar tf archive | sort
+              { set +x
+$as_echo "$at_srcdir/append01.at:34:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"SUB 1\"
-tar cf archive --no-anchored \\
-               --exclude=\"file1.txt\" \\
-               testdir
-tar tf archive | sort
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"SUB 2\"
-tar cf archive --anchored \\
-               --exclude=\"file1.txt\" \\
-               testdir
-tar tf archive | sort
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "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
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-echo \"SUB 3\"
-tar cf archive testdir file1.txt
-tar t \"file1.txt\" -f archive | sort
+              { set +x
+$as_echo "$at_srcdir/append01.at:34:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"SUB 4\"
-tar t --no-anchored \"file1.txt\" -f archive | sort
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"SUB 5\"
-tar t --anchored \"file1.txt\" -f archive | sort
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "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
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-rm -rf testdir file1.txt
+              { set +x
+$as_echo "$at_srcdir/append01.at:34:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
+touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
+tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append01.at:34"
 ( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX
+touch This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1 This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+tar cf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file1
+tar rf archive This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_appending_long_file_names_that_run_into_a_limit_of_the_ustar_tarX/file2
+tar tf archive
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "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
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/append01.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_34
+#AT_START_35
+at_fn_group_banner 35 'append02.at:55' \
+  "append vs. create" "                              " 5
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "35. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/append02.at:58:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+# Make sure file timestamps in the archive will not differ
+MTIME=\"--mtime=@0\"
 
+# 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
-mkdir -p testdir
-touch file1.txt
-touch testdir/file1.txt
-touch testdir/file2
+echo Creating archive.1
+tar \$MTIME -cf archive.1 file1 file2
 
-tar cf archive --exclude="file1.txt" \
-               testdir
-tar tf archive | sort
+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 "SUB 1"
-tar cf archive --no-anchored \
-               --exclude="file1.txt" \
-               testdir
-tar tf archive | sort
+echo Comparing archives
+cmp archive.1 archive.2
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "append02.at:58"
+( $at_check_trace;
+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
+genfile --file file1
+genfile --file file2
 
-echo "SUB 3"
-tar cf archive testdir file1.txt
-tar t "file1.txt" -f archive | sort
+# Make sure file timestamps in the archive will not differ
+MTIME="--mtime=@0"
 
-echo "SUB 4"
-tar t --no-anchored "file1.txt" -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
 
-echo "SUB 5"
-tar t --anchored "file1.txt" -f archive | sort
+echo Creating archive.1
+tar $MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file2
-SUB 1
-testdir/
-testdir/file2
-SUB 2
-testdir/
-testdir/file1.txt
-testdir/file2
-SUB 3
-file1.txt
-SUB 4
-file1.txt
-testdir/file1.txt
-SUB 5
-file1.txt
+echo >>"$at_stdout"; $as_echo "Creating archive.1
+Creating archive.2
+Comparing archives
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append02.at:58"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude02.at:22:
+$as_echo "$at_srcdir/append02.at:58:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -8332,46 +8275,30 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME=\"--mtime=@0\"
 
-echo \"SUB 4\"
-tar t --no-anchored \"file1.txt\" -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
 
-echo \"SUB 5\"
-tar t --anchored \"file1.txt\" -f archive | sort
+echo Creating archive.1
+tar \$MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append02.at:58"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -8381,73 +8308,44 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME="--mtime=@0"
 
-echo "SUB 4"
-tar t --no-anchored "file1.txt" -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
 
-echo "SUB 5"
-tar t --anchored "file1.txt" -f archive | sort
+echo Creating archive.1
+tar $MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file2
-SUB 1
-testdir/
-testdir/file2
-SUB 2
-testdir/
-testdir/file1.txt
-testdir/file2
-SUB 3
-file1.txt
-SUB 4
-file1.txt
-testdir/file1.txt
-SUB 5
-file1.txt
+echo >>"$at_stdout"; $as_echo "Creating archive.1
+Creating archive.2
+Comparing archives
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append02.at:58"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude02.at:22:
+$as_echo "$at_srcdir/append02.at:58:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -8456,46 +8354,30 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME=\"--mtime=@0\"
 
-echo \"SUB 4\"
-tar t --no-anchored \"file1.txt\" -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
 
-echo \"SUB 5\"
-tar t --anchored \"file1.txt\" -f archive | sort
+echo Creating archive.1
+tar \$MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append02.at:58"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -8505,73 +8387,44 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+# Make sure file timestamps in the archive will not differ
+MTIME="--mtime=@0"
 
+# 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
-mkdir -p testdir
-touch file1.txt
-touch testdir/file1.txt
-touch testdir/file2
+echo Creating archive.1
+tar $MTIME -cf archive.1 file1 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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file2
-SUB 1
-testdir/
-testdir/file2
-SUB 2
-testdir/
-testdir/file1.txt
-testdir/file2
-SUB 3
-file1.txt
-SUB 4
-file1.txt
-testdir/file1.txt
-SUB 5
-file1.txt
+echo >>"$at_stdout"; $as_echo "Creating archive.1
+Creating archive.2
+Comparing archives
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append02.at:58"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude02.at:22:
+$as_echo "$at_srcdir/append02.at:58:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -8580,46 +8433,30 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME=\"--mtime=@0\"
 
-echo \"SUB 4\"
-tar t --no-anchored \"file1.txt\" -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
 
-echo \"SUB 5\"
-tar t --anchored \"file1.txt\" -f archive | sort
+echo Creating archive.1
+tar \$MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append02.at:58"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -8629,73 +8466,44 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME="--mtime=@0"
 
-echo "SUB 4"
-tar t --no-anchored "file1.txt" -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
 
-echo "SUB 5"
-tar t --anchored "file1.txt" -f archive | sort
+echo Creating archive.1
+tar $MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file2
-SUB 1
-testdir/
-testdir/file2
-SUB 2
-testdir/
-testdir/file1.txt
-testdir/file2
-SUB 3
-file1.txt
-SUB 4
-file1.txt
-testdir/file1.txt
-SUB 5
-file1.txt
+echo >>"$at_stdout"; $as_echo "Creating archive.1
+Creating archive.2
+Comparing archives
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append02.at:58"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude02.at:22:
+$as_echo "$at_srcdir/append02.at:58:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -8704,46 +8512,30 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME=\"--mtime=@0\"
 
-echo \"SUB 4\"
-tar t --no-anchored \"file1.txt\" -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
 
-echo \"SUB 5\"
-tar t --anchored \"file1.txt\" -f archive | sort
+echo Creating archive.1
+tar \$MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append02.at:58"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -8753,68 +8545,39 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file1
+genfile --file file2
 
-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
+# Make sure file timestamps in the archive will not differ
+MTIME="--mtime=@0"
 
-echo "SUB 4"
-tar t --no-anchored "file1.txt" -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
 
-echo "SUB 5"
-tar t --anchored "file1.txt" -f archive | sort
+echo Creating archive.1
+tar $MTIME -cf archive.1 file1 file2
 
-rm -rf testdir file1.txt
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file2
-SUB 1
-testdir/
-testdir/file2
-SUB 2
-testdir/
-testdir/file1.txt
-testdir/file2
-SUB 3
-file1.txt
-SUB 4
-file1.txt
-testdir/file1.txt
-SUB 5
-file1.txt
+echo >>"$at_stdout"; $as_echo "Creating archive.1
+Creating archive.2
+Comparing archives
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append02.at:58"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -8827,8 +8590,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_35
 #AT_START_36
-at_fn_group_banner 36 'exclude03.at:19' \
-  "exclude: wildcards match slash" "                 " 7
+at_fn_group_banner 36 'append03.at:21' \
+  "append with name transformation" "                " 5
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -8837,10 +8600,12 @@ at_xfail=no
 
 
 
+# Description: Make sure filenames are transformed during append.
+
 
 
   { set +x
-$as_echo "$at_srcdir/exclude03.at:22:
+$as_echo "$at_srcdir/append03.at:26:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -8849,42 +8614,16 @@ TAR_OPTIONS=\"-H v7\"
 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/dir1 testdir/dir2 testdir/dir3
-touch testdir/\\*f\\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\\*
-touch testdir/dir2/file2
-touch testdir/dir2/\\*
-touch testdir/dir3/file3
-touch testdir/dir3/\\*
-
-tar cf archive --exclude='testdir*f*1' \\
-               --no-wildcards-match-slash \\
-               --exclude='testdir*f*2' \\
-               --wildcards-match-slash \\
-               --exclude='testdir*f*3' \\
-               testdir
-tar tf archive | sort
-
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -8894,69 +8633,33 @@ TAR_OPTIONS="-H v7"
 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/dir1 testdir/dir2 testdir/dir3
-touch testdir/\*f\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\*
-touch testdir/dir2/file2
-touch testdir/dir2/\*
-touch testdir/dir3/file3
-touch testdir/dir3/\*
-
-tar cf archive --exclude='testdir*f*1' \
-               --no-wildcards-match-slash \
-               --exclude='testdir*f*2' \
-               --wildcards-match-slash \
-               --exclude='testdir*f*3' \
-               testdir
-tar tf archive | sort
-
-echo "NEXT"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir1/*
-testdir/dir2/
-testdir/dir2/*
-testdir/dir2/file2
-testdir/dir3/
-testdir/dir3/*
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-NEXT
-testdir/*f*1
-NEXT
-testdir/*f*1
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "Appending
+plik.1
+Testing
+plik.1
+plik.2
+plik.1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude03.at:22:
+$as_echo "$at_srcdir/append03.at:26:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -8965,42 +8668,16 @@ 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
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\\*f\\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\\*
-touch testdir/dir2/file2
-touch testdir/dir2/\\*
-touch testdir/dir3/file3
-touch testdir/dir3/\\*
-
-tar cf archive --exclude='testdir*f*1' \\
-               --no-wildcards-match-slash \\
-               --exclude='testdir*f*2' \\
-               --wildcards-match-slash \\
-               --exclude='testdir*f*3' \\
-               testdir
-tar tf archive | sort
-
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -9010,69 +8687,33 @@ 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
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\*f\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\*
-touch testdir/dir2/file2
-touch testdir/dir2/\*
-touch testdir/dir3/file3
-touch testdir/dir3/\*
-
-tar cf archive --exclude='testdir*f*1' \
-               --no-wildcards-match-slash \
-               --exclude='testdir*f*2' \
-               --wildcards-match-slash \
-               --exclude='testdir*f*3' \
-               testdir
-tar tf archive | sort
-
-echo "NEXT"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir1/*
-testdir/dir2/
-testdir/dir2/*
-testdir/dir2/file2
-testdir/dir3/
-testdir/dir3/*
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-NEXT
-testdir/*f*1
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+echo >>"$at_stdout"; $as_echo "Appending
+plik.1
+Testing
+plik.1
+plik.2
+plik.1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude03.at:22:
+$as_echo "$at_srcdir/append03.at:26:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -9081,42 +8722,16 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file.1
+genfile --file file.2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\\*f\\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\\*
-touch testdir/dir2/file2
-touch testdir/dir2/\\*
-touch testdir/dir3/file3
-touch testdir/dir3/\\*
-
-tar cf archive --exclude='testdir*f*1' \\
-               --no-wildcards-match-slash \\
-               --exclude='testdir*f*2' \\
-               --wildcards-match-slash \\
-               --exclude='testdir*f*3' \\
-               testdir
-tar tf archive | sort
-
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -9126,69 +8741,33 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file.1
+genfile --file file.2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\*f\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\*
-touch testdir/dir2/file2
-touch testdir/dir2/\*
-touch testdir/dir3/file3
-touch testdir/dir3/\*
-
-tar cf archive --exclude='testdir*f*1' \
-               --no-wildcards-match-slash \
-               --exclude='testdir*f*2' \
-               --wildcards-match-slash \
-               --exclude='testdir*f*3' \
-               testdir
-tar tf archive | sort
-
-echo "NEXT"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir1/*
-testdir/dir2/
-testdir/dir2/*
-testdir/dir2/file2
-testdir/dir3/
-testdir/dir3/*
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-NEXT
-testdir/*f*1
-NEXT
-testdir/*f*1
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "Appending
+plik.1
+Testing
+plik.1
+plik.2
+plik.1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude03.at:22:
+$as_echo "$at_srcdir/append03.at:26:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -9197,42 +8776,16 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file.1
+genfile --file file.2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\\*f\\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\\*
-touch testdir/dir2/file2
-touch testdir/dir2/\\*
-touch testdir/dir3/file3
-touch testdir/dir3/\\*
-
-tar cf archive --exclude='testdir*f*1' \\
-               --no-wildcards-match-slash \\
-               --exclude='testdir*f*2' \\
-               --wildcards-match-slash \\
-               --exclude='testdir*f*3' \\
-               testdir
-tar tf archive | sort
-
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -9242,69 +8795,33 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file file.1
+genfile --file file.2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\*f\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\*
-touch testdir/dir2/file2
-touch testdir/dir2/\*
-touch testdir/dir3/file3
-touch testdir/dir3/\*
-
-tar cf archive --exclude='testdir*f*1' \
-               --no-wildcards-match-slash \
-               --exclude='testdir*f*2' \
-               --wildcards-match-slash \
-               --exclude='testdir*f*3' \
-               testdir
-tar tf archive | sort
-
-echo "NEXT"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir1/*
-testdir/dir2/
-testdir/dir2/*
-testdir/dir2/file2
-testdir/dir3/
-testdir/dir3/*
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-NEXT
-testdir/*f*1
-NEXT
-testdir/*f*1
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "Appending
+plik.1
+Testing
+plik.1
+plik.2
+plik.1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude03.at:22:
+$as_echo "$at_srcdir/append03.at:26:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -9313,42 +8830,16 @@ 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
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\\*f\\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\\*
-touch testdir/dir2/file2
-touch testdir/dir2/\\*
-touch testdir/dir3/file3
-touch testdir/dir3/\\*
-
-tar cf archive --exclude='testdir*f*1' \\
-               --no-wildcards-match-slash \\
-               --exclude='testdir*f*2' \\
-               --wildcards-match-slash \\
-               --exclude='testdir*f*3' \\
-               testdir
-tar tf archive | sort
-
-echo \"NEXT\"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo \"NEXT\"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append03.at:26"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -9358,64 +8849,28 @@ 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
-
-
-rm -rf testdir
-mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
-touch testdir/\*f\*1
-touch testdir/dir1/file1
-touch testdir/dir1/\*
-touch testdir/dir2/file2
-touch testdir/dir2/\*
-touch testdir/dir3/file3
-touch testdir/dir3/\*
-
-tar cf archive --exclude='testdir*f*1' \
-               --no-wildcards-match-slash \
-               --exclude='testdir*f*2' \
-               --wildcards-match-slash \
-               --exclude='testdir*f*3' \
-               testdir
-tar tf archive | sort
-
-echo "NEXT"
-tar cf archive testdir
-tar t --wildcards 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-echo "NEXT"
-tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
-
-rm -rf testdir
-
+tar -c -f 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir1/
-testdir/dir1/*
-testdir/dir2/
-testdir/dir2/*
-testdir/dir2/file2
-testdir/dir3/
-testdir/dir3/*
-NEXT
-testdir/*f*1
-testdir/dir1/file1
-NEXT
-testdir/*f*1
-NEXT
-testdir/*f*1
-testdir/dir1/file1
+echo >>"$at_stdout"; $as_echo "Appending
+plik.1
+Testing
+plik.1
+plik.2
+plik.1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -9428,8 +8883,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_36
 #AT_START_37
-at_fn_group_banner 37 'exclude04.at:19' \
-  "exclude: case insensitive" "                      " 7
+at_fn_group_banner 37 'append04.at:29' \
+  "append with verify" "                             " 5
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -9441,7 +8896,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude04.at:22:
+$as_echo "$at_srcdir/append04.at:32:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -9450,45 +8905,25 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo \"SUB 3\"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -9498,69 +8933,42 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo "SUB 3"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir/
-testdir/dir/File1
-testdir/dir/File2
-testdir/dir/File4
-testdir/file2
-SUB 1
-testdir/dir/File2
-SUB 2
-testdir/dir/File2
-testdir/file2
-SUB 3
-testdir/dir/File2
+echo >>"$at_stdout"; $as_echo "file1
+file2
+==
+file1
+file2
+file3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude04.at:22:
+$as_echo "$at_srcdir/append04.at:32:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -9569,45 +8977,25 @@ 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
-
-
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo \"SUB 3\"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -9617,69 +9005,42 @@ 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
 
-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
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir/
-testdir/dir/File1
-testdir/dir/File2
-testdir/dir/File4
-testdir/file2
-SUB 1
-testdir/dir/File2
-SUB 2
-testdir/dir/File2
-testdir/file2
-SUB 3
-testdir/dir/File2
+echo >>"$at_stdout"; $as_echo "file1
+file2
+==
+file1
+file2
+file3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude04.at:22:
+$as_echo "$at_srcdir/append04.at:32:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -9688,45 +9049,25 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo \"SUB 3\"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -9736,69 +9077,42 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo "SUB 3"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir/
-testdir/dir/File1
-testdir/dir/File2
-testdir/dir/File4
-testdir/file2
-SUB 1
-testdir/dir/File2
-SUB 2
-testdir/dir/File2
-testdir/file2
-SUB 3
-testdir/dir/File2
+echo >>"$at_stdout"; $as_echo "file1
+file2
+==
+file1
+file2
+file3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude04.at:22:
+$as_echo "$at_srcdir/append04.at:32:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -9807,45 +9121,25 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo \"SUB 3\"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -9855,69 +9149,42 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo "SUB 3"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir/
-testdir/dir/File1
-testdir/dir/File2
-testdir/dir/File4
-testdir/file2
-SUB 1
-testdir/dir/File2
-SUB 2
-testdir/dir/File2
-testdir/file2
-SUB 3
-testdir/dir/File2
+echo >>"$at_stdout"; $as_echo "file1
+file2
+==
+file1
+file2
+file3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude04.at:22:
+$as_echo "$at_srcdir/append04.at:32:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -9926,45 +9193,25 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo \"SUB 3\"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "append04.at:32"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -9974,64 +9221,37 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+# Create two empty files:
+touch file1 file2
 
-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
+# Create an archive:
+tar cpfW archive.tar file1 file2
 
-echo "SUB 3"
-tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+# Verify created archive by listing its content:
+tar -tf archive.tar
+echo ==
+# Create another empty file:
+touch file3
 
-rm -rf testdir
+# Append it to the already created archive:
+tar rpfW archive.tar file3
 
+# Verify content of the new archive:
+tar -tf archive.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/dir/
-testdir/dir/File1
-testdir/dir/File2
-testdir/dir/File4
-testdir/file2
-SUB 1
-testdir/dir/File2
-SUB 2
-testdir/dir/File2
-testdir/file2
-SUB 3
-testdir/dir/File2
+echo >>"$at_stdout"; $as_echo "file1
+file2
+==
+file1
+file2
+file3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/append04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -10044,8 +9264,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_37
 #AT_START_38
-at_fn_group_banner 38 'exclude05.at:21' \
-  "exclude: lots of excludes" "                      " 7
+at_fn_group_banner 38 'append05.at:32' \
+  "append after changed blocking" "                  " 5
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -10057,7 +9277,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude05.at:24:
+$as_echo "$at_srcdir/append05.at:35:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -10066,33 +9286,28 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo \$f > \$f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo \"NEXT\"
-tar cf archive --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "append05.at:35"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -10102,53 +9317,73 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo $f > $f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo "NEXT"
-tar cf archive --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file10
-testdir/file11
-testdir/file9
-NEXT
-testdir/
-testdir/file10
-testdir/file11
-testdir/file9
+echo >>"$at_stderr"; $as_echo "creating archive
+adding d e f
+adding g h i
+resulting archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "creating archive
+a
+b
+c
+adding d e f
+d
+e
+f
+==
+a
+b
+c
+d
+e
+f
+adding g h i
+g
+h
+i
+resulting archive
+a
+b
+c
+d
+e
+f
+g
+h
+i
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/append05.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude05.at:24:
+$as_echo "$at_srcdir/append05.at:35:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -10157,33 +9392,28 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo \$f > \$f
+done
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
+tar tf archive
 
-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
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-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
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "append05.at:35"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -10193,53 +9423,73 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo $f > $f
+done
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-rm -rf testdir 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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo "NEXT"
-tar cf archive --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file10
-testdir/file11
-testdir/file9
-NEXT
-testdir/
-testdir/file10
-testdir/file11
-testdir/file9
+echo >>"$at_stderr"; $as_echo "creating archive
+adding d e f
+adding g h i
+resulting archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "creating archive
+a
+b
+c
+adding d e f
+d
+e
+f
+==
+a
+b
+c
+d
+e
+f
+adding g h i
+g
+h
+i
+resulting archive
+a
+b
+c
+d
+e
+f
+g
+h
+i
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/append05.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude05.at:24:
+$as_echo "$at_srcdir/append05.at:35:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -10248,33 +9498,28 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo \$f > \$f
+done
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo \"NEXT\"
-tar cf archive --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "append05.at:35"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -10284,53 +9529,73 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo $f > $f
+done
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo "NEXT"
-tar cf archive --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file10
-testdir/file11
-testdir/file9
-NEXT
-testdir/
-testdir/file10
-testdir/file11
-testdir/file9
+echo >>"$at_stderr"; $as_echo "creating archive
+adding d e f
+adding g h i
+resulting archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "creating archive
+a
+b
+c
+adding d e f
+d
+e
+f
+==
+a
+b
+c
+d
+e
+f
+adding g h i
+g
+h
+i
+resulting archive
+a
+b
+c
+d
+e
+f
+g
+h
+i
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/append05.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude05.at:24:
+$as_echo "$at_srcdir/append05.at:35:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -10339,33 +9604,28 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo \$f > \$f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo \"NEXT\"
-tar cf archive --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "append05.at:35"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -10375,53 +9635,73 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo $f > $f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo "NEXT"
-tar cf archive --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file10
-testdir/file11
-testdir/file9
-NEXT
-testdir/
-testdir/file10
-testdir/file11
-testdir/file9
+echo >>"$at_stderr"; $as_echo "creating archive
+adding d e f
+adding g h i
+resulting archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "creating archive
+a
+b
+c
+adding d e f
+d
+e
+f
+==
+a
+b
+c
+d
+e
+f
+adding g h i
+g
+h
+i
+resulting archive
+a
+b
+c
+d
+e
+f
+g
+h
+i
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/append05.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude05.at:24:
+$as_echo "$at_srcdir/append05.at:35:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -10430,33 +9710,28 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo \$f > \$f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo \"NEXT\"
-tar cf archive --exclude-from=exclfile \\
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "append05.at:35"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -10466,48 +9741,68 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+for f in a b c d e f g h i
+do
+  echo $f > $f
+done
 
-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
+decho 'creating archive'
+tar -cf archive -b1 a b c
 
-tar cf archive --anchored --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+tar tf archive
 
-echo "NEXT"
-tar cf archive --exclude-from=exclfile \
-               testdir
-tar tf archive | sort
+decho 'adding d e f'
+tar -vrf archive -b3 d e f
+echo ==
+tar tf archive
 
-rm -rf testdir exclfile
+decho 'adding g h i'
+tar -vrf archive -b5 g h i
 
+decho 'resulting archive'
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "testdir/
-testdir/file10
-testdir/file11
-testdir/file9
-NEXT
-testdir/
-testdir/file10
-testdir/file11
-testdir/file9
+echo >>"$at_stderr"; $as_echo "creating archive
+adding d e f
+adding g h i
+resulting archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "creating archive
+a
+b
+c
+adding d e f
+d
+e
+f
+==
+a
+b
+c
+d
+e
+f
+adding g h i
+g
+h
+i
+resulting archive
+a
+b
+c
+d
+e
+f
+g
+h
+i
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/append05.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -10520,8 +9815,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_38
 #AT_START_39
-at_fn_group_banner 39 'exclude06.at:26' \
-  "exclude: long files in pax archives" "            " 7
+at_fn_group_banner 39 'xform-h.at:30' \
+  "transforming hard links on create" "              " 6
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -10535,97 +9830,36 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude06.at:31"
-( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+$as_echo "$at_srcdir/xform-h.at:39:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS=\"-H v7\"
 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "out/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude06.at:31"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_39
-#AT_START_40
-at_fn_group_banner 40 'exclude07.at:19' \
-  "exclude: --exclude-backups option" "              " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "40. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+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'
 
-  { set +x
-$as_echo "$at_srcdir/exclude07.at:22:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
 
-mkdir dir
-genfile --file dir/file
-genfile --file dir/file~
-genfile --file \"dir/.#file\"
-genfile --file \"dir/#file#\"
+echo \"Not transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -10635,28 +9869,44 @@ 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#"
+mkdir basedir
+echo "hello" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo "Default transform scope"
+tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Transforming hard links"
+tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Not transforming hard links"
+tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
+echo >>"$at_stdout"; $as_echo "Default transform scope
+test
+Transforming hard links
+test
+Not transforming hard links
+basedir/test
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude07.at:22:
+$as_echo "$at_srcdir/xform-h.at:39:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -10665,15 +9915,27 @@ 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#\"
+mkdir basedir
+echo \"hello\" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo \"Default transform scope\"
+tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Not transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -10683,28 +9945,44 @@ 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#"
+mkdir basedir
+echo "hello" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo "Default transform scope"
+tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Transforming hard links"
+tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Not transforming hard links"
+tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
+echo >>"$at_stdout"; $as_echo "Default transform scope
+test
+Transforming hard links
+test
+Not transforming hard links
+basedir/test
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude07.at:22:
+$as_echo "$at_srcdir/xform-h.at:39:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -10713,15 +9991,27 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-genfile --file dir/file
-genfile --file dir/file~
-genfile --file \"dir/.#file\"
-genfile --file \"dir/#file#\"
+mkdir basedir
+echo \"hello\" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo \"Default transform scope\"
+tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Not transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -10731,28 +10021,44 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-genfile --file dir/file
-genfile --file dir/file~
-genfile --file "dir/.#file"
-genfile --file "dir/#file#"
+mkdir basedir
+echo "hello" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo "Default transform scope"
+tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Transforming hard links"
+tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Not transforming hard links"
+tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
+echo >>"$at_stdout"; $as_echo "Default transform scope
+test
+Transforming hard links
+test
+Not transforming hard links
+basedir/test
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude07.at:22:
+$as_echo "$at_srcdir/xform-h.at:39:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -10761,15 +10067,27 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-genfile --file dir/file
-genfile --file dir/file~
-genfile --file \"dir/.#file\"
-genfile --file \"dir/#file#\"
+mkdir basedir
+echo \"hello\" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo \"Default transform scope\"
+tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Not transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -10779,28 +10097,44 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-genfile --file dir/file
-genfile --file dir/file~
-genfile --file "dir/.#file"
-genfile --file "dir/#file#"
+mkdir basedir
+echo "hello" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo "Default transform scope"
+tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Transforming hard links"
+tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Not transforming hard links"
+tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
+echo >>"$at_stdout"; $as_echo "Default transform scope
+test
+Transforming hard links
+test
+Not transforming hard links
+basedir/test
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude07.at:22:
+$as_echo "$at_srcdir/xform-h.at:39:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -10809,15 +10143,27 @@ 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#\"
+mkdir basedir
+echo \"hello\" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo \"Default transform scope\"
+tar cf archive --transform=\"s,^basedir/,,\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,h\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo \"Not transforming hard links\"
+tar cf archive --transform=\"s,^basedir/,,H\" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
+at_fn_check_prepare_notrace 'an embedded newline' "xform-h.at:39"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -10827,23 +10173,102 @@ 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#"
+mkdir basedir
+echo "hello" > basedir/test
+ln basedir/test basedir/test_link
+
+
+echo "Default transform scope"
+tar cf archive --transform="s,^basedir/,," basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Transforming hard links"
+tar cf archive --transform="s,^basedir/,,h" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
+
+
+echo "Not transforming hard links"
+tar cf archive --transform="s,^basedir/,,H" basedir/test basedir/test_link
+tar tvf archive | sed -n 's/.*test_link link to //p'
 
-tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
+echo >>"$at_stdout"; $as_echo "Default transform scope
+test
+Transforming hard links
+test
+Not transforming hard links
+basedir/test
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
+at_fn_check_status 0 $at_status "$at_srcdir/xform-h.at:39"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_39
+#AT_START_40
+at_fn_group_banner 40 'xform01.at:26' \
+  "transformations and GNU volume labels" "          " 6
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "40. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/xform01.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
+tar -cf archive.tar -V /label/ file
+tar tf archive.tar
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "xform01.at:29"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+genfile --file file
+tar -cf archive.tar -V /label/ file
+tar tf archive.tar
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "/label/
+file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xform01.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -10856,8 +10281,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_40
 #AT_START_41
-at_fn_group_banner 41 'exclude08.at:36' \
-  "--exclude-tag option" "                           " 7
+at_fn_group_banner 41 'xform02.at:21' \
+  "transforming escaped delimiters on create" "      " 6
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -10869,7 +10294,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude08.at:39:
+$as_echo "$at_srcdir/xform02.at:24:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -10878,13 +10303,12 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
+genfile --file file
+tar cvf /dev/null file \\
+   --transform='s/file/other\\/name/' \\
+   --show-transformed-name
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "xform02.at:24"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -10894,30 +10318,24 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
+genfile --file file
+tar cvf /dev/null file \
+   --transform='s/file/other\/name/' \
+   --show-transformed-name
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "other/name
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/xform02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude08.at:39:
+$as_echo "$at_srcdir/xform02.at:24:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -10926,13 +10344,12 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
+genfile --file file
+tar cvf /dev/null file \\
+   --transform='s/file/other\\/name/' \\
+   --show-transformed-name
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "xform02.at:24"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -10942,30 +10359,24 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
+genfile --file file
+tar cvf /dev/null file \
+   --transform='s/file/other\/name/' \
+   --show-transformed-name
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "other/name
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/xform02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude08.at:39:
+$as_echo "$at_srcdir/xform02.at:24:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -10974,13 +10385,12 @@ 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
+genfile --file file
+tar cvf /dev/null file \\
+   --transform='s/file/other\\/name/' \\
+   --show-transformed-name
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "xform02.at:24"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -10990,30 +10400,24 @@ 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
+genfile --file file
+tar cvf /dev/null file \
+   --transform='s/file/other\/name/' \
+   --show-transformed-name
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "other/name
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/xform02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude08.at:39:
+$as_echo "$at_srcdir/xform02.at:24:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -11022,13 +10426,12 @@ 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
+genfile --file file
+tar cvf /dev/null file \\
+   --transform='s/file/other\\/name/' \\
+   --show-transformed-name
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "xform02.at:24"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -11038,30 +10441,24 @@ 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
+genfile --file file
+tar cvf /dev/null file \
+   --transform='s/file/other\/name/' \
+   --show-transformed-name
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "other/name
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/xform02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude08.at:39:
+$as_echo "$at_srcdir/xform02.at:24:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -11070,13 +10467,12 @@ 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "xform02.at:24"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -11086,25 +10482,19 @@ 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "other/name
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/xform02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -11117,8 +10507,8 @@ $at_traceon; }
 read at_status <"$at_status_file"
 #AT_STOP_41
 #AT_START_42
-at_fn_group_banner 42 'exclude09.at:37' \
-  "--exclude-tag option and --listed-incremental" "  " 7
+at_fn_group_banner 42 'exclude.at:23' \
+  "exclude" "                                        " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
@@ -11130,146 +10520,198 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude09.at:40:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/exclude.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 *
 
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude09.at:40"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/subdir/excludeme
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude09.at:40"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_42
-#AT_START_43
-at_fn_group_banner 43 'exclude10.at:38' \
-  "--exclude-tag option in incremental pass" "       " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "43. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/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
+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
 
-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
+for option in exclude-caches exclude-caches-under exclude-caches-all
+do
+  echo OPTION \$option
+  tar -cf archive.tar --\$option -v dir 2>err | sort
+  cat err
+  echo ARCHIVE
+  tar tf archive.tar | sort
+done
 
-decho \"# Level 1\"
-cp snar-0 snar-1
-tar -c -f etest-1.tar --exclude-tag=excludeme --listed=snar-1 -v etest | sort
+for option in exclude-tag exclude-tag-under exclude-tag-all
+do
+  echo OPTION \$option
+  tar -cf archive.tar --\${option}=tagfile -v dir 2>err | sort
+  cat err
+  echo ARCHIVE
+  tar tf archive.tar | sort
+done
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude10.at:41"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude.at:26"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "# Level 0
-tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-# Level 1
-tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Level 0
-etest/
-etest/subdir/
-etest/subdir/subdir-file
-etest/top-level-file
-# Level 1
-etest/
-etest/subdir/
-etest/subdir/excludeme
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "OPTION exclude-caches
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+OPTION exclude-caches-under
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; contents not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+OPTION exclude-caches-all
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+tar: dir/rock/: contains a cache directory tag CACHEDIR.TAG; directory not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/folk/
+dir/folk/sanjuan
+dir/folk/tagfile
+dir/jazz
+OPTION exclude-tag
+dir/
+dir/blues
+dir/folk/
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
+tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/folk/
+dir/folk/tagfile
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
+OPTION exclude-tag-under
+dir/
+dir/blues
+dir/folk/
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
+tar: dir/folk/: contains a cache directory tag tagfile; contents not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/folk/
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
+OPTION exclude-tag-all
+dir/
+dir/blues
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
+tar: dir/folk/: contains a cache directory tag tagfile; directory not dumped
+ARCHIVE
+dir/
+dir/blues
+dir/jazz
+dir/rock/
+dir/rock/CACHEDIR.TAG
+dir/rock/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude10.at:41"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -11280,14 +10722,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_43
-#AT_START_44
-at_fn_group_banner 44 'exclude11.at:36' \
-  "--exclude-tag-under option" "                     " 7
+#AT_STOP_42
+#AT_START_43
+at_fn_group_banner 43 'exclude01.at:19' \
+  "exclude wildcards" "                              " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "44. $at_setup_line: testing $at_desc ..."
+  $as_echo "43. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -11295,7 +10737,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude11.at:39:
+$as_echo "$at_srcdir/exclude01.at:22:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -11307,10 +10749,39 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -11323,26 +10794,62 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir2/
+testdir/dir2/file2
+testdir/dir3/
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude11.at:39:
+$as_echo "$at_srcdir/exclude01.at:22:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -11354,10 +10861,39 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -11370,26 +10906,62 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir2/
+testdir/dir2/file2
+testdir/dir3/
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude11.at:39:
+$as_echo "$at_srcdir/exclude01.at:22:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -11401,10 +10973,39 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -11417,26 +11018,62 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir2/
+testdir/dir2/file2
+testdir/dir3/
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude11.at:39:
+$as_echo "$at_srcdir/exclude01.at:22:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -11448,10 +11085,39 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -11464,26 +11130,62 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir2/
+testdir/dir2/file2
+testdir/dir3/
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude11.at:39:
+$as_echo "$at_srcdir/exclude01.at:22:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -11495,78 +11197,39 @@ 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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_44
-#AT_START_45
-at_fn_group_banner 45 'exclude12.at:37' \
-  "--exclude-tag-under and --listed-incremental" "   " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "45. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
 
+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
 
-  { set +x
-$as_echo "$at_srcdir/exclude12.at:40:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+echo \"NEXT\"
+tar cf archive testdir
+tar t \"testdir/dir1/*\" -f archive | sort
 
+echo \"NEXT\"
+tar cf archive testdir/dir1
+tar t --no-wildcards \"testdir/dir1/*\" -f archive | sort
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+echo \"NEXT\"
+tar cf archive testdir
+tar t --wildcards \"testdir/dir1/*\" -f archive | sort
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort
+rm -rf testdir
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude12.at:40"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude01.at:22"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -11579,116 +11242,57 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/subdir/
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude12.at:40"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_45
-#AT_START_46
-at_fn_group_banner 46 'exclude13.at:39' \
-  "--exclude-tag-under option in incremental pass" " " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "46. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
 
-  { set +x
-$as_echo "$at_srcdir/exclude13.at:42:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkexcltest etest
-rm etest/subdir/excludeme
-decho \"# Level 0\"
-tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort
-touch etest/subdir/excludeme
-touch etest/subdir/otherfile
+rm -rf testdir
+mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
+touch testdir/dir1/file1
+touch testdir/dir1/\*
+touch testdir/dir2/file2
+touch testdir/dir2/\*
+touch testdir/dir3/file3
+touch testdir/dir3/\*
 
-decho \"# Level 1\"
-cp snar-0 snar-1
-tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude13.at:42"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+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
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+echo "NEXT"
+tar cf archive testdir/dir1
+tar t --no-wildcards "testdir/dir1/*" -f archive | sort
 
-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
+echo "NEXT"
+tar cf archive testdir
+tar t --wildcards "testdir/dir1/*" -f archive | sort
 
-decho "# Level 1"
-cp snar-0 snar-1
-tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort
+rm -rf testdir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Level 0
-tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-# Level 1
-tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Level 0
-etest/
-etest/subdir/
-etest/subdir/subdir-file
-etest/top-level-file
-# Level 1
-etest/
-etest/subdir/
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir2/
+testdir/dir2/file2
+testdir/dir3/
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+NEXT
+testdir/dir1/*
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude13.at:42"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude01.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -11699,14 +11303,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_46
-#AT_START_47
-at_fn_group_banner 47 'exclude14.at:36' \
-  "--exclude-tag-all option" "                       " 7
+#AT_STOP_43
+#AT_START_44
+at_fn_group_banner 44 'exclude02.at:19' \
+  "exclude: anchoring" "                             " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "47. $at_setup_line: testing $at_desc ..."
+  $as_echo "44. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -11714,7 +11318,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/exclude14.at:39:
+$as_echo "$at_srcdir/exclude02.at:22:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -11726,10 +11330,43 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
+
+rm -rf 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
+
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -11742,25 +11379,70 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
+
+rm -rf 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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file2
+SUB 1
+testdir/
+testdir/file2
+SUB 2
+testdir/
+testdir/file1.txt
+testdir/file2
+SUB 3
+file1.txt
+SUB 4
+file1.txt
+testdir/file1.txt
+SUB 5
+file1.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude14.at:39:
+$as_echo "$at_srcdir/exclude02.at:22:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -11772,10 +11454,43 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
+
+rm -rf 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
+
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -11788,25 +11503,70 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
+
+rm -rf 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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file2
+SUB 1
+testdir/
+testdir/file2
+SUB 2
+testdir/
+testdir/file1.txt
+testdir/file2
+SUB 3
+file1.txt
+SUB 4
+file1.txt
+testdir/file1.txt
+SUB 5
+file1.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude14.at:39:
+$as_echo "$at_srcdir/exclude02.at:22:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -11818,10 +11578,43 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
+
+rm -rf 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
+
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -11834,207 +11627,194 @@ 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/exclude14.at:39:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
+rm -rf testdir
+mkdir -p testdir
+touch file1.txt
+touch testdir/file1.txt
+touch testdir/file2
 
+tar cf archive --exclude="file1.txt" \
+               testdir
+tar tf archive | sort
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+echo "SUB 1"
+tar cf archive --no-anchored \
+               --exclude="file1.txt" \
+               testdir
+tar tf archive | sort
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
+echo "SUB 2"
+tar cf archive --anchored \
+               --exclude="file1.txt" \
+               testdir
+tar tf archive | sort
 
+echo "SUB 3"
+tar cf archive testdir file1.txt
+tar t "file1.txt" -f archive | sort
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+echo "SUB 4"
+tar t --no-anchored "file1.txt" -f archive | sort
+
+echo "SUB 5"
+tar t --anchored "file1.txt" -f archive | sort
+
+rm -rf testdir file1.txt
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file2
+SUB 1
+testdir/
+testdir/file2
+SUB 2
+testdir/
+testdir/file1.txt
+testdir/file2
+SUB 3
+file1.txt
+SUB 4
+file1.txt
+testdir/file1.txt
+SUB 5
+file1.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/exclude14.at:39:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/exclude02.at:22:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_47
-#AT_START_48
-at_fn_group_banner 48 'exclude15.at:36' \
-  "--exclude-tag-all and --listed-incremental" "     " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "48. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+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
 
-  { set +x
-$as_echo "$at_srcdir/exclude15.at:39:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+echo \"SUB 4\"
+tar t --no-anchored \"file1.txt\" -f archive | sort
 
+echo \"SUB 5\"
+tar t --anchored \"file1.txt\" -f archive | sort
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+rm -rf testdir file1.txt
 
-mkexcltest etest
-tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude15.at:39"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
 ( $at_check_trace;
-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 *
 
 
 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "etest/
-etest/top-level-file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude15.at:39"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
+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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_48
-#AT_START_49
-at_fn_group_banner 49 'exclude16.at:38' \
-  "--exclude-tag-all option in incremental pass" "   " 7
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "49. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+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
 
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file2
+SUB 1
+testdir/
+testdir/file2
+SUB 2
+testdir/
+testdir/file1.txt
+testdir/file2
+SUB 3
+file1.txt
+SUB 4
+file1.txt
+testdir/file1.txt
+SUB 5
+file1.txt
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/exclude16.at:41:
+              { set +x
+$as_echo "$at_srcdir/exclude02.at:22:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -12046,18 +11826,43 @@ 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
+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
+
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "exclude16.at:41"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude02.at:22"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -12070,37 +11875,65 @@ 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
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Level 0
-tar: etest: Directory is new
-tar: etest/subdir: Directory is new
-# Level 1
-tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Level 0
-etest/
-etest/subdir/
-etest/subdir/subdir-file
-etest/top-level-file
-# Level 1
-etest/
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file2
+SUB 1
+testdir/
+testdir/file2
+SUB 2
+testdir/
+testdir/file1.txt
+testdir/file2
+SUB 3
+file1.txt
+SUB 4
+file1.txt
+testdir/file1.txt
+SUB 5
+file1.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/exclude16.at:41"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude02.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -12111,14 +11944,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_49
-#AT_START_50
-at_fn_group_banner 50 'delete01.at:23' \
-  "deleting a member after a big one" "              " 8
+#AT_STOP_44
+#AT_START_45
+at_fn_group_banner 45 'exclude03.at:19' \
+  "exclude: wildcards match slash" "                 " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "50. $at_setup_line: testing $at_desc ..."
+  $as_echo "45. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -12126,7 +11959,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/delete01.at:26:
+$as_echo "$at_srcdir/exclude03.at:22:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -12135,12 +11968,42 @@ 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 archive --delete file2
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26"
+
+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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -12150,24 +12013,69 @@ 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 archive --delete file2
-tar tf archive)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
+touch testdir/\*f\*1
+touch testdir/dir1/file1
+touch testdir/dir1/\*
+touch testdir/dir2/file2
+touch testdir/dir2/\*
+touch testdir/dir3/file3
+touch testdir/dir3/\*
+
+tar cf archive --exclude='testdir*f*1' \
+               --no-wildcards-match-slash \
+               --exclude='testdir*f*2' \
+               --wildcards-match-slash \
+               --exclude='testdir*f*3' \
+               testdir
+tar tf archive | sort
+
+echo "NEXT"
+tar cf archive testdir
+tar t --wildcards 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+rm -rf testdir
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir1/*
+testdir/dir2/
+testdir/dir2/*
+testdir/dir2/file2
+testdir/dir3/
+testdir/dir3/*
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+NEXT
+testdir/*f*1
+NEXT
+testdir/*f*1
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete01.at:26:
+$as_echo "$at_srcdir/exclude03.at:22:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -12176,53 +12084,158 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-              { set +x
-$as_echo "$at_srcdir/delete01.at:26:
-mkdir ustar
-(cd ustar
+
+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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/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
+
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir1/*
+testdir/dir2/
+testdir/dir2/*
+testdir/dir2/file2
+testdir/dir3/
+testdir/dir3/*
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+NEXT
+testdir/*f*1
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/exclude03.at:22:
+mkdir ustar
+(cd ustar
 TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26"
+
+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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -12232,24 +12245,69 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
+touch testdir/\*f\*1
+touch testdir/dir1/file1
+touch testdir/dir1/\*
+touch testdir/dir2/file2
+touch testdir/dir2/\*
+touch testdir/dir3/file3
+touch testdir/dir3/\*
+
+tar cf archive --exclude='testdir*f*1' \
+               --no-wildcards-match-slash \
+               --exclude='testdir*f*2' \
+               --wildcards-match-slash \
+               --exclude='testdir*f*3' \
+               testdir
+tar tf archive | sort
+
+echo "NEXT"
+tar cf archive testdir
+tar t --wildcards 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+rm -rf testdir
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir1/*
+testdir/dir2/
+testdir/dir2/*
+testdir/dir2/file2
+testdir/dir3/
+testdir/dir3/*
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+NEXT
+testdir/*f*1
+NEXT
+testdir/*f*1
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete01.at:26:
+$as_echo "$at_srcdir/exclude03.at:22:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -12258,12 +12316,42 @@ 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 archive --delete file2
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26"
+
+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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -12273,24 +12361,69 @@ 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 archive --delete file2
-tar tf archive)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
+touch testdir/\*f\*1
+touch testdir/dir1/file1
+touch testdir/dir1/\*
+touch testdir/dir2/file2
+touch testdir/dir2/\*
+touch testdir/dir3/file3
+touch testdir/dir3/\*
+
+tar cf archive --exclude='testdir*f*1' \
+               --no-wildcards-match-slash \
+               --exclude='testdir*f*2' \
+               --wildcards-match-slash \
+               --exclude='testdir*f*3' \
+               testdir
+tar tf archive | sort
+
+echo "NEXT"
+tar cf archive testdir
+tar t --wildcards 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+rm -rf testdir
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir1/*
+testdir/dir2/
+testdir/dir2/*
+testdir/dir2/file2
+testdir/dir3/
+testdir/dir3/*
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+NEXT
+testdir/*f*1
+NEXT
+testdir/*f*1
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete01.at:26:
+$as_echo "$at_srcdir/exclude03.at:22:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -12299,12 +12432,42 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:26"
+
+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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude03.at:22"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -12314,19 +12477,64 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 50000 --file file1
-genfile -l 1024 --file file2
-tar cf archive file1 file2
-tar f archive --delete file2
-tar tf archive)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir1 testdir/dir2 testdir/dir3
+touch testdir/\*f\*1
+touch testdir/dir1/file1
+touch testdir/dir1/\*
+touch testdir/dir2/file2
+touch testdir/dir2/\*
+touch testdir/dir3/file3
+touch testdir/dir3/\*
+
+tar cf archive --exclude='testdir*f*1' \
+               --no-wildcards-match-slash \
+               --exclude='testdir*f*2' \
+               --wildcards-match-slash \
+               --exclude='testdir*f*3' \
+               testdir
+tar tf archive | sort
+
+echo "NEXT"
+tar cf archive testdir
+tar t --wildcards 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --no-wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+echo "NEXT"
+tar t --wildcards --wildcards-match-slash 'testdir/*f*1' -f archive | sort
+
+rm -rf testdir
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir1/
+testdir/dir1/*
+testdir/dir2/
+testdir/dir2/*
+testdir/dir2/file2
+testdir/dir3/
+testdir/dir3/*
+NEXT
+testdir/*f*1
+testdir/dir1/file1
+NEXT
+testdir/*f*1
+NEXT
+testdir/*f*1
+testdir/dir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude03.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -12337,14 +12545,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_50
-#AT_START_51
-at_fn_group_banner 51 'delete02.at:23' \
-  "deleting a member from stdin archive" "           " 8
+#AT_STOP_45
+#AT_START_46
+at_fn_group_banner 46 'exclude04.at:19' \
+  "exclude: case insensitive" "                      " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "51. $at_setup_line: testing $at_desc ..."
+  $as_echo "46. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -12352,7 +12560,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/delete02.at:26:
+$as_echo "$at_srcdir/exclude04.at:22:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -12361,15 +12569,45 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 3073 -p zeros --file 1
-cp 1 2
-cp 2 3
-tar cf archive 1 2 3
-tar tf archive
-cat archive | tar f - --delete 2 > archive2
-echo separator
-tar tf archive2)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir
+touch testdir/file1
+touch testdir/file2
+touch testdir/file3
+touch testdir/file4
+touch testdir/dir/File1
+touch testdir/dir/File2
+touch testdir/dir/File3
+touch testdir/dir/File4
+
+tar cf archive --exclude=FILE2 \\
+               --exclude=file1 \\
+               --ignore-case \\
+               --exclude=file3 \\
+               --no-ignore-case \\
+               --exclude=FILE2 \\
+               --exclude=file4 \\
+               testdir
+tar tf archive | sort
+
+echo \"SUB 1\"
+tar cf archive testdir
+tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort
+
+echo \"SUB 2\"
+tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort
+
+echo \"SUB 3\"
+tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+
+rm -rf testdir
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -12379,32 +12617,69 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 3073 -p zeros --file 1
-cp 1 2
-cp 2 3
-tar cf archive 1 2 3
-tar tf archive
-cat archive | tar f - --delete 2 > archive2
-echo separator
-tar tf archive2)
+
+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
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "1
-2
-3
-separator
-1
-3
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir/
+testdir/dir/File1
+testdir/dir/File2
+testdir/dir/File4
+testdir/file2
+SUB 1
+testdir/dir/File2
+SUB 2
+testdir/dir/File2
+testdir/file2
+SUB 3
+testdir/dir/File2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete02.at:26:
+$as_echo "$at_srcdir/exclude04.at:22:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -12413,15 +12688,45 @@ TAR_OPTIONS=\"-H oldgnu\"
 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir
+touch testdir/file1
+touch testdir/file2
+touch testdir/file3
+touch testdir/file4
+touch testdir/dir/File1
+touch testdir/dir/File2
+touch testdir/dir/File3
+touch testdir/dir/File4
+
+tar cf archive --exclude=FILE2 \\
+               --exclude=file1 \\
+               --ignore-case \\
+               --exclude=file3 \\
+               --no-ignore-case \\
+               --exclude=FILE2 \\
+               --exclude=file4 \\
+               testdir
+tar tf archive | sort
+
+echo \"SUB 1\"
+tar cf archive testdir
+tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort
+
+echo \"SUB 2\"
+tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort
+
+echo \"SUB 3\"
+tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+
+rm -rf testdir
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -12431,32 +12736,69 @@ TAR_OPTIONS="-H oldgnu"
 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)
+
+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
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "1
-2
-3
-separator
-1
-3
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir/
+testdir/dir/File1
+testdir/dir/File2
+testdir/dir/File4
+testdir/file2
+SUB 1
+testdir/dir/File2
+SUB 2
+testdir/dir/File2
+testdir/file2
+SUB 3
+testdir/dir/File2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete02.at:26:
+$as_echo "$at_srcdir/exclude04.at:22:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -12465,15 +12807,45 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir
+touch testdir/file1
+touch testdir/file2
+touch testdir/file3
+touch testdir/file4
+touch testdir/dir/File1
+touch testdir/dir/File2
+touch testdir/dir/File3
+touch testdir/dir/File4
+
+tar cf archive --exclude=FILE2 \\
+               --exclude=file1 \\
+               --ignore-case \\
+               --exclude=file3 \\
+               --no-ignore-case \\
+               --exclude=FILE2 \\
+               --exclude=file4 \\
+               testdir
+tar tf archive | sort
+
+echo \"SUB 1\"
+tar cf archive testdir
+tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort
+
+echo \"SUB 2\"
+tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort
+
+echo \"SUB 3\"
+tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+
+rm -rf testdir
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -12483,32 +12855,69 @@ 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)
+
+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
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "1
-2
-3
-separator
-1
-3
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir/
+testdir/dir/File1
+testdir/dir/File2
+testdir/dir/File4
+testdir/file2
+SUB 1
+testdir/dir/File2
+SUB 2
+testdir/dir/File2
+testdir/file2
+SUB 3
+testdir/dir/File2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete02.at:26:
+$as_echo "$at_srcdir/exclude04.at:22:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -12517,15 +12926,45 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir
+touch testdir/file1
+touch testdir/file2
+touch testdir/file3
+touch testdir/file4
+touch testdir/dir/File1
+touch testdir/dir/File2
+touch testdir/dir/File3
+touch testdir/dir/File4
+
+tar cf archive --exclude=FILE2 \\
+               --exclude=file1 \\
+               --ignore-case \\
+               --exclude=file3 \\
+               --no-ignore-case \\
+               --exclude=FILE2 \\
+               --exclude=file4 \\
+               testdir
+tar tf archive | sort
+
+echo \"SUB 1\"
+tar cf archive testdir
+tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort
+
+echo \"SUB 2\"
+tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort
+
+echo \"SUB 3\"
+tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+
+rm -rf testdir
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -12535,32 +12974,69 @@ 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)
+
+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
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "1
-2
-3
-separator
-1
-3
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir/
+testdir/dir/File1
+testdir/dir/File2
+testdir/dir/File4
+testdir/file2
+SUB 1
+testdir/dir/File2
+SUB 2
+testdir/dir/File2
+testdir/file2
+SUB 3
+testdir/dir/File2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete02.at:26:
+$as_echo "$at_srcdir/exclude04.at:22:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -12569,15 +13045,45 @@ 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+rm -rf testdir
+mkdir -p testdir/dir
+touch testdir/file1
+touch testdir/file2
+touch testdir/file3
+touch testdir/file4
+touch testdir/dir/File1
+touch testdir/dir/File2
+touch testdir/dir/File3
+touch testdir/dir/File4
+
+tar cf archive --exclude=FILE2 \\
+               --exclude=file1 \\
+               --ignore-case \\
+               --exclude=file3 \\
+               --no-ignore-case \\
+               --exclude=FILE2 \\
+               --exclude=file4 \\
+               testdir
+tar tf archive | sort
+
+echo \"SUB 1\"
+tar cf archive testdir
+tar t --wildcards --wildcards-match-slash '*File2' -f archive | sort
+
+echo \"SUB 2\"
+tar t --wildcards --wildcards-match-slash --ignore-case '*File2' -f archive | sort
+
+echo \"SUB 3\"
+tar t --wildcards --wildcards-match-slash --no-ignore-case '*File2' -f archive | sort
+
+rm -rf testdir
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude04.at:22"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -12587,27 +13093,64 @@ 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)
+
+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
+
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "1
-2
-3
-separator
-1
-3
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/dir/
+testdir/dir/File1
+testdir/dir/File2
+testdir/dir/File4
+testdir/file2
+SUB 1
+testdir/dir/File2
+SUB 2
+testdir/dir/File2
+testdir/file2
+SUB 3
+testdir/dir/File2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude04.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -12618,82 +13161,113 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_51
-#AT_START_52
-at_fn_group_banner 52 'delete03.at:21' \
-  "deleting members with long names" "               " 8
+#AT_STOP_46
+#AT_START_47
+at_fn_group_banner 47 'exclude05.at:21' \
+  "exclude: lots of excludes" "                      " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "52. $at_setup_line: testing $at_desc ..."
+  $as_echo "47. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-
-
   { set +x
-$as_echo "$at_srcdir/delete03.at:26:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/exclude05.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
 
-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
-)"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
-( $at_check_trace;
-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
 
 
-prefix=This_is_a_very_long_file_name_prefix_that_is_designed_to_cause_problems_with_file_names_that_run_into_a_limit_of_the_posix_tar_formatXX
-rm -f $prefix*
-for i in 1 2 3 4 5 6 7 8 9
-do touch $prefix$i
-done
-tar -cf archive ./$prefix* &&
- tar --delete -f archive ./${prefix}5 &&
- tar -tf archive
+rm -rf testdir 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
+
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
+( $at_check_trace;
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "./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_formatXX1
-./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_formatXX2
-./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_formatXX3
-./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_formatXX4
-./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_formatXX6
-./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_formatXX7
-./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_formatXX8
-./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_formatXX9
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file10
+testdir/file11
+testdir/file9
+NEXT
+testdir/
+testdir/file10
+testdir/file11
+testdir/file9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete03.at:26:
+$as_echo "$at_srcdir/exclude05.at:24:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -12703,16 +13277,32 @@ 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
+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
+
 )"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -12723,463 +13313,413 @@ 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
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "./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_formatXX1
-./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_formatXX2
-./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_formatXX3
-./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_formatXX4
-./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_formatXX6
-./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_formatXX7
-./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_formatXX8
-./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_formatXX9
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file10
+testdir/file11
+testdir/file9
+NEXT
+testdir/
+testdir/file10
+testdir/file11
+testdir/file9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete03.at:26:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/exclude05.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 *
 
 
-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
+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
+
 )"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
 ( $at_check_trace;
-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 *
 
 
-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
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "./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_formatXX1
-./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_formatXX2
-./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_formatXX3
-./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_formatXX4
-./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_formatXX6
-./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_formatXX7
-./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_formatXX8
-./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_formatXX9
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file10
+testdir/file11
+testdir/file9
+NEXT
+testdir/
+testdir/file10
+testdir/file11
+testdir/file9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/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
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_52
-#AT_START_53
-at_fn_group_banner 53 'delete04.at:23' \
-  "deleting a large last member" "                   " 8
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "53. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+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
 
-  { set +x
-$as_echo "$at_srcdir/delete04.at:26:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
+rm -rf testdir exclfile
 
-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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
 ( $at_check_trace;
-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 *
 
-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
+
+
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-file3
-file4
-file5
-file6
-file7
-file8
-file9
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file10
+testdir/file11
+testdir/file9
+NEXT
+testdir/
+testdir/file10
+testdir/file11
+testdir/file9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete04.at:26:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/exclude05.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 *
 
-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
+
+
+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
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude05.at:24"
 ( $at_check_trace;
-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 *
 
-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
+
+
+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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-file3
-file4
-file5
-file6
-file7
-file8
-file9
+echo >>"$at_stdout"; $as_echo "testdir/
+testdir/file10
+testdir/file11
+testdir/file9
+NEXT
+testdir/
+testdir/file10
+testdir/file11
+testdir/file9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude05.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/delete04.at:26:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
 
-genfile -l      3 -f file1
-genfile -l      5 -f file2
-genfile -l      3 -f file3
-genfile -l      6 -f file4
-genfile -l     24 -f file5
-genfile -l     13 -f file6
-genfile -l   1385 -f file7
-genfile -l     30 -f file8
-genfile -l     10 -f file9
-genfile -l 256000 -f file10
-tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
-tar f archive --delete file10
-tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
 
-genfile -l      3 -f file1
-genfile -l      5 -f file2
-genfile -l      3 -f file3
-genfile -l      6 -f file4
-genfile -l     24 -f file5
-genfile -l     13 -f file6
-genfile -l   1385 -f file7
-genfile -l     30 -f file8
-genfile -l     10 -f file9
-genfile -l 256000 -f file10
-tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
-tar f archive --delete file10
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-file3
-file4
-file5
-file6
-file7
-file8
-file9
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/delete04.at:26:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_47
+#AT_START_48
+at_fn_group_banner 48 'exclude06.at:26' \
+  "exclude: long files in pax archives" "            " 7
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "48. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
 
-genfile -l      3 -f file1
-genfile -l      5 -f file2
-genfile -l      3 -f file3
-genfile -l      6 -f file4
-genfile -l     24 -f file5
-genfile -l     13 -f file6
-genfile -l   1385 -f file7
-genfile -l     30 -f file8
-genfile -l     10 -f file9
-genfile -l 256000 -f file10
-tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
-tar f archive --delete file10
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-file3
-file4
-file5
-file6
-file7
-file8
-file9
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/delete04.at:26:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/exclude06.at:31:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H pax\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l      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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude06.at:31"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H pax"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l      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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file2
-file3
-file4
-file5
-file6
-file7
-file8
-file9
+echo >>"$at_stdout"; $as_echo "out/one/two/three/four/five/six/seven/eight/nine/ten/eleven/twelve/thirteen/fourteen/fifteen/sixteen/seventeen/1.c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude06.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_53
-#AT_START_54
-at_fn_group_banner 54 'delete05.at:27' \
-  "deleting non-existing member" "                   " 8
+#AT_STOP_48
+#AT_START_49
+at_fn_group_banner 49 'exclude07.at:19' \
+  "exclude: --exclude-backups option" "              " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "54. $at_setup_line: testing $at_desc ..."
+  $as_echo "49. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -13187,7 +13727,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/delete05.at:30:
+$as_echo "$at_srcdir/exclude07.at:22:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -13196,16 +13736,15 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file \"dir/.#file\"
+genfile --file \"dir/#file#\"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -13215,32 +13754,28 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file "dir/.#file"
+genfile --file "dir/#file#"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "en
-to
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete05.at:30:
+$as_echo "$at_srcdir/exclude07.at:22:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -13249,16 +13784,15 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file \"dir/.#file\"
+genfile --file \"dir/#file#\"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -13268,32 +13802,28 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file "dir/.#file"
+genfile --file "dir/#file#"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "en
-to
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete05.at:30:
+$as_echo "$at_srcdir/exclude07.at:22:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -13302,16 +13832,15 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file \"dir/.#file\"
+genfile --file \"dir/#file#\"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -13321,32 +13850,28 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file "dir/.#file"
+genfile --file "dir/#file#"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "en
-to
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete05.at:30:
+$as_echo "$at_srcdir/exclude07.at:22:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -13355,16 +13880,15 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file \"dir/.#file\"
+genfile --file \"dir/#file#\"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -13374,32 +13898,28 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file "dir/.#file"
+genfile --file "dir/#file#"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "en
-to
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/delete05.at:30:
+$as_echo "$at_srcdir/exclude07.at:22:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -13408,16 +13928,15 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file \"dir/.#file\"
+genfile --file \"dir/#file#\"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "exclude07.at:22"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -13427,27 +13946,23 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 1024 -f en
-genfile -l 1024 -f to
+mkdir dir
+genfile --file dir/file
+genfile --file dir/file~
+genfile --file "dir/.#file"
+genfile --file "dir/#file#"
 
-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
+tar -v -c -f archive --exclude-backups dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "en
-to
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude07.at:22"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -13458,14 +13973,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_54
-#AT_START_55
-at_fn_group_banner 55 'extrac01.at:23' \
-  "extract over an existing directory" "             " 9
+#AT_STOP_49
+#AT_START_50
+at_fn_group_banner 50 'exclude08.at:36' \
+  "--exclude-tag option" "                           " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "55. $at_setup_line: testing $at_desc ..."
+  $as_echo "50. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -13473,7 +13988,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac01.at:26:
+$as_echo "$at_srcdir/exclude08.at:39:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -13482,12 +13997,13 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -13497,22 +14013,30 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26"
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac01.at:26:
+$as_echo "$at_srcdir/exclude08.at:39:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -13521,12 +14045,13 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -13536,22 +14061,30 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26"
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac01.at:26:
+$as_echo "$at_srcdir/exclude08.at:39:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -13560,12 +14093,13 @@ 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
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -13575,36 +14109,45 @@ 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
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/extrac01.at:26:
-mkdir posix
-(cd posix
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/exclude08.at:39:
+mkdir posix
+(cd posix
 TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -13614,22 +14157,30 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-touch directory/file
-tar cf archive directory || exit 1
-tar xf archive --warning=no-timestamp || exit 1
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26"
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac01.at:26:
+$as_echo "$at_srcdir/exclude08.at:39:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -13638,12 +14189,13 @@ 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
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude08.at:39"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -13653,17 +14205,25 @@ 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
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:26"
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude08.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -13674,196 +14234,93 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_55
-#AT_START_56
-at_fn_group_banner 56 'extrac02.at:23' \
-  "extracting symlinks over an existing file" "      " 9
+#AT_STOP_50
+#AT_START_51
+at_fn_group_banner 51 'exclude09.at:37' \
+  "--exclude-tag option and --listed-incremental" "  " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "56. $at_setup_line: testing $at_desc ..."
+  $as_echo "51. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-# FIXME: Skip if symlinks are not supported on the system
-
 
 
   { set +x
-$as_echo "$at_srcdir/extrac02.at:28:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
-
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28"
-( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/exclude09.at:40:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/extrac02.at:28:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude09.at:40"
 ( $at_check_trace;
-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 *
 
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag=excludeme --listed=snar -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28"
+echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/subdir/excludeme
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude09.at:40"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/extrac02.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_51
+#AT_START_52
+at_fn_group_banner 52 'exclude10.at:38' \
+  "--exclude-tag option in incremental pass" "       " 7
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "52. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
 
-touch file
-ln -s file link 2> /dev/null || ln file link
-tar cf archive link
-rm link
-touch link
-tar xf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/extrac02.at:28:
+
+
+  { set +x
+$as_echo "$at_srcdir/exclude10.at:41:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -13872,14 +14329,21 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude10.at:41"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -13889,19 +14353,42 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:28"
+echo >>"$at_stderr"; $as_echo "# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Level 0
+etest/
+etest/subdir/
+etest/subdir/subdir-file
+etest/top-level-file
+# Level 1
+etest/
+etest/subdir/
+etest/subdir/excludeme
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude10.at:41"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -13912,14 +14399,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_56
-#AT_START_57
-at_fn_group_banner 57 'extrac03.at:23' \
-  "extraction loops" "                               " 9
+#AT_STOP_52
+#AT_START_53
+at_fn_group_banner 53 'exclude11.at:36' \
+  "--exclude-tag-under option" "                     " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "57. $at_setup_line: testing $at_desc ..."
+  $as_echo "53. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -13927,7 +14414,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac03.at:26:
+$as_echo "$at_srcdir/exclude11.at:39:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -13936,11 +14423,13 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -13950,25 +14439,29 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/../directory/
-separator
-directory/../directory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac03.at:26:
+$as_echo "$at_srcdir/exclude11.at:39:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -13977,11 +14470,13 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -13991,25 +14486,29 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/../directory/
-separator
-directory/../directory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac03.at:26:
+$as_echo "$at_srcdir/exclude11.at:39:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -14018,11 +14517,13 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -14032,25 +14533,29 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/../directory/
-separator
-directory/../directory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac03.at:26:
+$as_echo "$at_srcdir/exclude11.at:39:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -14059,11 +14564,13 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -14073,25 +14580,29 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/../directory/
-separator
-directory/../directory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac03.at:26:
+$as_echo "$at_srcdir/exclude11.at:39:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -14100,11 +14611,13 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude11.at:39"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -14114,20 +14627,24 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-tar -cPvf archive directory/../directory
-echo separator
-tar -xPvf archive --warning=no-timestamp)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme -v etest | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/../directory/
-separator
-directory/../directory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude11.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -14138,14 +14655,177 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_57
-#AT_START_58
-at_fn_group_banner 58 'extrac04.at:23' \
-  "extract + fnmatch" "                              " 9
+#AT_STOP_53
+#AT_START_54
+at_fn_group_banner 54 'exclude12.at:37' \
+  "--exclude-tag-under and --listed-incremental" "   " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "58. $at_setup_line: testing $at_desc ..."
+  $as_echo "54. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/exclude12.at:40:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude12.at:40"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-under=excludeme --listed=snar -v etest | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/subdir/
+etest/top-level-file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude12.at:40"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_54
+#AT_START_55
+at_fn_group_banner 55 'exclude13.at:39' \
+  "--exclude-tag-under option in incremental pass" " " 7
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "55. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/exclude13.at:42:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkexcltest etest
+rm etest/subdir/excludeme
+decho \"# Level 0\"
+tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort
+touch etest/subdir/excludeme
+touch etest/subdir/otherfile
+
+decho \"# Level 1\"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude13.at:42"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkexcltest etest
+rm etest/subdir/excludeme
+decho "# Level 0"
+tar -c -f etest-0.tar --exclude-tag-under=excludeme --listed=snar-0 -v etest | sort
+touch etest/subdir/excludeme
+touch etest/subdir/otherfile
+
+decho "# Level 1"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-under=excludeme --listed=snar-1 -v etest | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; contents not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Level 0
+etest/
+etest/subdir/
+etest/subdir/subdir-file
+etest/top-level-file
+# Level 1
+etest/
+etest/subdir/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude13.at:42"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_55
+#AT_START_56
+at_fn_group_banner 56 'exclude14.at:36' \
+  "--exclude-tag-all option" "                       " 7
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "56. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -14153,7 +14833,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac04.at:26:
+$as_echo "$at_srcdir/exclude14.at:39:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -14165,20 +14845,10 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -14191,34 +14861,25 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/file2
-directory/subdirectory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac04.at:26:
+$as_echo "$at_srcdir/exclude14.at:39:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -14230,20 +14891,10 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -14256,34 +14907,25 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/file2
-directory/subdirectory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac04.at:26:
+$as_echo "$at_srcdir/exclude14.at:39:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -14295,20 +14937,10 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -14321,34 +14953,25 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/file2
-directory/subdirectory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac04.at:26:
+$as_echo "$at_srcdir/exclude14.at:39:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -14360,20 +14983,10 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -14386,34 +14999,25 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/file2
-directory/subdirectory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac04.at:26:
+$as_echo "$at_srcdir/exclude14.at:39:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -14425,20 +15029,10 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude14.at:39"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -14451,29 +15045,20 @@ 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
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/file2
-directory/subdirectory/
+echo >>"$at_stderr"; $as_echo "tar: etest/subdir/: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude14.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -14484,85 +15069,65 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_58
-#AT_START_59
-at_fn_group_banner 59 'extrac05.at:30' \
-  "extracting selected members from pax" "           " 9
+#AT_STOP_56
+#AT_START_57
+at_fn_group_banner 57 'exclude15.at:36' \
+  "--exclude-tag-all and --listed-incremental" "     " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "59. $at_setup_line: testing $at_desc ..."
+  $as_echo "57. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-cat >list <<'_ATEOF'
-jeden
-cztery
-_ATEOF
-
-
 
 
   { set +x
-$as_echo "$at_srcdir/extrac05.at:38:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/exclude15.at:39:
+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 0 ABCD 1M EFGH 2000K IJKL || exit 77
-genfile --length 118 --file jeden
-genfile --length 223 --file dwa
-genfile --length 517 --file trzy
-genfile --length 110 --file cztery
-
-tar cf archive jeden dwa trzy cztery || exit 1
-
-mkdir dir
-cd dir
 
-tar xvfT ../archive ../../list --warning=no-timestamp || exit 1
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-cd ..
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac05.at:38"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude15.at:39"
 ( $at_check_trace;
-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 *
 
-genfile --sparse --file sparsefile 0 ABCD 1M EFGH 2000K IJKL || exit 77
-genfile --length 118 --file jeden
-genfile --length 223 --file dwa
-genfile --length 517 --file trzy
-genfile --length 110 --file cztery
-
-tar cf archive jeden dwa trzy cztery || exit 1
-
-mkdir dir
-cd dir
 
-tar xvfT ../archive ../../list --warning=no-timestamp || exit 1
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-cd ..
+mkexcltest etest
+tar -c -f etest.tar --exclude-tag-all=excludeme --listed=snar -v etest | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "jeden
-cztery
+echo >>"$at_stderr"; $as_echo "tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "etest/
+etest/top-level-file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac05.at:38"
+at_fn_check_status 0 $at_status "$at_srcdir/exclude15.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -14573,14 +15138,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_59
-#AT_START_60
-at_fn_group_banner 60 'extrac06.at:34' \
-  "mode of extracted directories" "                  " 9
+#AT_STOP_57
+#AT_START_58
+at_fn_group_banner 58 'exclude16.at:38' \
+  "--exclude-tag-all option in incremental pass" "   " 7
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "60. $at_setup_line: testing $at_desc ..."
+  $as_echo "58. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -14588,97 +15153,140 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac06.at:37:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/exclude16.at:41:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
 
-# Force umask
-umask 022
-
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"
-
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
-
-# Archive it
-tar cf arc directory
-
-# Change its permissions ...
-chmod 755 directory
-genfile --stat=mode:777 directory
-
-# ... and attempt to restore it twice
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
+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
 
-# After both restores, the directory mode should be 755
+decho \"# Level 1\"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
+at_fn_check_prepare_notrace 'a `...` command substitution' "exclude16.at:41"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
 
-# Force umask
-umask 022
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
+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
 
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
+decho "# Level 1"
+cp snar-0 snar-1
+tar -c -f etest-1.tar --exclude-tag-all=excludeme --listed=snar-1 -v etest | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Level 0
+tar: etest: Directory is new
+tar: etest/subdir: Directory is new
+# Level 1
+tar: etest/subdir: contains a cache directory tag excludeme; directory not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Level 0
+etest/
+etest/subdir/
+etest/subdir/subdir-file
+etest/top-level-file
+# Level 1
+etest/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/exclude16.at:41"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-# 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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_58
+#AT_START_59
+at_fn_group_banner 59 'delete01.at:24' \
+  "deleting a member after a big one" "              " 8
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "59. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-# After both restores, the directory mode should be 755
-)
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/delete01.at:27:
+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 archive --delete file2
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:27"
+( $at_check_trace;
+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 archive --delete file2
+tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "777
-755
-755
-755
+echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac06.at:37:
+$as_echo "$at_srcdir/delete01.at:27:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -14687,35 +15295,12 @@ TAR_OPTIONS=\"-H oldgnu\"
 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:27"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -14725,50 +15310,24 @@ TAR_OPTIONS="-H oldgnu"
 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
-)
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "777
-755
-755
-755
+echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac06.at:37:
+$as_echo "$at_srcdir/delete01.at:27:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -14777,35 +15336,12 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-
-# Force umask
-umask 022
-
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"
-
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
-
-# Archive it
-tar cf arc directory
-
-# Change its permissions ...
-chmod 755 directory
-genfile --stat=mode:777 directory
-
-# ... and attempt to restore it twice
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-# After both restores, the directory mode should be 755
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:27"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -14815,50 +15351,24 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-
-# Force umask
-umask 022
-
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
-
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
-
-# Archive it
-tar cf arc directory
-
-# Change its permissions ...
-chmod 755 directory
-genfile --stat=mode:777 directory
-
-# ... and attempt to restore it twice
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-# After both restores, the directory mode should be 755
-)
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "777
-755
-755
-755
+echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac06.at:37:
+$as_echo "$at_srcdir/delete01.at:27:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -14867,35 +15377,12 @@ 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:27"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -14905,50 +15392,24 @@ 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
-)
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "777
-755
-755
-755
+echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac06.at:37:
+$as_echo "$at_srcdir/delete01.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -14957,35 +15418,12 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
-# Force umask
-umask 022
-
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"
-
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
-
-# Archive it
-tar cf arc directory
-
-# Change its permissions ...
-chmod 755 directory
-genfile --stat=mode:777 directory
-
-# ... and attempt to restore it twice
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-# After both restores, the directory mode should be 755
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete01.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -14995,45 +15433,19 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-
-# Force umask
-umask 022
-
-# Make sure user's umask is honored, even if we are superuser
-TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
-
-# Create a directory
-mkdir directory
-chmod 777 directory
-genfile --stat=mode:777 directory
-
-# Archive it
-tar cf arc directory
-
-# Change its permissions ...
-chmod 755 directory
-genfile --stat=mode:777 directory
-
-# ... and attempt to restore it twice
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-tar xf arc directory --warning=no-timestamp
-genfile --stat=mode:777 directory
-
-# After both restores, the directory mode should be 755
-)
+genfile -l 50000 --file file1
+genfile -l 1024 --file file2
+tar cf archive file1 file2
+tar f archive --delete file2
+tar tf archive)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "777
-755
-755
-755
+echo >>"$at_stdout"; $as_echo "file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+at_fn_check_status 0 $at_status "$at_srcdir/delete01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -15044,14 +15456,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_60
-#AT_START_61
-at_fn_group_banner 61 'extrac07.at:27' \
-  "extracting symlinks to a read-only dir" "         " 9
+#AT_STOP_59
+#AT_START_60
+at_fn_group_banner 60 'delete02.at:24' \
+  "deleting a member from stdin archive" "           " 8
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "61. $at_setup_line: testing $at_desc ..."
+  $as_echo "60. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -15059,184 +15471,76 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac07.at:30:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+$as_echo "$at_srcdir/delete02.at:27:
+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 *
 
-
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac07.at:30"
+genfile -l 3073 -p zeros --file 1
+cp 1 2
+cp 2 3
+tar cf archive 1 2 3
+tar tf archive
+cat archive | tar f - --delete 2 > archive2
+echo separator
+tar tf archive2)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:27"
 ( $at_check_trace;
-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 *
 
-
-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
-)
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Prepare the directory
-Create the archive
-Extract
-dir/
-dir/foo
+echo >>"$at_stdout"; $as_echo "1
+2
+3
+separator
+1
+3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac07.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/delete02.at:27:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
- # Testing one format is enough
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_61
-#AT_START_62
-at_fn_group_banner 62 'extrac08.at:33' \
-  "restoring mode on existing directory" "           " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "62. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/extrac08.at:36:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
-
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
-( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
-export TAR_OPTIONS
-rm -rf *
-
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
-755
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:27"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -15246,30 +15550,32 @@ 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
-)
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
-755
+echo >>"$at_stdout"; $as_echo "1
+2
+3
+separator
+1
+3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac08.at:36:
+$as_echo "$at_srcdir/delete02.at:27:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -15278,16 +15584,15 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:27"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -15297,30 +15602,32 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
-755
+echo >>"$at_stdout"; $as_echo "1
+2
+3
+separator
+1
+3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac08.at:36:
+$as_echo "$at_srcdir/delete02.at:27:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -15329,16 +15636,15 @@ TAR_OPTIONS=\"-H posix\"
 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:27"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -15348,30 +15654,32 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)
+genfile -l 3073 -p zeros --file 1
+cp 1 2
+cp 2 3
+tar cf archive 1 2 3
+tar tf archive
+cat archive | tar f - --delete 2 > archive2
+echo separator
+tar tf archive2)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
-755
+echo >>"$at_stdout"; $as_echo "1
+2
+3
+separator
+1
+3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac08.at:36:
+$as_echo "$at_srcdir/delete02.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -15380,16 +15688,15 @@ 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete02.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -15399,25 +15706,27 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-umask 000
-mkdir dir
-chmod 755 dir
-echo bla > dir/file
-tar cf test.tar dir
-chmod 700 dir
-tar xfv test.tar --warning=no-timestamp
-genfile --stat=mode.777 dir
-)
+genfile -l 3073 -p zeros --file 1
+cp 1 2
+cp 2 3
+tar cf archive 1 2 3
+tar tf archive
+cat archive | tar f - --delete 2 > archive2
+echo separator
+tar tf archive2)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/file
-755
+echo >>"$at_stdout"; $as_echo "1
+2
+3
+separator
+1
+3
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/delete02.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -15428,22 +15737,24 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_62
-#AT_START_63
-at_fn_group_banner 63 'extrac09.at:24' \
-  "no need to save dir with unreadable . and .." "   " 9
+#AT_STOP_60
+#AT_START_61
+at_fn_group_banner 61 'delete03.at:21' \
+  "deleting members with long names" "               " 8
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "63. $at_setup_line: testing $at_desc ..."
+  $as_echo "61. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
+
+
   { set +x
-$as_echo "$at_srcdir/extrac09.at:27:
+$as_echo "$at_srcdir/delete03.at:26:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -15453,30 +15764,16 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 && exit 77
-
-
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/extract
-genfile --file dir/sub/f
-cd dir/sub
-
-tar -cf archive.tar f
-
-chmod a-r . ..
-tar -xvf archive.tar -C extract f
-status=\$?
-chmod a+r . ..
-cmp f extract/f || status=\$?
-exit \$status
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac09.at:27"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -15487,123 +15784,165 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 && exit 77
-
-
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/extract
-genfile --file dir/sub/f
-cd dir/sub
-
-tar -cf archive.tar f
-
-chmod a-r . ..
-tar -xvf archive.tar -C extract f
-status=$?
-chmod a+r . ..
-cmp f extract/f || status=$?
-exit $status
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "f
+echo >>"$at_stdout"; $as_echo "./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_formatXX1
+./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_formatXX2
+./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_formatXX3
+./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_formatXX4
+./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_formatXX6
+./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_formatXX7
+./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_formatXX8
+./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_formatXX9
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac09.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/delete03.at:26:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_63
-#AT_START_64
-at_fn_group_banner 64 'extrac10.at:29' \
-  "-C and delayed setting of metadata" "             " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "64. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
+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
+)"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "./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_formatXX1
+./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_formatXX2
+./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_formatXX3
+./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_formatXX4
+./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_formatXX6
+./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_formatXX7
+./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_formatXX8
+./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_formatXX9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/extrac10.at:32:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/delete03.at:26:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir d x x/y
-echo foo >d/d1
-echo bar >e
 
-tar -cf archive.tar d e &&
-tar -xf archive.tar -C x d -C y e &&
-diff -r d x/d &&
-diff e x/y/e
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac10.at:32"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "delete03.at:26"
 ( $at_check_trace;
-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 *
 
-mkdir d x x/y
-echo foo >d/d1
-echo bar >e
 
-tar -cf archive.tar d e &&
-tar -xf archive.tar -C x d -C y e &&
-diff -r d x/d &&
-diff e x/y/e
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac10.at:32"
+echo >>"$at_stdout"; $as_echo "./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_formatXX1
+./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_formatXX2
+./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_formatXX3
+./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_formatXX4
+./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_formatXX6
+./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_formatXX7
+./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_formatXX8
+./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_formatXX9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_64
-#AT_START_65
-at_fn_group_banner 65 'extrac11.at:25' \
-  "scarce file descriptors" "                        " 9
+#AT_STOP_61
+#AT_START_62
+at_fn_group_banner 62 'delete04.at:24' \
+  "deleting a large last member" "                   " 8
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "65. $at_setup_line: testing $at_desc ..."
+  $as_echo "62. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -15611,333 +15950,275 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac11.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/delete04.at:27:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-exec </dev/null
-dirs='a
-      a/b
-      a/b/c
-      a/b/c/d
-      a/b/c/d/e
-      a/b/c/d/e/f
-      a/b/c/d/e/f/g
-      a/b/c/d/e/f/g/h
-      a/b/c/d/e/f/g/h/i
-      a/b/c/d/e/f/g/h/i/j
-      a/b/c/d/e/f/g/h/i/j/k
-'
-files=
-mkdir \$dirs dest1 dest2 dest3 || exit
-for dir in \$dirs; do
-  for file in X Y Z; do
-    echo \$file >\$dir/\$file || exit
-    files=\"\$files \$file\"
-  done
-done
-
-# Check that \"ulimit\" itself works.  Close file descriptors before
-# invoking ulimit, to work around a bug (or a \"feature\") in some shells,
-# where they squirrel away dups of file descriptors into FD 10 and up
-# before closing the originals.
-( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-   ulimit -n 100 &&
-   tar -cf archive1.tar a &&
-   tar -xf archive1.tar -C dest1 a
-  ) &&
-  diff -r a dest1/a
-) >/dev/null 2>&1 ||
-   exit 77
-
-# Another test that \"ulimit\" itself works:
-# tar should fail when completely starved of file descriptors.
-( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-   ulimit -n 4 &&
-   tar -cf archive2.tar a &&
-   tar -xf archive2.tar -C dest2 a
-  ) &&
-  diff -r a dest2/a
-) >/dev/null 2>&1 &&
-   exit 77
-
-# 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; }
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac11.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:27"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-exec </dev/null
-dirs='a
-      a/b
-      a/b/c
-      a/b/c/d
-      a/b/c/d/e
-      a/b/c/d/e/f
-      a/b/c/d/e/f/g
-      a/b/c/d/e/f/g/h
-      a/b/c/d/e/f/g/h/i
-      a/b/c/d/e/f/g/h/i/j
-      a/b/c/d/e/f/g/h/i/j/k
-'
-files=
-mkdir $dirs dest1 dest2 dest3 || exit
-for dir in $dirs; do
-  for file in X Y Z; do
-    echo $file >$dir/$file || exit
-    files="$files $file"
-  done
-done
-
-# Check that "ulimit" itself works.  Close file descriptors before
-# invoking ulimit, to work around a bug (or a "feature") in some shells,
-# where they squirrel away dups of file descriptors into FD 10 and up
-# before closing the originals.
-( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-   ulimit -n 100 &&
-   tar -cf archive1.tar a &&
-   tar -xf archive1.tar -C dest1 a
-  ) &&
-  diff -r a dest1/a
-) >/dev/null 2>&1 ||
-   exit 77
-
-# Another test that "ulimit" itself works:
-# tar should fail when completely starved of file descriptors.
-( (exec 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-   ulimit -n 4 &&
-   tar -cf archive2.tar a &&
-   tar -xf archive2.tar -C dest2 a
-  ) &&
-  diff -r a dest2/a
-) >/dev/null 2>&1 &&
-   exit 77
-
-# 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; }
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac11.at:28"
+echo >>"$at_stdout"; $as_echo "file1
+file2
+file3
+file4
+file5
+file6
+file7
+file8
+file9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_65
-#AT_START_66
-at_fn_group_banner 66 'extrac12.at:25' \
-  "extract dot permissions" "                        " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "66. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/extrac12.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/delete04.at:27:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir src dst
-echo file1 >src/file1
-echo file2 >src/file2
-chmod a-w src
-
-tar --no-recursion -cf archive.tar -C src . ./file1 file2 &&
-tar -xf archive.tar -C dst &&
-cmp src/file1 dst/file1 &&
-cmp src/file2 dst/file2
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac12.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:27"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir src dst
-echo file1 >src/file1
-echo file2 >src/file2
-chmod a-w src
-
-tar --no-recursion -cf archive.tar -C src . ./file1 file2 &&
-tar -xf archive.tar -C dst &&
-cmp src/file1 dst/file1 &&
-cmp src/file2 dst/file2
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac12.at:28"
+echo >>"$at_stdout"; $as_echo "file1
+file2
+file3
+file4
+file5
+file6
+file7
+file8
+file9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_66
-#AT_START_67
-at_fn_group_banner 67 'extrac13.at:26' \
-  "extract over symlinks" "                          " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "67. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/extrac13.at:29:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/delete04.at:27:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir src 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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac13.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:27"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac13.at:29"
+echo >>"$at_stdout"; $as_echo "file1
+file2
+file3
+file4
+file5
+file6
+file7
+file8
+file9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/delete04.at:27:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
+genfile -l      3 -f file1
+genfile -l      5 -f file2
+genfile -l      3 -f file3
+genfile -l      6 -f file4
+genfile -l     24 -f file5
+genfile -l     13 -f file6
+genfile -l   1385 -f file7
+genfile -l     30 -f file8
+genfile -l     10 -f file9
+genfile -l 256000 -f file10
+tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
+tar f archive --delete file10
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:27"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
+genfile -l      3 -f file1
+genfile -l      5 -f file2
+genfile -l      3 -f file3
+genfile -l      6 -f file4
+genfile -l     24 -f file5
+genfile -l     13 -f file6
+genfile -l   1385 -f file7
+genfile -l     30 -f file8
+genfile -l     10 -f file9
+genfile -l 256000 -f file10
+tar cf archive file1 file2 file3 file4 file5 file6 file7 file8 file9 file10
+tar f archive --delete file10
+tar tf archive
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+file2
+file3
+file4
+file5
+file6
+file7
+file8
+file9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_67
-#AT_START_68
-at_fn_group_banner 68 'extrac14.at:25' \
-  "extract -C symlink" "                             " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "68. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/extrac14.at:28:
+              { set +x
+$as_echo "$at_srcdir/delete04.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -15946,14 +16227,21 @@ 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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac14.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "delete04.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -15963,19 +16251,36 @@ 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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac14.at:28"
+echo >>"$at_stdout"; $as_echo "file1
+file2
+file3
+file4
+file5
+file6
+file7
+file8
+file9
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -15986,14 +16291,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_68
-#AT_START_69
-at_fn_group_banner 69 'extrac15.at:25' \
-  "extract parent mkdir failure" "                   " 9
+#AT_STOP_62
+#AT_START_63
+at_fn_group_banner 63 'delete05.at:28' \
+  "deleting non-existing member" "                   " 8
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "69. $at_setup_line: testing $at_desc ..."
+  $as_echo "63. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -16001,99 +16306,219 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac15.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/delete05.at:31:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f en
+genfile -l 1024 -f to
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 && exit 77
-
-
-mkdir src src/a src/a/b dest dest/a
-touch src/a/b/c
-chmod a-w dest/a
-
-tar -cf archive.tar -C src a/b/c &&
-if tar -xf archive.tar -C dest a/b/c
-then (exit 1)
-else (exit 0)
-fi
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac15.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:31"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
+genfile -l 1024 -f 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "en
+to
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:31"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 && exit 77
+              { set +x
+$as_echo "$at_srcdir/delete05.at:31:
+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
 
-mkdir src src/a src/a/b dest dest/a
-touch src/a/b/c
-chmod a-w dest/a
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:31"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-tar -cf archive.tar -C src a/b/c &&
-if tar -xf archive.tar -C dest a/b/c
-then (exit 1)
-else (exit 0)
-fi
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: a/b: Cannot mkdir: Permission denied
-tar: a/b/c: Cannot open: No such file or directory
+echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
 tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac15.at:28"
+echo >>"$at_stdout"; $as_echo "en
+to
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/delete05.at:31:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:31"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "en
+to
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:31"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_69
-#AT_START_70
-at_fn_group_banner 70 'extrac16.at:26' \
-  "extract empty directory with -C" "                " 9
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "70. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+              { set +x
+$as_echo "$at_srcdir/delete05.at:31:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
+genfile -l 1024 -f en
+genfile -l 1024 -f to
 
+tar cf archive en to
+# Make sure we don't use bogus blocking factor.
+# GNU tar up to and including 1.14.91 produced an empty archive this way:
+tar --file archive --blocking-factor=20 --delete tre
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:31"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
+genfile -l 1024 -f en
+genfile -l 1024 -f to
 
+tar cf archive en to
+# Make sure we don't use bogus blocking factor.
+# GNU tar up to and including 1.14.91 produced an empty archive this way:
+tar --file archive --blocking-factor=20 --delete tre
+tar tf archive
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "en
+to
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:31"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/extrac16.at:29:
+              { set +x
+$as_echo "$at_srcdir/delete05.at:31:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -16102,13 +16527,16 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir src src/a src/a/b dest
-touch src/a/c
+genfile -l 1024 -f en
+genfile -l 1024 -f to
 
-tar -cf archive.tar -C src a &&
-tar -xf archive.tar -C dest
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac16.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "delete05.at:31"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -16118,18 +16546,27 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir src src/a src/a/b dest
-touch src/a/c
+genfile -l 1024 -f en
+genfile -l 1024 -f to
 
-tar -cf archive.tar -C src a &&
-tar -xf archive.tar -C dest
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac16.at:29"
+echo >>"$at_stderr"; $as_echo "tar: tre: Not found in archive
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "en
+to
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/delete05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -16140,32 +16577,22 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_70
-#AT_START_71
-at_fn_group_banner 71 'extrac17.at:21' \
-  "name matching/transformation ordering" "          " 9
+#AT_STOP_63
+#AT_START_64
+at_fn_group_banner 64 'extrac01.at:24' \
+  "extract over an existing directory" "             " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "71. $at_setup_line: testing $at_desc ..."
+  $as_echo "64. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-# Description: Tar 1.24 changed the ordering of name matching and
-# name transformation so that the former saw already transformed
-# file names (see commit 9c194c99 and exclude06.at).  This reverted
-# ordering made it impossible to match file names in certain cases.
-# In particular, the testcase below would not extract anything.
-#
-# Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
-# References: <x6r5fd9jye@gzp>, <20101026175126.29028@Pirx.gnu.org.ua>
-#             http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00047.html
-
 
 
   { set +x
-$as_echo "$at_srcdir/extrac17.at:34:
+$as_echo "$at_srcdir/extrac01.at:27:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -16174,16 +16601,12 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir dir/subdir1 dir/subdir2 out
-genfile --file dir/subdir1/file1
-genfile --file dir/subdir2/file2
-
-tar cf dir.tar dir
-
-tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
-  dir/subdir1/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:27"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -16193,28 +16616,22 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir dir/subdir1 dir/subdir2 out
-genfile --file dir/subdir1/file1
-genfile --file dir/subdir2/file2
-
-tar cf dir.tar dir
-
-tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \
-  dir/subdir1/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac17.at:34:
+$as_echo "$at_srcdir/extrac01.at:27:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -16223,16 +16640,12 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:27"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -16242,28 +16655,22 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac17.at:34:
+$as_echo "$at_srcdir/extrac01.at:27:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -16272,16 +16679,12 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:27"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -16291,28 +16694,22 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac17.at:34:
+$as_echo "$at_srcdir/extrac01.at:27:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -16321,16 +16718,12 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:27"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -16340,28 +16733,22 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac17.at:34:
+$as_echo "$at_srcdir/extrac01.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -16370,16 +16757,12 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac01.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -16389,23 +16772,17 @@ 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/
+mkdir directory
+touch directory/file
+tar cf archive directory || exit 1
+tar xf archive --warning=no-timestamp || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -16416,22 +16793,24 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_71
-#AT_START_72
-at_fn_group_banner 72 'extrac18.at:34' \
-  "keep-old-files" "                                 " 9
+#AT_STOP_64
+#AT_START_65
+at_fn_group_banner 65 'extrac02.at:24' \
+  "extracting symlinks over an existing file" "      " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "72. $at_setup_line: testing $at_desc ..."
+  $as_echo "65. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# FIXME: Skip if symlinks are not supported on the system
+
 
 
   { set +x
-$as_echo "$at_srcdir/extrac18.at:37:
+$as_echo "$at_srcdir/extrac02.at:29:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -16440,22 +16819,14 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=\$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:29"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -16465,38 +16836,24 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=2
-File a
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac18.at:37:
+$as_echo "$at_srcdir/extrac02.at:29:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -16505,22 +16862,14 @@ 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
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:29"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -16530,38 +16879,24 @@ 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
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=2
-File a
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac18.at:37:
+$as_echo "$at_srcdir/extrac02.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -16570,22 +16905,14 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=\$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -16595,38 +16922,24 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=2
-File a
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac18.at:37:
+$as_echo "$at_srcdir/extrac02.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -16635,22 +16948,14 @@ 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
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -16660,38 +16965,24 @@ 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
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=2
-File a
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac18.at:37:
+$as_echo "$at_srcdir/extrac02.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -16700,22 +16991,14 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=\$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac02.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -16725,33 +17008,19 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x -k -f ../archive
-echo status=$?
-
-cat a
+touch file
+ln -s file link 2> /dev/null || ln file link
+tar cf archive link
+rm link
+touch link
+tar xf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=2
-File a
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -16762,14 +17031,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_72
-#AT_START_73
-at_fn_group_banner 73 'extrac19.at:21' \
-  "skip-old-files" "                                 " 9
+#AT_STOP_65
+#AT_START_66
+at_fn_group_banner 66 'extrac03.at:23' \
+  "extraction loops" "                               " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "73. $at_setup_line: testing $at_desc ..."
+  $as_echo "66. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -16777,7 +17046,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/extrac19.at:24:
+$as_echo "$at_srcdir/extrac03.at:26:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -16786,22 +17055,11 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=\$?
-
-cat a
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -16811,35 +17069,25 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=$?
-
-cat a
-)
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=0
-File a
+echo >>"$at_stdout"; $as_echo "directory/../directory/
+separator
+directory/../directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac19.at:24:
+$as_echo "$at_srcdir/extrac03.at:26:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -16848,22 +17096,11 @@ 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -16873,35 +17110,25 @@ 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
-)
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=0
-File a
+echo >>"$at_stdout"; $as_echo "directory/../directory/
+separator
+directory/../directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac19.at:24:
+$as_echo "$at_srcdir/extrac03.at:26:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -16910,22 +17137,11 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=\$?
-
-cat a
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -16935,35 +17151,25 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=$?
-
-cat a
-)
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=0
-File a
+echo >>"$at_stdout"; $as_echo "directory/../directory/
+separator
+directory/../directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac19.at:24:
+$as_echo "$at_srcdir/extrac03.at:26:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -16972,22 +17178,11 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=\$?
-
-cat a
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -16997,35 +17192,25 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-cd dir
-echo 'Old file a' > a
-echo 'Old file b' > b
-
-tar cf ../archive .
-
-rm b
-echo 'File a' > a
-
-tar -x --skip-old-files -f ../archive
-echo status=$?
-
-cat a
-)
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=0
-File a
+echo >>"$at_stdout"; $as_echo "directory/../directory/
+separator
+directory/../directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/extrac19.at:24:
+$as_echo "$at_srcdir/extrac03.at:26:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -17034,22 +17219,11 @@ 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=\$?
-
-cat a
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac03.at:26"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -17059,30 +17233,20 @@ 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=$?
-
-cat a
-)
+mkdir directory
+tar -cPvf archive directory/../directory
+echo separator
+tar -xPvf archive --warning=no-timestamp)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "status=0
-File a
+echo >>"$at_stdout"; $as_echo "directory/../directory/
+separator
+directory/../directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac03.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -17093,14 +17257,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_73
-#AT_START_74
-at_fn_group_banner 74 'backup01.at:33' \
-  "extracting existing dir with --backup" "          " 9
+#AT_STOP_66
+#AT_START_67
+at_fn_group_banner 67 'extrac04.at:24' \
+  "extract + fnmatch" "                              " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "74. $at_setup_line: testing $at_desc ..."
+  $as_echo "67. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -17108,7 +17272,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/backup01.at:36:
+$as_echo "$at_srcdir/extrac04.at:27:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -17117,13 +17281,23 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:27"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -17133,28 +17307,37 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir1/
-dir1/file1
-Renaming 'dir1/file1' to 'dir1/file1~'
-dir2/
+echo >>"$at_stdout"; $as_echo "directory/
+directory/file2
+directory/subdirectory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/backup01.at:36:
+$as_echo "$at_srcdir/extrac04.at:27:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -17163,44 +17346,63 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-unset VERSION_CONTROL
-mkdir dir1 dir2
-echo bla > dir1/file1
-tar cf test.tar dir1 dir2
-tar xfv test.tar --backup --warning=no-timestamp
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
 
-unset VERSION_CONTROL
-mkdir dir1 dir2
-echo bla > dir1/file1
-tar cf test.tar dir1 dir2
-tar xfv test.tar --backup --warning=no-timestamp
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:27"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+touch file1
+mkdir directory
+mkdir directory/subdirectory
+touch directory/file1
+touch directory/file2
+touch directory/subdirectory/file1
+touch directory/subdirectory/file2
+tar -cf archive ./file1 directory
+tar -tf archive \
+  --exclude='./*1' \
+  --exclude='d*/*1' \
+  --exclude='d*/s*/*2' | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir1/
-dir1/file1
-Renaming 'dir1/file1' to 'dir1/file1~'
-dir2/
+echo >>"$at_stdout"; $as_echo "directory/
+directory/file2
+directory/subdirectory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/backup01.at:36:
+$as_echo "$at_srcdir/extrac04.at:27:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -17209,13 +17411,23 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:27"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -17225,28 +17437,37 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir1/
-dir1/file1
-Renaming 'dir1/file1' to 'dir1/file1~'
-dir2/
+echo >>"$at_stdout"; $as_echo "directory/
+directory/file2
+directory/subdirectory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/backup01.at:36:
+$as_echo "$at_srcdir/extrac04.at:27:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -17255,13 +17476,23 @@ 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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:27"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -17271,28 +17502,37 @@ 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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir1/
-dir1/file1
-Renaming 'dir1/file1' to 'dir1/file1~'
-dir2/
+echo >>"$at_stdout"; $as_echo "directory/
+directory/file2
+directory/subdirectory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/backup01.at:36:
+$as_echo "$at_srcdir/extrac04.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -17301,13 +17541,23 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-unset VERSION_CONTROL
-mkdir dir1 dir2
-echo bla > dir1/file1
-tar cf test.tar dir1 dir2
-tar xfv test.tar --backup --warning=no-timestamp
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+at_fn_check_prepare_notrace 'a `...` command substitution' "extrac04.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -17317,23 +17567,32 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-unset VERSION_CONTROL
-mkdir dir1 dir2
-echo bla > dir1/file1
-tar cf test.tar dir1 dir2
-tar xfv test.tar --backup --warning=no-timestamp
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir1/
-dir1/file1
-Renaming 'dir1/file1' to 'dir1/file1~'
-dir2/
+echo >>"$at_stdout"; $as_echo "directory/
+directory/file2
+directory/subdirectory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac04.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -17344,108 +17603,28 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_74
-#AT_START_75
-at_fn_group_banner 75 'label01.at:21' \
-  "single-volume label" "                            " 10
+#AT_STOP_67
+#AT_START_68
+at_fn_group_banner 68 'extrac05.at:31' \
+  "extracting selected members from pax" "           " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "75. $at_setup_line: testing $at_desc ..."
+  $as_echo "68. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+cat >list <<'_ATEOF'
+jeden
+cztery
+_ATEOF
 
 
-  { set +x
-$as_echo "$at_srcdir/label01.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
-
-genfile --file foo
-genfile --file bar
-tar -cf archive --label=Test foo bar
-tar tf archive
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
-
-genfile --file foo
-genfile --file bar
-tar -cf archive --label=Test foo bar
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test
-foo
-bar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test
-foo
-bar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/label01.at:24:
+  { set +x
+$as_echo "$at_srcdir/extrac05.at:39:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -17454,12 +17633,22 @@ 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
+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 ..
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac05.at:39"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -17469,21 +17658,30 @@ 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
+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 ..
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test
-foo
-bar
+echo >>"$at_stdout"; $as_echo "jeden
+cztery
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac05.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -17494,14 +17692,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_75
-#AT_START_76
-at_fn_group_banner 76 'label02.at:21' \
-  "multi-volume label" "                             " 10
+#AT_STOP_68
+#AT_START_69
+at_fn_group_banner 69 'extrac06.at:34' \
+  "mode of extracted directories" "                  " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "76. $at_setup_line: testing $at_desc ..."
+  $as_echo "69. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -17509,55 +17707,97 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/label02.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/extrac06.at:37:
+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 *
 
-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
+
+# 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-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
+
+# 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test Volume 1
-foo
-bar
-baz
+echo >>"$at_stdout"; $as_echo "777
+755
+755
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/label02.at:24:
+$as_echo "$at_srcdir/extrac06.at:37:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -17566,14 +17806,35 @@ 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
+
+# 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -17583,314 +17844,140 @@ 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test Volume 1
-foo
-bar
-baz
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/label02.at:24:
-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
 
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
+# Make sure user's umask is honored, even if we are superuser
+TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
 
-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
+# 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Test Volume 1
-foo
-bar
-baz
+echo >>"$at_stdout"; $as_echo "777
+755
+755
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/extrac06.at:37:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
 
+# Force umask
+umask 022
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_76
-#AT_START_77
-at_fn_group_banner 77 'label03.at:27' \
-  "test-label option" "                              " 10
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "77. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+# 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
 
-  { set +x
-$as_echo "$at_srcdir/label03.at:30:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+tar xf arc directory --warning=no-timestamp
+genfile --stat=mode:777 directory
 
-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 \$?
+# After both restores, the directory mode should be 755
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-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 $?
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "# Display label
-# Display label: unlabeled
-# Test label: success
-# Test label: failure
-# Test label: unlabeled
-# Test label, verbose: success
-# Test label, verbose: failure
-tar: Archive label mismatch
-# Test label: multiple arguments
-# Test label: wildcards
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Display label
-iamalabel
-0
-# Display label: unlabeled
-0
-# Test label: success
-0
-# Test label: failure
-1
-# Test label: unlabeled
-1
-# Test label, verbose: success
-iamalabel
-0
-# Test label, verbose: failure
-iamalabel
-1
-# Test label: multiple arguments
-0
-# Test label: wildcards
-0
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/label03.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+# Force umask
+umask 022
 
-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 \$?
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
+# Make sure user's umask is honored, even if we are superuser
+TAR_OPTIONS="$TAR_OPTIONS --no-same-permissions"
 
-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 $?
+# 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Display label
-# Display label: unlabeled
-# Test label: success
-# Test label: failure
-# Test label: unlabeled
-# Test label, verbose: success
-# Test label, verbose: failure
-tar: Archive label mismatch
-# Test label: multiple arguments
-# Test label: wildcards
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Display label
-iamalabel
-0
-# Display label: unlabeled
-0
-# Test label: success
-0
-# Test label: failure
-1
-# Test label: unlabeled
-1
-# Test label, verbose: success
-iamalabel
-0
-# Test label, verbose: failure
-iamalabel
-1
-# Test label: multiple arguments
-0
-# Test label: wildcards
-0
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "777
+755
+755
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/label03.at:30:
+$as_echo "$at_srcdir/extrac06.at:37:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -17899,30 +17986,35 @@ TAR_OPTIONS=\"-H posix\"
 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 \$?
+
+# 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -17932,94 +18024,50 @@ TAR_OPTIONS="-H posix"
 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 $?
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "# Display label
-# Display label: unlabeled
-# Test label: success
-# Test label: failure
-# Test label: unlabeled
-# Test label, verbose: success
-# Test label, verbose: failure
-tar: Archive label mismatch
-# Test label: multiple arguments
-# Test label: wildcards
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Display label
-iamalabel
-0
-# Display label: unlabeled
-0
-# Test label: success
-0
-# Test label: failure
-1
-# Test label: unlabeled
-1
-# Test label, verbose: success
-iamalabel
-0
-# Test label, verbose: failure
-iamalabel
-1
-# Test label: multiple arguments
-0
-# Test label: wildcards
-0
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
+# 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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_77
-#AT_START_78
-at_fn_group_banner 78 'label04.at:27' \
-  "label with non-create option" "                   " 10
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "78. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+# 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "777
+755
+755
+755
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/label04.at:30:
+              { set +x
+$as_echo "$at_srcdir/extrac06.at:37:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -18028,185 +18076,209 @@ 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Volume 'New volume' does not match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+# Force umask
+umask 022
 
-              { set +x
-$as_echo "$at_srcdir/label04.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+# Make sure user's umask is honored, even if we are superuser
+TAR_OPTIONS=\"\$TAR_OPTIONS --no-same-permissions\"
 
-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
+# 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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac06.at:37"
 ( $at_check_trace;
-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 *
 
-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
+
+# 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Volume 'New volume' does not match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "777
+755
+755
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac06.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/label04.at:30:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_69
+#AT_START_70
+at_fn_group_banner 70 'extrac07.at:27' \
+  "extracting symlinks to a read-only dir" "         " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "70. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/extrac07.at:30:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac07.at:30"
 ( $at_check_trace;
-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 *
 
-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
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Volume 'New volume' does not match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Prepare the directory
+Create the archive
+Extract
+dir/
+dir/foo
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac07.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
-
+ # Testing one format is enough
 
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_78
-#AT_START_79
-at_fn_group_banner 79 'label05.at:24' \
-  "label with non-create option" "                   " 10
+#AT_STOP_70
+#AT_START_71
+at_fn_group_banner 71 'extrac08.at:33' \
+  "restoring mode on existing directory" "           " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "79. $at_setup_line: testing $at_desc ..."
+  $as_echo "71. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -18214,65 +18286,58 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/label05.at:27:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/extrac08.at:36:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Archive not labeled to match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/label05.at:27:
+$as_echo "$at_srcdir/extrac08.at:36:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -18281,16 +18346,16 @@ 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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -18300,37 +18365,81 @@ 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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Archive not labeled to match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
+755
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/extrac08.at:36:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
+
+umask 000
+mkdir dir
+chmod 755 dir
+echo bla > dir/file
+tar cf test.tar dir
+chmod 700 dir
+tar xfv test.tar --warning=no-timestamp
+genfile --stat=mode.777 dir
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
+
+umask 000
+mkdir dir
+chmod 755 dir
+echo bla > dir/file
+tar cf test.tar dir
+chmod 700 dir
+tar xfv test.tar --warning=no-timestamp
+genfile --stat=mode.777 dir
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/label05.at:27:
+$as_echo "$at_srcdir/extrac08.at:36:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -18339,16 +18448,16 @@ 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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -18358,50 +18467,94 @@ 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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "# Create volume
-# Update: wrong label
-tar: Archive not labeled to match 'My volume'
-tar: Error is not recoverable: exiting now
-# Update: right label
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Create volume
-# Update: wrong label
-2
-# Update: right label
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
+755
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/extrac08.at:36:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_79
-#AT_START_80
-at_fn_group_banner 80 'incremental.at:23' \
-  "incremental" "                                    " 11
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac08.at:36"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/file
+755
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac08.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_71
+#AT_START_72
+at_fn_group_banner 72 'extrac09.at:34' \
+  "extracting even when . and .. are unreadable" "   " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "80. $at_setup_line: testing $at_desc ..."
+  $as_echo "72. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -18409,7 +18562,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/incremental.at:26:
+$as_echo "$at_srcdir/extrac09.at:37:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -18418,34 +18571,31 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 && exit 77
 
-# If the time of an initial backup and the creation time of a file contained
-# in that backup are the same, the file will be backed up again when an
-# incremental backup is done, because the incremental backup backs up
-# files created \"on or after\" the initial backup time.  Without the sleep
-# command, behaviour of tar becomes variable, depending whether the system
-# clock ticked over to the next second between creating the file and
-# backing it up.
-sleep 1
 
-tar cf archive --listed=list structure
-tar cfv archive --listed=list structure
-echo separator
-# ReiserFS often offsets the timestamps of newly created files
-# 1 second to the past.  Try to compensate for it, until a better
-# solution is found.
-sleep 2
-echo y >structure/file
-tar cfv archive --listed=list structure
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/extract
+genfile --file dir/sub/f
+cd dir/sub
+
+tar -cf archive.tar f
+
+chmod a-r . ..
+tar -xvf archive.tar -C extract f
+status=\$?
+chmod a+r . ..
+cmp f extract/f || status=\$?
+exit \$status
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac09.at:37"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -18455,220 +18605,266 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-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
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 && exit 77
 
-# If the time of an initial backup and the creation time of a file contained
-# in that backup are the same, the file will be backed up again when an
-# incremental backup is done, because the incremental backup backs up
-# files created "on or after" the initial backup time.  Without the sleep
-# command, behaviour of tar becomes variable, depending whether the system
-# clock ticked over to the next second between creating the file and
-# backing it up.
-sleep 1
 
-tar cf archive --listed=list structure
-tar cfv archive --listed=list structure
-echo separator
-# ReiserFS often offsets the timestamps of newly created files
-# 1 second to the past.  Try to compensate for it, until a better
-# solution is found.
-sleep 2
-echo y >structure/file
-tar cfv archive --listed=list structure
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/extract
+genfile --file dir/sub/f
+cd dir/sub
+
+tar -cf archive.tar f
+
+chmod a-r . ..
+tar -xvf archive.tar -C extract f
+status=$?
+chmod a+r . ..
+cmp f extract/f || status=$?
+exit $status
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "structure/
-separator
-structure/
-structure/file
+echo >>"$at_stdout"; $as_echo "f
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac09.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incremental.at:26:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_72
+#AT_START_73
+at_fn_group_banner 73 'extrac10.at:29' \
+  "-C and delayed setting of metadata" "             " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "73. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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 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
+mkdir d x x/y
+echo foo >d/d1
+echo bar >e
 
-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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac10.at:32"
 ( $at_check_trace;
-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 *
 
-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
+mkdir d x x/y
+echo foo >d/d1
+echo bar >e
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "structure/
-separator
-structure/
-structure/file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac10.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incremental.at:26:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_73
+#AT_START_74
+at_fn_group_banner 74 'extrac11.at:25' \
+  "scarce file descriptors" "                        " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "74. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/extrac11.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 *
 
-mkdir structure
-echo x >structure/file
+exec </dev/null
+dirs='a
+      a/b
+      a/b/c
+      a/b/c/d
+      a/b/c/d/e
+      a/b/c/d/e/f
+      a/b/c/d/e/f/g
+      a/b/c/d/e/f/g/h
+      a/b/c/d/e/f/g/h/i
+      a/b/c/d/e/f/g/h/i/j
+      a/b/c/d/e/f/g/h/i/j/k
+'
+files=
+mkdir \$dirs dest1 dest2 dest3 || exit
+for dir in \$dirs; do
+  for file in X Y Z; do
+    echo \$file >\$dir/\$file || exit
+    files=\"\$files \$file\"
+  done
+done
 
-# 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
+# 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
 
-# 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
+# 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
 
-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
+# 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; }
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac11.at:28"
 ( $at_check_trace;
-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 *
 
-mkdir structure
-echo x >structure/file
+exec </dev/null
+dirs='a
+      a/b
+      a/b/c
+      a/b/c/d
+      a/b/c/d/e
+      a/b/c/d/e/f
+      a/b/c/d/e/f/g
+      a/b/c/d/e/f/g/h
+      a/b/c/d/e/f/g/h/i
+      a/b/c/d/e/f/g/h/i/j
+      a/b/c/d/e/f/g/h/i/j/k
+'
+files=
+mkdir $dirs dest1 dest2 dest3 || exit
+for dir in $dirs; do
+  for file in X Y Z; do
+    echo $file >$dir/$file || exit
+    files="$files $file"
+  done
+done
 
-# 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
+# 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
 
-# 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
+# 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
 
-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
+# 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; }
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "structure/
-separator
-structure/
-structure/file
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac11.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -18679,14 +18875,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_80
-#AT_START_81
-at_fn_group_banner 81 'incr01.at:27' \
-  "restore broken symlinks from incremental" "       " 11
+#AT_STOP_74
+#AT_START_75
+at_fn_group_banner 75 'extrac12.at:25' \
+  "extract dot permissions" "                        " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "81. $at_setup_line: testing $at_desc ..."
+  $as_echo "75. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -18694,7 +18890,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/incr01.at:30:
+$as_echo "$at_srcdir/extrac12.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -18703,20 +18899,17 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+mkdir src dst
+echo file1 >src/file1
+echo file2 >src/file2
+chmod a-w src
 
-tar xvfg archive.0 /dev/null --warning=no-timestamp
-echo separator
-tar xvfg archive.1 /dev/null --warning=no-timestamp
+tar --no-recursion -cf archive.tar -C src . ./file1 file2 &&
+tar -xf archive.tar -C dst &&
+cmp src/file1 dst/file1 &&
+cmp src/file2 dst/file2
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac12.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -18726,153 +18919,118 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-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
+mkdir src dst
+echo file1 >src/file1
+echo file2 >src/file2
+chmod a-w src
 
-tar xvfg archive.0 /dev/null --warning=no-timestamp
-echo separator
-tar xvfg archive.1 /dev/null --warning=no-timestamp
+tar --no-recursion -cf archive.tar -C src . ./file1 file2 &&
+tar -xf archive.tar -C dst &&
+cmp src/file1 dst/file1 &&
+cmp src/file2 dst/file2
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/bar
-separator
-directory/
-tar: Deleting 'directory/bar'
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac12.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incr01.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
-
-mkdir directory
-\$as_ln_s foo directory/bar
 
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_75
+#AT_START_76
+at_fn_group_banner 76 'extrac13.at:26' \
+  "extract over symlinks" "                          " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "76. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/bar
-separator
-directory/
-tar: Deleting 'directory/bar'
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incr01.at:30:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/extrac13.at:29:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-\$as_ln_s foo directory/bar
+mkdir src dst1 dst2 dst3
+echo file1 >src/file1
+ln -s target1 dst1/file1
+echo target1 >dst1/target1
+echo target1 >target1
 
-tar -cf archive.0 -g db directory
-rm directory/bar
-tar -cf archive.1 -g db directory
+tar -cf archive.tar -C src . &&
+tar -xf archive.tar -C dst1 --warning=no-timestamp &&
+diff src/file1 dst1/file1 &&
+diff target1 dst1/target1
 
-mv directory orig
+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
 
-tar xvfg archive.0 /dev/null --warning=no-timestamp
-echo separator
-tar xvfg archive.1 /dev/null --warning=no-timestamp
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac13.at:29"
 ( $at_check_trace;
-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 *
 
-mkdir directory
-$as_ln_s foo directory/bar
+mkdir src dst1 dst2 dst3
+echo file1 >src/file1
+ln -s target1 dst1/file1
+echo target1 >dst1/target1
+echo target1 >target1
 
-tar -cf archive.0 -g db directory
-rm directory/bar
-tar -cf archive.1 -g db directory
+tar -cf archive.tar -C src . &&
+tar -xf archive.tar -C dst1 --warning=no-timestamp &&
+diff src/file1 dst1/file1 &&
+diff target1 dst1/target1
 
-mv directory orig
+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
 
-tar xvfg archive.0 /dev/null --warning=no-timestamp
-echo separator
-tar xvfg archive.1 /dev/null --warning=no-timestamp
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/bar
-separator
-directory/
-tar: Deleting 'directory/bar'
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac13.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -18883,14 +19041,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_81
-#AT_START_82
-at_fn_group_banner 82 'incr02.at:32' \
-  "restoring timestamps from incremental" "          " 11
+#AT_STOP_76
+#AT_START_77
+at_fn_group_banner 77 'extrac14.at:25' \
+  "extract -C symlink" "                             " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "82. $at_setup_line: testing $at_desc ..."
+  $as_echo "77. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -18898,7 +19056,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/incr02.at:35:
+$as_echo "$at_srcdir/extrac14.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -18907,43 +19065,14 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-# 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 -
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac14.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -18953,250 +19082,111 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-# 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 -
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac14.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incr02.at:35:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
-
-# 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 -
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
-
-# 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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_77
+#AT_START_78
+at_fn_group_banner 78 'extrac15.at:25' \
+  "extract parent mkdir failure" "                   " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "78. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-# 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 -
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/incr02.at:35:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/extrac15.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-# 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
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 && exit 77
 
-# Wait enough time for timestamps to differ in case of failure.
-sleep 5
 
-# Restore the directory
-tar -xf archive dir
+mkdir src src/a src/a/b dest dest/a
+touch src/a/b/c
+chmod a-w dest/a
 
-# Check the timestamp
-genfile --stat=mtime dir/subdir1 | diff ts -
+tar -cf archive.tar -C src a/b/c &&
+if tar -xf archive.tar -C dest a/b/c
+then (exit 1)
+else (exit 0)
+fi
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac15.at:28"
 ( $at_check_trace;
-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 *
 
-# 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
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 && exit 77
 
-# Wait enough time for timestamps to differ in case of failure.
-sleep 5
 
-# Restore the directory
-tar -xf archive dir
+mkdir src src/a src/a/b dest dest/a
+touch src/a/b/c
+chmod a-w dest/a
 
-# Check the timestamp
-genfile --stat=mtime dir/subdir1 | diff ts -
+tar -cf archive.tar -C src a/b/c &&
+if tar -xf archive.tar -C dest a/b/c
+then (exit 1)
+else (exit 0)
+fi
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stderr"; $as_echo "tar: a/b: Cannot mkdir: Permission denied
+tar: a/b/c: Cannot open: No such file or directory
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac15.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -19207,14 +19197,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_82
-#AT_START_83
-at_fn_group_banner 83 'listed01.at:26' \
-  "--listed for individual files" "                  " 11
+#AT_STOP_78
+#AT_START_79
+at_fn_group_banner 79 'extrac16.at:26' \
+  "extract empty directory with -C" "                " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "83. $at_setup_line: testing $at_desc ..."
+  $as_echo "79. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -19222,7 +19212,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/listed01.at:29:
+$as_echo "$at_srcdir/extrac16.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -19231,32 +19221,13 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+mkdir src src/a src/a/b dest
+touch src/a/c
 
-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 -cf archive.tar -C src a &&
+tar -xf archive.tar -C dest
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac16.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -19266,46 +19237,103 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-genfile --length 10240 --pattern zeros --file directory/file1
-# Let the things settle
-sleep 1
+mkdir src src/a src/a/b dest
+touch src/a/c
 
-tar --create \
-    --file=archive.1 \
-    --listed-incremental=listing \
-    directory/file*
+tar -cf archive.tar -C src a &&
+tar -xf archive.tar -C dest
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac16.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_79
+#AT_START_80
+at_fn_group_banner 80 'extrac17.at:21' \
+  "name matching/transformation ordering" "          " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "80. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-tar tf archive.2 || exit 1
+
+
+# Description: Tar 1.24 changed the ordering of name matching and
+# name transformation so that the former saw already transformed
+# file names (see commit 9c194c99 and exclude06.at).  This reverted
+# ordering made it impossible to match file names in certain cases.
+# In particular, the testcase below would not extract anything.
+#
+# Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
+# References: <x6r5fd9jye@gzp>, <20101026175126.29028@Pirx.gnu.org.ua>
+#             http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00047.html
+
+
+
+  { set +x
+$as_echo "$at_srcdir/extrac17.at:34:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
+
+tar cf dir.tar dir
+
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
+  dir/subdir1/
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H v7"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
+
+tar cf dir.tar dir
+
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \
+  dir/subdir1/
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/file1
-separator
-directory/file2
+echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/listed01.at:29:
+$as_echo "$at_srcdir/extrac17.at:34:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -19314,32 +19342,16 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
 
-echo \"separator\"
-cp listing listing.old
-tar --create \\
-    --file=archive.2 \\
-    --listed-incremental=listing \\
-    directory/file* || exit 1
+tar cf dir.tar dir
 
-tar tf archive.2 || exit 1
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
+  dir/subdir1/
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -19349,67 +19361,126 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-genfile --length 10240 --pattern zeros --file directory/file1
-# Let the things settle
-sleep 1
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
 
-tar --create \
-    --file=archive.1 \
-    --listed-incremental=listing \
-    directory/file*
+tar cf dir.tar dir
 
-tar tf archive.1 || exit 1
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \
+  dir/subdir1/
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-sleep 2
+              { set +x
+$as_echo "$at_srcdir/extrac17.at:34:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-genfile --length 10240 --pattern zeros --file directory/file2
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
 
-echo "separator"
-cp listing listing.old
-tar --create \
-    --file=archive.2 \
-    --listed-incremental=listing \
-    directory/file* || exit 1
+tar cf dir.tar dir
 
-tar tf archive.2 || exit 1
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
+  dir/subdir1/
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+( $at_check_trace;
+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/
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/file1
-separator
-directory/file2
+echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_83
-#AT_START_84
-at_fn_group_banner 84 'listed02.at:28' \
-  "working --listed" "                               " 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "84. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
+  dir/subdir1/
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+( $at_check_trace;
+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/
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/listed02.at:31:
+              { set +x
+$as_echo "$at_srcdir/extrac17.at:34:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -19418,540 +19489,328 @@ 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
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar cf dir.tar dir
 
-echo Create directories
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \\
+  dir/subdir1/
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac17.at:34"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-mkdir tart
-sleep 1
-mkdir tart/c0
-sleep 1
-mkdir tart/c1
-sleep 1
+mkdir dir dir/subdir1 dir/subdir2 out
+genfile --file dir/subdir1/file1
+genfile --file dir/subdir2/file2
 
-for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
-do
-  echo File \$file > \$file
-  sleep 1
-done
+tar cf dir.tar dir
 
-sleep 1
-echo Creating main archive
-echo >&2 \"Creating main archive\"
-tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+tar -x -v -f dir.tar -C out --strip-components=2 --warning=no-timestamp \
+  dir/subdir1/
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/subdir1/file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac17.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-# The above prints two lines to stderr announcing the new directories c0 and c1.
-# Ensure that they appear in this script's stderr in sorted order.
-sort err 1>&2; rm -f err
 
-sleep 1
-echo Modifying filesystem
-rm tart/a1
 
-mv tart/b1 tart/b2
-mv tart/c1 tart/c2
-touch tart/c2/ca3
 
-echo Directory contents
-find tart -print | sort 2>/dev/null
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_80
+#AT_START_81
+at_fn_group_banner 81 'extrac18.at:34' \
+  "keep-old-files" "                                 " 9
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "81. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-sleep 1
-echo Creating incremental archive
-echo >&2 \"Creating incremental archive\"
-cp -p tart.incr1 tart.incr2
-tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
 
-sleep 1
 
-rm -rf tart/*
-echo Extracting main archive
-echo >&2 \"Extracting main archive\"
-tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
-echo Extracting incremental archive
-# This command should produce three messages about deletion
-# of the existing files, that may appear in any order. Piping
-# to sort makes sure we don't depend on any particular ordering.
-tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
 
-echo Final files:
-find tart -print | sort 2>/dev/null
+
+  { set +x
+$as_echo "$at_srcdir/extrac18.at:37:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
+
+tar cf ../archive .
+
+rm b
+echo 'File a' > a
+
+tar -x -k -f ../archive
+echo status=\$?
+
+cat a
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 'Old file a' > a
+echo 'Old file b' > b
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar cf ../archive .
 
-echo Create directories
+rm b
+echo 'File a' > a
 
-mkdir tart
-sleep 1
-mkdir tart/c0
-sleep 1
-mkdir tart/c1
-sleep 1
+tar -x -k -f ../archive
+echo status=$?
 
-for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
-do
-  echo File $file > $file
-  sleep 1
-done
+cat a
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "status=2
+File a
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-sleep 1
-echo Creating main archive
-echo >&2 "Creating main archive"
-tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+              { set +x
+$as_echo "$at_srcdir/extrac18.at:37:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-# The above prints two lines to stderr announcing the new directories c0 and c1.
-# Ensure that they appear in this script's stderr in sorted order.
-sort err 1>&2; rm -f err
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-sleep 1
-echo Modifying filesystem
-rm tart/a1
+tar cf ../archive .
 
-mv tart/b1 tart/b2
-mv tart/c1 tart/c2
-touch tart/c2/ca3
+rm b
+echo 'File a' > a
 
-echo Directory contents
-find tart -print | sort 2>/dev/null
+tar -x -k -f ../archive
+echo status=\$?
 
-sleep 1
-echo Creating incremental archive
-echo >&2 "Creating incremental archive"
-cp -p tart.incr1 tart.incr2
-tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+cat a
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-sleep 1
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-rm -rf tart/*
-echo Extracting main archive
-echo >&2 "Extracting main archive"
-tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
-echo Extracting incremental archive
-# This command should produce three messages about deletion
-# of the existing files, that may appear in any order. Piping
-# to sort makes sure we don't depend on any particular ordering.
-tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+tar cf ../archive .
 
-echo Final files:
-find tart -print | sort 2>/dev/null
+rm b
+echo 'File a' > a
+
+tar -x -k -f ../archive
+echo status=$?
+
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating main archive
-tar: tart/c0: Directory is new
-tar: tart/c1: Directory is new
-tar: tart: Directory is new
-Creating incremental archive
-tar: tart/c2: Directory has been renamed from 'tart/c1'
-Extracting main archive
+echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Create directories
-Creating main archive
-tart/
-tart/c0/
-tart/c1/
-tart/a1
-tart/b1
-tart/c0/cq1
-tart/c0/cq2
-tart/c1/ca1
-tart/c1/ca2
-Modifying filesystem
-Directory contents
-tart
-tart/b2
-tart/c0
-tart/c0/cq1
-tart/c0/cq2
-tart/c2
-tart/c2/ca1
-tart/c2/ca2
-tart/c2/ca3
-Creating incremental archive
-tart/
-tart/c0/
-tart/c2/
-tart/b2
-tart/c2/ca3
-Extracting main archive
-tart/
-tart/c0/
-tart/c1/
-tart/a1
-tart/b1
-tart/c0/cq1
-tart/c0/cq2
-tart/c1/ca1
-tart/c1/ca2
-Extracting incremental archive
-tar: Deleting 'tart/a1'
-tar: Deleting 'tart/b1'
-tart/
-tart/b2
-tart/c0/
-tart/c2/
-tart/c2/ca3
-Final files:
-tart
-tart/b2
-tart/c0
-tart/c0/cq1
-tart/c0/cq2
-tart/c2
-tart/c2/ca1
-tart/c2/ca2
-tart/c2/ca3
+echo >>"$at_stdout"; $as_echo "status=2
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/listed02.at:31:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/extrac18.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 *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-echo Create directories
-
-mkdir tart
-sleep 1
-mkdir tart/c0
-sleep 1
-mkdir tart/c1
-sleep 1
-
-for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
-do
-  echo File \$file > \$file
-  sleep 1
-done
-
-sleep 1
-echo Creating main archive
-echo >&2 \"Creating main archive\"
-tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
-
-# The above prints two lines to stderr announcing the new directories c0 and c1.
-# Ensure that they appear in this script's stderr in sorted order.
-sort err 1>&2; rm -f err
-
-sleep 1
-echo Modifying filesystem
-rm tart/a1
-
-mv tart/b1 tart/b2
-mv tart/c1 tart/c2
-touch tart/c2/ca3
-
-echo Directory contents
-find tart -print | sort 2>/dev/null
-
-sleep 1
-echo Creating incremental archive
-echo >&2 \"Creating incremental archive\"
-cp -p tart.incr1 tart.incr2
-tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+tar cf ../archive .
 
-sleep 1
+rm b
+echo 'File a' > a
 
-rm -rf tart/*
-echo Extracting main archive
-echo >&2 \"Extracting main archive\"
-tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
-echo Extracting incremental archive
-# This command should produce three messages about deletion
-# of the existing files, that may appear in any order. Piping
-# to sort makes sure we don't depend on any particular ordering.
-tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+tar -x -k -f ../archive
+echo status=\$?
 
-echo Final files:
-find tart -print | sort 2>/dev/null
+cat a
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
 ( $at_check_trace;
-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 *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-echo Create directories
-
-mkdir tart
-sleep 1
-mkdir tart/c0
-sleep 1
-mkdir tart/c1
-sleep 1
-
-for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
-do
-  echo File $file > $file
-  sleep 1
-done
-
-sleep 1
-echo Creating main archive
-echo >&2 "Creating main archive"
-tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
-
-# The above prints two lines to stderr announcing the new directories c0 and c1.
-# Ensure that they appear in this script's stderr in sorted order.
-sort err 1>&2; rm -f err
-
-sleep 1
-echo Modifying filesystem
-rm tart/a1
-
-mv tart/b1 tart/b2
-mv tart/c1 tart/c2
-touch tart/c2/ca3
-
-echo Directory contents
-find tart -print | sort 2>/dev/null
-
-sleep 1
-echo Creating incremental archive
-echo >&2 "Creating incremental archive"
-cp -p tart.incr1 tart.incr2
-tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+tar cf ../archive .
 
-sleep 1
+rm b
+echo 'File a' > a
 
-rm -rf tart/*
-echo Extracting main archive
-echo >&2 "Extracting main archive"
-tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
-echo Extracting incremental archive
-# This command should produce three messages about deletion
-# of the existing files, that may appear in any order. Piping
-# to sort makes sure we don't depend on any particular ordering.
-tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+tar -x -k -f ../archive
+echo status=$?
 
-echo Final files:
-find tart -print | sort 2>/dev/null
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating main archive
-tar: tart/c0: Directory is new
-tar: tart/c1: Directory is new
-tar: tart: Directory is new
-Creating incremental archive
-tar: tart/c2: Directory has been renamed from 'tart/c1'
-Extracting main archive
+echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Create directories
-Creating main archive
-tart/
-tart/c0/
-tart/c1/
-tart/a1
-tart/b1
-tart/c0/cq1
-tart/c0/cq2
-tart/c1/ca1
-tart/c1/ca2
-Modifying filesystem
-Directory contents
-tart
-tart/b2
-tart/c0
-tart/c0/cq1
-tart/c0/cq2
-tart/c2
-tart/c2/ca1
-tart/c2/ca2
-tart/c2/ca3
-Creating incremental archive
-tart/
-tart/c0/
-tart/c2/
-tart/b2
-tart/c2/ca3
-Extracting main archive
-tart/
-tart/c0/
-tart/c1/
-tart/a1
-tart/b1
-tart/c0/cq1
-tart/c0/cq2
-tart/c1/ca1
-tart/c1/ca2
-Extracting incremental archive
-tar: Deleting 'tart/a1'
-tar: Deleting 'tart/b1'
-tart/
-tart/b2
-tart/c0/
-tart/c2/
-tart/c2/ca3
-Final files:
-tart
-tart/b2
-tart/c0
-tart/c0/cq1
-tart/c0/cq2
-tart/c2
-tart/c2/ca1
-tart/c2/ca2
-tart/c2/ca3
+echo >>"$at_stdout"; $as_echo "status=2
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_84
-#AT_START_85
-at_fn_group_banner 85 'listed03.at:24' \
-  "incremental dump when the parent directory is unreadable" "" 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "85. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/listed03.at:27:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/extrac18.at:37:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 && exit 77
+tar cf ../archive .
 
+rm b
+echo 'File a' > a
 
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/a
-genfile --file dir/sub/a/file
-cd dir/sub
+tar -x -k -f ../archive
+echo status=\$?
 
-chmod a-r ..
-tar -c -f archive.tar --listed-incremental=db.1 -v a
-status=\$?
-chmod a+r ..
-exit \$status
+cat a
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "listed03.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
 ( $at_check_trace;
-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 *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 && exit 77
+tar cf ../archive .
 
+rm b
+echo 'File a' > a
 
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/a
-genfile --file dir/sub/a/file
-cd dir/sub
+tar -x -k -f ../archive
+echo status=$?
 
-chmod a-r ..
-tar -c -f archive.tar --listed-incremental=db.1 -v a
-status=$?
-chmod a+r ..
-exit $status
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
+echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "a/
-a/file
+echo >>"$at_stdout"; $as_echo "status=2
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed03.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_85
-#AT_START_86
-at_fn_group_banner 86 'listed04.at:26' \
-  "--listed-incremental and --one-file-system" "     " 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "86. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/listed04.at:29:
+              { set +x
+$as_echo "$at_srcdir/extrac18.at:37:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -19960,15 +19819,22 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
 mkdir dir
-echo a >dir/a
-echo b >dir/b
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-tar --one-file-system -cvf archive.tar -g archive.incr dir || exit
-tar -tf archive.tar || exit
+tar cf ../archive .
+
+rm b
+echo 'File a' > a
+
+tar -x -k -f ../archive
+echo status=\$?
+
+cat a
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "listed04.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac18.at:37"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -19978,29 +19844,33 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-
 mkdir dir
-echo a >dir/a
-echo b >dir/b
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-tar --one-file-system -cvf archive.tar -g archive.incr dir || exit
-tar -tf archive.tar || exit
+tar cf ../archive .
+
+rm b
+echo 'File a' > a
+
+tar -x -k -f ../archive
+echo status=$?
+
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
+echo >>"$at_stderr"; $as_echo "tar: ./a: Cannot open: File exists
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/a
-dir/b
-dir/
-dir/a
-dir/b
+echo >>"$at_stdout"; $as_echo "status=2
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed04.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac18.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -20011,14 +19881,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_86
-#AT_START_87
-at_fn_group_banner 87 'listed05.at:33' \
-  "--listed-incremental and remounted directories" " " 11
+#AT_STOP_81
+#AT_START_82
+at_fn_group_banner 82 'extrac19.at:21' \
+  "skip-old-files" "                                 " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "87. $at_setup_line: testing $at_desc ..."
+  $as_echo "82. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -20026,345 +19896,193 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/listed05.at:36:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/extrac19.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+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
-
-options=\"-C tartest --create --one-file-system --verbose\"
-rm -rf archive-01.snar archive-01.tar tartest subdir
-
-# Create initial structure
-mkdir tartest
-echo \"hi\" > tartest/top-level-file
-mkdir tartest/subdir
-echo \"hi\" > tartest/subdir/subdir-file
-
-echo \"# Level 0\"
-tar \$options --file archive-0.tar --listed-incremental=archive-0.snar .
+tar cf ../archive .
 
-echo \"# Remount\"
-mv tartest/subdir .
-mkdir tartest/subdir
-mount -t ramfs none tartest/subdir || exit 77
-tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
+rm b
+echo 'File a' > a
 
-echo \"# Level 1\"
-cp archive-0.snar archive-1.snar
-tar \$options --file archive-1.tar --listed-incremental=archive-1.snar .
+tar -x --skip-old-files -f ../archive
+echo status=\$?
 
-umount tartest/subdir
+cat a
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "listed05.at:36"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 '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
-
-options="-C tartest --create --one-file-system --verbose"
-rm -rf archive-01.snar archive-01.tar tartest subdir
-
-# Create initial structure
-mkdir tartest
-echo "hi" > tartest/top-level-file
-mkdir tartest/subdir
-echo "hi" > tartest/subdir/subdir-file
-
-echo "# Level 0"
-tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
+tar cf ../archive .
 
-echo "# Remount"
-mv tartest/subdir .
-mkdir tartest/subdir
-mount -t ramfs none tartest/subdir || exit 77
-tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
+rm b
+echo 'File a' > a
 
-echo "# Level 1"
-cp archive-0.snar archive-1.snar
-tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
+tar -x --skip-old-files -f ../archive
+echo status=$?
 
-umount tartest/subdir
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: .: Directory is new
-tar: ./subdir: Directory is new
-tar: ./subdir: directory is on a different filesystem; not dumped
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "# Level 0
-./
-./subdir/
-./top-level-file
-./subdir/subdir-file
-# Remount
-# Level 1
-./
-./subdir/
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "status=0
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/listed05.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_87
-#AT_START_88
-at_fn_group_banner 88 'incr03.at:28' \
-  "renamed files in incrementals" "                  " 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "88. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/incr03.at:31:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/extrac19.at:24:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-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
+tar cf ../archive .
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+rm b
+echo 'File a' > a
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=\$?
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+cat a
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-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
+tar cf ../archive .
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+rm b
+echo 'File a' > a
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=$?
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Listing of archive.1
-directory/
-directory/x
-directory/y
-Listing of archive.2
-directory/
-directory/z
-Directory after first restore
-directory
-directory/x
-directory/y
-Directory after second restore
-directory
-directory/y
-directory/z
+echo >>"$at_stdout"; $as_echo "status=0
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr03.at:31:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/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
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-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
+tar cf ../archive .
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+rm b
+echo 'File a' > a
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=\$?
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+cat a
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
 ( $at_check_trace;
-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 *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-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
+tar cf ../archive .
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+rm b
+echo 'File a' > a
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=$?
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Listing of archive.1
-directory/
-directory/x
-directory/y
-Listing of archive.2
-directory/
-directory/z
-Directory after first restore
-directory
-directory/x
-directory/y
-Directory after second restore
-directory
-directory/y
-directory/z
+echo >>"$at_stdout"; $as_echo "status=0
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr03.at:31:
+$as_echo "$at_srcdir/extrac19.at:24:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -20373,37 +20091,22 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-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
+tar cf ../archive .
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+rm b
+echo 'File a' > a
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=\$?
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+cat a
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -20413,58 +20116,92 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar cf ../archive .
 
-mkdir directory
-genfile --file=directory/x
-genfile --file=directory/y
+rm b
+echo 'File a' > a
 
-sleep 1
+tar -x --skip-old-files -f ../archive
+echo status=$?
 
-tar -cf archive.1 -g db directory
+cat a
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "status=0
+File a
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-mv directory/x directory/z
-cp db db.old
-tar -cf archive.2 -g db directory
+              { set +x
+$as_echo "$at_srcdir/extrac19.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-mv directory orig
+mkdir dir
+cd dir
+echo 'Old file a' > a
+echo 'Old file b' > b
 
-echo Listing of archive.1
-tar -tf archive.1 | sort
-echo Listing of archive.2
-tar -tf archive.2 | sort
+tar cf ../archive .
 
-echo Directory after first restore
-tar -xf archive.1 -g db --warning=no-timestamp
-find directory | sort
+rm b
+echo 'File a' > a
 
-echo Directory after second restore
-tar -xf archive.2 -g db --warning=no-timestamp
-find directory | sort
+tar -x --skip-old-files -f ../archive
+echo status=\$?
+
+cat a
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "extrac19.at:24"
+( $at_check_trace;
+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=$?
+
+cat a
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Listing of archive.1
-directory/
-directory/x
-directory/y
-Listing of archive.2
-directory/
-directory/z
-Directory after first restore
-directory
-directory/x
-directory/y
-Directory after second restore
-directory
-directory/y
-directory/z
+echo >>"$at_stdout"; $as_echo "status=0
+File a
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/extrac19.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -20475,236 +20212,68 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_88
-#AT_START_89
-at_fn_group_banner 89 'incr04.at:29' \
-  "proper icontents initialization" "                " 11
+#AT_STOP_82
+#AT_START_83
+at_fn_group_banner 83 'backup01.at:33' \
+  "extracting existing dir with --backup" "          " 9
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "89. $at_setup_line: testing $at_desc ..."
+  $as_echo "83. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-
-
   { set +x
-$as_echo "$at_srcdir/incr04.at:34:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/backup01.at:36:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-
-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
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-
-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
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
-tar: a/b: Directory is new
-tar: a/c: Directory has been renamed from 'a/b'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Initial dump
-a/
-a/b/
-a/b/one_31_chars_long_file_name_001
-a/b/one_31_chars_long_file_name_002
-a/b/one_31_chars_long_file_name_003
-a/b/one_31_chars_long_file_name_004
-a/b/one_31_chars_long_file_name_005
-a/b/one_31_chars_long_file_name_006
-a/b/one_31_chars_long_file_name_007
-a/b/one_31_chars_long_file_name_008
-a/b/one_31_chars_long_file_name_009
-a/b/one_31_chars_long_file_name_010
-a/b/one_31_chars_long_file_name_011
-a/b/one_31_chars_long_file_name_012
-a/b/one_31_chars_long_file_name_013
-a/b/one_31_chars_long_file_name_014
-a/b/one_31_chars_long_file_name_015
-a/b/one_31_chars_long_file_name_016
-a/b/one_31_chars_long_file_name_017
-a/b/one_31_chars_long_file_name_018
-a/b/one_31_chars_long_file_name_019
-a/b/one_31_chars_long_file_name_020
-a/b/one_31_chars_long_file_name_021
-a/b/one_31_chars_long_file_name_022
-a/b/one_31_chars_long_file_name_023
-a/b/one_31_chars_long_file_name_024
-a/b/one_31_chars_long_file_name_025
-a/b/one_31_chars_long_file_name_026
-a/b/one_31_chars_long_file_name_027
-a/b/one_31_chars_long_file_name_028
-a/b/one_31_chars_long_file_name_029
-a/b/one_31_chars_long_file_name_030
-a/b/one_31_chars_long_file_name_031
-a/b/one_31_chars_long_file_name_032
-a/b/one_31_chars_long_file_name_033
-a/b/one_31_chars_long_file_name_034
-a/b/one_31_chars_long_file_name_035
-a/b/one_31_chars_long_file_name_036
-a/b/one_31_chars_long_file_name_037
-a/b/one_31_chars_long_file_name_038
-a/b/one_31_chars_long_file_name_039
-a/b/one_31_chars_long_file_name_040
-a/b/one_31_chars_long_file_name_041
-a/b/one_31_chars_long_file_name_042
-a/b/one_31_chars_long_file_name_043
-a/b/one_31_chars_long_file_name_044
-a/b/one_31_chars_long_file_name_045
-a/b/one_31_chars_long_file_name_046
-a/b/one_31_chars_long_file_name_047
-a/b/one_31_chars_long_file_name_048
-a/b/one_31_chars_long_file_name_049
-a/b/one_31_chars_long_file_name_050
-a/b/one_31_chars_long_file_name_051
-a/b/one_31_chars_long_file_name_052
-a/b/one_31_chars_long_file_name_053
-a/b/one_31_chars_long_file_name_054
-a/b/one_31_chars_long_file_name_055
-a/b/one_31_chars_long_file_name_056
-a/b/one_31_chars_long_file_name_057
-a/b/one_31_chars_long_file_name_058
-a/b/one_31_chars_long_file_name_059
-a/b/one_31_chars_long_file_name_060
-a/b/one_31_chars_long_file_name_061
-a/b/one_31_chars_long_file_name_062
-a/b/one_31_chars_long_file_name_063
-a/b/one_31_chars_long_file_name_064
-a/b/one_31_chars_long_file_name_065
-a/b/one_31_chars_long_file_name_066
-a/b/one_31_chars_long_file_name_067
-a/b/one_31_chars_long_file_name_068
-a/b/one_31_chars_long_file_name_069
-a/b/one_31_chars_long_file_name_070
-a/b/one_31_chars_long_file_name_071
-a/b/one_31_chars_long_file_name_072
-a/b/one_31_chars_long_file_name_073
-a/b/one_31_chars_long_file_name_074
-a/b/one_31_chars_long_file_name_075
-a/b/one_31_chars_long_file_name_076
-a/b/one_31_chars_long_file_name_077
-a/b/one_31_chars_long_file_name_078
-a/b/one_31_chars_long_file_name_079
-a/b/one_31_chars_long_file_name_080
-a/b/one_31_chars_long_file_name_081
-a/b/one_31_chars_long_file_name_082
-a/b/one_31_chars_long_file_name_083
-a/b/one_31_chars_long_file_name_084
-a/b/one_31_chars_long_file_name_085
-a/b/one_31_chars_long_file_name_086
-a/b/one_31_chars_long_file_name_087
-a/b/one_31_chars_long_file_name_088
-a/b/one_31_chars_long_file_name_089
-a/b/one_31_chars_long_file_name_090
-a/b/one_31_chars_long_file_name_091
-a/b/one_31_chars_long_file_name_092
-a/b/one_31_chars_long_file_name_093
-a/b/one_31_chars_long_file_name_094
-a/b/one_31_chars_long_file_name_095
-a/b/one_31_chars_long_file_name_096
-a/b/one_31_chars_long_file_name_097
-a/b/one_31_chars_long_file_name_098
-a/b/one_31_chars_long_file_name_099
-a/b/one_31_chars_long_file_name_100
-a/b/one_31_chars_long_file_name_101
-a/b/one_31_chars_long_file_name_102
-a/b/one_31_chars_long_file_name_103
-a/b/one_31_chars_long_file_name_104
-a/b/one_31_chars_long_file_name_105
-a/b/one_31_chars_long_file_name_106
-a/b/one_31_chars_long_file_name_107
-a/b/one_31_chars_long_file_name_108
-a/b/one_31_chars_long_file_name_109
-a/b/one_31_chars_long_file_name_110
-a/b/one_31_chars_long_file_name_111
-a/b/one_31_chars_long_file_name_112
-a/b/one_31_chars_long_file_name_113
-a/b/one_31_chars_long_file_name_114
-a/b/one_31_chars_long_file_name_115
-a/b/one_31_chars_long_file_name_116
-a/b/one_31_chars_long_file_name_117
-a/b/one_31_chars_long_file_name_118
-a/b/one_31_chars_long_file_name_119
-a/b/one_31_chars_long_file_name_120
-a/b/one_31_chars_long_file_name_121
-a/b/one_31_chars_long_file_name_122
-a/b/one_31_chars_long_file_name_123
-a/b/one_31_chars_long_file_name_124
-a/b/one_31_chars_long_file_name_125
-a/b/one_31_chars_long_file_name_126
-a/b/one_31_chars_long_file_name_127
-a/b/one_31_chars_long_file_name_128
-a/b/one_31_chars_long_file_name_129
-a/b/one_31_chars_long_file_name_130
-a/b/one_31_chars_long_file_name_131
-a/b/one_31_chars_long_file_name_132
-a/b/one_31_chars_long_file_name_133
-a/b/one_31_chars_long_file_name_134
-a/b/one_31_chars_long_file_name_135
-a/b/one_31_chars_long_file_name_136
-a/b/one_31_chars_long_file_name_137
-a/b/one_31_chars_long_file_name_138
-a/b/one_31_chars_long_file_name_139
-a/b/one_31_chars_long_file_name_140
-a/b/one_31_chars_long_file_name_141
-a/b/one_31_chars_long_file_name_142
-Incremental dump
-a/
-a/c/
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir1/
+dir1/file1
+Renaming 'dir1/file1' to 'dir1/file1~'
+dir2/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr04.at:34:
+$as_echo "$at_srcdir/backup01.at:36:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -20713,22 +20282,13 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
-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
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -20738,185 +20298,74 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir1/
+dir1/file1
+Renaming 'dir1/file1' to 'dir1/file1~'
+dir2/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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 -
+              { set +x
+$as_echo "$at_srcdir/backup01.at:36:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-sleep 1
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-echo "Initial dump"
-tar cvf a0.tar -g a.sna a
-mv a/b a/c
-echo "Incremental dump"
-tar cvf a1.tar -g a.sna a
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
-tar: a/b: Directory is new
-tar: a/c: Directory has been renamed from 'a/b'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Initial dump
-a/
-a/b/
-a/b/one_31_chars_long_file_name_001
-a/b/one_31_chars_long_file_name_002
-a/b/one_31_chars_long_file_name_003
-a/b/one_31_chars_long_file_name_004
-a/b/one_31_chars_long_file_name_005
-a/b/one_31_chars_long_file_name_006
-a/b/one_31_chars_long_file_name_007
-a/b/one_31_chars_long_file_name_008
-a/b/one_31_chars_long_file_name_009
-a/b/one_31_chars_long_file_name_010
-a/b/one_31_chars_long_file_name_011
-a/b/one_31_chars_long_file_name_012
-a/b/one_31_chars_long_file_name_013
-a/b/one_31_chars_long_file_name_014
-a/b/one_31_chars_long_file_name_015
-a/b/one_31_chars_long_file_name_016
-a/b/one_31_chars_long_file_name_017
-a/b/one_31_chars_long_file_name_018
-a/b/one_31_chars_long_file_name_019
-a/b/one_31_chars_long_file_name_020
-a/b/one_31_chars_long_file_name_021
-a/b/one_31_chars_long_file_name_022
-a/b/one_31_chars_long_file_name_023
-a/b/one_31_chars_long_file_name_024
-a/b/one_31_chars_long_file_name_025
-a/b/one_31_chars_long_file_name_026
-a/b/one_31_chars_long_file_name_027
-a/b/one_31_chars_long_file_name_028
-a/b/one_31_chars_long_file_name_029
-a/b/one_31_chars_long_file_name_030
-a/b/one_31_chars_long_file_name_031
-a/b/one_31_chars_long_file_name_032
-a/b/one_31_chars_long_file_name_033
-a/b/one_31_chars_long_file_name_034
-a/b/one_31_chars_long_file_name_035
-a/b/one_31_chars_long_file_name_036
-a/b/one_31_chars_long_file_name_037
-a/b/one_31_chars_long_file_name_038
-a/b/one_31_chars_long_file_name_039
-a/b/one_31_chars_long_file_name_040
-a/b/one_31_chars_long_file_name_041
-a/b/one_31_chars_long_file_name_042
-a/b/one_31_chars_long_file_name_043
-a/b/one_31_chars_long_file_name_044
-a/b/one_31_chars_long_file_name_045
-a/b/one_31_chars_long_file_name_046
-a/b/one_31_chars_long_file_name_047
-a/b/one_31_chars_long_file_name_048
-a/b/one_31_chars_long_file_name_049
-a/b/one_31_chars_long_file_name_050
-a/b/one_31_chars_long_file_name_051
-a/b/one_31_chars_long_file_name_052
-a/b/one_31_chars_long_file_name_053
-a/b/one_31_chars_long_file_name_054
-a/b/one_31_chars_long_file_name_055
-a/b/one_31_chars_long_file_name_056
-a/b/one_31_chars_long_file_name_057
-a/b/one_31_chars_long_file_name_058
-a/b/one_31_chars_long_file_name_059
-a/b/one_31_chars_long_file_name_060
-a/b/one_31_chars_long_file_name_061
-a/b/one_31_chars_long_file_name_062
-a/b/one_31_chars_long_file_name_063
-a/b/one_31_chars_long_file_name_064
-a/b/one_31_chars_long_file_name_065
-a/b/one_31_chars_long_file_name_066
-a/b/one_31_chars_long_file_name_067
-a/b/one_31_chars_long_file_name_068
-a/b/one_31_chars_long_file_name_069
-a/b/one_31_chars_long_file_name_070
-a/b/one_31_chars_long_file_name_071
-a/b/one_31_chars_long_file_name_072
-a/b/one_31_chars_long_file_name_073
-a/b/one_31_chars_long_file_name_074
-a/b/one_31_chars_long_file_name_075
-a/b/one_31_chars_long_file_name_076
-a/b/one_31_chars_long_file_name_077
-a/b/one_31_chars_long_file_name_078
-a/b/one_31_chars_long_file_name_079
-a/b/one_31_chars_long_file_name_080
-a/b/one_31_chars_long_file_name_081
-a/b/one_31_chars_long_file_name_082
-a/b/one_31_chars_long_file_name_083
-a/b/one_31_chars_long_file_name_084
-a/b/one_31_chars_long_file_name_085
-a/b/one_31_chars_long_file_name_086
-a/b/one_31_chars_long_file_name_087
-a/b/one_31_chars_long_file_name_088
-a/b/one_31_chars_long_file_name_089
-a/b/one_31_chars_long_file_name_090
-a/b/one_31_chars_long_file_name_091
-a/b/one_31_chars_long_file_name_092
-a/b/one_31_chars_long_file_name_093
-a/b/one_31_chars_long_file_name_094
-a/b/one_31_chars_long_file_name_095
-a/b/one_31_chars_long_file_name_096
-a/b/one_31_chars_long_file_name_097
-a/b/one_31_chars_long_file_name_098
-a/b/one_31_chars_long_file_name_099
-a/b/one_31_chars_long_file_name_100
-a/b/one_31_chars_long_file_name_101
-a/b/one_31_chars_long_file_name_102
-a/b/one_31_chars_long_file_name_103
-a/b/one_31_chars_long_file_name_104
-a/b/one_31_chars_long_file_name_105
-a/b/one_31_chars_long_file_name_106
-a/b/one_31_chars_long_file_name_107
-a/b/one_31_chars_long_file_name_108
-a/b/one_31_chars_long_file_name_109
-a/b/one_31_chars_long_file_name_110
-a/b/one_31_chars_long_file_name_111
-a/b/one_31_chars_long_file_name_112
-a/b/one_31_chars_long_file_name_113
-a/b/one_31_chars_long_file_name_114
-a/b/one_31_chars_long_file_name_115
-a/b/one_31_chars_long_file_name_116
-a/b/one_31_chars_long_file_name_117
-a/b/one_31_chars_long_file_name_118
-a/b/one_31_chars_long_file_name_119
-a/b/one_31_chars_long_file_name_120
-a/b/one_31_chars_long_file_name_121
-a/b/one_31_chars_long_file_name_122
-a/b/one_31_chars_long_file_name_123
-a/b/one_31_chars_long_file_name_124
-a/b/one_31_chars_long_file_name_125
-a/b/one_31_chars_long_file_name_126
-a/b/one_31_chars_long_file_name_127
-a/b/one_31_chars_long_file_name_128
-a/b/one_31_chars_long_file_name_129
-a/b/one_31_chars_long_file_name_130
-a/b/one_31_chars_long_file_name_131
-a/b/one_31_chars_long_file_name_132
-a/b/one_31_chars_long_file_name_133
-a/b/one_31_chars_long_file_name_134
-a/b/one_31_chars_long_file_name_135
-a/b/one_31_chars_long_file_name_136
-a/b/one_31_chars_long_file_name_137
-a/b/one_31_chars_long_file_name_138
-a/b/one_31_chars_long_file_name_139
-a/b/one_31_chars_long_file_name_140
-a/b/one_31_chars_long_file_name_141
-a/b/one_31_chars_long_file_name_142
-Incremental dump
-a/
-a/c/
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir1/
+dir1/file1
+Renaming 'dir1/file1' to 'dir1/file1~'
+dir2/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr04.at:34:
+$as_echo "$at_srcdir/backup01.at:36:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -20925,22 +20374,13 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-
-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
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -20950,68 +20390,3813 @@ 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir1/
+dir1/file1
+Renaming 'dir1/file1' to 'dir1/file1~'
+dir2/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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 -
+              { set +x
+$as_echo "$at_srcdir/backup01.at:36:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-sleep 1
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "backup01.at:36"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-echo "Initial dump"
-tar cvf a0.tar -g a.sna a
-mv a/b a/c
-echo "Incremental dump"
-tar cvf a1.tar -g a.sna a
+unset VERSION_CONTROL
+mkdir dir1 dir2
+echo bla > dir1/file1
+tar cf test.tar dir1 dir2
+tar xfv test.tar --backup --warning=no-timestamp
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
-tar: a/b: Directory is new
-tar: a/c: Directory has been renamed from 'a/b'
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir1/
+dir1/file1
+Renaming 'dir1/file1' to 'dir1/file1~'
+dir2/
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Initial dump
-a/
-a/b/
-a/b/one_31_chars_long_file_name_001
-a/b/one_31_chars_long_file_name_002
-a/b/one_31_chars_long_file_name_003
-a/b/one_31_chars_long_file_name_004
-a/b/one_31_chars_long_file_name_005
-a/b/one_31_chars_long_file_name_006
-a/b/one_31_chars_long_file_name_007
-a/b/one_31_chars_long_file_name_008
-a/b/one_31_chars_long_file_name_009
-a/b/one_31_chars_long_file_name_010
-a/b/one_31_chars_long_file_name_011
-a/b/one_31_chars_long_file_name_012
-a/b/one_31_chars_long_file_name_013
-a/b/one_31_chars_long_file_name_014
-a/b/one_31_chars_long_file_name_015
-a/b/one_31_chars_long_file_name_016
-a/b/one_31_chars_long_file_name_017
-a/b/one_31_chars_long_file_name_018
-a/b/one_31_chars_long_file_name_019
-a/b/one_31_chars_long_file_name_020
-a/b/one_31_chars_long_file_name_021
-a/b/one_31_chars_long_file_name_022
-a/b/one_31_chars_long_file_name_023
-a/b/one_31_chars_long_file_name_024
-a/b/one_31_chars_long_file_name_025
-a/b/one_31_chars_long_file_name_026
-a/b/one_31_chars_long_file_name_027
-a/b/one_31_chars_long_file_name_028
-a/b/one_31_chars_long_file_name_029
-a/b/one_31_chars_long_file_name_030
-a/b/one_31_chars_long_file_name_031
-a/b/one_31_chars_long_file_name_032
-a/b/one_31_chars_long_file_name_033
-a/b/one_31_chars_long_file_name_034
-a/b/one_31_chars_long_file_name_035
-a/b/one_31_chars_long_file_name_036
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/backup01.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_83
+#AT_START_84
+at_fn_group_banner 84 'label01.at:21' \
+  "single-volume label" "                            " 10
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "84. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/label01.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+genfile --file foo
+genfile --file bar
+tar -cf archive --label=Test foo bar
+tar tf archive
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+genfile --file foo
+genfile --file bar
+tar -cf archive --label=Test foo bar
+tar tf archive
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test
+foo
+bar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test
+foo
+bar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label01.at:24"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test
+foo
+bar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_84
+#AT_START_85
+at_fn_group_banner 85 'label02.at:21' \
+  "multi-volume label" "                             " 10
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "85. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/label02.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+exec <&-
+genfile --length 0 --file foo
+genfile --length 12288 --file bar
+genfile --length 12288 --file baz
+tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz
+tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+exec <&-
+genfile --length 0 --file foo
+genfile --length 12288 --file bar
+genfile --length 12288 --file baz
+tar --label=Test -cM -L10 -f 1.tar -f 2.tar -f 3.tar -f 4.tar foo bar baz
+tar -Mt -f 1.tar -f 2.tar -f 3.tar -f 4.tar
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test Volume 1
+foo
+bar
+baz
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test Volume 1
+foo
+bar
+baz
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label02.at:24"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Test Volume 1
+foo
+bar
+baz
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_85
+#AT_START_86
+at_fn_group_banner 86 'label03.at:27' \
+  "test-label option" "                              " 10
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "86. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/label03.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
+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 \$?
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
+( $at_check_trace;
+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
+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 $?
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Display label
+# Display label: unlabeled
+# Test label: success
+# Test label: failure
+# Test label: unlabeled
+# Test label, verbose: success
+# Test label, verbose: failure
+tar: Archive label mismatch
+# Test label: multiple arguments
+# Test label: wildcards
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Display label
+iamalabel
+0
+# Display label: unlabeled
+0
+# Test label: success
+0
+# Test label: failure
+1
+# Test label: unlabeled
+1
+# Test label, verbose: success
+iamalabel
+0
+# Test label, verbose: failure
+iamalabel
+1
+# Test label: multiple arguments
+0
+# Test label: wildcards
+0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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 \$?
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
+( $at_check_trace;
+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 $?
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Display label
+# Display label: unlabeled
+# Test label: success
+# Test label: failure
+# Test label: unlabeled
+# Test label, verbose: success
+# Test label, verbose: failure
+tar: Archive label mismatch
+# Test label: multiple arguments
+# Test label: wildcards
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Display label
+iamalabel
+0
+# Display label: unlabeled
+0
+# Test label: success
+0
+# Test label: failure
+1
+# Test label: unlabeled
+1
+# Test label, verbose: success
+iamalabel
+0
+# Test label, verbose: failure
+iamalabel
+1
+# Test label: multiple arguments
+0
+# Test label: wildcards
+0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/label03.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
+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 \$?
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label03.at:30"
+( $at_check_trace;
+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
+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 $?
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Display label
+# Display label: unlabeled
+# Test label: success
+# Test label: failure
+# Test label: unlabeled
+# Test label, verbose: success
+# Test label, verbose: failure
+tar: Archive label mismatch
+# Test label: multiple arguments
+# Test label: wildcards
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Display label
+iamalabel
+0
+# Display label: unlabeled
+0
+# Test label: success
+0
+# Test label: failure
+1
+# Test label: unlabeled
+1
+# Test label, verbose: success
+iamalabel
+0
+# Test label, verbose: failure
+iamalabel
+1
+# Test label: multiple arguments
+0
+# Test label: wildcards
+0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label03.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_86
+#AT_START_87
+at_fn_group_banner 87 'label04.at:27' \
+  "label with non-create option" "                   " 10
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "87. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Volume 'New volume' does not match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Volume 'New volume' does not match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label04.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Volume 'New volume' does not match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_87
+#AT_START_88
+at_fn_group_banner 88 'label05.at:24' \
+  "label with non-create option" "                   " 10
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "88. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Archive not labeled to match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Archive not labeled to match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "label05.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "# Create volume
+# Update: wrong label
+tar: Archive not labeled to match 'My volume'
+tar: Error is not recoverable: exiting now
+# Update: right label
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Create volume
+# Update: wrong label
+2
+# Update: right label
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/label05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_88
+#AT_START_89
+at_fn_group_banner 89 'incremental.at:23' \
+  "incremental" "                                    " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "89. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incremental.at:26:
+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 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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+( $at_check_trace;
+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 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "structure/
+separator
+structure/
+structure/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "structure/
+separator
+structure/
+structure/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incremental.at:26"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "structure/
+separator
+structure/
+structure/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incremental.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_89
+#AT_START_90
+at_fn_group_banner 90 'incr01.at:27' \
+  "restore broken symlinks from incremental" "       " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "90. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr01.at:30:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+\$as_ln_s foo directory/bar
+
+tar -cf archive.0 -g db directory
+rm directory/bar
+tar -cf archive.1 -g db directory
+
+mv directory orig
+
+tar xvfg archive.0 /dev/null --warning=no-timestamp
+echo separator
+tar xvfg archive.1 /dev/null --warning=no-timestamp
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+$as_ln_s foo directory/bar
+
+tar -cf archive.0 -g db directory
+rm directory/bar
+tar -cf archive.1 -g db directory
+
+mv directory orig
+
+tar xvfg archive.0 /dev/null --warning=no-timestamp
+echo separator
+tar xvfg archive.1 /dev/null --warning=no-timestamp
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+directory/bar
+separator
+directory/
+tar: Deleting 'directory/bar'
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+directory/bar
+separator
+directory/
+tar: Deleting 'directory/bar'
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr01.at:30:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+\$as_ln_s foo directory/bar
+
+tar -cf archive.0 -g db directory
+rm directory/bar
+tar -cf archive.1 -g db directory
+
+mv directory orig
+
+tar xvfg archive.0 /dev/null --warning=no-timestamp
+echo separator
+tar xvfg archive.1 /dev/null --warning=no-timestamp
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr01.at:30"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+$as_ln_s foo directory/bar
+
+tar -cf archive.0 -g db directory
+rm directory/bar
+tar -cf archive.1 -g db directory
+
+mv directory orig
+
+tar xvfg archive.0 /dev/null --warning=no-timestamp
+echo separator
+tar xvfg archive.1 /dev/null --warning=no-timestamp
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+directory/bar
+separator
+directory/
+tar: Deleting 'directory/bar'
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr01.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_90
+#AT_START_91
+at_fn_group_banner 91 'incr02.at:32' \
+  "restoring timestamps from incremental" "          " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "91. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr02.at:35:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+# Create directory structure
+mkdir dir
+mkdir dir/subdir1
+mkdir dir/subdir2
+genfile --length 10 --file dir/subdir1/file
+
+# Save mtime for later comparison
+genfile --stat=mtime dir/subdir1 > ts
+
+# Create an archive. Using incremental mode makes sure the
+# archive will have a directory-first member ordering,
+# i.e.:
+# dir/
+# dir/subdir1/
+# dir/subdir2/
+# dir/subdir1/foofile
+#
+# When restoring from this directory structure, 'dir/subdir2/' used to
+# trigger apply_nonancestor_delayed_set_stat() which restored stats for
+# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the
+# latter clobbered the directory timestamp.
+
+tar -cf archive -g db dir
+
+# Move away the directory
+mv dir orig
+
+# Wait enough time for timestamps to differ in case of failure.
+sleep 5
+
+# Restore the directory
+tar -xf archive dir
+
+# Check the timestamp
+genfile --stat=mtime dir/subdir1 | diff ts -
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+# Create directory structure
+mkdir dir
+mkdir dir/subdir1
+mkdir dir/subdir2
+genfile --length 10 --file dir/subdir1/file
+
+# Save mtime for later comparison
+genfile --stat=mtime dir/subdir1 > ts
+
+# Create an archive. Using incremental mode makes sure the
+# archive will have a directory-first member ordering,
+# i.e.:
+# dir/
+# dir/subdir1/
+# dir/subdir2/
+# dir/subdir1/foofile
+#
+# When restoring from this directory structure, 'dir/subdir2/' used to
+# trigger apply_nonancestor_delayed_set_stat() which restored stats for
+# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the
+# latter clobbered the directory timestamp.
+
+tar -cf archive -g db dir
+
+# Move away the directory
+mv dir orig
+
+# Wait enough time for timestamps to differ in case of failure.
+sleep 5
+
+# Restore the directory
+tar -xf archive dir
+
+# Check the timestamp
+genfile --stat=mtime dir/subdir1 | diff ts -
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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 -
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
+( $at_check_trace;
+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 -
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr02.at:35:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+# Create directory structure
+mkdir dir
+mkdir dir/subdir1
+mkdir dir/subdir2
+genfile --length 10 --file dir/subdir1/file
+
+# Save mtime for later comparison
+genfile --stat=mtime dir/subdir1 > ts
+
+# Create an archive. Using incremental mode makes sure the
+# archive will have a directory-first member ordering,
+# i.e.:
+# dir/
+# dir/subdir1/
+# dir/subdir2/
+# dir/subdir1/foofile
+#
+# When restoring from this directory structure, 'dir/subdir2/' used to
+# trigger apply_nonancestor_delayed_set_stat() which restored stats for
+# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the
+# latter clobbered the directory timestamp.
+
+tar -cf archive -g db dir
+
+# Move away the directory
+mv dir orig
+
+# Wait enough time for timestamps to differ in case of failure.
+sleep 5
+
+# Restore the directory
+tar -xf archive dir
+
+# Check the timestamp
+genfile --stat=mtime dir/subdir1 | diff ts -
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr02.at:35"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+# Create directory structure
+mkdir dir
+mkdir dir/subdir1
+mkdir dir/subdir2
+genfile --length 10 --file dir/subdir1/file
+
+# Save mtime for later comparison
+genfile --stat=mtime dir/subdir1 > ts
+
+# Create an archive. Using incremental mode makes sure the
+# archive will have a directory-first member ordering,
+# i.e.:
+# dir/
+# dir/subdir1/
+# dir/subdir2/
+# dir/subdir1/foofile
+#
+# When restoring from this directory structure, 'dir/subdir2/' used to
+# trigger apply_nonancestor_delayed_set_stat() which restored stats for
+# 'subdir1' prior to restoring 'dir/subdir1/foofile'. Then, restoring the
+# latter clobbered the directory timestamp.
+
+tar -cf archive -g db dir
+
+# Move away the directory
+mv dir orig
+
+# Wait enough time for timestamps to differ in case of failure.
+sleep 5
+
+# Restore the directory
+tar -xf archive dir
+
+# Check the timestamp
+genfile --stat=mtime dir/subdir1 | diff ts -
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr02.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_91
+#AT_START_92
+at_fn_group_banner 92 'listed01.at:27' \
+  "--listed for individual files" "                  " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "92. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/listed01.at:30:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+# Let the things settle
+sleep 1
+
+tar --create \\
+    --file=archive.1 \\
+    --listed-incremental=listing \\
+    directory/file*
+
+tar tf archive.1 || exit 1
+
+sleep 2
+
+genfile --length 10240 --pattern zeros --file directory/file2
+
+echo \"separator\"
+cp listing listing.old
+tar --create \\
+    --file=archive.2 \\
+    --listed-incremental=listing \\
+    directory/file* || exit 1
+
+tar tf archive.2 || exit 1
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:30"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+# Let the things settle
+sleep 1
+
+tar --create \
+    --file=archive.1 \
+    --listed-incremental=listing \
+    directory/file*
+
+tar tf archive.1 || exit 1
+
+sleep 2
+
+genfile --length 10240 --pattern zeros --file directory/file2
+
+echo "separator"
+cp listing listing.old
+tar --create \
+    --file=archive.2 \
+    --listed-incremental=listing \
+    directory/file* || exit 1
+
+tar tf archive.2 || exit 1
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/file1
+separator
+directory/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/listed01.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
+genfile --length 10240 --pattern zeros --file directory/file1
+# Let the things settle
+sleep 1
+
+tar --create \\
+    --file=archive.1 \\
+    --listed-incremental=listing \\
+    directory/file*
+
+tar tf archive.1 || exit 1
+
+sleep 2
+
+genfile --length 10240 --pattern zeros --file directory/file2
+
+echo \"separator\"
+cp listing listing.old
+tar --create \\
+    --file=archive.2 \\
+    --listed-incremental=listing \\
+    directory/file* || exit 1
+
+tar tf archive.2 || exit 1
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "listed01.at:30"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+# Let the things settle
+sleep 1
+
+tar --create \
+    --file=archive.1 \
+    --listed-incremental=listing \
+    directory/file*
+
+tar tf archive.1 || exit 1
+
+sleep 2
+
+genfile --length 10240 --pattern zeros --file directory/file2
+
+echo "separator"
+cp listing listing.old
+tar --create \
+    --file=archive.2 \
+    --listed-incremental=listing \
+    directory/file* || exit 1
+
+tar tf archive.2 || exit 1
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/file1
+separator
+directory/file2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed01.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_92
+#AT_START_93
+at_fn_group_banner 93 'listed02.at:29' \
+  "working --listed" "                               " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "93. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/listed02.at:32:
+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
+
+echo Create directories
+
+mkdir tart
+sleep 1
+mkdir tart/c0
+sleep 1
+mkdir tart/c1
+sleep 1
+
+for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
+do
+  echo File \$file > \$file
+  sleep 1
+done
+
+sleep 1
+echo Creating main archive
+echo >&2 \"Creating main archive\"
+tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+
+# The above prints two lines to stderr announcing the new directories c0 and c1.
+# Ensure that they appear in this script's stderr in sorted order.
+sort err 1>&2; rm -f err
+
+sleep 1
+echo Modifying filesystem
+rm tart/a1
+
+mv tart/b1 tart/b2
+mv tart/c1 tart/c2
+touch tart/c2/ca3
+
+echo Directory contents
+find tart -print | sort 2>/dev/null
+
+sleep 1
+echo Creating incremental archive
+echo >&2 \"Creating incremental archive\"
+cp -p tart.incr1 tart.incr2
+tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+
+sleep 1
+
+rm -rf tart/*
+echo Extracting main archive
+echo >&2 \"Extracting main archive\"
+tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
+echo Extracting incremental archive
+# This command should produce three messages about deletion
+# of the existing files, that may appear in any order. Piping
+# to sort makes sure we don't depend on any particular ordering.
+tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+
+echo Final files:
+find tart -print | sort 2>/dev/null
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:32"
+( $at_check_trace;
+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
+
+echo Create directories
+
+mkdir tart
+sleep 1
+mkdir tart/c0
+sleep 1
+mkdir tart/c1
+sleep 1
+
+for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
+do
+  echo File $file > $file
+  sleep 1
+done
+
+sleep 1
+echo Creating main archive
+echo >&2 "Creating main archive"
+tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+
+# The above prints two lines to stderr announcing the new directories c0 and c1.
+# Ensure that they appear in this script's stderr in sorted order.
+sort err 1>&2; rm -f err
+
+sleep 1
+echo Modifying filesystem
+rm tart/a1
+
+mv tart/b1 tart/b2
+mv tart/c1 tart/c2
+touch tart/c2/ca3
+
+echo Directory contents
+find tart -print | sort 2>/dev/null
+
+sleep 1
+echo Creating incremental archive
+echo >&2 "Creating incremental archive"
+cp -p tart.incr1 tart.incr2
+tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+
+sleep 1
+
+rm -rf tart/*
+echo Extracting main archive
+echo >&2 "Extracting main archive"
+tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
+echo Extracting incremental archive
+# This command should produce three messages about deletion
+# of the existing files, that may appear in any order. Piping
+# to sort makes sure we don't depend on any particular ordering.
+tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+
+echo Final files:
+find tart -print | sort 2>/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating main archive
+tar: tart/c0: Directory is new
+tar: tart/c1: Directory is new
+tar: tart: Directory is new
+Creating incremental archive
+tar: tart/c2: Directory has been renamed from 'tart/c1'
+Extracting main archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Create directories
+Creating main archive
+tart/
+tart/c0/
+tart/c1/
+tart/a1
+tart/b1
+tart/c0/cq1
+tart/c0/cq2
+tart/c1/ca1
+tart/c1/ca2
+Modifying filesystem
+Directory contents
+tart
+tart/b2
+tart/c0
+tart/c0/cq1
+tart/c0/cq2
+tart/c2
+tart/c2/ca1
+tart/c2/ca2
+tart/c2/ca3
+Creating incremental archive
+tart/
+tart/c0/
+tart/c2/
+tart/b2
+tart/c2/ca3
+Extracting main archive
+tart/
+tart/c0/
+tart/c1/
+tart/a1
+tart/b1
+tart/c0/cq1
+tart/c0/cq2
+tart/c1/ca1
+tart/c1/ca2
+Extracting incremental archive
+tar: Deleting 'tart/a1'
+tar: Deleting 'tart/b1'
+tart/
+tart/b2
+tart/c0/
+tart/c2/
+tart/c2/ca3
+Final files:
+tart
+tart/b2
+tart/c0
+tart/c0/cq1
+tart/c0/cq2
+tart/c2
+tart/c2/ca1
+tart/c2/ca2
+tart/c2/ca3
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/listed02.at:32:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+echo Create directories
+
+mkdir tart
+sleep 1
+mkdir tart/c0
+sleep 1
+mkdir tart/c1
+sleep 1
+
+for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
+do
+  echo File \$file > \$file
+  sleep 1
+done
+
+sleep 1
+echo Creating main archive
+echo >&2 \"Creating main archive\"
+tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+
+# The above prints two lines to stderr announcing the new directories c0 and c1.
+# Ensure that they appear in this script's stderr in sorted order.
+sort err 1>&2; rm -f err
+
+sleep 1
+echo Modifying filesystem
+rm tart/a1
+
+mv tart/b1 tart/b2
+mv tart/c1 tart/c2
+touch tart/c2/ca3
+
+echo Directory contents
+find tart -print | sort 2>/dev/null
+
+sleep 1
+echo Creating incremental archive
+echo >&2 \"Creating incremental archive\"
+cp -p tart.incr1 tart.incr2
+tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+
+sleep 1
+
+rm -rf tart/*
+echo Extracting main archive
+echo >&2 \"Extracting main archive\"
+tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
+echo Extracting incremental archive
+# This command should produce three messages about deletion
+# of the existing files, that may appear in any order. Piping
+# to sort makes sure we don't depend on any particular ordering.
+tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+
+echo Final files:
+find tart -print | sort 2>/dev/null
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "listed02.at:32"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+echo Create directories
+
+mkdir tart
+sleep 1
+mkdir tart/c0
+sleep 1
+mkdir tart/c1
+sleep 1
+
+for file in tart/a1 tart/b1 tart/c0/cq1 tart/c0/cq2 tart/c1/ca1 tart/c1/ca2
+do
+  echo File $file > $file
+  sleep 1
+done
+
+sleep 1
+echo Creating main archive
+echo >&2 "Creating main archive"
+tar -c -v --listed-incremental=tart.incr1 -f archive.1 tart 2> err || exit 1
+
+# The above prints two lines to stderr announcing the new directories c0 and c1.
+# Ensure that they appear in this script's stderr in sorted order.
+sort err 1>&2; rm -f err
+
+sleep 1
+echo Modifying filesystem
+rm tart/a1
+
+mv tart/b1 tart/b2
+mv tart/c1 tart/c2
+touch tart/c2/ca3
+
+echo Directory contents
+find tart -print | sort 2>/dev/null
+
+sleep 1
+echo Creating incremental archive
+echo >&2 "Creating incremental archive"
+cp -p tart.incr1 tart.incr2
+tar -c -v --listed-incremental=tart.incr2 -f archive.2 tart || exit 1
+
+sleep 1
+
+rm -rf tart/*
+echo Extracting main archive
+echo >&2 "Extracting main archive"
+tar -x -v --listed-incremental=tart.incr1 -f archive.1 || exit 1
+echo Extracting incremental archive
+# This command should produce three messages about deletion
+# of the existing files, that may appear in any order. Piping
+# to sort makes sure we don't depend on any particular ordering.
+tar -x -v --listed-incremental=tart.incr2 -f archive.2 | sort 2>/dev/null
+
+echo Final files:
+find tart -print | sort 2>/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating main archive
+tar: tart/c0: Directory is new
+tar: tart/c1: Directory is new
+tar: tart: Directory is new
+Creating incremental archive
+tar: tart/c2: Directory has been renamed from 'tart/c1'
+Extracting main archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Create directories
+Creating main archive
+tart/
+tart/c0/
+tart/c1/
+tart/a1
+tart/b1
+tart/c0/cq1
+tart/c0/cq2
+tart/c1/ca1
+tart/c1/ca2
+Modifying filesystem
+Directory contents
+tart
+tart/b2
+tart/c0
+tart/c0/cq1
+tart/c0/cq2
+tart/c2
+tart/c2/ca1
+tart/c2/ca2
+tart/c2/ca3
+Creating incremental archive
+tart/
+tart/c0/
+tart/c2/
+tart/b2
+tart/c2/ca3
+Extracting main archive
+tart/
+tart/c0/
+tart/c1/
+tart/a1
+tart/b1
+tart/c0/cq1
+tart/c0/cq2
+tart/c1/ca1
+tart/c1/ca2
+Extracting incremental archive
+tar: Deleting 'tart/a1'
+tar: Deleting 'tart/b1'
+tart/
+tart/b2
+tart/c0/
+tart/c2/
+tart/c2/ca3
+Final files:
+tart
+tart/b2
+tart/c0
+tart/c0/cq1
+tart/c0/cq2
+tart/c2
+tart/c2/ca1
+tart/c2/ca2
+tart/c2/ca3
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed02.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_93
+#AT_START_94
+at_fn_group_banner 94 'listed03.at:24' \
+  "incremental dump when the parent directory is unreadable" "" 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "94. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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
+
+
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "listed03.at:27"
+( $at_check_trace;
+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
+
+
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed03.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_94
+#AT_START_95
+at_fn_group_banner 95 'listed04.at:26' \
+  "--listed-incremental and --one-file-system" "     " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "95. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/listed04.at:29:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+echo a >dir/a
+echo b >dir/b
+
+tar --one-file-system -cvf archive.tar -g archive.incr dir || exit
+tar -tf archive.tar || exit
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "listed04.at:29"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+echo a >dir/a
+echo b >dir/b
+
+tar --one-file-system -cvf archive.tar -g archive.incr dir || exit
+tar -tf archive.tar || exit
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/a
+dir/b
+dir/
+dir/a
+dir/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed04.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_95
+#AT_START_96
+at_fn_group_banner 96 'listed05.at:33' \
+  "--listed-incremental and remounted directories" " " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "96. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/listed05.at:36:
+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
+
+options=\"-C tartest --create --one-file-system --verbose\"
+rm -rf archive-01.snar archive-01.tar tartest subdir
+
+# Create initial structure
+mkdir tartest
+echo \"hi\" > tartest/top-level-file
+mkdir tartest/subdir
+echo \"hi\" > tartest/subdir/subdir-file
+
+echo \"# Level 0\"
+tar \$options --file archive-0.tar --listed-incremental=archive-0.snar .
+
+echo \"# Remount\"
+mv tartest/subdir .
+mkdir tartest/subdir
+mount -t ramfs none tartest/subdir || exit 77
+tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
+
+echo \"# Level 1\"
+cp archive-0.snar archive-1.snar
+tar \$options --file archive-1.tar --listed-incremental=archive-1.snar .
+
+umount tartest/subdir
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "listed05.at:36"
+( $at_check_trace;
+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
+
+options="-C tartest --create --one-file-system --verbose"
+rm -rf archive-01.snar archive-01.tar tartest subdir
+
+# Create initial structure
+mkdir tartest
+echo "hi" > tartest/top-level-file
+mkdir tartest/subdir
+echo "hi" > tartest/subdir/subdir-file
+
+echo "# Level 0"
+tar $options --file archive-0.tar --listed-incremental=archive-0.snar .
+
+echo "# Remount"
+mv tartest/subdir .
+mkdir tartest/subdir
+mount -t ramfs none tartest/subdir || exit 77
+tar -C subdir -c -f - . | tar -C tartest/subdir -x -f -
+
+echo "# Level 1"
+cp archive-0.snar archive-1.snar
+tar $options --file archive-1.tar --listed-incremental=archive-1.snar .
+
+umount tartest/subdir
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: .: Directory is new
+tar: ./subdir: Directory is new
+tar: ./subdir: directory is on a different filesystem; not dumped
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "# Level 0
+./
+./subdir/
+./top-level-file
+./subdir/subdir-file
+# Remount
+# Level 1
+./
+./subdir/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/listed05.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_96
+#AT_START_97
+at_fn_group_banner 97 'incr03.at:29' \
+  "renamed files in incrementals" "                  " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "97. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr03.at:32:
+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 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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:32"
+( $at_check_trace;
+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 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Listing of archive.1
+directory/
+directory/x
+directory/y
+Listing of archive.2
+directory/
+directory/z
+Directory after first restore
+directory
+directory/x
+directory/y
+Directory after second restore
+directory
+directory/y
+directory/z
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr03.at:32:
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:32"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Listing of archive.1
+directory/
+directory/x
+directory/y
+Listing of archive.2
+directory/
+directory/z
+Directory after first restore
+directory
+directory/x
+directory/y
+Directory after second restore
+directory
+directory/y
+directory/z
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr03.at:32:
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr03.at:32"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Listing of archive.1
+directory/
+directory/x
+directory/y
+Listing of archive.2
+directory/
+directory/z
+Directory after first restore
+directory
+directory/x
+directory/y
+Directory after second restore
+directory
+directory/y
+directory/z
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr03.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_97
+#AT_START_98
+at_fn_group_banner 98 'incr04.at:30' \
+  "proper icontents initialization" "                " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "98. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr04.at:35:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:35"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+install-sh -d a/b >/dev/null  || exit 77
+awk 'BEGIN {
+  for (i=1;i<=142;i++)
+    printf("a/b/one_31_chars_long_file_name_%03d\n", i);
+  }' < /dev/null | genfile --files-from -
+
+sleep 1
+
+echo "Initial dump"
+tar cvf a0.tar -g a.sna a
+mv a/b a/c
+echo "Incremental dump"
+tar cvf a1.tar -g a.sna a
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
+tar: a/b: Directory is new
+tar: a/c: Directory has been renamed from 'a/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Initial dump
+a/
+a/b/
+a/b/one_31_chars_long_file_name_001
+a/b/one_31_chars_long_file_name_002
+a/b/one_31_chars_long_file_name_003
+a/b/one_31_chars_long_file_name_004
+a/b/one_31_chars_long_file_name_005
+a/b/one_31_chars_long_file_name_006
+a/b/one_31_chars_long_file_name_007
+a/b/one_31_chars_long_file_name_008
+a/b/one_31_chars_long_file_name_009
+a/b/one_31_chars_long_file_name_010
+a/b/one_31_chars_long_file_name_011
+a/b/one_31_chars_long_file_name_012
+a/b/one_31_chars_long_file_name_013
+a/b/one_31_chars_long_file_name_014
+a/b/one_31_chars_long_file_name_015
+a/b/one_31_chars_long_file_name_016
+a/b/one_31_chars_long_file_name_017
+a/b/one_31_chars_long_file_name_018
+a/b/one_31_chars_long_file_name_019
+a/b/one_31_chars_long_file_name_020
+a/b/one_31_chars_long_file_name_021
+a/b/one_31_chars_long_file_name_022
+a/b/one_31_chars_long_file_name_023
+a/b/one_31_chars_long_file_name_024
+a/b/one_31_chars_long_file_name_025
+a/b/one_31_chars_long_file_name_026
+a/b/one_31_chars_long_file_name_027
+a/b/one_31_chars_long_file_name_028
+a/b/one_31_chars_long_file_name_029
+a/b/one_31_chars_long_file_name_030
+a/b/one_31_chars_long_file_name_031
+a/b/one_31_chars_long_file_name_032
+a/b/one_31_chars_long_file_name_033
+a/b/one_31_chars_long_file_name_034
+a/b/one_31_chars_long_file_name_035
+a/b/one_31_chars_long_file_name_036
+a/b/one_31_chars_long_file_name_037
+a/b/one_31_chars_long_file_name_038
+a/b/one_31_chars_long_file_name_039
+a/b/one_31_chars_long_file_name_040
+a/b/one_31_chars_long_file_name_041
+a/b/one_31_chars_long_file_name_042
+a/b/one_31_chars_long_file_name_043
+a/b/one_31_chars_long_file_name_044
+a/b/one_31_chars_long_file_name_045
+a/b/one_31_chars_long_file_name_046
+a/b/one_31_chars_long_file_name_047
+a/b/one_31_chars_long_file_name_048
+a/b/one_31_chars_long_file_name_049
+a/b/one_31_chars_long_file_name_050
+a/b/one_31_chars_long_file_name_051
+a/b/one_31_chars_long_file_name_052
+a/b/one_31_chars_long_file_name_053
+a/b/one_31_chars_long_file_name_054
+a/b/one_31_chars_long_file_name_055
+a/b/one_31_chars_long_file_name_056
+a/b/one_31_chars_long_file_name_057
+a/b/one_31_chars_long_file_name_058
+a/b/one_31_chars_long_file_name_059
+a/b/one_31_chars_long_file_name_060
+a/b/one_31_chars_long_file_name_061
+a/b/one_31_chars_long_file_name_062
+a/b/one_31_chars_long_file_name_063
+a/b/one_31_chars_long_file_name_064
+a/b/one_31_chars_long_file_name_065
+a/b/one_31_chars_long_file_name_066
+a/b/one_31_chars_long_file_name_067
+a/b/one_31_chars_long_file_name_068
+a/b/one_31_chars_long_file_name_069
+a/b/one_31_chars_long_file_name_070
+a/b/one_31_chars_long_file_name_071
+a/b/one_31_chars_long_file_name_072
+a/b/one_31_chars_long_file_name_073
+a/b/one_31_chars_long_file_name_074
+a/b/one_31_chars_long_file_name_075
+a/b/one_31_chars_long_file_name_076
+a/b/one_31_chars_long_file_name_077
+a/b/one_31_chars_long_file_name_078
+a/b/one_31_chars_long_file_name_079
+a/b/one_31_chars_long_file_name_080
+a/b/one_31_chars_long_file_name_081
+a/b/one_31_chars_long_file_name_082
+a/b/one_31_chars_long_file_name_083
+a/b/one_31_chars_long_file_name_084
+a/b/one_31_chars_long_file_name_085
+a/b/one_31_chars_long_file_name_086
+a/b/one_31_chars_long_file_name_087
+a/b/one_31_chars_long_file_name_088
+a/b/one_31_chars_long_file_name_089
+a/b/one_31_chars_long_file_name_090
+a/b/one_31_chars_long_file_name_091
+a/b/one_31_chars_long_file_name_092
+a/b/one_31_chars_long_file_name_093
+a/b/one_31_chars_long_file_name_094
+a/b/one_31_chars_long_file_name_095
+a/b/one_31_chars_long_file_name_096
+a/b/one_31_chars_long_file_name_097
+a/b/one_31_chars_long_file_name_098
+a/b/one_31_chars_long_file_name_099
+a/b/one_31_chars_long_file_name_100
+a/b/one_31_chars_long_file_name_101
+a/b/one_31_chars_long_file_name_102
+a/b/one_31_chars_long_file_name_103
+a/b/one_31_chars_long_file_name_104
+a/b/one_31_chars_long_file_name_105
+a/b/one_31_chars_long_file_name_106
+a/b/one_31_chars_long_file_name_107
+a/b/one_31_chars_long_file_name_108
+a/b/one_31_chars_long_file_name_109
+a/b/one_31_chars_long_file_name_110
+a/b/one_31_chars_long_file_name_111
+a/b/one_31_chars_long_file_name_112
+a/b/one_31_chars_long_file_name_113
+a/b/one_31_chars_long_file_name_114
+a/b/one_31_chars_long_file_name_115
+a/b/one_31_chars_long_file_name_116
+a/b/one_31_chars_long_file_name_117
+a/b/one_31_chars_long_file_name_118
+a/b/one_31_chars_long_file_name_119
+a/b/one_31_chars_long_file_name_120
+a/b/one_31_chars_long_file_name_121
+a/b/one_31_chars_long_file_name_122
+a/b/one_31_chars_long_file_name_123
+a/b/one_31_chars_long_file_name_124
+a/b/one_31_chars_long_file_name_125
+a/b/one_31_chars_long_file_name_126
+a/b/one_31_chars_long_file_name_127
+a/b/one_31_chars_long_file_name_128
+a/b/one_31_chars_long_file_name_129
+a/b/one_31_chars_long_file_name_130
+a/b/one_31_chars_long_file_name_131
+a/b/one_31_chars_long_file_name_132
+a/b/one_31_chars_long_file_name_133
+a/b/one_31_chars_long_file_name_134
+a/b/one_31_chars_long_file_name_135
+a/b/one_31_chars_long_file_name_136
+a/b/one_31_chars_long_file_name_137
+a/b/one_31_chars_long_file_name_138
+a/b/one_31_chars_long_file_name_139
+a/b/one_31_chars_long_file_name_140
+a/b/one_31_chars_long_file_name_141
+a/b/one_31_chars_long_file_name_142
+Incremental dump
+a/
+a/c/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr04.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
+
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:35"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
+tar: a/b: Directory is new
+tar: a/c: Directory has been renamed from 'a/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Initial dump
+a/
+a/b/
+a/b/one_31_chars_long_file_name_001
+a/b/one_31_chars_long_file_name_002
+a/b/one_31_chars_long_file_name_003
+a/b/one_31_chars_long_file_name_004
+a/b/one_31_chars_long_file_name_005
+a/b/one_31_chars_long_file_name_006
+a/b/one_31_chars_long_file_name_007
+a/b/one_31_chars_long_file_name_008
+a/b/one_31_chars_long_file_name_009
+a/b/one_31_chars_long_file_name_010
+a/b/one_31_chars_long_file_name_011
+a/b/one_31_chars_long_file_name_012
+a/b/one_31_chars_long_file_name_013
+a/b/one_31_chars_long_file_name_014
+a/b/one_31_chars_long_file_name_015
+a/b/one_31_chars_long_file_name_016
+a/b/one_31_chars_long_file_name_017
+a/b/one_31_chars_long_file_name_018
+a/b/one_31_chars_long_file_name_019
+a/b/one_31_chars_long_file_name_020
+a/b/one_31_chars_long_file_name_021
+a/b/one_31_chars_long_file_name_022
+a/b/one_31_chars_long_file_name_023
+a/b/one_31_chars_long_file_name_024
+a/b/one_31_chars_long_file_name_025
+a/b/one_31_chars_long_file_name_026
+a/b/one_31_chars_long_file_name_027
+a/b/one_31_chars_long_file_name_028
+a/b/one_31_chars_long_file_name_029
+a/b/one_31_chars_long_file_name_030
+a/b/one_31_chars_long_file_name_031
+a/b/one_31_chars_long_file_name_032
+a/b/one_31_chars_long_file_name_033
+a/b/one_31_chars_long_file_name_034
+a/b/one_31_chars_long_file_name_035
+a/b/one_31_chars_long_file_name_036
+a/b/one_31_chars_long_file_name_037
+a/b/one_31_chars_long_file_name_038
+a/b/one_31_chars_long_file_name_039
+a/b/one_31_chars_long_file_name_040
+a/b/one_31_chars_long_file_name_041
+a/b/one_31_chars_long_file_name_042
+a/b/one_31_chars_long_file_name_043
+a/b/one_31_chars_long_file_name_044
+a/b/one_31_chars_long_file_name_045
+a/b/one_31_chars_long_file_name_046
+a/b/one_31_chars_long_file_name_047
+a/b/one_31_chars_long_file_name_048
+a/b/one_31_chars_long_file_name_049
+a/b/one_31_chars_long_file_name_050
+a/b/one_31_chars_long_file_name_051
+a/b/one_31_chars_long_file_name_052
+a/b/one_31_chars_long_file_name_053
+a/b/one_31_chars_long_file_name_054
+a/b/one_31_chars_long_file_name_055
+a/b/one_31_chars_long_file_name_056
+a/b/one_31_chars_long_file_name_057
+a/b/one_31_chars_long_file_name_058
+a/b/one_31_chars_long_file_name_059
+a/b/one_31_chars_long_file_name_060
+a/b/one_31_chars_long_file_name_061
+a/b/one_31_chars_long_file_name_062
+a/b/one_31_chars_long_file_name_063
+a/b/one_31_chars_long_file_name_064
+a/b/one_31_chars_long_file_name_065
+a/b/one_31_chars_long_file_name_066
+a/b/one_31_chars_long_file_name_067
+a/b/one_31_chars_long_file_name_068
+a/b/one_31_chars_long_file_name_069
+a/b/one_31_chars_long_file_name_070
+a/b/one_31_chars_long_file_name_071
+a/b/one_31_chars_long_file_name_072
+a/b/one_31_chars_long_file_name_073
+a/b/one_31_chars_long_file_name_074
+a/b/one_31_chars_long_file_name_075
+a/b/one_31_chars_long_file_name_076
+a/b/one_31_chars_long_file_name_077
+a/b/one_31_chars_long_file_name_078
+a/b/one_31_chars_long_file_name_079
+a/b/one_31_chars_long_file_name_080
+a/b/one_31_chars_long_file_name_081
+a/b/one_31_chars_long_file_name_082
+a/b/one_31_chars_long_file_name_083
+a/b/one_31_chars_long_file_name_084
+a/b/one_31_chars_long_file_name_085
+a/b/one_31_chars_long_file_name_086
+a/b/one_31_chars_long_file_name_087
+a/b/one_31_chars_long_file_name_088
+a/b/one_31_chars_long_file_name_089
+a/b/one_31_chars_long_file_name_090
+a/b/one_31_chars_long_file_name_091
+a/b/one_31_chars_long_file_name_092
+a/b/one_31_chars_long_file_name_093
+a/b/one_31_chars_long_file_name_094
+a/b/one_31_chars_long_file_name_095
+a/b/one_31_chars_long_file_name_096
+a/b/one_31_chars_long_file_name_097
+a/b/one_31_chars_long_file_name_098
+a/b/one_31_chars_long_file_name_099
+a/b/one_31_chars_long_file_name_100
+a/b/one_31_chars_long_file_name_101
+a/b/one_31_chars_long_file_name_102
+a/b/one_31_chars_long_file_name_103
+a/b/one_31_chars_long_file_name_104
+a/b/one_31_chars_long_file_name_105
+a/b/one_31_chars_long_file_name_106
+a/b/one_31_chars_long_file_name_107
+a/b/one_31_chars_long_file_name_108
+a/b/one_31_chars_long_file_name_109
+a/b/one_31_chars_long_file_name_110
+a/b/one_31_chars_long_file_name_111
+a/b/one_31_chars_long_file_name_112
+a/b/one_31_chars_long_file_name_113
+a/b/one_31_chars_long_file_name_114
+a/b/one_31_chars_long_file_name_115
+a/b/one_31_chars_long_file_name_116
+a/b/one_31_chars_long_file_name_117
+a/b/one_31_chars_long_file_name_118
+a/b/one_31_chars_long_file_name_119
+a/b/one_31_chars_long_file_name_120
+a/b/one_31_chars_long_file_name_121
+a/b/one_31_chars_long_file_name_122
+a/b/one_31_chars_long_file_name_123
+a/b/one_31_chars_long_file_name_124
+a/b/one_31_chars_long_file_name_125
+a/b/one_31_chars_long_file_name_126
+a/b/one_31_chars_long_file_name_127
+a/b/one_31_chars_long_file_name_128
+a/b/one_31_chars_long_file_name_129
+a/b/one_31_chars_long_file_name_130
+a/b/one_31_chars_long_file_name_131
+a/b/one_31_chars_long_file_name_132
+a/b/one_31_chars_long_file_name_133
+a/b/one_31_chars_long_file_name_134
+a/b/one_31_chars_long_file_name_135
+a/b/one_31_chars_long_file_name_136
+a/b/one_31_chars_long_file_name_137
+a/b/one_31_chars_long_file_name_138
+a/b/one_31_chars_long_file_name_139
+a/b/one_31_chars_long_file_name_140
+a/b/one_31_chars_long_file_name_141
+a/b/one_31_chars_long_file_name_142
+Incremental dump
+a/
+a/c/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr04.at:35:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr04.at:35"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+install-sh -d a/b >/dev/null  || exit 77
+awk 'BEGIN {
+  for (i=1;i<=142;i++)
+    printf("a/b/one_31_chars_long_file_name_%03d\n", i);
+  }' < /dev/null | genfile --files-from -
+
+sleep 1
+
+echo "Initial dump"
+tar cvf a0.tar -g a.sna a
+mv a/b a/c
+echo "Incremental dump"
+tar cvf a1.tar -g a.sna a
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: a: Directory is new
+tar: a/b: Directory is new
+tar: a/c: Directory has been renamed from 'a/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Initial dump
+a/
+a/b/
+a/b/one_31_chars_long_file_name_001
+a/b/one_31_chars_long_file_name_002
+a/b/one_31_chars_long_file_name_003
+a/b/one_31_chars_long_file_name_004
+a/b/one_31_chars_long_file_name_005
+a/b/one_31_chars_long_file_name_006
+a/b/one_31_chars_long_file_name_007
+a/b/one_31_chars_long_file_name_008
+a/b/one_31_chars_long_file_name_009
+a/b/one_31_chars_long_file_name_010
+a/b/one_31_chars_long_file_name_011
+a/b/one_31_chars_long_file_name_012
+a/b/one_31_chars_long_file_name_013
+a/b/one_31_chars_long_file_name_014
+a/b/one_31_chars_long_file_name_015
+a/b/one_31_chars_long_file_name_016
+a/b/one_31_chars_long_file_name_017
+a/b/one_31_chars_long_file_name_018
+a/b/one_31_chars_long_file_name_019
+a/b/one_31_chars_long_file_name_020
+a/b/one_31_chars_long_file_name_021
+a/b/one_31_chars_long_file_name_022
+a/b/one_31_chars_long_file_name_023
+a/b/one_31_chars_long_file_name_024
+a/b/one_31_chars_long_file_name_025
+a/b/one_31_chars_long_file_name_026
+a/b/one_31_chars_long_file_name_027
+a/b/one_31_chars_long_file_name_028
+a/b/one_31_chars_long_file_name_029
+a/b/one_31_chars_long_file_name_030
+a/b/one_31_chars_long_file_name_031
+a/b/one_31_chars_long_file_name_032
+a/b/one_31_chars_long_file_name_033
+a/b/one_31_chars_long_file_name_034
+a/b/one_31_chars_long_file_name_035
+a/b/one_31_chars_long_file_name_036
 a/b/one_31_chars_long_file_name_037
 a/b/one_31_chars_long_file_name_038
 a/b/one_31_chars_long_file_name_039
 a/c/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/incr04.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_98
+#AT_START_99
+at_fn_group_banner 99 'incr05.at:21' \
+  "incremental dumps with -C" "                      " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "99. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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 .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+( $at_check_trace;
+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 .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0
+./
+./sub/
+./file1
+./sub/file2
+Level 1
+./
+./sub/
+./file3
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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 .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+( $at_check_trace;
+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 .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0
+./
+./sub/
+./file1
+./sub/file2
+Level 1
+./
+./sub/
+./file3
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr05.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+
+echo Level 0
+tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+
+genfile --file dir/file3
+echo Level 1
+tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+
+echo Level 0
+tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+
+genfile --file dir/file3
+echo Level 1
+tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0
+./
+./sub/
+./file1
+./sub/file2
+Level 1
+./
+./sub/
+./file3
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_99
+#AT_START_100
+at_fn_group_banner 100 'incr06.at:21' \
+  "incremental dumps of nested directories" "        " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "100. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr06.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0 . sub
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 0 sub .
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 1 . sub
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+Level 1 sub .
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr06.at:24:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0 . sub
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 0 sub .
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 1 . sub
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+Level 1 sub .
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr06.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dir
+mkdir dir/sub
+mkdir dir/sub/a
+mkdir dir/sub/b
+genfile --file dir/file1
+genfile --file dir/sub/file2
+genfile --file dir/sub/a/file3
+
+echo Level 0 . sub
+tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 0 sub .
+tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+
+mkdir dir/c
+genfile --file dir/sub/b/file4
+
+echo Level 1 . sub
+tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
+echo Level 1 sub .
+tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0 . sub
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 0 sub .
+./
+sub/
+sub/a/
+sub/b/
+./file1
+sub/file2
+sub/a/file3
+Level 1 . sub
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+Level 1 sub .
+./
+./c/
+sub/
+sub/a/
+sub/b/
+sub/b/file4
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_100
+#AT_START_101
+at_fn_group_banner 101 'incr07.at:18' \
+  "incremental restores with -C" "                   " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "101. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+# Tar 1.26 had problems extracting from incremental restores when given
+# the -C option.  The code in incremen.c:try_purge_directory and
+# misc.c:remove_any_file was using savedir(), which ignored eventual changes
+# in the current working directory and caused the malfunctioning.
+#
+# The problem was reported by Piotr Rotter on 2013-03-22.
+#
+# This testcase is based on scripts provided by Piotr Rotter and Nathan
+# Stratton Treadway.
+#
+# References: <514C8F56.90900@active24.pl>,
+#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html,
+#             <20130326181922.GZ3732@shire.ontko.com>,
+#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html,
+#             <20130327051828.GA3732@shire.ontko.com>,
+#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html,
+#             <20130327054957.GB3732@shire.ontko.com>,
+#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr07.at:40:
+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 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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+( $at_check_trace;
+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 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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "C0
+tar: dirA: Directory is new
+C1
+C2
+E0
+E1
+E2
+E3
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "C0
+dirA/
+dirA/a
+dirA/b
+C1
+dirA/
+dirA/c
+C2
+dirA/
+E0
+dirA/
+dirA/a
+dirA/b
+E1
+dirA/
+dirA/c
+E2
+dirA/
+tar: Deleting 'dirA/a'
+E3
+dirA/
+tar: Deleting 'dirA/dirB'
+FIN
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/incr07.at:40:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dirA
+echo 'a' > dirA/a
+echo 'a' > dirA/b
+
+decho C0
+tar -g test.snar -vcf test.0.tar dirA
+
+echo 'a' > dirA/c
+decho C1
+tar -g test.snar -vcf test.1.tar dirA
+
+rm -f dirA/a
+decho C2
+tar -g test.snar -vcf test.2.tar dirA
+
+mkdir ext
+rm -rf dirA
+
+decho E0
+tar -g test.snar -vxf test.0.tar -C ext/
+decho E1
+tar -g test.snar -vxf test.1.tar -C ext/
+
+decho E2
+tar -g test.snar -vxf test.2.tar -C ext/
+
+mkdir ext/dirA/dirB
+touch ext/dirA/dirB/file
+
+decho E3
+tar -g test.snar -vxf test.2.tar -C ext/
+
+echo FIN
+test -d dirA && echo >&2 \"toplevel dirA exists\"
+exit 0
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir dirA
+echo 'a' > dirA/a
+echo 'a' > dirA/b
+
+decho C0
+tar -g test.snar -vcf test.0.tar dirA
+
+echo 'a' > dirA/c
+decho C1
+tar -g test.snar -vcf test.1.tar dirA
+
+rm -f dirA/a
+decho C2
+tar -g test.snar -vcf test.2.tar dirA
+
+mkdir ext
+rm -rf dirA
+
+decho E0
+tar -g test.snar -vxf test.0.tar -C ext/
+decho E1
+tar -g test.snar -vxf test.1.tar -C ext/
+
+decho E2
+tar -g test.snar -vxf test.2.tar -C ext/
+
+mkdir ext/dirA/dirB
+touch ext/dirA/dirB/file
+
+decho E3
+tar -g test.snar -vxf test.2.tar -C ext/
+
+echo FIN
+test -d dirA && echo >&2 "toplevel dirA exists"
+exit 0
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "C0
+tar: dirA: Directory is new
+C1
+C2
+E0
+E1
+E2
+E3
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "C0
+dirA/
+dirA/a
+dirA/b
+C1
+dirA/
+dirA/c
+C2
+dirA/
+E0
+dirA/
+dirA/a
+dirA/b
+E1
+dirA/
+dirA/c
+E2
+dirA/
+tar: Deleting 'dirA/a'
+E3
+dirA/
+tar: Deleting 'dirA/dirB'
+FIN
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "C0
+tar: dirA: Directory is new
+C1
+C2
+E0
+E1
+E2
+E3
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "C0
+dirA/
+dirA/a
+dirA/b
+C1
+dirA/
+dirA/c
+C2
+dirA/
+E0
+dirA/
+dirA/a
+dirA/b
+E1
+dirA/
+dirA/c
+E2
+dirA/
+tar: Deleting 'dirA/a'
+E3
+dirA/
+tar: Deleting 'dirA/dirB'
+FIN
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_101
+#AT_START_102
+at_fn_group_banner 102 'incr08.at:38' \
+  "filename normalization" "                         " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "102. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr08.at:41:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir tartest
+cd tartest
+mkdir foo
+mkdir foo/subdir
+mkdir foo/subdir/dir1
+mkdir subdir
+mkdir subdir/dir2
+decho A
+find .|sort
+
+decho B
+DIR=\`pwd\`
+tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . \$DIR 2>../err |\\
+  sed \"s|\$DIR|ABSPATH|\"
+sed \"s|\$DIR|ABSPATH|\" ../err >&2
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr08.at:41"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir tartest
+cd tartest
+mkdir foo
+mkdir foo/subdir
+mkdir foo/subdir/dir1
+mkdir subdir
+mkdir subdir/dir2
+decho A
+find .|sort
+
+decho B
+DIR=`pwd`
+tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR 2>../err |\
+  sed "s|$DIR|ABSPATH|"
+sed "s|$DIR|ABSPATH|" ../err >&2
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "A
+B
+tar: .: Directory is new
+tar: ./subdir: Directory is new
+tar: ./subdir/dir1: Directory is new
+tar: ABSPATH: Directory is new
+tar: ABSPATH/subdir: Directory is new
+tar: ABSPATH/subdir/dir2: Directory is new
+tar: Removing leading \`/' from member names
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+.
+./foo
+./foo/subdir
+./foo/subdir/dir1
+./subdir
+./subdir/dir2
+B
+./
+./subdir/
+./subdir/dir1/
+ABSPATH/
+ABSPATH/subdir/
+ABSPATH/subdir/dir2/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr08.at:41"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_102
+#AT_START_103
+at_fn_group_banner 103 'incr09.at:26' \
+  "incremental with alternating -C" "                " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "103. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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 .
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr09.at:29"
+( $at_check_trace;
+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 .
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "A
+tar: .: Directory is new
+tar: middle: Directory is new
+tar: .: Directory is new
+B
+tar: .: Directory is new
+tar: .: Directory is new
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+./
+./
+middle/
+./bar_file
+./foo_file
+middle/middle_file
+B
+./
+./
+toplevel_file
+./bar_file
+./foo_file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr09.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_103
+#AT_START_104
+at_fn_group_banner 104 'incr10.at:18' \
+  "concatenated incremental archives (deletes)" "    " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "104. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+# Description: Extraction from concatenated incremental archives
+# produced spurious error messages when trying to set file ownership
+# and permissions on deleted directories.
+# Reported by: Alex Efros <powerman@powerman.name>
+# References: <20150411224008.GO24600@home.power>
+#             http://lists.gnu.org/archive/html/bug-tar/2015-04/msg00003.html
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr10.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir in
+mkdir in/dir
+decho Level 0
+tar -cvf 1.tar -g snap -C in .
+rmdir in/dir
+decho Level 1
+tar -cvf 2.tar -g snap -C in .
+cp 1.tar full.tar
+decho Concat
+tar -A 2.tar -f full.tar -g /dev/null
+decho Extract
+mkdir out
+tar -xvf full.tar -g /dev/null -C out
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "incr10.at:28"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+mkdir in
+mkdir in/dir
+decho Level 0
+tar -cvf 1.tar -g snap -C in .
+rmdir in/dir
+decho Level 1
+tar -cvf 2.tar -g snap -C in .
+cp 1.tar full.tar
+decho Concat
+tar -A 2.tar -f full.tar -g /dev/null
+decho Extract
+mkdir out
+tar -xvf full.tar -g /dev/null -C out
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Level 0
+tar: .: Directory is new
+tar: ./dir: Directory is new
+Level 1
+Concat
+Extract
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0
+./
+./dir/
+Level 1
+./
+Concat
+Extract
+./
+./dir/
+./
+tar: Deleting './dir'
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr10.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_104
+#AT_START_105
+at_fn_group_banner 105 'incr11.at:25' \
+  "concatenated incremental archives (renames)" "    " 11
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "105. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/incr11.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+ckmtime || exit 77
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+install-sh -d data/dir >/dev/null && genfile --file data/dir/file || exit 77
+decho Level 0
+tar -cvf full.tar -g snap -C data .
+decho Level 1
+mv data/dir data/dir2
+tar -cvf incr.tar -g snap -C data .
+decho Concat
+cp full.tar full2.tar
+tar -A -f full2.tar incr.tar
+decho Extract
+mkdir out
+tar -xvf full2.tar -g /dev/null -C out
+decho List
+find out | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "incr11.at:28"
+( $at_check_trace;
+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
+
+
+install-sh -d data/dir >/dev/null && genfile --file data/dir/file || exit 77
+decho Level 0
+tar -cvf full.tar -g snap -C data .
+decho Level 1
+mv data/dir data/dir2
+tar -cvf incr.tar -g snap -C data .
+decho Concat
+cp full.tar full2.tar
+tar -A -f full2.tar incr.tar
+decho Extract
+mkdir out
+tar -xvf full2.tar -g /dev/null -C out
+decho List
+find out | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Level 0
+tar: .: Directory is new
+tar: ./dir: Directory is new
+Level 1
+tar: ./dir2: Directory has been renamed from './dir'
+Concat
+Extract
+List
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Level 0
+./
+./dir/
+./dir/file
+Level 1
+./
+./dir2/
+Concat
+Extract
+./
+./dir/
+./dir/file
+./
+./dir2/
+List
+out
+out/dir2
+out/dir2/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/incr11.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_105
+#AT_START_106
+at_fn_group_banner 106 'filerem01.at:36' \
+  "file removed as we read it (ca. 22 seconds)" "    " 12
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "106. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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 --checkpoint=1 --checkpoint-action='sleep=1' \\
+       --checkpoint-action='echo' -c -f archive.tar \\
+       --listed-incremental db -v dir >/dev/null
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39"
+( $at_check_trace;
+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 --checkpoint=1 --checkpoint-action='sleep=1' \
+       --checkpoint-action='echo' -c -f archive.tar \
+       --listed-incremental db -v dir >/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
+tar: dir/sub: Directory is new
+tar: dir/file1: File removed before we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo stdout:; cat "$at_stdout"
+at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/filerem01.at:39:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+
+genfile --run --checkpoint=3 --unlink dir/file1 -- \\
+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
+       --checkpoint-action='echo' -c -f archive.tar \\
+       --listed-incremental db -v dir >/dev/null
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+
+genfile --run --checkpoint=3 --unlink dir/file1 -- \
+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
+       --checkpoint-action='echo' -c -f archive.tar \
+       --listed-incremental db -v dir >/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
+tar: dir/sub: Directory is new
+tar: dir/file1: File removed before we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo stdout:; cat "$at_stdout"
+at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+# Timing information:
+#
+# For -Hgnu the above command line takes about 8 seconds to execute and
+# produces:
+#
+# tar: dir: Directory is new
+# tar: dir/sub: Directory is new
+# dir/
+# tar: Write checkpoint 1
+# tar: Write checkpoint 2
+# dir/sub/
+# tar: Write checkpoint 3
+# tar: Write checkpoint 4
+# dir/file1
+# tar: Write checkpoint 5
+# dir/sub/file2
+# tar: Write checkpoint 6
+# tar: Write checkpoint 7
+# tar: Write checkpoint 8
+#
+# For -Hposix the above command line takes about 14 seconds to execute and
+# produces:
+#
+# ./tar: dir: Directory is new
+# ./tar: dir/sub: Directory is new
+# dir/
+# ./tar: Write checkpoint 1
+# ./tar: Write checkpoint 2
+# ./tar: Write checkpoint 3
+# dir/sub/
+# ./tar: Write checkpoint 4
+# ./tar: Write checkpoint 5
+# ./tar: Write checkpoint 6
+# dir/file1
+# ./tar: Write checkpoint 7
+# ./tar: Write checkpoint 8
+# ./tar: Write checkpoint 9
+# dir/sub/file2
+# ./tar: Write checkpoint 10
+# ./tar: Write checkpoint 11
+# ./tar: Write checkpoint 12
+# ./tar: Write checkpoint 13
+# ./tar: Write checkpoint 14
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_106
+#AT_START_107
+at_fn_group_banner 107 'filerem02.at:26' \
+  "toplevel file removed (ca. 24 seconds)" "         " 12
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "107. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/filerem02.at:29:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+mkdir dir2
+genfile --file dir2/file1
+
+genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \\
+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
+       --checkpoint-action='echo' -c -f archive.tar \\
+       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+mkdir dir/sub
+genfile --file dir/file1
+genfile --file dir/sub/file2
+mkdir dir2
+genfile --file dir2/file1
+
+genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \
+       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
+       --checkpoint-action='echo' -c -f archive.tar \
+       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo stderr:; cat "$at_stderr"
+echo stdout:; cat "$at_stdout"
+at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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 --checkpoint=1 --checkpoint-action='sleep=1' \\
+       --checkpoint-action='echo' -c -f archive.tar \\
+       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29"
+( $at_check_trace;
+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 --checkpoint=1 --checkpoint-action='sleep=1' \
+       --checkpoint-action='echo' -c -f archive.tar \
+       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo stderr:; cat "$at_stderr"
+echo stdout:; cat "$at_stdout"
+at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+# Ignore stdout and stderr because their contents depend on
+# the file system implementation.
+
+# Timing information: see filerem01.at
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_107
+#AT_START_108
+at_fn_group_banner 108 'rename01.at:25' \
+  "renamed dirs in incrementals" "                   " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "108. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/rename01.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
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:28"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+mkdir foo/bar
+genfile --file foo/bar/file
+
+echo "Creating base archive"
+tar -g incr -cf arch.1 -v foo
+
+mv foo/bar foo/baz
+
+echo "Creating incremental archive"
+tar -g incr -cf arch.2 -v foo
+
+mv foo old
+
+tar xfg arch.1 /dev/null
+
+echo "Begin directory listing 1"
+find foo | sort
+echo "End directory listing 1"
+
+tar xfg arch.2 /dev/null
+echo Begin directory listing 2
+find foo | sort
+echo End directory listing 2
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/file1
+foo/file2
+foo/bar/file
+Creating incremental archive
+foo/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/file
+foo/file1
+foo/file2
+End directory listing 1
+Begin directory listing 2
+foo
+foo/baz
+foo/baz/file
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename01.at:28:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:28"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/file1
+foo/file2
+foo/bar/file
+Creating incremental archive
+foo/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/file
+foo/file1
+foo/file2
+End directory listing 1
+Begin directory listing 2
+foo
+foo/baz
+foo/baz/file
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename01.at:28:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:28"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+mkdir foo/bar
+genfile --file foo/bar/file
+
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/file1
+foo/file2
+foo/bar/file
+Creating incremental archive
+foo/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/file
+foo/file1
+foo/file2
+End directory listing 1
+Begin directory listing 2
+foo
+foo/baz
+foo/baz/file
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_108
+#AT_START_109
+at_fn_group_banner 109 'rename02.at:25' \
+  "move between hierarchies" "                       " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "109. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/rename02.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
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:28"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+mkdir foo/bar
+genfile --file foo/bar/file.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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/bar/baz: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/bar/baz/
+foo/file1
+foo/file2
+foo/bar/file.r
+foo/bar/baz/file.z
+Creating incremental archive
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/baz
+foo/bar/baz/file.z
+foo/bar/file.r
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 2
+foo
+foo/bar
+foo/bar/file.r
+foo/baz
+foo/baz/file.z
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename02.at:28:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:28"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/bar/baz: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/bar/baz/
+foo/file1
+foo/file2
+foo/bar/file.r
+foo/bar/baz/file.z
+Creating incremental archive
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/baz
+foo/bar/baz/file.z
+foo/bar/file.r
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 2
+foo
+foo/bar
+foo/bar/file.r
+foo/baz
+foo/baz/file.z
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename02.at:28:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:28"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+mkdir foo/bar
+genfile --file foo/bar/file.r
+mkdir foo/bar/baz
+genfile --file foo/bar/baz/file.z
+
+sleep 1
+
+echo "Creating base archive"
+tar -g incr -cf arch.1 -v foo
+
+mv foo/bar/baz foo
+
+echo "Creating incremental archive"
+tar -g incr -cf arch.2 -v foo
+
+mv foo old
+
+tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
+sort tmperr >&2
+
+echo "Begin directory listing 1"
+find foo | sort
+echo "End directory listing 1"
+
+tar xfgv arch.2 /dev/null --warning=no-timestamp
+echo Begin directory listing 2
+find foo | sort
+echo End directory listing 2
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
+tar: foo/bar: Directory is new
+tar: foo/bar/baz: Directory is new
+tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating base archive
+foo/
+foo/bar/
+foo/bar/baz/
+foo/file1
+foo/file2
+foo/bar/file.r
+foo/bar/baz/file.z
+Creating incremental archive
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 1
+foo
+foo/bar
+foo/bar/baz
+foo/bar/baz/file.z
+foo/bar/file.r
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/bar/
+foo/baz/
+Begin directory listing 2
+foo
+foo/bar
+foo/bar/file.r
+foo/baz
+foo/baz/file.z
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_109
+#AT_START_110
+at_fn_group_banner 110 'rename03.at:24' \
+  "cyclic renames" "                                 " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "110. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/rename03.at:27:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+
+mkdir foo/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:27"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+
+mkdir foo/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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "First dump
+tar: foo/a: Directory is new
+tar: foo/b: Directory is new
+tar: foo/c: Directory is new
+tar: foo: Directory is new
+Second dump
+tar: foo/a: Directory has been renamed from 'foo/c'
+tar: foo/b: Directory has been renamed from 'foo/a'
+tar: foo/c: Directory has been renamed from 'foo/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+foo/file1
+foo/file2
+foo/a/filea
+foo/b/fileb
+foo/c/filec
+Second dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 1
+foo
+foo/a
+foo/a/filea
+foo/b
+foo/b/fileb
+foo/c
+foo/c/filec
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 2
+foo
+foo/a
+foo/a/filec
+foo/b
+foo/b/filea
+foo/c
+foo/c/fileb
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename03.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/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:27"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+
+mkdir foo/a
+genfile --file foo/a/filea
+
+mkdir foo/b
+genfile --file foo/b/fileb
+
+mkdir foo/c
+genfile --file foo/c/filec
+
+sleep 1
+
+echo "First dump"
+echo "First dump">&2
+tar -g incr -cf arch.1 -v foo 2>tmperr
+sort tmperr >&2
+
+# Shuffle directories:
+(cd foo
+mv a $$
+mv c a
+mv b c
+mv $$ b)
+
+echo "Second dump"
+echo "Second dump" >&2
+tar -g incr -cf arch.2 -v foo 2>tmperr
+sort tmperr >&2
+
+tar xfg arch.1 /dev/null --warning=no-timestamp
+
+echo "Begin directory listing 1"
+find foo | sort
+echo "End directory listing 1"
+
+tar xfgv arch.2 /dev/null --warning=no-timestamp
+echo Begin directory listing 2
+find foo | sort
+echo End directory listing 2
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "First dump
+tar: foo/a: Directory is new
+tar: foo/b: Directory is new
+tar: foo/c: Directory is new
+tar: foo: Directory is new
+Second dump
+tar: foo/a: Directory has been renamed from 'foo/c'
+tar: foo/b: Directory has been renamed from 'foo/a'
+tar: foo/c: Directory has been renamed from 'foo/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+foo/file1
+foo/file2
+foo/a/filea
+foo/b/fileb
+foo/c/filec
+Second dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 1
+foo
+foo/a
+foo/a/filea
+foo/b
+foo/b/fileb
+foo/c
+foo/c/filec
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 2
+foo
+foo/a
+foo/a/filec
+foo/b
+foo/b/filea
+foo/c
+foo/c/fileb
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename03.at:27:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+mkdir foo
+genfile --file foo/file1
+genfile --file foo/file2
+
+mkdir foo/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "First dump
+tar: foo/a: Directory is new
+tar: foo/b: Directory is new
+tar: foo/c: Directory is new
+tar: foo: Directory is new
+Second dump
+tar: foo/a: Directory has been renamed from 'foo/c'
+tar: foo/b: Directory has been renamed from 'foo/a'
+tar: foo/c: Directory has been renamed from 'foo/b'
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+foo/file1
+foo/file2
+foo/a/filea
+foo/b/fileb
+foo/c/filec
+Second dump
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 1
+foo
+foo/a
+foo/a/filea
+foo/b
+foo/b/fileb
+foo/c
+foo/c/filec
+foo/file1
+foo/file2
+End directory listing 1
+foo/
+foo/a/
+foo/b/
+foo/c/
+Begin directory listing 2
+foo
+foo/a
+foo/a/filec
+foo/b
+foo/b/filea
+foo/c
+foo/c/fileb
+foo/file1
+foo/file2
+End directory listing 2
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_110
+#AT_START_111
+at_fn_group_banner 111 'rename04.at:27' \
+  "renamed directory containing subdirectories" "    " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "111. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/rename04.at:30:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2
+find dir | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2
+find dir | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename04.at:30:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2
+find dir | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2
+find dir | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_111
+#AT_START_112
+at_fn_group_banner 112 'rename05.at:24' \
+  "renamed subdirectories" "                         " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "112. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir.0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir.0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/rename05.at:27:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory/subdir directory/subdir.0
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1 --warning=no-timestamp
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2 --warning=no-timestamp
+find dir | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+decho Creating directory structure
+mkdir directory
+mkdir directory/subdir
+genfile --file=directory/file
+
+decho Creating initial archive
+tar -cf archive.1 -g db.1 directory
+
+decho Renaming
+mv directory/subdir directory/subdir.0
+mv directory dir
+
+decho Creating incremental archive
+cp db.1 db.2
+tar -cf archive.2 -g db.2 dir
+
+mv dir orig
+
+decho First restore
+tar -xf archive.1 -g db.1 --warning=no-timestamp
+find directory | sort
+
+decho Second restore
+tar -xf archive.2 -g db.2 --warning=no-timestamp
+find dir | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+Second restore
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating directory structure
+Creating initial archive
+Renaming
+Creating incremental archive
+First restore
+directory
+directory/file
+directory/subdir
+Second restore
+dir
+dir/subdir.0
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_112
+#AT_START_113
+at_fn_group_banner 113 'chtype.at:27' \
+  "changed file types in incrementals" "             " 13
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "113. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/chtype.at:30:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
+mkdir directory/a
+genfile --file directory/a/a
+
+echo First backup
+tar --create --file=archive.1 --listed-incremental=db.1 directory
+
+sleep 2
+
+# Remove directory b and create a file with this name.
+# Previous versions were not able to restore over this file.
+rm -r directory/b
+genfile --file directory/b
+genfile --file directory/a/b
+
+echo Second backup
+tar --create --file=archive.2 --listed-incremental=db.2 directory
+
+# Delete a
+rm -r directory
+
+echo Restore archive.1
+tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
+echo Restore archive.2
+tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
+find directory | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
+mkdir directory/a
+genfile --file directory/a/a
+
+echo First backup
+tar --create --file=archive.1 --listed-incremental=db.1 directory
+
+sleep 2
+
+# Remove directory b and create a file with this name.
+# Previous versions were not able to restore over this file.
+rm -r directory/b
+genfile --file directory/b
+genfile --file directory/a/b
+
+echo Second backup
+tar --create --file=archive.2 --listed-incremental=db.2 directory
+
+# Delete a
+rm -r directory
+
+echo Restore archive.1
+tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
+echo Restore archive.2
+tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
+find directory | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First backup
+Second backup
+Restore archive.1
+Restore archive.2
+directory
+directory/a
+directory/a/a
+directory/a/b
+directory/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First backup
+Second backup
+Restore archive.1
+Restore archive.2
+directory
+directory/a
+directory/a/a
+directory/a/b
+directory/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/chtype.at:30:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
+mkdir directory/a
+genfile --file directory/a/a
+
+echo First backup
+tar --create --file=archive.1 --listed-incremental=db.1 directory
+
+sleep 2
+
+# Remove directory b and create a file with this name.
+# Previous versions were not able to restore over this file.
+rm -r directory/b
+genfile --file directory/b
+genfile --file directory/a/b
+
+echo Second backup
+tar --create --file=archive.2 --listed-incremental=db.2 directory
+
+# Delete a
+rm -r directory
+
+echo Restore archive.1
+tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
+echo Restore archive.2
+tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
+find directory | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
+mkdir directory/a
+genfile --file directory/a/a
+
+echo First backup
+tar --create --file=archive.1 --listed-incremental=db.1 directory
+
+sleep 2
+
+# Remove directory b and create a file with this name.
+# Previous versions were not able to restore over this file.
+rm -r directory/b
+genfile --file directory/b
+genfile --file directory/a/b
+
+echo Second backup
+tar --create --file=archive.2 --listed-incremental=db.2 directory
+
+# Delete a
+rm -r directory
+
+echo Restore archive.1
+tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
+echo Restore archive.2
+tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
+find directory | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "First backup
+Second backup
+Restore archive.1
+Restore archive.2
+directory
+directory/a
+directory/a/a
+directory/a/b
+directory/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_113
+#AT_START_114
+at_fn_group_banner 114 'ignfail.at:24' \
+  "ignfail" "                                        " 14
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "114. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/ignfail.at:27:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "-----
+tar: file: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: file: Warning: Cannot open: Permission denied
+-----
+tar: directory: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: directory: Warning: Cannot open: Permission denied
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/ignfail.at:27:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "-----
+tar: file: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: file: Warning: Cannot open: Permission denied
+-----
+tar: directory: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: directory: Warning: Cannot open: Permission denied
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/ignfail.at:27:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "-----
+tar: file: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: file: Warning: Cannot open: Permission denied
+-----
+tar: directory: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: directory: Warning: Cannot open: Permission denied
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/ignfail.at:27:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
+
+# The test is meaningless for super-user.
+
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 && exit 77
+
+
+touch file
+mkdir directory
+touch directory/file
+
+echo 1>&2 -----
+chmod 000 file
+tar cf archive file
+status=\$?
+chmod 600 file
+test \$status = 2 || exit 1
+
+echo 1>&2 -----
+chmod 000 file
+tar cf archive --ignore-failed-read file || exit 1
+status=\$?
+chmod 600 file
+test \$status = 0 || exit 1
+
+echo 1>&2 -----
+chmod 000 directory
+tar cf archive directory
+status=\$?
+chmod 700 directory
+test \$status = 2 || exit 1
+
+echo 1>&2 -----
+chmod 000 directory
+tar cf archive --ignore-failed-read directory || exit 1
+status=\$?
+chmod 700 directory
+test \$status = 0
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:27"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+# The test is meaningless for super-user.
+
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 && exit 77
+
+
+touch file
+mkdir directory
+touch directory/file
+
+echo 1>&2 -----
+chmod 000 file
+tar cf archive file
+status=$?
+chmod 600 file
+test $status = 2 || exit 1
+
+echo 1>&2 -----
+chmod 000 file
+tar cf archive --ignore-failed-read file || exit 1
+status=$?
+chmod 600 file
+test $status = 0 || exit 1
+
+echo 1>&2 -----
+chmod 000 directory
+tar cf archive directory
+status=$?
+chmod 700 directory
+test $status = 2 || exit 1
+
+echo 1>&2 -----
+chmod 000 directory
+tar cf archive --ignore-failed-read directory || exit 1
+status=$?
+chmod 700 directory
+test $status = 0
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "-----
+tar: file: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: file: Warning: Cannot open: Permission denied
+-----
+tar: directory: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: directory: Warning: Cannot open: Permission denied
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/ignfail.at:27:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:27"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "-----
+tar: file: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: file: Warning: Cannot open: Permission denied
+-----
+tar: directory: Cannot open: Permission denied
+tar: Exiting with failure status due to previous errors
+-----
+tar: directory: Warning: Cannot open: Permission denied
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_114
+#AT_START_115
+at_fn_group_banner 115 'link01.at:34' \
+  "link count gt 2" "                                " 15
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "115. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/link01.at:37:
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link01.at:37"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "test.txt
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link01.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/link01.at:37:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
+tar cf archive directory/test1/test.txt directory/test1/test.txt
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_89
-#AT_START_90
-at_fn_group_banner 90 'incr05.at:21' \
-  "incremental dumps with -C" "                      " 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "90. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link01.at:37"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
+tar cf archive directory/test1/test.txt directory/test1/test.txt
 
+rm -r directory
+tar xf archive --warning=no-timestamp
 
-  { set +x
-$as_echo "$at_srcdir/incr05.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+ls directory/test1
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "test.txt
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link01.at:37"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/link01.at:37:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link01.at:37"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0
-./
-./sub/
-./file1
-./sub/file2
-Level 1
-./
-./sub/
-./file3
+echo >>"$at_stdout"; $as_echo "test.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link01.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr05.at:24:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/link01.at:37:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link01.at:37"
 ( $at_check_trace;
-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 *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0
-./
-./sub/
-./file1
-./sub/file2
-Level 1
-./
-./sub/
-./file3
+echo >>"$at_stdout"; $as_echo "test.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link01.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr05.at:24:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/link01.at:37:
+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
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr05.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link01.at:37"
 ( $at_check_trace;
-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 *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
+mkdir directory
+mkdir directory/test1
+mkdir directory/test2
 
-echo Level 0
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+echo TEST > directory/test1/test.txt
+ln directory/test1/test.txt directory/test2/test.txt || exit 77
 
-genfile --file dir/file3
-echo Level 1
-tar -c -f archive.tar -g db -C dir -v --warning=no-new-dir .
+tar cf archive directory/test1/test.txt directory/test1/test.txt
+
+rm -r directory
+tar xf archive --warning=no-timestamp
+
+ls directory/test1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0
-./
-./sub/
-./file1
-./sub/file2
-Level 1
-./
-./sub/
-./file3
+echo >>"$at_stdout"; $as_echo "test.txt
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr05.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link01.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -21345,14 +29388,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_90
-#AT_START_91
-at_fn_group_banner 91 'incr06.at:21' \
-  "incremental dumps of nested directories" "        " 11
+#AT_STOP_115
+#AT_START_116
+at_fn_group_banner 116 'link02.at:32' \
+  "preserve hard links with --remove-files" "        " 15
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "91. $at_setup_line: testing $at_desc ..."
+  $as_echo "116. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -21360,109 +29403,54 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/incr06.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/link02.at:35:
+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
-mkdir dir/sub
-mkdir dir/sub/a
-mkdir dir/sub/b
-genfile --file dir/file1
-genfile --file dir/sub/file2
-genfile --file dir/sub/a/file3
-
-echo Level 0 . sub
-tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 0 sub .
-tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
-
-mkdir dir/c
-genfile --file dir/sub/b/file4
-
-echo Level 1 . sub
-tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 1 sub .
-tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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
-mkdir dir/sub
-mkdir dir/sub/a
-mkdir dir/sub/b
-genfile --file dir/file1
-genfile --file dir/sub/file2
-genfile --file dir/sub/a/file3
-
-echo Level 0 . sub
-tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 0 sub .
-tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
-
-mkdir dir/c
-genfile --file dir/sub/b/file4
-
-echo Level 1 . sub
-tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 1 sub .
-tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0 . sub
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 0 sub .
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 1 . sub
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
-Level 1 sub .
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
+echo >>"$at_stdout"; $as_echo "file1
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr06.at:24:
+$as_echo "$at_srcdir/link02.at:35:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -21471,28 +29459,14 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/a
-mkdir dir/sub/b
-genfile --file dir/file1
-genfile --file dir/sub/file2
-genfile --file dir/sub/a/file3
-
-echo Level 0 . sub
-tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 0 sub .
-tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
-
-mkdir dir/c
-genfile --file dir/sub/b/file4
-
-echo Level 1 . sub
-tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 1 sub .
-tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -21502,69 +29476,75 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/a
-mkdir dir/sub/b
-genfile --file dir/file1
-genfile --file dir/sub/file2
-genfile --file dir/sub/a/file3
-
-echo Level 0 . sub
-tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 0 sub .
-tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
-
-mkdir dir/c
-genfile --file dir/sub/b/file4
-
-echo Level 1 . sub
-tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 1 sub .
-tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0 . sub
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 0 sub .
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 1 . sub
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
-Level 1 sub .
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
+echo >>"$at_stdout"; $as_echo "file1
+file1
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/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'
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+( $at_check_trace;
+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'
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr06.at:24:
+$as_echo "$at_srcdir/link02.at:35:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -21573,28 +29553,14 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-mkdir dir/sub/a
-mkdir dir/sub/b
-genfile --file dir/file1
-genfile --file dir/sub/file2
-genfile --file dir/sub/a/file3
-
-echo Level 0 . sub
-tar -c -f archive-0.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 0 sub .
-tar -c -f archive-0.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
-
-mkdir dir/c
-genfile --file dir/sub/b/file4
-
-echo Level 1 . sub
-tar -c -f archive-1.1.tar -g db.1 -C dir -v --warning=no-new-dir . sub
-echo Level 1 sub .
-tar -c -f archive-1.2.tar -g db.2 -C dir -v --warning=no-new-dir sub .
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr06.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -21604,64 +29570,70 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-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
+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'
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "file1
+file1
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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 .
+              { set +x
+$as_echo "$at_srcdir/link02.at:35:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-mkdir dir/c
-genfile --file dir/sub/b/file4
+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'
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-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 -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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Level 0 . sub
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 0 sub .
-./
-sub/
-sub/a/
-sub/b/
-./file1
-sub/file2
-sub/a/file3
-Level 1 . sub
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
-Level 1 sub .
-./
-./c/
-sub/
-sub/a/
-sub/b/
-sub/b/file4
+echo >>"$at_stdout"; $as_echo "file1
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr06.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -21672,175 +29644,99 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_91
-#AT_START_92
-at_fn_group_banner 92 'incr07.at:18' \
-  "incremental restores with -C" "                   " 11
+#AT_STOP_116
+#AT_START_117
+at_fn_group_banner 117 'link03.at:24' \
+  "working -l with --remove-files" "                 " 15
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "92. $at_setup_line: testing $at_desc ..."
+  $as_echo "117. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-# Tar 1.26 had problems extracting from incremental restores when given
-# the -C option.  The code in incremen.c:try_purge_directory and
-# misc.c:remove_any_file was using savedir(), which ignored eventual changes
-# in the current working directory and caused the malfunctioning.
-#
-# The problem was reported by Piotr Rotter on 2013-03-22.
-#
-# This testcase is based on scripts provided by Piotr Rotter and Nathan
-# Stratton Treadway.
-#
-# References: <514C8F56.90900@active24.pl>,
-#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00036.html,
-#             <20130326181922.GZ3732@shire.ontko.com>,
-#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00042.html,
-#             <20130327051828.GA3732@shire.ontko.com>,
-#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00043.html,
-#             <20130327054957.GB3732@shire.ontko.com>,
-#             http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00044.html
+
 
 
 
   { set +x
-$as_echo "$at_srcdir/incr07.at:40:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/link03.at:34:
+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 A
-echo 'a' > A/a
-echo 'a' > A/b
-
-decho C0
-tar -g test.snar -vcf test.0.tar A
-
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
-
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
-
-mkdir ext
-rm -rf A
-
-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/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext/A/B
-touch ext/A/B/file
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo FIN
-test -d A && echo >&2 \"toplevel A exists\"
-exit 0
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 A
-echo 'a' > A/a
-echo 'a' > A/b
-
-decho C0
-tar -g test.snar -vcf test.0.tar A
-
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
-
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
-
-mkdir ext
-rm -rf A
-
-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/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext/A/B
-touch ext/A/B/file
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo FIN
-test -d A && echo >&2 "toplevel A exists"
-exit 0
+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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "C0
-tar: A: Directory is new
-C1
-C2
-E0
-E1
-E2
-E3
+echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "C0
-A/
-A/a
-A/b
-C1
-A/
-A/c
-C2
-A/
-E0
-A/
-A/a
-A/b
-E1
-A/
-A/c
-E2
-A/
-tar: Deleting 'A/a'
-E3
-A/
-tar: Deleting 'A/B'
-FIN
+echo >>"$at_stdout"; $as_echo "archive.1
+archive.2
+testing archive.2
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr07.at:40:
+$as_echo "$at_srcdir/link03.at:34:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -21849,43 +29745,26 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir A
-echo 'a' > A/a
-echo 'a' > A/b
-
-decho C0
-tar -g test.snar -vcf test.0.tar A
-
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
-
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
-
-mkdir ext
-rm -rf A
-
-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/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext/A/B
-touch ext/A/B/file
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo FIN
-test -d A && echo >&2 \"toplevel A exists\"
-exit 0
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -21895,86 +29774,119 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir A
-echo 'a' > A/a
-echo 'a' > A/b
 
-decho C0
-tar -g test.snar -vcf test.0.tar A
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext
-rm -rf A
+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'
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "archive.1
+archive.2
+testing archive.2
+file1
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-decho E0
-tar -g test.snar -vxf test.0.tar -C ext/
-decho E1
-tar -g test.snar -vxf test.1.tar -C ext/
+              { set +x
+$as_echo "$at_srcdir/link03.at:34:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-decho E2
-tar -g test.snar -vxf test.2.tar -C ext/
 
-mkdir ext/A/B
-touch ext/A/B/file
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-echo FIN
-test -d A && echo >&2 "toplevel A exists"
-exit 0
+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'
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
+
+
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
+
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
+
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
+
+echo archive.2
+tar -c -f archive.2 -l --remove-files file1 file2 file3
+echo testing archive.2
+tar tfv archive.2 | sed -n 's/.*file[2-3] link to //p'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "C0
-tar: A: Directory is new
-C1
-C2
-E0
-E1
-E2
-E3
+echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "C0
-A/
-A/a
-A/b
-C1
-A/
-A/c
-C2
-A/
-E0
-A/
-A/a
-A/b
-E1
-A/
-A/c
-E2
-A/
-tar: Deleting 'A/a'
-E3
-A/
-tar: Deleting 'A/B'
-FIN
+echo >>"$at_stdout"; $as_echo "archive.1
+archive.2
+testing archive.2
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/incr07.at:40:
+$as_echo "$at_srcdir/link03.at:34:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -21983,43 +29895,26 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir A
-echo 'a' > A/a
-echo 'a' > A/b
-
-decho C0
-tar -g test.snar -vcf test.0.tar A
-
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
-
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
-
-mkdir ext
-rm -rf A
-
-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/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext/A/B
-touch ext/A/B/file
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo FIN
-test -d A && echo >&2 \"toplevel A exists\"
-exit 0
+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'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "incr07.at:40"
+at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -22029,107 +29924,44 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir A
-echo 'a' > A/a
-echo 'a' > A/b
 
-decho C0
-tar -g test.snar -vcf test.0.tar A
-
-echo 'a' > A/c
-decho C1
-tar -g test.snar -vcf test.1.tar A
-
-rm -f A/a
-decho C2
-tar -g test.snar -vcf test.2.tar A
-
-mkdir ext
-rm -rf A
-
-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/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir ext/A/B
-touch ext/A/B/file
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho E3
-tar -g test.snar -vxf test.2.tar -C ext/
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-echo FIN
-test -d A && echo >&2 "toplevel A exists"
-exit 0
+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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "C0
-tar: A: Directory is new
-C1
-C2
-E0
-E1
-E2
-E3
+echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "C0
-A/
-A/a
-A/b
-C1
-A/
-A/c
-C2
-A/
-E0
-A/
-A/a
-A/b
-E1
-A/
-A/c
-E2
-A/
-tar: Deleting 'A/a'
-E3
-A/
-tar: Deleting 'A/B'
-FIN
+echo >>"$at_stdout"; $as_echo "archive.1
+archive.2
+testing archive.2
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr07.at:40"
+at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_92
-#AT_START_93
-at_fn_group_banner 93 'incr08.at:38' \
-  "filename normalization" "                         " 11
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "93. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/incr08.at:41:
+              { set +x
+$as_echo "$at_srcdir/link03.at:34:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -22139,25 +29971,25 @@ export TAR_OPTIONS
 rm -rf *
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir tartest
-cd tartest
-mkdir foo
-mkdir foo/subdir
-mkdir foo/subdir/dir1
-mkdir subdir
-mkdir subdir/dir2
-decho A
-find .|sort
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho B
-DIR=\`pwd\`
-tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . \$DIR 2>../err |\\
-  sed \"s|\$DIR|ABSPATH|\"
-sed \"s|\$DIR|ABSPATH|\" ../err >&2
+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'
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "incr08.at:41"
+at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -22168,73 +30000,57 @@ export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+genfile -l 64 -f file1
+ln file1 file2
+ln file2 file3
+ln file3 file4
 
-mkdir tartest
-cd tartest
-mkdir foo
-mkdir foo/subdir
-mkdir foo/subdir/dir1
-mkdir subdir
-mkdir subdir/dir2
-decho A
-find .|sort
+echo archive.1
+tar -c -f archive.1 -l --remove-files file1 file2 file3 file4
 
-decho B
-DIR=`pwd`
-tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR 2>../err |\
-  sed "s|$DIR|ABSPATH|"
-sed "s|$DIR|ABSPATH|" ../err >&2
+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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-tar: .: Directory is new
-tar: ./subdir: Directory is new
-tar: ./subdir/dir1: Directory is new
-tar: ABSPATH: Directory is new
-tar: ABSPATH/subdir: Directory is new
-tar: ABSPATH/subdir/dir2: Directory is new
-tar: Removing leading \`/' from member names
+echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./foo
-./foo/subdir
-./foo/subdir/dir1
-./subdir
-./subdir/dir2
-B
-./
-./subdir/
-./subdir/dir1/
-ABSPATH/
-ABSPATH/subdir/
-ABSPATH/subdir/dir2/
+echo >>"$at_stdout"; $as_echo "archive.1
+archive.2
+testing archive.2
+file1
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr08.at:41"
+at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_93
-#AT_START_94
-at_fn_group_banner 94 'incr09.at:26' \
-  "incremental with alternating -C" "                " 11
+#AT_STOP_117
+#AT_START_118
+at_fn_group_banner 118 'link04.at:29' \
+  "link count is 1 but multiple occurrences" "       " 15
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "94. $at_setup_line: testing $at_desc ..."
+  $as_echo "118. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -22242,281 +30058,347 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/incr09.at:29:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/link04.at:32:
+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
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar cf archive dir dir
+tar tvf archive | sed '
+  s,.*[0-9] dir/,dir/,
+' | sort
 
-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 .
+echo --
 
-rm foo.tar
->toplevel_file
-decho B
-tar -cvf foo.tar --incremental -C foo . -C \`pwd\` toplevel_file  -C bar .
+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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "incr09.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar cf archive dir dir
+tar tvf archive | sed '
+  s,.*[0-9] dir/,dir/,
+' | sort
 
-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 .
+echo --
 
-rm foo.tar
->toplevel_file
-decho B
-tar -cvf foo.tar --incremental -C foo . -C `pwd` toplevel_file  -C bar .
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-tar: .: Directory is new
-tar: middle: Directory is new
-tar: .: Directory is new
-B
-tar: .: Directory is new
-tar: .: Directory is new
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-./
-./
-middle/
-./bar_file
-./foo_file
-middle/middle_file
-B
-./
-./
-toplevel_file
-./bar_file
-./foo_file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/
+dir/file
+dir/file link to dir/file
+dir/symlink -> file
+dir/symlink link to dir/symlink
+--
+==
+dir/
+dir/FOO
+dir/FOO link to dir/FOO
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/incr09.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_94
-#AT_START_95
-at_fn_group_banner 95 'filerem01.at:36' \
-  "file removed as we read it (ca. 22 seconds)" "    " 12
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "95. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/filerem01.at:39:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/link04.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 *
 
 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
 
-genfile --run --checkpoint=3 --unlink dir/file1 -- \\
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
-       --checkpoint-action='echo' -c -f archive.tar \\
-       --listed-incremental db -v dir >/dev/null
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
 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
 
-genfile --run --checkpoint=3 --unlink dir/file1 -- \
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
-       --checkpoint-action='echo' -c -f archive.tar \
-       --listed-incremental db -v dir >/dev/null
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
-tar: dir/sub: Directory is new
-tar: dir/file1: File removed before we read it
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/
+dir/file
+dir/file link to dir/file
+dir/symlink -> file
+dir/symlink link to dir/symlink
+--
+==
+dir/
+dir/FOO
+dir/FOO link to dir/FOO
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo stdout:; cat "$at_stdout"
-at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/filerem01.at:39:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/link04.at:32:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 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
 
-genfile --run --checkpoint=3 --unlink dir/file1 -- \\
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
-       --checkpoint-action='echo' -c -f archive.tar \\
-       --listed-incremental db -v dir >/dev/null
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "filerem01.at:39"
+at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
 ( $at_check_trace;
-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 *
 
 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
 
-genfile --run --checkpoint=3 --unlink dir/file1 -- \
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
-       --checkpoint-action='echo' -c -f archive.tar \
-       --listed-incremental db -v dir >/dev/null
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: dir: Directory is new
-tar: dir/sub: Directory is new
-tar: dir/file1: File removed before we read it
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/
+dir/file
+dir/file link to dir/file
+dir/symlink -> file
+dir/symlink link to dir/symlink
+--
+==
+dir/
+dir/FOO
+dir/FOO link to dir/FOO
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo stdout:; cat "$at_stdout"
-at_fn_check_status 1 $at_status "$at_srcdir/filerem01.at:39"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/link04.at:32:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
+mkdir dir
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
+tar cf archive dir dir
+tar tvf archive | sed '
+  s,.*[0-9] dir/,dir/,
+' | sort
 
-# Timing information:
-#
-# For -Hgnu the above command line takes about 8 seconds to execute and
-# produces:
-#
-# tar: dir: Directory is new
-# tar: dir/sub: Directory is new
-# dir/
-# tar: Write checkpoint 1
-# tar: Write checkpoint 2
-# dir/sub/
-# tar: Write checkpoint 3
-# tar: Write checkpoint 4
-# dir/file1
-# tar: Write checkpoint 5
-# dir/sub/file2
-# tar: Write checkpoint 6
-# tar: Write checkpoint 7
-# tar: Write checkpoint 8
-#
-# For -Hposix the above command line takes about 14 seconds to execute and
-# produces:
-#
-# ./tar: dir: Directory is new
-# ./tar: dir/sub: Directory is new
-# dir/
-# ./tar: Write checkpoint 1
-# ./tar: Write checkpoint 2
-# ./tar: Write checkpoint 3
-# dir/sub/
-# ./tar: Write checkpoint 4
-# ./tar: Write checkpoint 5
-# ./tar: Write checkpoint 6
-# dir/file1
-# ./tar: Write checkpoint 7
-# ./tar: Write checkpoint 8
-# ./tar: Write checkpoint 9
-# dir/sub/file2
-# ./tar: Write checkpoint 10
-# ./tar: Write checkpoint 11
-# ./tar: Write checkpoint 12
-# ./tar: Write checkpoint 13
-# ./tar: Write checkpoint 14
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_95
-#AT_START_96
-at_fn_group_banner 96 'filerem02.at:26' \
-  "toplevel file removed (ca. 24 seconds)" "         " 12
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "96. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
+
+mkdir dir
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
+tar cf archive dir dir
+tar tvf archive | sed '
+  s,.*[0-9] dir/,dir/,
+' | sort
 
+echo --
 
+tar cfl archive dir dir
 
+echo ==
 
-  { set +x
-$as_echo "$at_srcdir/filerem02.at:29:
+tar chf archive dir
+tar tvf archive | sed '
+  s,.*[0-9] dir/,dir/,
+  s,file,FOO,g
+  s,symlink,FOO,g
+' | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/
+dir/file
+dir/file link to dir/file
+dir/symlink -> file
+dir/symlink link to dir/symlink
+--
+==
+dir/
+dir/FOO
+dir/FOO link to dir/FOO
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/link04.at:32:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -22526,18 +30408,28 @@ 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
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
-genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \\
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
-       --checkpoint-action='echo' -c -f archive.tar \\
-       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -22548,107 +30440,150 @@ 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
+echo TEST > dir/file
+ln -s file dir/symlink || exit 77
 
-genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
-       --checkpoint-action='echo' -c -f archive.tar \
-       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo stderr:; cat "$at_stderr"
-echo stdout:; cat "$at_stdout"
-at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/
+dir/
+dir/file
+dir/file link to dir/file
+dir/symlink -> file
+dir/symlink link to dir/symlink
+--
+==
+dir/
+dir/FOO
+dir/FOO link to dir/FOO
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/filerem02.at:29:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_118
+#AT_START_119
+at_fn_group_banner 119 'longv7.at:25' \
+  "long names in V7 archives" "                      " 16
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "119. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/longv7.at:31:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
-mkdir dir2
-genfile --file dir2/file1
+mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
+touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c
 
-genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \\
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \\
-       --checkpoint-action='echo' -c -f archive.tar \\
-       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
+echo separator
+tar tf archive
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "filerem02.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "longv7.at:31"
 ( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-mkdir dir/sub
-genfile --file dir/file1
-genfile --file dir/sub/file2
-mkdir dir2
-genfile --file dir2/file1
+mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
+touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c
 
-genfile --run --checkpoint=3 --exec 'rm -rf dir2' -- \
-       tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
-       --checkpoint-action='echo' -c -f archive.tar \
-       --listed-incremental db -v --warning=no-new-dir dir dir2 >/dev/null
+tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
+echo separator
+tar tf archive
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo stderr:; cat "$at_stderr"
-echo stdout:; cat "$at_stdout"
-at_fn_check_status 2 $at_status "$at_srcdir/filerem02.at:29"
+echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c: file name is too long (max 99); not dumped
+tar: Exiting with failure status due to previous errors
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+this_is_a_very_long_name_for_a_directory_which_causes_problems/
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/longv7.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-# Ignore stdout and stderr because their contents depend on
-# the file system implementation.
 
-# Timing information: see filerem01.at
 
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_96
-#AT_START_97
-at_fn_group_banner 97 'rename01.at:24' \
-  "renamed dirs in incrementals" "                   " 13
+#AT_STOP_119
+#AT_START_120
+at_fn_group_banner 120 'long01.at:28' \
+  "long file names divisible by block size" "        " 16
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "97. $at_setup_line: testing $at_desc ..."
+  $as_echo "120. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
+
+
+
+
   { set +x
-$as_echo "$at_srcdir/rename01.at:27:
+$as_echo "$at_srcdir/long01.at:36:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -22658,37 +30593,12 @@ 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\"
+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 xfg arch.2 /dev/null
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -22699,75 +30609,25 @@ 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"
+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 xfg arch.2 /dev/null
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
-)
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/file1
-foo/file2
-foo/bar/file
-Creating incremental archive
-foo/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/file
-foo/file1
-foo/file2
-End directory listing 1
-Begin directory listing 2
-foo
-foo/baz
-foo/baz/file
-foo/file1
-foo/file2
-End directory listing 2
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/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
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/rename01.at:27:
+$as_echo "$at_srcdir/long01.at:36:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -22777,37 +30637,12 @@ 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\"
+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 xfg arch.2 /dev/null
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -22818,624 +30653,484 @@ export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77
+echo test > endfile
 
+tar cf archive 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde endfile
+tar tf archive)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/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
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_120
+#AT_START_121
+at_fn_group_banner 121 'lustar01.at:21' \
+  "ustar: unsplittable file name" "                  " 16
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "121. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "lustar01.at:27"
+( $at_check_trace;
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar'
+echo >>"$at_stderr"; $as_echo "tar: 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: file name is too long (cannot be split); not dumped
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/file1
-foo/file2
-foo/bar/file
-Creating incremental archive
-foo/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/file
-foo/file1
-foo/file2
-End directory listing 1
-Begin directory listing 2
-foo
-foo/baz
-foo/baz/file
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/lustar01.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/rename01.at:27:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
 
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-mkdir foo/bar
-genfile --file foo/bar/file
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_121
+#AT_START_122
+at_fn_group_banner 122 'lustar02.at:21' \
+  "ustar: unsplittable path name" "                  " 16
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "122. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename01.at:27"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/lustar02.at:32:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 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
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "lustar02.at:32"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar'
+echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/: file name is too long (cannot be split); not dumped
+tar: Exiting with failure status due to previous errors
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/file1
-foo/file2
-foo/bar/file
-Creating incremental archive
-foo/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/file
-foo/file1
-foo/file2
-End directory listing 1
-Begin directory listing 2
-foo
-foo/baz
-foo/baz/file
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename01.at:27"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/lustar02.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+
+
+
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_97
-#AT_START_98
-at_fn_group_banner 98 'rename02.at:24' \
-  "move between hierarchies" "                       " 13
+#AT_STOP_122
+#AT_START_123
+at_fn_group_banner 123 'lustar03.at:21' \
+  "ustar: splitting long names" "                    " 16
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "98. $at_setup_line: testing $at_desc ..."
+  $as_echo "123. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-  { set +x
-$as_echo "$at_srcdir/rename02.at:27:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-mkdir foo/bar
-genfile --file foo/bar/file.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
+  { set +x
+$as_echo "$at_srcdir/lustar03.at:29:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27"
+install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77
+echo \"Create archive\"
+tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
+echo \"List archive\"
+tar tf archive)"
+at_fn_check_prepare_notrace 'an embedded newline' "lustar03.at:29"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77
+echo "Create archive"
+tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
+echo "List archive"
+tar tf archive)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Create archive
+List 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/
+this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/lustar03.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_123
+#AT_START_124
+at_fn_group_banner 124 'old.at:23' \
+  "old archives" "                                   " 16
+at_xfail=no
+(
+  $as_echo "124. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
-)
+unset TAR_OPTIONS
+{ set +x
+$as_echo "$at_srcdir/old.at:27:
+mkdir directory
+tar cfvo archive directory || exit 1
+tar tf archive
+"
+at_fn_check_prepare_notrace 'an embedded newline' "old.at:27"
+( $at_check_trace;
+mkdir directory
+tar cfvo archive directory || exit 1
+tar tf archive
+
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/bar/baz: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/bar/baz/
-foo/file1
-foo/file2
-foo/bar/file.r
-foo/bar/baz/file.z
-Creating incremental archive
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/baz
-foo/bar/baz/file.z
-foo/bar/file.r
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 2
-foo
-foo/bar
-foo/bar/file.r
-foo/baz
-foo/baz/file.z
-foo/file1
-foo/file2
-End directory listing 2
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+directory/
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/old.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/rename02.at:27:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
 
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_124
+#AT_START_125
+at_fn_group_banner 125 'time01.at:20' \
+  "time: tricky time stamps" "                       " 16
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "125. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
+  { set +x
+$as_echo "$at_srcdir/time01.at:23:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H pax\"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"Creating incremental archive\"
-tar -g incr -cf arch.2 -v foo
+export TZ=UTC0
+mkdir dir
 
-mv foo old
+# Test files with time stamps that are near common sources of error,
+# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years).
+# Use GNU-style @ notation for very large time stamps, since they
+# typically don't render into years correctly due to int overflow.
+for s in \\
+  @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \\
+  0000-01-01T00:00:00 0000-01-01T00:00:01 \\
+  0000-01-02T00:00:00 \\
+  1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \\
+  1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \\
+  1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \\
+  1901-12-14T20:45:51 \\
+  1969-12-31T23:59:58 1969-12-31T23:59:59 \\
+  1970-01-01T00:00:00 1970-01-01T00:00:01 \\
+  2038-01-18T03:14:07 \\
+  2038-01-19T03:14:07 2038-01-19T03:14:08 \\
+  2106-02-07T06:28:15 2106-02-07T06:28:16 \\
+  2242-03-16T12:56:31 2242-03-16T12:56:32 \\
+  9999-12-31T23:59:58 9999-12-31T23:59:59 \\
+  @9223372036854775807 @9223372036854775808
+do
+  # Skip a time stamp \$s if it's out of range for this platform,
+  # of if it uses a notation that this platform does not recognize.
+  touch -d \$s dir/f\$s >/dev/null 2>&1 || continue
 
-tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
-sort tmperr >&2
+  # Likewise for \$s.1.  If \$s is the most negative time stamp and
+  # time stamps are signed, then \$s.1 is out of range.
+  touch -d \$s.1 dir/f\$s.\$ns >/dev/null 2>&1 || continue
 
-echo \"Begin directory listing 1\"
-find foo | sort
-echo \"End directory listing 1\"
+  for frac in   01 001 00001 000001 0000001 00000001 000000001 0000000001 \\
+             9 99 999 99999 999999 9999999 99999999 999999999 9999999999
+  do
+    touch -d \$s.\$frac dir/f\$s.\$frac
+  done
+done
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+tar -c -f archive.tar dir
+tar -d -f archive.tar dir
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27"
+at_fn_check_prepare_notrace 'an embedded newline' "time01.at:23"
 ( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
+TAR_OPTIONS="-H pax"
 export TAR_OPTIONS
 rm -rf *
 
+export TZ=UTC0
+mkdir dir
 
-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
+# Test files with time stamps that are near common sources of error,
+# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years).
+# Use GNU-style @ notation for very large time stamps, since they
+# typically don't render into years correctly due to int overflow.
+for s in \
+  @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \
+  0000-01-01T00:00:00 0000-01-01T00:00:01 \
+  0000-01-02T00:00:00 \
+  1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \
+  1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \
+  1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \
+  1901-12-14T20:45:51 \
+  1969-12-31T23:59:58 1969-12-31T23:59:59 \
+  1970-01-01T00:00:00 1970-01-01T00:00:01 \
+  2038-01-18T03:14:07 \
+  2038-01-19T03:14:07 2038-01-19T03:14:08 \
+  2106-02-07T06:28:15 2106-02-07T06:28:16 \
+  2242-03-16T12:56:31 2242-03-16T12:56:32 \
+  9999-12-31T23:59:58 9999-12-31T23:59:59 \
+  @9223372036854775807 @9223372036854775808
+do
+  # Skip a time stamp $s if it's out of range for this platform,
+  # of if it uses a notation that this platform does not recognize.
+  touch -d $s dir/f$s >/dev/null 2>&1 || continue
 
-tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
-sort tmperr >&2
+  # Likewise for $s.1.  If $s is the most negative time stamp and
+  # time stamps are signed, then $s.1 is out of range.
+  touch -d $s.1 dir/f$s.$ns >/dev/null 2>&1 || continue
 
-echo "Begin directory listing 1"
-find foo | sort
-echo "End directory listing 1"
+  for frac in   01 001 00001 000001 0000001 00000001 000000001 0000000001 \
+             9 99 999 99999 999999 9999999 99999999 999999999 9999999999
+  do
+    touch -d $s.$frac dir/f$s.$frac
+  done
+done
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+tar -c -f archive.tar dir
+tar -d -f archive.tar dir
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/bar/baz: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/bar/baz/
-foo/file1
-foo/file2
-foo/bar/file.r
-foo/bar/baz/file.z
-Creating incremental archive
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/baz
-foo/bar/baz/file.z
-foo/bar/file.r
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 2
-foo
-foo/bar
-foo/bar/file.r
-foo/baz
-foo/baz/file.z
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/rename02.at:27:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/time01.at:23"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_125
+#AT_START_126
+at_fn_group_banner 126 'time02.at:20' \
+  "time: clamping mtime" "                           " 16
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "126. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename02.at:27"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/time02.at:23:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
+TAR_OPTIONS=\"-H pax\"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir 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
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-sleep 1
+export TZ=UTC0
+mkdir dir
 
-echo "Creating base archive"
-tar -g incr -cf arch.1 -v foo
+touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || exit 77
+touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || exit 77
+touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || exit 77
+touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || exit 77
 
-mv foo/bar/baz foo
+tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir
+tar -d -f archive.tar dir|sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "time02.at:23"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-echo "Creating incremental archive"
-tar -g incr -cf arch.2 -v foo
 
-mv foo old
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-tar xfg arch.1 /dev/null --warning=no-timestamp 2>tmperr
-sort tmperr >&2
+export TZ=UTC0
+mkdir dir
 
-echo "Begin directory listing 1"
-find foo | sort
-echo "End directory listing 1"
+touch -d 2015-12-01T00:00:00 dir/a >/dev/null 2>&1 || exit 77
+touch -d 2016-01-01T00:00:00 dir/b >/dev/null 2>&1 || exit 77
+touch -d 2016-02-01T00:00:00 dir/c >/dev/null 2>&1 || exit 77
+touch -d 2038-01-01T00:00:00 dir/d >/dev/null 2>&1 || exit 77
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+tar -c --mtime 2016-01-15T00:00:00 --clamp-mtime -f archive.tar dir
+tar -d -f archive.tar dir|sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: Directory is new
-tar: foo/bar: Directory is new
-tar: foo/bar/baz: Directory is new
-tar: foo/baz: Directory has been renamed from 'foo/bar/baz'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating base archive
-foo/
-foo/bar/
-foo/bar/baz/
-foo/file1
-foo/file2
-foo/bar/file.r
-foo/bar/baz/file.z
-Creating incremental archive
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 1
-foo
-foo/bar
-foo/bar/baz
-foo/bar/baz/file.z
-foo/bar/file.r
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/bar/
-foo/baz/
-Begin directory listing 2
-foo
-foo/bar
-foo/bar/file.r
-foo/baz
-foo/baz/file.z
-foo/file1
-foo/file2
-End directory listing 2
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "dir/c: Mod time differs
+dir/d: Mod time differs
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename02.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/time02.at:23"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -23446,22 +31141,26 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_98
-#AT_START_99
-at_fn_group_banner 99 'rename03.at:23' \
-  "cyclic renames" "                                 " 13
+#AT_STOP_126
+#AT_START_127
+at_fn_group_banner 127 'multiv01.at:24' \
+  "multivolume dumps from pipes" "                   " 17
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "99. $at_setup_line: testing $at_desc ..."
+  $as_echo "127. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# Fixme: should be configurable
+#  TRUSS=truss -o /tmp/tr
+#  TRUSS=strace
+
 
 
   { set +x
-$as_echo "$at_srcdir/rename03.at:26:
+$as_echo "$at_srcdir/multiv01.at:31:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -23470,54 +31169,36 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
+              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
+  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  done
+done >file2
 
-echo \"Second dump\"
-echo \"Second dump\" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test \$TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo \"Begin directory listing 1\"
-find foo | sort
-echo \"End directory listing 1\"
+mkdir extract-dir-pipe
+dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
+      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:31"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -23527,116 +31208,46 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
+              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
+  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  done
+done >file2
 
-echo "Second dump"
-echo "Second dump" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test $TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=$TAPE_LENGTH \
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo "Begin directory listing 1"
-find foo | sort
-echo "End directory listing 1"
+mkdir extract-dir-pipe
+dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
+      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "First dump
-tar: foo/a: Directory is new
-tar: foo/b: Directory is new
-tar: foo/c: Directory is new
-tar: foo: Directory is new
-Second dump
-tar: foo/a: Directory has been renamed from 'foo/c'
-tar: foo/b: Directory has been renamed from 'foo/a'
-tar: foo/c: Directory has been renamed from 'foo/b'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-foo/file1
-foo/file2
-foo/a/filea
-foo/b/fileb
-foo/c/filec
-Second dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 1
-foo
-foo/a
-foo/a/filea
-foo/b
-foo/b/fileb
-foo/c
-foo/c/filec
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 2
-foo
-foo/a
-foo/a/filec
-foo/b
-foo/b/filea
-foo/c
-foo/c/fileb
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/rename03.at:26:
+$as_echo "$at_srcdir/multiv01.at:31:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -23645,54 +31256,36 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
+              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
+  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  done
+done >file2
 
-echo \"Second dump\"
-echo \"Second dump\" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test \$TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo \"Begin directory listing 1\"
-find foo | sort
-echo \"End directory listing 1\"
+mkdir extract-dir-pipe
+dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
+      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:31"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -23702,286 +31295,128 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
+              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
+  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  done
+done >file2
 
-echo "Second dump"
-echo "Second dump" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test $TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=$TAPE_LENGTH \
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo "Begin directory listing 1"
-find foo | sort
-echo "End directory listing 1"
+mkdir extract-dir-pipe
+dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
+      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "First dump
-tar: foo/a: Directory is new
-tar: foo/b: Directory is new
-tar: foo/c: Directory is new
-tar: foo: Directory is new
-Second dump
-tar: foo/a: Directory has been renamed from 'foo/c'
-tar: foo/b: Directory has been renamed from 'foo/a'
-tar: foo/c: Directory has been renamed from 'foo/b'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-foo/file1
-foo/file2
-foo/a/filea
-foo/b/fileb
-foo/c/filec
-Second dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 1
-foo
-foo/a
-foo/a/filea
-foo/b
-foo/b/fileb
-foo/c
-foo/c/filec
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 2
-foo
-foo/a
-foo/a/filec
-foo/b
-foo/b/filea
-foo/c
-foo/c/fileb
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26"
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/rename03.at:26:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/multiv01.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 *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
+              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
+  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
+  done
+done >file2
 
-echo \"Second dump\"
-echo \"Second dump\" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test \$TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo \"Begin directory listing 1\"
-find foo | sort
-echo \"End directory listing 1\"
+mkdir extract-dir-pipe
+dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
+      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename03.at:26"
+at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:31"
 ( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+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 *
 
+exec <&-
+genfile --length 7168 --file file1
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-mkdir foo
-genfile --file foo/file1
-genfile --file foo/file2
-
-mkdir foo/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)
+for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
+              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
+  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  for count in 2 3 4 5 6 7 8 ; do
+    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
+  done
+done >file2
 
-echo "Second dump"
-echo "Second dump" >&2
-tar -g incr -cf arch.2 -v foo 2>tmperr
-sort tmperr >&2
+if test $TEST_TAR_FORMAT = pax; then
+  TAPE_LENGTH=11
+else
+  TAPE_LENGTH=10
+fi
 
-tar xfg arch.1 /dev/null --warning=no-timestamp
+tar -c --multi-volume --tape-length=$TAPE_LENGTH \
+  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
 
-echo "Begin directory listing 1"
-find foo | sort
-echo "End directory listing 1"
+mkdir extract-dir-pipe
+dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
+PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
+      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
+      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
 
-tar xfgv arch.2 /dev/null --warning=no-timestamp
-echo Begin directory listing 2
-find foo | sort
-echo End directory listing 2
+cmp file1 extract-dir-pipe/file1
+cmp file2 extract-dir-pipe/file2
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "First dump
-tar: foo/a: Directory is new
-tar: foo/b: Directory is new
-tar: foo/c: Directory is new
-tar: foo: Directory is new
-Second dump
-tar: foo/a: Directory has been renamed from 'foo/c'
-tar: foo/b: Directory has been renamed from 'foo/a'
-tar: foo/c: Directory has been renamed from 'foo/b'
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-foo/file1
-foo/file2
-foo/a/filea
-foo/b/fileb
-foo/c/filec
-Second dump
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 1
-foo
-foo/a
-foo/a/filea
-foo/b
-foo/b/fileb
-foo/c
-foo/c/filec
-foo/file1
-foo/file2
-End directory listing 1
-foo/
-foo/a/
-foo/b/
-foo/c/
-Begin directory listing 2
-foo
-foo/a
-foo/a/filec
-foo/b
-foo/b/filea
-foo/c
-foo/c/fileb
-foo/file1
-foo/file2
-End directory listing 2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename03.at:26"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -23992,14 +31427,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_99
-#AT_START_100
-at_fn_group_banner 100 'rename04.at:27' \
-  "renamed directory containing subdirectories" "    " 13
+#AT_STOP_127
+#AT_START_128
+at_fn_group_banner 128 'multiv02.at:29' \
+  "skipping a straddling member" "                   " 17
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "100. $at_setup_line: testing $at_desc ..."
+  $as_echo "128. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -24007,7 +31442,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/rename04.at:30:
+$as_echo "$at_srcdir/multiv02.at:32:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -24016,311 +31451,358 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:32"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+exec <&-
 
-decho Renaming
-mv directory dir
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+en
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+              { set +x
+$as_echo "$at_srcdir/multiv02.at:32:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-mv dir orig
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+exec <&-
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | 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
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+en
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:32"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+              { set +x
+$as_echo "$at_srcdir/multiv02.at:32:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H pax\"
+export TAR_OPTIONS
+rm -rf *
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-decho Renaming
-mv directory dir
+exec <&-
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:32"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-mv dir orig
+genfile --length 10240 --file en
+genfile --length 20000 --file to
+genfile --length 20000 --file tre
+genfile --length 10240 --file fire
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+exec <&-
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | 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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+en
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/rename04.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_128
+#AT_START_129
+at_fn_group_banner 129 'multiv03.at:30' \
+  "MV archive & long filenames" "                    " 17
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "129. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/multiv03.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 *
 
+AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\`
+BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\`
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
+cat > ../experr <<EOF
+tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
+tar: '\$BFILE' is possibly continued on this volume: header contains truncated name
+EOF
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+cat > ../expout <<EOF
+\$AFILE
+separator-1
+separator-2
+EOF
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+genfile --length 15360 --file \$AFILE
 
-decho Renaming
-mv directory dir
+exec <&-
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
+tar -tM -f arch.1 -f arch.2 || exit 1
 
-mv dir orig
+echo separator-1
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+genfile --length 15360 --file \$BFILE
+tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | sort
+echo separator-2
+mv \$BFILE bfile
+tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
+cmp \$BFILE bfile
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33"
 ( $at_check_trace;
-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 *
 
+AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
+BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+cat > ../experr <<EOF
+tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
+tar: '$BFILE' is possibly continued on this volume: header contains truncated name
+EOF
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+cat > ../expout <<EOF
+$AFILE
+separator-1
+separator-2
+EOF
 
-decho Renaming
-mv directory dir
+genfile --length 15360 --file $AFILE
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+exec <&-
 
-mv dir orig
+tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
+tar -tM -f arch.1 -f arch.2 || exit 1
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+echo separator-1
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | sort
+genfile --length 15360 --file $BFILE
+tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
+
+echo separator-2
+mv $BFILE bfile
+tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
+cmp $BFILE bfile
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+$at_diff experr "$at_stderr" || at_failed=:
+$at_diff expout "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/rename04.at:30:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/multiv03.at:33:
+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 *
 
+AFILE=\`awk 'BEGIN { for (i = 0; i < 100; i++) printf \"a\"; exit; }'\`
+BFILE=\`awk 'BEGIN { for (i = 0; i < 101; i++) printf \"b\"; exit; }'\`
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
+cat > ../experr <<EOF
+tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
+tar: '\$BFILE' is possibly continued on this volume: header contains truncated name
+EOF
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+cat > ../expout <<EOF
+\$AFILE
+separator-1
+separator-2
+EOF
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+genfile --length 15360 --file \$AFILE
 
-decho Renaming
-mv directory dir
+exec <&-
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
+tar -tM -f arch.1 -f arch.2 || exit 1
 
-mv dir orig
+echo separator-1
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+genfile --length 15360 --file \$BFILE
+tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | sort
+echo separator-2
+mv \$BFILE bfile
+tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
+cmp \$BFILE bfile
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename04.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33"
 ( $at_check_trace;
-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 *
 
+AFILE=`awk 'BEGIN { for (i = 0; i < 100; i++) printf "a"; exit; }'`
+BFILE=`awk 'BEGIN { for (i = 0; i < 101; i++) printf "b"; exit; }'`
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
+cat > ../experr <<EOF
+tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
+tar: '$BFILE' is possibly continued on this volume: header contains truncated name
+EOF
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+cat > ../expout <<EOF
+$AFILE
+separator-1
+separator-2
+EOF
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+genfile --length 15360 --file $AFILE
 
-decho Renaming
-mv directory dir
+exec <&-
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
+tar -tM -f arch.1 -f arch.2 || exit 1
 
-mv dir orig
+echo separator-1
 
-decho First restore
-tar -xf archive.1 -g db.1
-find directory | sort
+genfile --length 15360 --file $BFILE
+tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
 
-decho Second restore
-tar -xf archive.2 -g db.2
-find dir | sort
+echo separator-2
+mv $BFILE bfile
+tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
+cmp $BFILE bfile
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename04.at:30"
+$at_diff experr "$at_stderr" || at_failed=:
+$at_diff expout "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -24331,14 +31813,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_100
-#AT_START_101
-at_fn_group_banner 101 'rename05.at:24' \
-  "renamed subdirectories" "                         " 13
+#AT_STOP_129
+#AT_START_130
+at_fn_group_banner 130 'multiv04.at:36' \
+  "split directory members in a MV archive" "        " 17
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "101. $at_setup_line: testing $at_desc ..."
+  $as_echo "130. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -24346,7 +31828,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/rename05.at:27:
+$as_echo "$at_srcdir/multiv04.at:39:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -24356,36 +31838,23 @@ 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); }' </dev/null | genfile --files-from -
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+exec <&-
 
-decho Renaming
-mv directory/subdir directory/subdir.0
-mv directory dir
+sleep 2
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar --listed-incremental=list -c -f archive.a directory
 
-mv dir orig
+sleep 2
 
-decho First restore
-tar -xf archive.1 -g db.1 --warning=no-timestamp
-find directory | sort
+tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
 
-decho Second restore
-tar -xf archive.2 -g db.2 --warning=no-timestamp
-find dir | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
+echo separator
+
+tar -MRt -f arc.1 -f arc.2)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -24396,65 +31865,38 @@ 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); }' </dev/null | genfile --files-from -
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+exec <&-
 
-decho Renaming
-mv directory/subdir directory/subdir.0
-mv directory dir
+sleep 2
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar --listed-incremental=list -c -f archive.a directory
 
-mv dir orig
+sleep 2
 
-decho First restore
-tar -xf archive.1 -g db.1 --warning=no-timestamp
-find directory | sort
+tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
 
-decho Second restore
-tar -xf archive.2 -g db.2 --warning=no-timestamp
-find dir | sort
-)
+echo separator
+
+tar -MRt -f arc.1 -f arc.2)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir.0
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+separator
+block 0: directory/
+block 35: ** Block of NULs **
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/rename05.at:27:
+$as_echo "$at_srcdir/multiv04.at:39:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -24464,36 +31906,23 @@ 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); }' </dev/null | genfile --files-from -
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+exec <&-
 
-decho Renaming
-mv directory/subdir directory/subdir.0
-mv directory dir
+sleep 2
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar --listed-incremental=list -c -f archive.a directory
 
-mv dir orig
+sleep 2
 
-decho First restore
-tar -xf archive.1 -g db.1 --warning=no-timestamp
-find directory | sort
+tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
 
-decho Second restore
-tar -xf archive.2 -g db.2 --warning=no-timestamp
-find dir | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
+echo separator
+
+tar -MRt -f arc.1 -f arc.2)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -24504,186 +31933,178 @@ 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); }' </dev/null | genfile --files-from -
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
+exec <&-
 
-decho Renaming
-mv directory/subdir directory/subdir.0
-mv directory dir
+sleep 2
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+tar --listed-incremental=list -c -f archive.a directory
 
-mv dir orig
+sleep 2
 
-decho First restore
-tar -xf archive.1 -g db.1 --warning=no-timestamp
-find directory | sort
+tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
 
-decho Second restore
-tar -xf archive.2 -g db.2 --warning=no-timestamp
-find dir | sort
-)
+echo separator
+
+tar -MRt -f arc.1 -f arc.2)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir.0
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "directory/
+separator
+block 0: directory/
+block 35: ** Block of NULs **
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/rename05.at:27:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
-
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
 
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_130
+#AT_START_131
+at_fn_group_banner 131 'multiv05.at:26' \
+  "Restoring after an out of sync volume" "          " 17
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "131. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "rename05.at:27"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/multiv05.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 *
 
+exec <&-
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-decho Creating directory structure
-mkdir directory
-mkdir directory/subdir
-genfile --file=directory/file
+genfile --length 250k --file jeden
+genfile --length 250k --file dwa
+genfile --length 250k --file trzy
+genfile --length 250k --file cztery
+genfile --length 250k --file piec
+genfile --length 250k --file szesc
 
-decho Creating initial archive
-tar -cf archive.1 -g db.1 directory
 
-decho Renaming
-mv directory/subdir directory/subdir.0
-mv directory dir
+echo Creating archive
+tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc
+echo separator
+mkdir bak
+mv jeden dwa trzy cztery piec szesc bak
+tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar
+echo Diffing jeden
+   cmp bak/jeden jeden || exit 1
+echo Diffing dwa
+   cmp bak/dwa dwa || exit 1
+echo Diffing trzy
+   cmp bak/trzy trzy || exit 1
+echo Diffing cztery
+   cmp bak/cztery cztery || exit 1
+echo Diffing piec
+   cmp bak/piec piec || exit 1
+echo Diffing szesc
+   cmp bak/szesc szesc || exit 1
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv05.at:30"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-decho Creating incremental archive
-cp db.1 db.2
-tar -cf archive.2 -g db.2 dir
+exec <&-
 
-mv dir orig
+genfile --length 250k --file jeden
+genfile --length 250k --file dwa
+genfile --length 250k --file trzy
+genfile --length 250k --file cztery
+genfile --length 250k --file piec
+genfile --length 250k --file szesc
 
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-Second restore
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating directory structure
-Creating initial archive
-Renaming
-Creating incremental archive
-First restore
-directory
-directory/file
-directory/subdir
-Second restore
-dir
-dir/subdir.0
+echo Creating archive
+tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc
+echo separator
+mkdir bak
+mv jeden dwa trzy cztery piec szesc bak
+tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar
+echo Diffing jeden
+   cmp bak/jeden jeden || exit 1
+echo Diffing dwa
+   cmp bak/dwa dwa || exit 1
+echo Diffing trzy
+   cmp bak/trzy trzy || exit 1
+echo Diffing cztery
+   cmp bak/cztery cztery || exit 1
+echo Diffing piec
+   cmp bak/piec piec || exit 1
+echo Diffing szesc
+   cmp bak/szesc szesc || exit 1
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: 'trzy' is not continued on this volume
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating archive
+separator
+jeden
+dwa
+trzy
+cztery
+piec
+szesc
+Diffing jeden
+Diffing dwa
+Diffing trzy
+Diffing cztery
+Diffing piec
+Diffing szesc
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/rename05.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv05.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_101
-#AT_START_102
-at_fn_group_banner 102 'chtype.at:27' \
-  "changed file types in incrementals" "             " 13
+#AT_STOP_131
+#AT_START_132
+at_fn_group_banner 132 'multiv06.at:27' \
+  "Multivolumes with L=record_size" "                " 17
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "102. $at_setup_line: testing $at_desc ..."
+  $as_echo "132. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -24691,7 +32112,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/chtype.at:30:
+$as_echo "$at_srcdir/multiv06.at:30:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -24700,38 +32121,14 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-
-install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
-mkdir directory/a
-genfile --file directory/a/a
-
-echo First backup
-tar --create --file=archive.1 --listed-incremental=db.1 directory
-
-sleep 2
-
-# Remove directory b and create a file with this name.
-# Previous versions were not able to restore over this file.
-rm -r directory/b
-genfile --file directory/b
-genfile --file directory/a/b
-
-echo Second backup
-tar --create --file=archive.2 --listed-incremental=db.2 directory
-
-# Delete a
-rm -r directory
-
-echo Restore archive.1
-tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
-echo Restore archive.2
-tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
-find directory | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -24741,255 +32138,213 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
-mkdir directory/a
-genfile --file directory/a/a
-
-echo First backup
-tar --create --file=archive.1 --listed-incremental=db.1 directory
-
-sleep 2
-
-# Remove directory b and create a file with this name.
-# Previous versions were not able to restore over this file.
-rm -r directory/b
-genfile --file directory/b
-genfile --file directory/a/b
-
-echo Second backup
-tar --create --file=archive.2 --listed-incremental=db.2 directory
-
-# Delete a
-rm -r directory
-
-echo Restore archive.1
-tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
-echo Restore archive.2
-tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
-find directory | sort
-)
+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)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First backup
-Second backup
-Restore archive.1
-Restore archive.2
-directory
-directory/a
-directory/a/a
-directory/a/b
-directory/b
+echo >>"$at_stderr"; $as_echo "Creating file
+Creating archive
+Testing archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating file
+Creating archive
+Testing archive
+file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/chtype.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/multiv06.at:30:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
+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)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+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)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "Creating file
+Creating archive
+Testing archive
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating file
+Creating archive
+Testing archive
+file
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_132
+#AT_START_133
+at_fn_group_banner 133 'multiv07.at:28' \
+  "volumes split at an extended header" "            " 17
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "133. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-# 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
+{ set +x
+$as_echo "$at_srcdir/multiv07.at:31:
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
 
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
+exec <&-
 
-install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
-mkdir directory/a
-genfile --file directory/a/a
+cd \$TEST_DATA_DIR
+tar -t -M -fxsplit-1.tar -fxsplit-2.tar
+"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv07.at:31"
+( $at_check_trace;
 
-echo First backup
-tar --create --file=archive.1 --listed-incremental=db.1 directory
 
-sleep 2
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
 
-# 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
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
 
-echo Second backup
-tar --create --file=archive.2 --listed-incremental=db.2 directory
+exec <&-
 
-# Delete a
-rm -r directory
+cd $TEST_DATA_DIR
+tar -t -M -fxsplit-1.tar -fxsplit-2.tar
 
-echo Restore archive.1
-tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
-echo Restore archive.2
-tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
-find directory | sort
-)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First backup
-Second backup
-Restore archive.1
-Restore archive.2
-directory
-directory/a
-directory/a/a
-directory/a/b
-directory/b
+echo >>"$at_stdout"; $as_echo "Archive volumes split at an extended header Volume 1
+foo
+bar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv07.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/chtype.at:30:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
 
-install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
-mkdir directory/a
-genfile --file directory/a/a
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_133
+#AT_START_134
+at_fn_group_banner 134 'multiv08.at:25' \
+  "multivolume header creation" "                    " 17
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "134. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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
+  { set +x
+$as_echo "$at_srcdir/multiv08.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-echo Restore archive.1
-tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
-echo Restore archive.2
-tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
-find directory | sort
+genfile --length 9472 --file a
+genfile --length 9984 --file b
+decho Creating
+tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b
+decho Testing
+tar -tMR -f A.tar -f B.tar -f C.tar
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "chtype.at:30"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv08.at:28"
 ( $at_check_trace;
-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 *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-install-sh -d directory/b/c >/dev/null && genfile --file directory/b/c/x || exit 77
-mkdir directory/a
-genfile --file directory/a/a
-
-echo First backup
-tar --create --file=archive.1 --listed-incremental=db.1 directory
-
-sleep 2
-
-# Remove directory b and create a file with this name.
-# Previous versions were not able to restore over this file.
-rm -r directory/b
-genfile --file directory/b
-genfile --file directory/a/b
-
-echo Second backup
-tar --create --file=archive.2 --listed-incremental=db.2 directory
-
-# Delete a
-rm -r directory
-
-echo Restore archive.1
-tar -xf archive.1 --listed-incremental=/dev/null --warning=no-timestamp
-echo Restore archive.2
-tar -xf archive.2 --listed-incremental=/dev/null --warning=no-timestamp
-find directory | sort
+genfile --length 9472 --file a
+genfile --length 9984 --file b
+decho Creating
+tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b
+decho Testing
+tar -tMR -f A.tar -f B.tar -f C.tar
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "First backup
-Second backup
-Restore archive.1
-Restore archive.2
-directory
-directory/a
-directory/a/a
-directory/a/b
-directory/b
+echo >>"$at_stderr"; $as_echo "Creating
+Testing
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Creating
+Testing
+block 0: a
+block 21: b
+block 43: ** Block of NULs **
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/chtype.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/multiv08.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -25000,22 +32355,25 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_102
-#AT_START_103
-at_fn_group_banner 103 'ignfail.at:23' \
-  "ignfail" "                                        " 14
+#AT_STOP_134
+#AT_START_135
+at_fn_group_banner 135 'multiv09.at:26' \
+  "bad next volume" "                                " 17
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "103. $at_setup_line: testing $at_desc ..."
+  $as_echo "135. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# filename of length 100 characters
+
+
 
 
   { set +x
-$as_echo "$at_srcdir/ignfail.at:26:
+$as_echo "$at_srcdir/multiv09.at:33:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -25024,49 +32382,15 @@ 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
+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 <<EOF
+y
+q
+EOF
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv09.at:33"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -25076,70 +32400,27 @@ 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
+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 <<EOF
+y
+q
+EOF
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: file: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: file: Warning: Cannot open: Permission denied
------
-tar: directory: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: directory: Warning: Cannot open: Permission denied
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "created
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/multiv09.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/ignfail.at:26:
+$as_echo "$at_srcdir/multiv09.at:33:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -25148,49 +32429,15 @@ 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
+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 <<EOF
+y
+q
+EOF
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv09.at:33"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -25200,70 +32447,27 @@ 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
+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 <<EOF
+y
+q
+EOF
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: file: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: file: Warning: Cannot open: Permission denied
------
-tar: directory: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: directory: Warning: Cannot open: Permission denied
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "created
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/multiv09.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/ignfail.at:26:
+$as_echo "$at_srcdir/multiv09.at:33:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -25272,49 +32476,15 @@ 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
+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 <<EOF
+y
+q
+EOF
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv09.at:33"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -25324,70 +32494,27 @@ 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
+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 <<EOF
+y
+q
+EOF
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: file: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: file: Warning: Cannot open: Permission denied
------
-tar: directory: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: directory: Warning: Cannot open: Permission denied
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "created
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/multiv09.at:33"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/ignfail.at:26:
+$as_echo "$at_srcdir/multiv09.at:33:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -25396,122 +32523,192 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-# The test is meaningless for super-user.
+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 <<EOF
+y
+q
+EOF
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv09.at:33"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 && exit 77
+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 <<EOF
+y
+q
+EOF
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "created
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/multiv09.at:33"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/multiv09.at:33:
+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
+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 <<EOF
+y
+q
+EOF
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "multiv09.at:33"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive file
-status=\$?
-chmod 600 file
-test \$status = 2 || exit 1
+genfile --length 2000000 --file aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+tar --format=gnu -cM --tape-length 1M -f A.tar -f B.tar aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa || exit $?
+echo "created"
+tar --format=gnu -xM -f A.tar 2>/dev/null <<EOF
+y
+q
+EOF
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "created
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/multiv09.at:33"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_135
+#AT_START_136
+at_fn_group_banner 136 'owner.at:21' \
+  "--owner and --group" "                            " 18
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "136. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/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 *
 
-# The test is meaningless for super-user.
+export TZ=UTC0
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 && exit 77
+genfile --file a
 
+tar --owner=\"Joe the Plumber:1234\" \\
+    --group=\"Plumber's Union:5678\" \\
+    --mtime='@0' \\
+    --mode='u=rw,go=r' \\
+    -cf arc a
 
-touch file
-mkdir directory
-touch directory/file
+tar -tvf arc
+tar --numeric-owner -tvf arc
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "owner.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive file
-status=$?
-chmod 600 file
-test $status = 2 || exit 1
+export TZ=UTC0
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive --ignore-failed-read file || exit 1
-status=$?
-chmod 600 file
-test $status = 0 || exit 1
+genfile --file a
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive directory
-status=$?
-chmod 700 directory
-test $status = 2 || exit 1
+tar --owner="Joe the Plumber:1234" \
+    --group="Plumber's Union:5678" \
+    --mtime='@0' \
+    --mode='u=rw,go=r' \
+    -cf arc a
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive --ignore-failed-read directory || exit 1
-status=$?
-chmod 700 directory
-test $status = 0
+tar -tvf arc
+tar --numeric-owner -tvf arc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: file: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: file: Warning: Cannot open: Permission denied
------
-tar: directory: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: directory: Warning: Cannot open: Permission denied
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "-rw-r--r-- Joe the Plumber/Plumber's Union 0 1970-01-01 00:00 a
+-rw-r--r-- 1234/5678         0 1970-01-01 00:00 a
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/owner.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/ignfail.at:26:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_136
+#AT_START_137
+at_fn_group_banner 137 'map.at:21' \
+  "--owner-map and --group-map" "                    " 18
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "137. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/map.at:24:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -25520,49 +32717,45 @@ 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
-
+export TZ=UTC0
 
-touch file
-mkdir directory
-touch directory/file
+genfile --file a
+set -- \`genfile --stat=uid,gid a\`
+cat > uid.map <<EOT
+# Owner mapping
++\$1   \"Joe the Plumber:1234\"
+EOT
+# Group mapping
+cat > gid.map <<EOT
++\$2   \"Plumber's Union:5678\"
+EOT
+
+tar --owner-map=uid.map\\
+    --group-map=gid.map\\
+    --owner=\"Fallback Owner:4321\" \\
+    --group=\"Fallback Group:8765\" \\
+    --mtime='@0' \\
+    --mode='u=rw,go=r' \\
+    -cf 1.tar a
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive file
-status=\$?
-chmod 600 file
-test \$status = 2 || exit 1
+tar -tvf 1.tar
+tar --numeric-owner -tvf 1.tar
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive --ignore-failed-read file || exit 1
-status=\$?
-chmod 600 file
-test \$status = 0 || exit 1
+> uid.map
+> gid.map
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive directory
-status=\$?
-chmod 700 directory
-test \$status = 2 || exit 1
+tar --owner-map=uid.map\\
+    --group-map=gid.map\\
+    --owner=\"Fallback Owner:4321\" \\
+    --group=\"Fallback Group:8765\" \\
+    --mtime='@0' \\
+    --mode='u=rw,go=r' \\
+    -cf 2.tar a
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive --ignore-failed-read directory || exit 1
-status=\$?
-chmod 700 directory
-test \$status = 0
+tar -tvf 2.tar
+tar --numeric-owner -tvf 2.tar
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "ignfail.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "map.at:24"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -25572,65 +32765,55 @@ 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
+export TZ=UTC0
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive file
-status=$?
-chmod 600 file
-test $status = 2 || exit 1
+genfile --file a
+set -- `genfile --stat=uid,gid a`
+cat > uid.map <<EOT
+# Owner mapping
++$1    "Joe the Plumber:1234"
+EOT
+# Group mapping
+cat > gid.map <<EOT
++$2    "Plumber's Union:5678"
+EOT
+
+tar --owner-map=uid.map\
+    --group-map=gid.map\
+    --owner="Fallback Owner:4321" \
+    --group="Fallback Group:8765" \
+    --mtime='@0' \
+    --mode='u=rw,go=r' \
+    -cf 1.tar a
 
-echo 1>&2 -----
-chmod 000 file
-tar cf archive --ignore-failed-read file || exit 1
-status=$?
-chmod 600 file
-test $status = 0 || exit 1
+tar -tvf 1.tar
+tar --numeric-owner -tvf 1.tar
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive directory
-status=$?
-chmod 700 directory
-test $status = 2 || exit 1
+> uid.map
+> gid.map
 
-echo 1>&2 -----
-chmod 000 directory
-tar cf archive --ignore-failed-read directory || exit 1
-status=$?
-chmod 700 directory
-test $status = 0
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: file: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: file: Warning: Cannot open: Permission denied
------
-tar: directory: Cannot open: Permission denied
-tar: Exiting with failure status due to previous errors
------
-tar: directory: Warning: Cannot open: Permission denied
+tar --owner-map=uid.map\
+    --group-map=gid.map\
+    --owner="Fallback Owner:4321" \
+    --group="Fallback Group:8765" \
+    --mtime='@0' \
+    --mode='u=rw,go=r' \
+    -cf 2.tar a
+
+tar -tvf 2.tar
+tar --numeric-owner -tvf 2.tar
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "-rw-r--r-- Joe the Plumber/Plumber's Union 0 1970-01-01 00:00 a
+-rw-r--r-- 1234/5678         0 1970-01-01 00:00 a
+-rw-r--r-- Fallback Owner/Fallback Group 0 1970-01-01 00:00 a
+-rw-r--r-- 4321/8765         0 1970-01-01 00:00 a
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ignfail.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/map.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -25641,14 +32824,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_103
-#AT_START_104
-at_fn_group_banner 104 'link01.at:33' \
-  "link count gt 2" "                                " 15
+#AT_STOP_137
+#AT_START_138
+at_fn_group_banner 138 'sparse01.at:22' \
+  "sparse files" "                                   " 19
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "104. $at_setup_line: testing $at_desc ..."
+  $as_echo "138. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -25656,66 +32839,117 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/link01.at:36:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/sparse01.at:25:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+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
 
-ls directory/test1
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive --warning=no-timestamp
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:25"
 ( $at_check_trace;
-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 *
 
+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
-mkdir directory/test1
-mkdir directory/test2
+tar Cxf directory archive --warning=no-timestamp
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo stdout:; tee stdout <"$at_stdout"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:25"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
+              { set +x
+$as_echo "$at_srcdir/sparse01.at:25:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-tar cf archive directory/test1/test.txt directory/test1/test.txt
+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
 
-rm -r directory
-tar xf archive --warning=no-timestamp
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive --warning=no-timestamp
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:25"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-ls directory/test1
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "test.txt
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36"
+echo stdout:; tee stdout <"$at_stdout"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link01.at:36:
+$as_echo "$at_srcdir/sparse01.at:25:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -25724,21 +32958,20 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-mkdir directory/test1
-mkdir directory/test2
-
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
-
-tar cf archive directory/test1/test.txt directory/test1/test.txt
-
-rm -r directory
-tar xf archive --warning=no-timestamp
+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
 
-ls directory/test1
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive --warning=no-timestamp
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:25"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -25748,92 +32981,73 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-mkdir directory/test1
-mkdir directory/test2
-
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
-
-tar cf archive directory/test1/test.txt directory/test1/test.txt
-
-rm -r directory
-tar xf archive --warning=no-timestamp
+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
 
-ls directory/test1
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive --warning=no-timestamp
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "test.txt
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36"
+echo stdout:; tee stdout <"$at_stdout"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:25"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
+cat >stdout.re <<'_ATEOF'
+separator
+-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
+-rw-r--r-- ^ ^ *  *10344448 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
+-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
+separator
+sparsefile 10344448
+_ATEOF
 
-ls directory/test1
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
+awk '{print NR " " $0}' stdout > $$.1
+awk '{print NR " " $0}' stdout.re | join - $$.1 |
+while read NUM RE LINE
+do
+  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
+done
 
-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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_138
+#AT_START_139
+at_fn_group_banner 139 'sparse02.at:22' \
+  "extracting sparse file over a pipe" "             " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "139. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-tar cf archive directory/test1/test.txt directory/test1/test.txt
 
-rm -r directory
-tar xf archive --warning=no-timestamp
 
-ls directory/test1
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "test.txt
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+# Tar 1.14 - 1.15.1 was unable to extract sparse files to a pipe.
+# References: <16896.21739.460782.124775@jik.kamens.brookline.ma.us>
+# http://lists.gnu.org/archive/html/bug-tar/2005-02/msg00003.html
 
-              { set +x
-$as_echo "$at_srcdir/link01.at:36:
+
+
+  { set +x
+$as_echo "$at_srcdir/sparse02.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -25842,21 +33056,14 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-mkdir directory/test1
-mkdir directory/test2
-
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
-
-tar cf archive directory/test1/test.txt directory/test1/test.txt
-
-rm -r directory
-tar xf archive --warning=no-timestamp
+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
 
-ls directory/test1
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -25866,33 +33073,26 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-mkdir directory/test1
-mkdir directory/test2
-
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
-
-tar cf archive directory/test1/test.txt directory/test1/test.txt
-
-rm -r directory
-tar xf archive --warning=no-timestamp
+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
 
-ls directory/test1
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "test.txt
+echo >>"$at_stdout"; $as_echo "separator
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link01.at:36:
+$as_echo "$at_srcdir/sparse02.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -25901,21 +33101,14 @@ 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
+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
 
-ls directory/test1
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link01.at:36"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -25925,28 +33118,66 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir directory
-mkdir directory/test1
-mkdir directory/test2
+genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
+tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1
+echo separator
 
-echo TEST > directory/test1/test.txt
-ln directory/test1/test.txt directory/test2/test.txt || exit 77
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-tar cf archive directory/test1/test.txt directory/test1/test.txt
+              { set +x
+$as_echo "$at_srcdir/sparse02.at:29:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-rm -r directory
-tar xf archive --warning=no-timestamp
+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
 
-ls directory/test1
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:29"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
+
+genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
+tar --hole-detection=raw -c -f archive --sparse sparsefile || exit 1
+echo separator
+
+tar xfO archive | cat - > sparsecopy || exit 1
+cmp sparsefile sparsecopy
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "test.txt
+echo >>"$at_stdout"; $as_echo "separator
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -25957,163 +33188,2263 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_104
-#AT_START_105
-at_fn_group_banner 105 'link02.at:32' \
-  "preserve hard links with --remove-files" "        " 15
+#AT_STOP_139
+#AT_START_140
+at_fn_group_banner 140 'sparse03.at:21' \
+  "storing sparse files > 8G" "                      " 19
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "105. $at_setup_line: testing $at_desc ..."
+  $as_echo "140. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# Tar 1.15.1 incorrectly computed sparse member size if the extended
+# PAX header contained size keyword.
+# References: <87vf46nb36.fsf@penguin.cs.ucla.edu>
+# http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html
+
 
 
   { set +x
-$as_echo "$at_srcdir/link02.at:35:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/sparse03.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 -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
-tar -c -f archive --remove-files file1 file2 file3 file4
-tar tfv archive | sed -n 's/.*file[2-4] link to //p'
+genfile --length 1000 --file begin
+genfile --length 1000 --file end
+genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
+tar -c -f archive --sparse begin sparsefile end || exit 1
+echo separator
+
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse03.at:29"
 ( $at_check_trace;
-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 *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
-tar -c -f archive --remove-files file1 file2 file3 file4
-tar tfv archive | sed -n 's/.*file[2-4] link to //p'
+genfile --length 1000 --file begin
+genfile --length 1000 --file end
+genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
+tar -c -f archive --sparse begin sparsefile end || exit 1
+echo separator
+
+tar tfv archive
+echo separator
+mkdir directory
+tar Cxf directory archive
+genfile --stat=name,size sparsefile
+cmp sparsefile directory/sparsefile
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file1
-file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+echo stdout:; tee stdout <"$at_stdout"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse03.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/link02.at:35:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+
+
+
+
+cat >stdout.re <<'_ATEOF'
+separator
+-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
+-rw-r--r-- ^ ^ *  *8589935104 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
+-rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
+separator
+sparsefile 8589935104
+_ATEOF
+
+awk '{print NR " " $0}' stdout > $$.1
+awk '{print NR " " $0}' stdout.re | join - $$.1 |
+while read NUM RE LINE
+do
+  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
+done
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_140
+#AT_START_141
+at_fn_group_banner 141 'sparse04.at:21' \
+  "storing long sparse file names" "                 " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "141. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+# Description: Tar versions from 1.15.92 to 1.25 would incorrectly
+# store sparse file names longer than 100 characters in pax mode.
+# Namely, the 'path' keyword of the produced PAX header would contain the
+# crafted name of the header itself, instead of that of the file.
+# Reported by: Kamil Dudka <kdudka@redhat.com>
+# References: <201011250026.44908.kdudka@redhat.com>,
+#             http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00099.html
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/sparse04.at:35:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
+TAR_OPTIONS=\"-H pax\"
 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'
+genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77
+tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf -
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse04.at:35"
 ( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
+TAR_OPTIONS="-H pax"
 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'
+genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77
+tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf -
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file1
-file1
+echo >>"$at_stdout"; $as_echo "123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse04.at:35"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/link02.at:35:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_141
+#AT_START_142
+at_fn_group_banner 142 'sparse05.at:21' \
+  "listing sparse files bigger than 2^33 B" "        " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "142. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+# Description: If an archive in POSIX.1-2001 archive contained a sparse file
+# member whose real size (excluding zero blocks) is bigger than 2^33 bytes,
+# tar 1.28 would incorrectly list the real member size.
+# Reported by: Pavel Raiskup <praiskup@redhat.com>
+# References: <1359119879.15037.4.camel@raiskup>,
+#             http://lists.gnu.org/archive/html/bug-tar/2013-01/msg00001.html
+
+
+
+  { set +x
+$as_echo "$at_srcdir/sparse05.at:31:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
+TAR_OPTIONS=\"-H pax\"
 export TAR_OPTIONS
 rm -rf *
 
-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'
+cat >mapfile <<'_ATEOF'
+0 =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+_ATEOF
+
+genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77
+tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print \$3, \$(NF) }'
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "sparse05.at:31"
 ( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
+TAR_OPTIONS="-H pax"
 export TAR_OPTIONS
 rm -rf *
 
-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'
+cat >mapfile <<'_ATEOF'
+0 =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+10M =2560
+_ATEOF
+
+genfile --sparse --file BIGFILE --block-size 4K - < mapfile || exit 77
+tar -f - -c --sparse --posix BIGFILE | tar tvf - | awk '{ print $3, $(NF) }'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file1
-file1
+echo >>"$at_stdout"; $as_echo "20961034240 BIGFILE
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+at_fn_check_status 0 $at_status "$at_srcdir/sparse05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/link02.at:35:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_142
+#AT_START_143
+at_fn_group_banner 143 'sparse06.at:21' \
+  "storing sparse file using seek method" "          " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "143. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/sparse06.at:32:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -26122,14 +35453,69 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
-tar -c -f archive --remove-files file1 file2 file3 file4
-tar tfv archive | sed -n 's/.*file[2-4] link to //p'
+
+checkseekhole || exit 77
+
+
+TAR_OPTIONS=\"\$TAR_OPTIONS --hole-detection=seek\"
+genfile --sparse --file bigsparse 0 ABC 8G DEF
+tar -cSf a bigsparse
+test \$? -eq 0 || exit 1
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC 10M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC 10M DEF
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M ABC
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M ABC 20M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M DEF 20M GHI 30M JKL 40M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "sparse06.at:32"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -26139,70 +35525,74 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
-tar -c -f archive --remove-files file1 file2 file3 file4
-tar tfv archive | sed -n 's/.*file[2-4] link to //p'
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file1
-file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/link02.at:35:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+checkseekhole || exit 77
+
+
+TAR_OPTIONS="$TAR_OPTIONS --hole-detection=seek"
+genfile --sparse --file bigsparse 0 ABC 8G DEF
+tar -cSf a bigsparse
+test $? -eq 0 || exit 1
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC 10M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 0 ABC 10M DEF
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M ABC
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M ABC 20M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
+
+
+
+rm -rf out archive.tar smallsparse && mkdir out
+genfile --sparse --quiet --file smallsparse 10M DEF 20M GHI 30M JKL 40M
+tar -cSf archive.tar smallsparse
+tar -xf archive.tar -C out
+cmp smallsparse out/smallsparse
 
-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'
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "link02.at:35"
-( $at_check_trace;
-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'
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "file1
-file1
-file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link02.at:35"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/sparse06.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -26213,99 +35603,109 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_105
-#AT_START_106
-at_fn_group_banner 106 'link03.at:24' \
-  "working -l with --remove-files" "                 " 15
+#AT_STOP_143
+#AT_START_144
+at_fn_group_banner 144 'sparsemv.at:21' \
+  "sparse files in MV archives" "                    " 19
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "106. $at_setup_line: testing $at_desc ..."
+  $as_echo "144. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-
+# Check if sparse files are correctly split between GNU multi-volume
+# archives.
+# There are two cases: the file can be split within an empty (null) block,
+# or within a data block. Since null blocks are not archived, the first
+# case means the file is split between two consecutive data blocks.
+#
 
 
 
   { set +x
-$as_echo "$at_srcdir/link03.at:34:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/sparsemv.at:31:
+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 *
 
+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
 
-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'
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+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 *
 
+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
 
-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'
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "archive.1
-archive.2
-testing archive.2
-file1
-file1
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
+Create archive
+Test archive
+sparsefile
+Compare archive
+Pass 2: Split within a data block
+Create archive
+Test archive
+sparsefile
+Compare archive
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link03.at:34:
+$as_echo "$at_srcdir/sparsemv.at:31:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -26314,26 +35714,27 @@ 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
 
-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'
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -26343,283 +35744,367 @@ 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
 
-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'
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "archive.1
-archive.2
-testing archive.2
-file1
-file1
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
+Create archive
+Test archive
+sparsefile
+Compare archive
+Pass 2: Split within a data block
+Create archive
+Test archive
+sparsefile
+Compare archive
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_144
+#AT_START_145
+at_fn_group_banner 145 'spmvp00.at:21' \
+  "sparse files in PAX MV archives, v.0.0" "         " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "145. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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'
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/spmvp00.at:24:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
+TAR_OPTIONS=\"-H pax\"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+TAR_OPTIONS=\"\$TAR_OPTIONS --hole-detection=raw\"
+genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77
+echo \"Pass 1: Split between data blocks\"
+echo \"Create archive\"
+tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-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
+echo \"Pass 2: Split within a data block\"
+genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
+echo \"Create archive\"
+tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "spmvp00.at:24"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
+exec <&-
+TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw"
+genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77
+echo "Pass 1: Split between data blocks"
+echo "Create archive"
+tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-echo 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'
+echo "Pass 2: Split within a data block"
+genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
+echo "Create archive"
+tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "archive.1
-archive.2
-testing archive.2
-file1
-file1
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
+Create archive
+Test archive
+sparsefile
+Compare archive
+Pass 2: Split within a data block
+Create archive
+Test archive
+sparsefile
+Compare archive
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/spmvp00.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_145
+#AT_START_146
+at_fn_group_banner 146 'spmvp01.at:21' \
+  "sparse files in PAX MV archives, v.0.1" "         " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "146. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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'
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/spmvp01.at:24:
+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 *
 
+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 --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-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
+echo \"Pass 2: Split within a data block\"
+genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
+echo \"Create archive\"
+tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "spmvp01.at:24"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
+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 --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-echo 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'
+echo "Pass 2: Split within a data block"
+genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
+echo "Create archive"
+tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "archive.1
-archive.2
-testing archive.2
-file1
-file1
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
+Create archive
+Test archive
+sparsefile
+Compare archive
+Pass 2: Split within a data block
+Create archive
+Test archive
+sparsefile
+Compare archive
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/spmvp01.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_146
+#AT_START_147
+at_fn_group_banner 147 'spmvp10.at:21' \
+  "sparse files in PAX MV archives, v.1.0" "         " 19
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "147. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-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'
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "link03.at:34"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/spmvp10.at:24:
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS=\"-H pax\"
 export TAR_OPTIONS
 rm -rf *
 
+exec <&-
+TAR_OPTIONS=\"\$TAR_OPTIONS --hole-detection=raw\"
+genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
+echo \"Pass 1: Split between data blocks\"
+echo \"Create archive\"
+tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-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
+echo \"Pass 2: Split within a data block\"
+genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77
+echo \"Create archive\"
+tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo \"Test archive\"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo \"Compare archive\"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "spmvp10.at:24"
+( $at_check_trace;
+mkdir pax
+(cd pax
+TEST_TAR_FORMAT=pax
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H pax"
+export TAR_OPTIONS
+rm -rf *
 
-genfile -l 64 -f file1
-ln file1 file2
-ln file2 file3
-ln file3 file4
+exec <&-
+TAR_OPTIONS="$TAR_OPTIONS --hole-detection=raw"
+genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
+echo "Pass 1: Split between data blocks"
+echo "Create archive"
+tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 
-echo 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'
+echo "Pass 2: Split within a data block"
+genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77
+echo "Create archive"
+tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
+echo "Test archive"
+tar -t -M -f arc.1 -f arc.2 -f arc.3
+echo "Compare archive"
+tar -d -M -f arc.1 -f arc.2 -f arc.3
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: Missing links to 'file1'.
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "archive.1
-archive.2
-testing archive.2
-file1
-file1
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
+Create archive
+Test archive
+sparsefile
+Compare archive
+Pass 2: Split within a data block
+Create archive
+Test archive
+sparsefile
+Compare archive
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link03.at:34"
+at_fn_check_status 0 $at_status "$at_srcdir/spmvp10.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_106
-#AT_START_107
-at_fn_group_banner 107 'link04.at:29' \
-  "link count is 1 but multiple occurrences" "       " 15
+#AT_STOP_147
+#AT_START_148
+at_fn_group_banner 148 'update.at:28' \
+  "update unchanged directories" "                   " 20
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "107. $at_setup_line: testing $at_desc ..."
+  $as_echo "148. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -26627,7 +36112,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/link04.at:32:
+$as_echo "$at_srcdir/update.at:31:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -26636,25 +36121,20 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -26664,46 +36144,36 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/
-dir/file
-dir/file link to dir/file
-dir/symlink -> file
-dir/symlink link to dir/symlink
-==
-dir/
-dir/FOO
-dir/FOO link to dir/FOO
+echo >>"$at_stdout"; $as_echo "separator
+separator
+directory/
+directory/file1
+directory/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link04.at:32:
+$as_echo "$at_srcdir/update.at:31:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -26712,25 +36182,20 @@ 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
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -26740,46 +36205,36 @@ 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
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/
-dir/file
-dir/file link to dir/file
-dir/symlink -> file
-dir/symlink link to dir/symlink
-==
-dir/
-dir/FOO
-dir/FOO link to dir/FOO
+echo >>"$at_stdout"; $as_echo "separator
+separator
+directory/
+directory/file1
+directory/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link04.at:32:
+$as_echo "$at_srcdir/update.at:31:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -26788,25 +36243,20 @@ 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
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -26816,46 +36266,36 @@ 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
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-tar chf archive dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-  s,file,FOO,g
-  s,symlink,FOO,g
-' | sort
+tar cf archive directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/
-dir/file
-dir/file link to dir/file
-dir/symlink -> file
-dir/symlink link to dir/symlink
-==
-dir/
-dir/FOO
-dir/FOO link to dir/FOO
+echo >>"$at_stdout"; $as_echo "separator
+separator
+directory/
+directory/file1
+directory/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link04.at:32:
+$as_echo "$at_srcdir/update.at:31:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -26864,25 +36304,20 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-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 directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -26892,46 +36327,36 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-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 directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/
-dir/file
-dir/file link to dir/file
-dir/symlink -> file
-dir/symlink link to dir/symlink
-==
-dir/
-dir/FOO
-dir/FOO link to dir/FOO
+echo >>"$at_stdout"; $as_echo "separator
+separator
+directory/
+directory/file1
+directory/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/link04.at:32:
+$as_echo "$at_srcdir/update.at:31:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -26940,25 +36365,20 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-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 directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "link04.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -26968,41 +36388,31 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir dir
-echo TEST > dir/file
-ln -s file dir/symlink || exit 77
 
-tar cf archive dir dir
-tar tvf archive | sed '
-  s,.*[0-9] dir/,dir/,
-' | sort
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-echo ==
+mkdir directory
+genfile --length 10240 --pattern zeros --file directory/file1
+genfile --length 10240 --pattern default --file directory/file2
 
-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 directory || exit 1
+echo separator
+tar uf archive directory || exit 1
+echo separator
+tar tf archive | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/
-dir/
-dir/file
-dir/file link to dir/file
-dir/symlink -> file
-dir/symlink link to dir/symlink
-==
-dir/
-dir/FOO
-dir/FOO link to dir/FOO
+echo >>"$at_stdout"; $as_echo "separator
+separator
+directory/
+directory/file1
+directory/file2
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/link04.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -27013,25 +36423,22 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_107
-#AT_START_108
-at_fn_group_banner 108 'longv7.at:24' \
-  "long names in V7 archives" "                      " 16
+#AT_STOP_148
+#AT_START_149
+at_fn_group_banner 149 'update01.at:29' \
+  "update directories" "                             " 20
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "108. $at_setup_line: testing $at_desc ..."
+  $as_echo "149. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-
-
-
   { set +x
-$as_echo "$at_srcdir/longv7.at:30:
+$as_echo "$at_srcdir/update01.at:32:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -27040,14 +36447,24 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
-touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c
 
-tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
-echo separator
-tar tf archive
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "longv7.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -27057,101 +36474,41 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir this_is_a_very_long_name_for_a_directory_which_causes_problems
-touch this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c
-
-tar cf archive this_is_a_very_long_name_for_a_directory_which_causes_problems
-echo separator
-tar tf archive
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_directory_which_causes_problems/this_is_a_very_long_file_name_which_raises_issues.c: file name is too long (max 99); not dumped
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-this_is_a_very_long_name_for_a_directory_which_causes_problems/
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/longv7.at:30"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_108
-#AT_START_109
-at_fn_group_banner 109 'long01.at:28' \
-  "long file names divisible by block size" "        " 16
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "109. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/long01.at:36:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-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
+mkdir a
+genfile --file a/b
 
-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)"
-at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+tar cf arc a
 
+echo "separator"
 
-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
+sleep 2
+genfile --file a/c
 
-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)
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/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
+echo >>"$at_stdout"; $as_echo "separator
+a/c
+separator
+a/
+a/b
+a/c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/long01.at:36:
+$as_echo "$at_srcdir/update01.at:32:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -27161,12 +36518,23 @@ export TAR_OPTIONS
 rm -rf *
 
 
-install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77
-echo test > endfile
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-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)"
-at_fn_check_prepare_notrace 'an embedded newline' "long01.at:36"
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -27177,50 +36545,40 @@ export TAR_OPTIONS
 rm -rf *
 
 
-install-sh -d 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde >/dev/null && genfile --file 0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde || exit 77
-echo test > endfile
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-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)
+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
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/0123456789abcde/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
+echo >>"$at_stdout"; $as_echo "separator
+a/c
+separator
+a/
+a/b
+a/c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/long01.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_109
-#AT_START_110
-at_fn_group_banner 110 'lustar01.at:21' \
-  "ustar: unsplittable file name" "                  " 16
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "110. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/lustar01.at:27:
+              { set +x
+$as_echo "$at_srcdir/update01.at:32:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -27229,77 +36587,24 @@ 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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "lustar01.at:27"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: 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: file name is too long (cannot be split); not dumped
-tar: Exiting with failure status due to previous errors
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/lustar01.at:27"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_110
-#AT_START_111
-at_fn_group_banner 111 'lustar02.at:21' \
-  "ustar: unsplittable path name" "                  " 16
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "111. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
+mkdir a
+genfile --file a/b
 
+tar cf arc a
 
-  { set +x
-$as_echo "$at_srcdir/lustar02.at:32:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
+echo \"separator\"
 
+sleep 2
+genfile --file a/c
 
-install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77
-tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "lustar02.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -27310,154 +36615,193 @@ export TAR_OPTIONS
 rm -rf *
 
 
-install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/tween_name_and_prefix || exit 77
-tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: this_is_a_very_long_name_for_a_file_designed_to_test_generation_of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/: file name is too long (cannot be split); not dumped
-tar: Exiting with failure status due to previous errors
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+a/c
+separator
+a/
+a/b
+a/c
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/lustar02.at:32"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_111
-#AT_START_112
-at_fn_group_banner 112 'lustar03.at:21' \
-  "ustar: splitting long names" "                    " 16
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "112. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/lustar03.at:29:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
-
-
-install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77
-echo \"Create archive\"
-tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
-echo \"List archive\"
-tar tf archive)"
-at_fn_check_prepare_notrace 'an embedded newline' "lustar03.at:29"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+( $at_check_trace;
+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 *
 
 
-install-sh -d this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be >/dev/null && genfile --file this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file || exit 77
-echo "Create archive"
-tar cf archive this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be
-echo "List archive"
-tar tf archive)
+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
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Create archive
-List 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/
-this_is_a_very_long_name_for_a_file_designed_to_test_generation/of_ustar_archives_by_gnu_tar_semicolon_it_will_not_fit_the_name_field_and_cannot_be_split_be/file
+echo >>"$at_stdout"; $as_echo "separator
+a/c
+separator
+a/
+a/b
+a/c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/lustar03.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/update01.at:32:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
+mkdir a
+genfile --file a/b
 
+tar cf arc a
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_112
-#AT_START_113
-at_fn_group_banner 113 'old.at:23' \
-  "old archives" "                                   " 16
-at_xfail=no
-(
-  $as_echo "113. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+echo \"separator\"
 
+sleep 2
+genfile --file a/c
 
-unset TAR_OPTIONS
-{ set +x
-$as_echo "$at_srcdir/old.at:27:
-mkdir directory
-tar cfvo archive directory || exit 1
-tar tf archive
-"
-at_fn_check_prepare_notrace 'an embedded newline' "old.at:27"
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
 ( $at_check_trace;
-mkdir directory
-tar cfvo archive directory || exit 1
-tar tf archive
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
+
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir a
+genfile --file a/b
 
+tar cf arc a
+
+echo "separator"
+
+sleep 2
+genfile --file a/c
+
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-directory/
+echo >>"$at_stdout"; $as_echo "separator
+a/c
+separator
+a/
+a/b
+a/c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/old.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
+
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_113
-#AT_START_114
-at_fn_group_banner 114 'time01.at:20' \
-  "time: tricky time stamps" "                       " 16
+#AT_STOP_149
+#AT_START_150
+at_fn_group_banner 150 'update02.at:26' \
+  "update changed files" "                           " 20
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "114. $at_setup_line: testing $at_desc ..."
+  $as_echo "150. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -27465,401 +36809,352 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/time01.at:23:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+$as_echo "$at_srcdir/update02.at:29:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-export TZ=UTC0
-mkdir dir
 
-# Test files with time stamps that are near common sources of error,
-# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years).
-# Use GNU-style @ notation for very large time stamps, since they
-# typically don't render into years correctly due to int overflow.
-for s in \\
-  @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \\
-  0000-01-01T00:00:00 0000-01-01T00:00:01 \\
-  0000-01-02T00:00:00 \\
-  1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \\
-  1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \\
-  1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \\
-  1901-12-14T20:45:51 \\
-  1969-12-31T23:59:58 1969-12-31T23:59:59 \\
-  1970-01-01T00:00:00 1970-01-01T00:00:01 \\
-  2038-01-18T03:14:07 \\
-  2038-01-19T03:14:07 2038-01-19T03:14:08 \\
-  2106-02-07T06:28:15 2106-02-07T06:28:16 \\
-  2242-03-16T12:56:31 2242-03-16T12:56:32 \\
-  9999-12-31T23:59:58 9999-12-31T23:59:59 \\
-  @9223372036854775807 @9223372036854775808
-do
-  # Skip a time stamp \$s if it's out of range for this platform,
-  # of if it uses a notation that this platform does not recognize.
-  touch -d \$s dir/f\$s >/dev/null 2>&1 || continue
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  # Likewise for \$s.1.  If \$s is the most negative time stamp and
-  # time stamps are signed, then \$s.1 is out of range.
-  touch -d \$s.1 dir/f\$s.\$ns >/dev/null 2>&1 || continue
+mkdir a
+genfile --file a/b
 
-  for frac in   01 001 00001 000001 0000001 00000001 000000001 0000000001 \\
-             9 99 999 99999 999999 9999999 99999999 999999999 9999999999
-  do
-    touch -d \$s.\$frac dir/f\$s.\$frac
-  done
-done
+tar cf arc a
 
-tar -c -f archive.tar dir
-tar -d -f archive.tar dir
+echo \"separator\"
+
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "time01.at:23"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
 ( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-export TZ=UTC0
-mkdir dir
 
-# Test files with time stamps that are near common sources of error,
-# typically near powers of 2 (for seconds) or near 0, 1970, or 9999 (years).
-# Use GNU-style @ notation for very large time stamps, since they
-# typically don't render into years correctly due to int overflow.
-for s in \
-  @-9223372036854775809 @-9223372036854775808 @-9223372036854775807 \
-  0000-01-01T00:00:00 0000-01-01T00:00:01 \
-  0000-01-02T00:00:00 \
-  1697-10-17T11:03:27 1697-10-17T11:03:28 1697-10-17T11:03:29 \
-  1833-11-24T17:31:43 1833-11-24T17:31:44 1833-11-24T17:31:45 \
-  1901-12-13T20:45:51 1901-12-13T20:45:52 1901-12-13T20:45:53 \
-  1901-12-14T20:45:51 \
-  1969-12-31T23:59:58 1969-12-31T23:59:59 \
-  1970-01-01T00:00:00 1970-01-01T00:00:01 \
-  2038-01-18T03:14:07 \
-  2038-01-19T03:14:07 2038-01-19T03:14:08 \
-  2106-02-07T06:28:15 2106-02-07T06:28:16 \
-  2242-03-16T12:56:31 2242-03-16T12:56:32 \
-  9999-12-31T23:59:58 9999-12-31T23:59:59 \
-  @9223372036854775807 @9223372036854775808
-do
-  # Skip a time stamp $s if it's out of range for this platform,
-  # of if it uses a notation that this platform does not recognize.
-  touch -d $s dir/f$s >/dev/null 2>&1 || continue
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  # Likewise for $s.1.  If $s is the most negative time stamp and
-  # time stamps are signed, then $s.1 is out of range.
-  touch -d $s.1 dir/f$s.$ns >/dev/null 2>&1 || continue
+mkdir a
+genfile --file a/b
 
-  for frac in   01 001 00001 000001 0000001 00000001 000000001 0000000001 \
-             9 99 999 99999 999999 9999999 99999999 999999999 9999999999
-  do
-    touch -d $s.$frac dir/f$s.$frac
-  done
-done
+tar cf arc a
 
-tar -c -f archive.tar dir
-tar -d -f archive.tar dir
+echo "separator"
+
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/time01.at:23"
+echo >>"$at_stdout"; $as_echo "separator
+a/b
+separator
+a/
+a/b
+a/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/update02.at:29:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_114
-#AT_START_115
-at_fn_group_banner 115 'multiv01.at:23' \
-  "multivolume dumps from pipes" "                   " 17
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "115. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+mkdir a
+genfile --file a/b
 
+tar cf arc a
 
+echo \"separator\"
 
-# Fixme: should be configurable
-#  TRUSS=truss -o /tmp/tr
-#  TRUSS=strace
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
+( $at_check_trace;
+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
 
-  { set +x
-$as_echo "$at_srcdir/multiv01.at:30:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+a/b
+separator
+a/
+a/b
+a/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/update02.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 *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
-              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
-  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  done
-done >file2
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-if test \$TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
-      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
+echo \"separator\"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
-              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
-  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  done
-done >file2
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-if test $TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=$TAPE_LENGTH \
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
-      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
+echo "separator"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30"
+echo >>"$at_stdout"; $as_echo "separator
+a/b
+separator
+a/
+a/b
+a/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv01.at:30:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/update02.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 *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
-              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
-  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  done
-done >file2
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-if test \$TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
-      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
+echo \"separator\"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
 ( $at_check_trace;
-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 *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
-              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
-  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  done
-done >file2
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-if test $TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=$TAPE_LENGTH \
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
-      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
+echo "separator"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30"
+echo >>"$at_stdout"; $as_echo "separator
+a/b
+separator
+a/
+a/b
+a/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv01.at:30:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+$as_echo "$at_srcdir/update02.at:29:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in \" 1\" \" 2\" \" 3\" \" 4\" \" 5\" \" 6\" \" 7\" \" 8\" \\
-              \" 9\" \"10\" \"11\" \"12\" \"13\" \"14\" \"15\" \"16\" ; do \\
-  echo \"file2  block \${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo \"bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla\"
-  done
-done >file2
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-if test \$TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=\$TAPE_LENGTH \\
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=\$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=\$PATH \${TRUSS} tar -f t1-pipe.tar -f - \\
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \\
-      --tape-length=\$TAPE_LENGTH --read-full-records || exit 1
+echo \"separator\"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo \"separator\"
+tar tf arc | sort || exit 1
 )"
-at_fn_check_prepare_notrace 'a ${...} parameter expansion' "multiv01.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
 ( $at_check_trace;
-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 *
 
-exec <&-
-genfile --length 7168 --file file1
 
-for block in " 1" " 2" " 3" " 4" " 5" " 6" " 7" " 8" \
-              " 9" "10" "11" "12" "13" "14" "15" "16" ; do \
-  echo "file2  block ${block} bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  for count in 2 3 4 5 6 7 8 ; do
-    echo "bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla!bla"
-  done
-done >file2
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-if test $TEST_TAR_FORMAT = pax; then
-  TAPE_LENGTH=11
-else
-  TAPE_LENGTH=10
-fi
+mkdir a
+genfile --file a/b
 
-tar -c --multi-volume --tape-length=$TAPE_LENGTH \
-  -f t1-pipe.tar -f t2-pipe.tar ./file1 ./file2 || exit 1
+tar cf arc a
 
-mkdir extract-dir-pipe
-dd bs=4096 count=$TAPE_LENGTH if=t2-pipe.tar 2>/dev/null |
-PATH=$PATH ${TRUSS} tar -f t1-pipe.tar -f - \
-      -C extract-dir-pipe -x --multi-volume --warning=no-timestamp \
-      --tape-length=$TAPE_LENGTH --read-full-records || exit 1
+echo "separator"
 
-cmp file1 extract-dir-pipe/file1
-cmp file2 extract-dir-pipe/file2
+sleep 2
+touch a/b
+
+tar ufv arc a
+echo "separator"
+tar tf arc | sort || exit 1
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv01.at:30"
+echo >>"$at_stdout"; $as_echo "separator
+a/b
+separator
+a/
+a/b
+a/b
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -27870,14 +37165,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_115
-#AT_START_116
-at_fn_group_banner 116 'multiv02.at:28' \
-  "skipping a straddling member" "                   " 17
+#AT_STOP_150
+#AT_START_151
+at_fn_group_banner 151 'verify.at:25' \
+  "verify" "                                         " 21
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "116. $at_setup_line: testing $at_desc ..."
+  $as_echo "151. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -27885,61 +37180,45 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/multiv02.at:31:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/verify.at:28:
+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 --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
+touch foo
+tar -cvf archive.tar --verify foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 --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
+touch foo
+tar -cvf archive.tar --verify foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-en
+echo >>"$at_stdout"; $as_echo "foo
+Verify foo
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv02.at:31:
+$as_echo "$at_srcdir/verify.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -27948,18 +37227,10 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 10240 --file en
-genfile --length 20000 --file to
-genfile --length 20000 --file tre
-genfile --length 10240 --file fire
-
-exec <&-
-
-tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
-echo separator
-tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1
+touch foo
+tar -cvf archive.tar --verify foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -27969,283 +37240,132 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 10240 --file en
-genfile --length 20000 --file to
-genfile --length 20000 --file tre
-genfile --length 10240 --file fire
-
-exec <&-
-
-tar -c -f A.tar -f B.tar -f C.tar -M -L 30 en to tre fire || exit 1
-echo separator
-tar -v -x -f A.tar -f B.tar -f C.tar -M en --warning=no-timestamp || exit 1
+touch foo
+tar -cvf archive.tar --verify foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-en
+echo >>"$at_stdout"; $as_echo "foo
+Verify foo
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv02.at:31:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+$as_echo "$at_srcdir/verify.at:28:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H ustar\"
 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
+touch foo
+tar -cvf archive.tar --verify foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv02.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
 ( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS="-H ustar"
 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
+touch foo
+tar -cvf archive.tar --verify foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-en
+echo >>"$at_stdout"; $as_echo "foo
+Verify foo
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv02.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_116
-#AT_START_117
-at_fn_group_banner 117 'multiv03.at:30' \
-  "MV archive & long filenames" "                    " 17
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "117. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/multiv03.at:33:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+              { set +x
+$as_echo "$at_srcdir/verify.at:28:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-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 <<EOF
-tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
-tar: '\$BFILE' is possibly continued on this volume: header contains truncated name
-EOF
-
-cat > ../expout <<EOF
-\$AFILE
-separator-1
-separator-2
-EOF
-
-genfile --length 15360 --file \$AFILE
-
-exec <&-
-
-tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
-tar -tM -f arch.1 -f arch.2 || exit 1
-
-echo separator-1
-
-genfile --length 15360 --file \$BFILE
-tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1
-
-echo separator-2
-mv \$BFILE bfile
-tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
-cmp \$BFILE bfile
+touch foo
+tar -cvf archive.tar --verify foo
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33"
+at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
 ( $at_check_trace;
-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 *
 
-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 <<EOF
-tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
-tar: '$BFILE' is possibly continued on this volume: header contains truncated name
-EOF
-
-cat > ../expout <<EOF
-$AFILE
-separator-1
-separator-2
-EOF
-
-genfile --length 15360 --file $AFILE
-
-exec <&-
-
-tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
-tar -tM -f arch.1 -f arch.2 || exit 1
-
-echo separator-1
-
-genfile --length 15360 --file $BFILE
-tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
-
-echo separator-2
-mv $BFILE bfile
-tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
-cmp $BFILE bfile
+touch foo
+tar -cvf archive.tar --verify foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-$at_diff experr "$at_stderr" || at_failed=:
-$at_diff expout "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+Verify foo
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv03.at:33:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/verify.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 *
 
-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 <<EOF
-tar: \$BFILE: file name too long to be stored in a GNU multivolume header, truncated
-tar: '\$BFILE' is possibly continued on this volume: header contains truncated name
-EOF
-
-cat > ../expout <<EOF
-\$AFILE
-separator-1
-separator-2
-EOF
-
-genfile --length 15360 --file \$AFILE
-
-exec <&-
-
-tar -M -L 10 -c -f arch.1 -f arch.2 \$AFILE || exit 1
-tar -tM -f arch.1 -f arch.2 || exit 1
-
-echo separator-1
-
-genfile --length 15360 --file \$BFILE
-tar -M -L 10 -c -f arch.1 -f arch.2 \$BFILE || exit 1
-
-echo separator-2
-mv \$BFILE bfile
-tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
-cmp \$BFILE bfile
+touch foo
+tar -cvf archive.tar --verify foo
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "multiv03.at:33"
+at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
 ( $at_check_trace;
-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 *
 
-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 <<EOF
-tar: $BFILE: file name too long to be stored in a GNU multivolume header, truncated
-tar: '$BFILE' is possibly continued on this volume: header contains truncated name
-EOF
-
-cat > ../expout <<EOF
-$AFILE
-separator-1
-separator-2
-EOF
-
-genfile --length 15360 --file $AFILE
-
-exec <&-
-
-tar -M -L 10 -c -f arch.1 -f arch.2 $AFILE || exit 1
-tar -tM -f arch.1 -f arch.2 || exit 1
-
-echo separator-1
-
-genfile --length 15360 --file $BFILE
-tar -M -L 10 -c -f arch.1 -f arch.2 $BFILE || exit 1
-
-echo separator-2
-mv $BFILE bfile
-tar -M -x -f arch.1 -f arch.2 --warning=no-timestamp || exit 1
-cmp $BFILE bfile
+touch foo
+tar -cvf archive.tar --verify foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-$at_diff experr "$at_stderr" || at_failed=:
-$at_diff expout "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv03.at:33"
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+Verify foo
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -28256,14 +37376,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_117
-#AT_START_118
-at_fn_group_banner 118 'multiv04.at:36' \
-  "split directory members in a MV archive" "        " 17
+#AT_STOP_151
+#AT_START_152
+at_fn_group_banner 152 'volume.at:24' \
+  "volume" "                                         " 22
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "118. $at_setup_line: testing $at_desc ..."
+  $as_echo "152. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -28271,7 +37391,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/multiv04.at:39:
+$as_echo "$at_srcdir/volume.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -28280,24 +37400,23 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+tar -cf archive -V label -T /dev/null || exit 1
 
-mkdir directory
-awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' </dev/null | genfile --files-from -
-
-exec <&-
-
-sleep 2
-
-tar --listed-incremental=list -c -f archive.a directory
-
-sleep 2
-
-tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
-
-echo separator
+tar xfV archive label || exit 1
+tar xfV archive 'la?el' || exit 1
+tar xfV archive 'l*l' || exit 1
 
-tar -MRt -f arc.1 -f arc.2)"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39"
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "volume.at:27"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -28307,39 +37426,43 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+tar -cf archive -V label -T /dev/null || exit 1
 
-mkdir directory
-awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' </dev/null | genfile --files-from -
-
-exec <&-
-
-sleep 2
-
-tar --listed-incremental=list -c -f archive.a directory
-
-sleep 2
-
-tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
-
-echo separator
+tar xfV archive label || exit 1
+tar xfV archive 'la?el' || exit 1
+tar xfV archive 'l*l' || exit 1
 
-tar -MRt -f arc.1 -f arc.2)
+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
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-separator
-block 0: directory/
-block 35: ** Block of NULs **
+echo >>"$at_stderr"; $as_echo "-----
+tar: Volume 'label' does not match 'lab'
+tar: Error is not recoverable: exiting now
+-----
+tar: Volume 'label' does not match 'bel'
+tar: Error is not recoverable: exiting now
+-----
+tar: Volume 'label' does not match 'babel'
+tar: Error is not recoverable: exiting now
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39"
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/volume.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv04.at:39:
+$as_echo "$at_srcdir/volume.at:27:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -28348,24 +37471,23 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
+tar -cf archive -V label -T /dev/null || exit 1
 
-mkdir directory
-awk 'BEGIN { for (i = 0; i < 1024; i++) printf(\"directory/%014x\\n\", i); }' </dev/null | genfile --files-from -
-
-exec <&-
-
-sleep 2
-
-tar --listed-incremental=list -c -f archive.a directory
-
-sleep 2
-
-tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
-
-echo separator
+tar xfV archive label || exit 1
+tar xfV archive 'la?el' || exit 1
+tar xfV archive 'l*l' || exit 1
 
-tar -MRt -f arc.1 -f arc.2)"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv04.at:39"
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "volume.at:27"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -28375,34 +37497,38 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+tar -cf archive -V label -T /dev/null || exit 1
 
-mkdir directory
-awk 'BEGIN { for (i = 0; i < 1024; i++) printf("directory/%014x\n", i); }' </dev/null | genfile --files-from -
-
-exec <&-
-
-sleep 2
-
-tar --listed-incremental=list -c -f archive.a directory
-
-sleep 2
-
-tar --listed-incremental=list -c --record-size 1024 -L 16 -f arc.1 -f arc.2 -v directory
-
-echo separator
+tar xfV archive label || exit 1
+tar xfV archive 'la?el' || exit 1
+tar xfV archive 'l*l' || exit 1
 
-tar -MRt -f arc.1 -f arc.2)
+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
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "directory/
-separator
-block 0: directory/
-block 35: ** Block of NULs **
+echo >>"$at_stderr"; $as_echo "-----
+tar: Volume 'label' does not match 'lab'
+tar: Error is not recoverable: exiting now
+-----
+tar: Volume 'label' does not match 'bel'
+tar: Error is not recoverable: exiting now
+-----
+tar: Volume 'label' does not match 'babel'
+tar: Error is not recoverable: exiting now
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv04.at:39"
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/volume.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -28413,334 +37539,298 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_118
-#AT_START_119
-at_fn_group_banner 119 'multiv05.at:26' \
-  "Restoring after an out of sync volume" "          " 17
+#AT_STOP_152
+#AT_START_153
+at_fn_group_banner 153 'volsize.at:29' \
+  "volume header size" "                             " 22
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "119. $at_setup_line: testing $at_desc ..."
+  $as_echo "153. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-
   { set +x
-$as_echo "$at_srcdir/multiv05.at:30:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/volsize.at:32:
+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 *
 
-exec <&-
 
-genfile --length 250k --file jeden
-genfile --length 250k --file dwa
-genfile --length 250k --file trzy
-genfile --length 250k --file cztery
-genfile --length 250k --file piec
-genfile --length 250k --file szesc
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
 
-echo Creating archive
-tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc
-echo separator
-mkdir bak
-mv jeden dwa trzy cztery piec szesc bak
-tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar
-echo Diffing jeden
-   cmp bak/jeden jeden || exit 1
-echo Diffing dwa
-   cmp bak/dwa dwa || exit 1
-echo Diffing trzy
-   cmp bak/trzy trzy || exit 1
-echo Diffing cztery
-   cmp bak/cztery cztery || exit 1
-echo Diffing piec
-   cmp bak/piec piec || exit 1
-echo Diffing szesc
-   cmp bak/szesc szesc || exit 1
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf \$TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf \$TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf \$TEST_DATA_DIR/abc.tar
+find abc|sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv05.at:30"
+at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-exec <&-
 
-genfile --length 250k --file jeden
-genfile --length 250k --file dwa
-genfile --length 250k --file trzy
-genfile --length 250k --file cztery
-genfile --length 250k --file piec
-genfile --length 250k --file szesc
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
 
-echo Creating archive
-tar -c -M -L 502 -f a.tar -f b.tar -f c.tar jeden dwa trzy cztery piec szesc
-echo separator
-mkdir bak
-mv jeden dwa trzy cztery piec szesc bak
-tar -vxM -f a.tar -f c.tar -f b.tar -f c.tar
-echo Diffing jeden
-   cmp bak/jeden jeden || exit 1
-echo Diffing dwa
-   cmp bak/dwa dwa || exit 1
-echo Diffing trzy
-   cmp bak/trzy trzy || exit 1
-echo Diffing cztery
-   cmp bak/cztery cztery || exit 1
-echo Diffing piec
-   cmp bak/piec piec || exit 1
-echo Diffing szesc
-   cmp bak/szesc szesc || exit 1
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf $TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf $TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf $TEST_DATA_DIR/abc.tar
+find abc|sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: 'trzy' is not continued on this volume
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating archive
-separator
-jeden
-dwa
-trzy
-cztery
-piec
-szesc
-Diffing jeden
-Diffing dwa
-Diffing trzy
-Diffing cztery
-Diffing piec
-Diffing szesc
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Short Listing
+abc/not-a-file.gif
+abc/CCC
+Verbose Listing
+V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
+-rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
+Extracted directory
+abc
+abc/CCC
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv05.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/volsize.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
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_119
-#AT_START_120
-at_fn_group_banner 120 'multiv06.at:27' \
-  "Multivolumes with L=record_size" "                " 17
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "120. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/multiv06.at:30:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
-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)"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30"
+echo Short Listing
+tar tf \$TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf \$TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf \$TEST_DATA_DIR/abc.tar
+find abc|sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-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)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf $TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf $TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf $TEST_DATA_DIR/abc.tar
+find abc|sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating file
-Creating archive
-Testing archive
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating file
-Creating archive
-Testing archive
-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Short Listing
+abc/not-a-file.gif
+abc/CCC
+Verbose Listing
+V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
+-rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
+Extracted directory
+abc
+abc/CCC
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/multiv06.at:30:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+$as_echo "$at_srcdir/volsize.at:32:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H ustar\"
 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)"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv06.at:30"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf \$TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf \$TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf \$TEST_DATA_DIR/abc.tar
+find abc|sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
 ( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS="-H ustar"
 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)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf $TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf $TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf $TEST_DATA_DIR/abc.tar
+find abc|sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating file
-Creating archive
-Testing archive
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating file
-Creating archive
-Testing archive
-file
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Short Listing
+abc/not-a-file.gif
+abc/CCC
+Verbose Listing
+V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
+-rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
+Extracted directory
+abc
+abc/CCC
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv06.at:30"
+at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/volsize.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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_120
-#AT_START_121
-at_fn_group_banner 121 'multiv07.at:28' \
-  "volumes split at an extended header" "            " 17
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "121. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-{ set +x
-$as_echo "$at_srcdir/multiv07.at:31:
-
-
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
 test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
-
-exec <&-
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
-cd \$TEST_DATA_DIR
-tar -t -M -fxsplit-1.tar -fxsplit-2.tar
-"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv07.at:31"
+echo Short Listing
+tar tf \$TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf \$TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf \$TEST_DATA_DIR/abc.tar
+find abc|sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
 ( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
 
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq xsplit-1.tar 0e008c84c517e48fbf23ca6a7033cde6 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
-
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq xsplit-2.tar 03150b9852d285458f43734e9e0b9a45 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-exec <&-
 
-cd $TEST_DATA_DIR
-tar -t -M -fxsplit-1.tar -fxsplit-2.tar
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
 
+echo Short Listing
+tar tf $TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf $TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf $TEST_DATA_DIR/abc.tar
+find abc|sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Archive volumes split at an extended header Volume 1
-foo
-bar
+echo >>"$at_stdout"; $as_echo "Short Listing
+abc/not-a-file.gif
+abc/CCC
+Verbose Listing
+V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
+-rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
+Extracted directory
+abc
+abc/CCC
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv07.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_121
-#AT_START_122
-at_fn_group_banner 122 'multiv08.at:25' \
-  "multivolume header creation" "                    " 17
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "122. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/multiv08.at:28:
+              { set +x
+$as_echo "$at_srcdir/volsize.at:32:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -28749,14 +37839,22 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 9472 --file a
-genfile --length 9984 --file b
-decho Creating
-tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b
-decho Testing
-tar -tMR -f A.tar -f B.tar -f C.tar
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+
+test -z \"\$TEST_DATA_DIR\" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf \$TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf \$TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf \$TEST_DATA_DIR/abc.tar
+find abc|sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "multiv08.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -28766,28 +37864,37 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 9472 --file a
-genfile --length 9984 --file b
-decho Creating
-tar -c -M -L10 -f A.tar -f B.tar -f C.tar a b
-decho Testing
-tar -tMR -f A.tar -f B.tar -f C.tar
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+
+test -z "$TEST_DATA_DIR" && exit 77
+tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
+
+echo Short Listing
+tar tf $TEST_DATA_DIR/abc.tar
+echo Verbose Listing
+tar --utc -tvf $TEST_DATA_DIR/abc.tar
+echo Extracted directory
+tar xf $TEST_DATA_DIR/abc.tar
+find abc|sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "Creating
-Testing
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Creating
-Testing
-block 0: a
-block 21: b
-block 43: ** Block of NULs **
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "Short Listing
+abc/not-a-file.gif
+abc/CCC
+Verbose Listing
+V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
+-rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
+Extracted directory
+abc
+abc/CCC
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multiv08.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -28798,399 +37905,413 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_122
-#AT_START_123
-at_fn_group_banner 123 'owner.at:21' \
-  "--owner and --group" "                            " 18
+#AT_STOP_153
+#AT_START_154
+at_fn_group_banner 154 'comprec.at:22' \
+  "compressed format recognition" "                  " 23
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "123. $at_setup_line: testing $at_desc ..."
+  $as_echo "154. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
+
   { set +x
-$as_echo "$at_srcdir/owner.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/comprec.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 *
 
-export TZ=UTC0
-
-genfile --file a
 
-tar --owner=\"Joe the Plumber:1234\" \\
-    --group=\"Plumber's Union:5678\" \\
-    --mtime='@0' \\
-    --mode='u=rw,go=r' \\
-    -cf arc a
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-tar -tvf arc
-tar --numeric-owner -tvf arc
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "owner.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:26"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-export TZ=UTC0
-
-genfile --file a
 
-tar --owner="Joe the Plumber:1234" \
-    --group="Plumber's Union:5678" \
-    --mtime='@0' \
-    --mode='u=rw,go=r' \
-    -cf arc a
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-tar -tvf arc
-tar --numeric-owner -tvf arc
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "-rw-r--r-- Joe the Plumber/Plumber's Union 0 1970-01-01 00:00 a
--rw-r--r-- 1234/5678         0 1970-01-01 00:00 a
+echo >>"$at_stdout"; $as_echo "separator
+separator
+file1
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/owner.at:24"
+at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/comprec.at:26:
+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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_123
-#AT_START_124
-at_fn_group_banner 124 'sparse01.at:21' \
-  "sparse files" "                                   " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "124. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+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
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:26"
+( $at_check_trace;
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "separator
+separator
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:26"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/sparse01.at:24:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+              { set +x
+$as_echo "$at_srcdir/comprec.at:26:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:26"
 ( $at_check_trace;
-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 *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo stdout:; tee stdout <"$at_stdout"
-at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24"
+echo >>"$at_stdout"; $as_echo "separator
+separator
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/sparse01.at:24:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/comprec.at:26:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:26"
 ( $at_check_trace;
-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 *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo stdout:; tee stdout <"$at_stdout"
-at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24"
+echo >>"$at_stdout"; $as_echo "separator
+separator
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/sparse01.at:24:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/comprec.at:26:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-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
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse01.at:24"
+at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:26"
 ( $at_check_trace;
-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 *
 
-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
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo stdout:; tee stdout <"$at_stdout"
-at_fn_check_status 0 $at_status "$at_srcdir/sparse01.at:24"
+echo >>"$at_stdout"; $as_echo "separator
+separator
+file1
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:26"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-
-cat >stdout.re <<'_ATEOF'
-separator
--rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
--rw-r--r-- ^ ^ *  *10344448 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
--rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
-separator
-sparsefile 10344448
-_ATEOF
-
-awk '{print NR " " $0}' stdout > $$.1
-awk '{print NR " " $0}' stdout.re | join - $$.1 |
-while read NUM RE LINE
-do
-  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
-done
-
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_124
-#AT_START_125
-at_fn_group_banner 125 'sparse02.at:21' \
-  "extracting sparse file over a pipe" "             " 19
+#AT_STOP_154
+#AT_START_155
+at_fn_group_banner 155 'shortfile.at:26' \
+  "short input files" "                              " 23
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "125. $at_setup_line: testing $at_desc ..."
+  $as_echo "155. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-# Tar 1.14 - 1.15.1 was unable to extract sparse files to a pipe.
-# References: <16896.21739.460782.124775@jik.kamens.brookline.ma.us>
-# http://lists.gnu.org/archive/html/bug-tar/2005-02/msg00003.html
-
 
 
   { set +x
-$as_echo "$at_srcdir/sparse02.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/shortfile.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 --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "shortfile.at:29"
 ( $at_check_trace;
-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 *
 
-genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stderr"; $as_echo "tar: This does not look like a tar archive
+tar: Exiting with failure status due to previous errors
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28"
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 2 $at_status "$at_srcdir/shortfile.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/sparse02.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_155
+#AT_START_156
+at_fn_group_banner 156 'shortupd.at:31' \
+  "updating short archives" "                        " 23
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "156. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/shortupd.at:34:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -c -f archive --sparse sparsefile || exit 1
-echo separator
-
-tar xfO archive | cat - > sparsecopy || exit 1
-cmp sparsefile sparsecopy
+touch foo
+tar uf archive foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
+( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -c -f archive --sparse sparsefile || exit 1
-echo separator
-
-tar xfO archive | cat - > sparsecopy || exit 1
-cmp sparsefile sparsecopy
+touch foo
+tar uf archive foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/sparse02.at:28:
+$as_echo "$at_srcdir/shortupd.at:34:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -29199,14 +38320,10 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -c -f archive --sparse sparsefile || exit 1
-echo separator
-
-tar xfO archive | cat - > sparsecopy || exit 1
-cmp sparsefile sparsecopy
+touch foo
+tar uf archive foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse02.at:28"
+at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -29216,52 +38333,55 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --sparse --file sparsefile --block-size 512 0 ABCD 1M EFGH 2000K IJKL || exit 77
-tar -c -f archive --sparse sparsefile || exit 1
-echo separator
-
-tar xfO archive | cat - > sparsecopy || exit 1
-cmp sparsefile sparsecopy
+touch foo
+tar uf archive foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparse02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/shortupd.at:34:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
+touch foo
+tar uf archive foo
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
+touch foo
+tar uf archive foo
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_125
-#AT_START_126
-at_fn_group_banner 126 'sparse03.at:21' \
-  "storing sparse files > 8G" "                      " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "126. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-# Tar 1.15.1 incorrectly computed sparse member size if the extended
-# PAX header contained size keyword.
-# References: <87vf46nb36.fsf@penguin.cs.ucla.edu>
-# http://lists.gnu.org/archive/html/bug-tar/2005-06/msg00040.html
-
-
-
-  { set +x
-$as_echo "$at_srcdir/sparse03.at:29:
+              { set +x
+$as_echo "$at_srcdir/shortupd.at:34:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -29270,20 +38390,10 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 1000 --file begin
-genfile --length 1000 --file end
-genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
-tar -c -f archive --sparse begin sparsefile end || exit 1
-echo separator
-
-tar tfv archive
-echo separator
-mkdir directory
-tar Cxf directory archive
-genfile --stat=name,size sparsefile
-cmp sparsefile directory/sparsefile
+touch foo
+tar uf archive foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse03.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -29293,223 +38403,129 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 1000 --file begin
-genfile --length 1000 --file end
-genfile --sparse --file sparsefile --block-size 512 8G A || exit 77
-tar -c -f archive --sparse begin sparsefile end || exit 1
-echo separator
-
-tar tfv archive
-echo separator
-mkdir directory
-tar Cxf directory archive
-genfile --stat=name,size sparsefile
-cmp sparsefile directory/sparsefile
+touch foo
+tar uf archive foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo stdout:; tee stdout <"$at_stdout"
-at_fn_check_status 0 $at_status "$at_srcdir/sparse03.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-
-cat >stdout.re <<'_ATEOF'
-separator
--rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 begin
--rw-r--r-- ^ ^ *  *8589935104 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 sparsefile
--rw-r--r-- ^ ^ *  *1000 0-90-90-90-9-0-90-9-0-90-9 0-90-9:0-90-9 end
-separator
-sparsefile 8589935104
-_ATEOF
-
-awk '{print NR " " $0}' stdout > $$.1
-awk '{print NR " " $0}' stdout.re | join - $$.1 |
-while read NUM RE LINE
-do
-  echo "$LINE" | grep -- "$RE" >/dev/null || exit 1
-done
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_126
-#AT_START_127
-at_fn_group_banner 127 'sparse04.at:21' \
-  "storing long sparse file names" "                 " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "127. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-# Description: Tar versions from 1.15.92 to 1.25 would incorrectly
-# store sparse file names longer than 100 characters in pax mode.
-# Namely, the 'path' keyword of the produced PAX header would contain the
-# crafted name of the header itself, instead of that of the file.
-# Reported by: Kamil Dudka <kdudka@redhat.com>
-# References: <201011250026.44908.kdudka@redhat.com>,
-#             http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00099.html
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/sparse04.at:35:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+              { set +x
+$as_echo "$at_srcdir/shortupd.at:34:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77
-tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf -
+touch foo
+tar uf archive foo
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "sparse04.at:35"
+at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
 ( $at_check_trace;
-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 *
 
-genfile --sparse --file 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 --block-size 512 8M A || exit 77
-tar -f - -c --sparse --posix 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 | tar tf -
+touch foo
+tar uf archive foo
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparse04.at:35"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
 
 
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_127
-#AT_START_128
-at_fn_group_banner 128 'sparsemv.at:21' \
-  "sparse files in MV archives" "                    " 19
+#AT_STOP_156
+#AT_START_157
+at_fn_group_banner 157 'truncate.at:29' \
+  "truncate" "                                       " 23
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "128. $at_setup_line: testing $at_desc ..."
+  $as_echo "157. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-# Check if sparse files are correctly split between GNU multi-volume
-# archives.
-# There are two cases: the file can be split within an empty (null) block,
-# or within a data block. Since null blocks are not archived, the first
-# case means the file is split between two consecutive data blocks.
-#
-
 
 
   { set +x
-$as_echo "$at_srcdir/sparsemv.at:31:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/truncate.at:32:
+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 *
 
-exec <&-
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31"
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: \$?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)"
+at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
-exec <&-
-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
-)
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: $?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
-Create archive
-Test archive
-sparsefile
-Compare archive
-Pass 2: Split within a data block
-Create archive
-Test archive
-sparsefile
-Compare archive
+echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+Exit status: 1
+separator
+foo
+foo: Mod time differs
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/sparsemv.at:31:
+$as_echo "$at_srcdir/truncate.at:32:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -29518,26 +38534,14 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "sparsemv.at:31"
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: \$?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)"
+at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -29547,342 +38551,188 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-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
-)
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: $?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
-Create archive
-Test archive
-sparsefile
-Compare archive
-Pass 2: Split within a data block
-Create archive
-Test archive
-sparsefile
-Compare archive
+echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+Exit status: 1
+separator
+foo
+foo: Mod time differs
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sparsemv.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_128
-#AT_START_129
-at_fn_group_banner 129 'spmvp00.at:21' \
-  "sparse files in PAX MV archives, v.0.0" "         " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "129. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/spmvp00.at:24:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+              { set +x
+$as_echo "$at_srcdir/truncate.at:32:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77
-echo \"Pass 1: Split between data blocks\"
-echo \"Create archive\"
-tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo \"Pass 2: Split within a data block\"
-genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
-echo \"Create archive\"
-tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "spmvp00.at:24"
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: \$?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)"
+at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
 ( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGHI 1M ABCDEFGHI || exit 77
-echo "Pass 1: Split between data blocks"
-echo "Create archive"
-tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo "Pass 2: Split within a data block"
-genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
-echo "Create archive"
-tar --sparse --sparse-version=0.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: $?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
-Create archive
-Test archive
-sparsefile
-Compare archive
-Pass 2: Split within a data block
-Create archive
-Test archive
-sparsefile
-Compare archive
+echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+Exit status: 1
+separator
+foo
+foo: Mod time differs
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/spmvp00.at:24"
+at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_129
-#AT_START_130
-at_fn_group_banner 130 'spmvp01.at:21' \
-  "sparse files in PAX MV archives, v.0.1" "         " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "130. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/spmvp01.at:24:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+              { set +x
+$as_echo "$at_srcdir/truncate.at:32:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
-echo \"Pass 1: Split between data blocks\"
-echo \"Create archive\"
-tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo \"Pass 2: Split within a data block\"
-genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
-echo \"Create archive\"
-tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "spmvp01.at:24"
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: \$?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)"
+at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
 ( $at_check_trace;
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H pax"
+TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGHIJK 1M ABCDEFGHI || exit 77
-echo "Pass 1: Split between data blocks"
-echo "Create archive"
-tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo "Pass 2: Split within a data block"
-genfile --sparse --file sparsefile 0 ABCDEFGHIJ 1M ABCDEFGHI || exit 77
-echo "Create archive"
-tar --sparse --sparse-version=0.1 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: $?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
-Create archive
-Test archive
-sparsefile
-Compare archive
-Pass 2: Split within a data block
-Create archive
-Test archive
-sparsefile
-Compare archive
+echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+Exit status: 1
+separator
+foo
+foo: Mod time differs
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/spmvp01.at:24"
+at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_130
-#AT_START_131
-at_fn_group_banner 131 'spmvp10.at:21' \
-  "sparse files in PAX MV archives, v.1.0" "         " 19
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "131. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/spmvp10.at:24:
-mkdir pax
-(cd pax
-TEST_TAR_FORMAT=pax
+              { set +x
+$as_echo "$at_srcdir/truncate.at:32:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H pax\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
-echo \"Pass 1: Split between data blocks\"
-echo \"Create archive\"
-tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo \"Pass 2: Split within a data block\"
-genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77
-echo \"Create archive\"
-tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo \"Test archive\"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo \"Compare archive\"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "spmvp10.at:24"
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: \$?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)"
+at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
 ( $at_check_trace;
-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 *
 
-exec <&-
-genfile --sparse --file sparsefile 0 ABCDEFGH 1M ABCDEFGHI || exit 77
-echo "Pass 1: Split between data blocks"
-echo "Create archive"
-tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-
-echo "Pass 2: Split within a data block"
-genfile --sparse --file sparsefile 0 ABCDEFG 1M ABCDEFGHI || exit 77
-echo "Create archive"
-tar --sparse --sparse-version=1.0 -c --record-size=512 -M -L6 -f arc.1 -f arc.2 -f arc.3 sparsefile
-echo "Test archive"
-tar -t -M -f arc.1 -f arc.2 -f arc.3
-echo "Compare archive"
-tar -d -M -f arc.1 -f arc.2 -f arc.3
-)
+genfile --file foo --length 200k
+genfile --file baz
+genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
+echo Exit status: $?
+echo separator
+genfile --file foo --seek 195k --length 5k --pattern=zeros
+tar dvf bar)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Pass 1: Split between data blocks
-Create archive
-Test archive
-sparsefile
-Compare archive
-Pass 2: Split within a data block
-Create archive
-Test archive
-sparsefile
-Compare archive
+echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+Exit status: 1
+separator
+foo
+foo: Mod time differs
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/spmvp10.at:24"
+at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -29893,14 +38743,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_131
-#AT_START_132
-at_fn_group_banner 132 'update.at:28' \
-  "update unchanged directories" "                   " 20
+#AT_STOP_157
+#AT_START_158
+at_fn_group_banner 158 'grow.at:24' \
+  "grow" "                                           " 23
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "132. $at_setup_line: testing $at_desc ..."
+  $as_echo "158. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -29908,7 +38758,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/update.at:31:
+$as_echo "$at_srcdir/grow.at:27:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -29917,20 +38767,11 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -29940,36 +38781,26 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-directory/
-directory/file1
-directory/file2
+echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update.at:31:
+$as_echo "$at_srcdir/grow.at:27:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -29978,20 +38809,11 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -30001,36 +38823,26 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-directory/
-directory/file1
-directory/file2
+echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update.at:31:
+$as_echo "$at_srcdir/grow.at:27:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -30039,20 +38851,11 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -30062,36 +38865,26 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-directory/
-directory/file1
-directory/file2
+echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update.at:31:
+$as_echo "$at_srcdir/grow.at:27:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -30100,20 +38893,11 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
+at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -30123,36 +38907,26 @@ 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
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-directory/
-directory/file1
-directory/file2
+echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
+at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update.at:31:
+$as_echo "$at_srcdir/grow.at:27:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -30161,80 +38935,133 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+genfile --file foo --length 50000k
+genfile --file baz
+genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
+( $at_check_trace;
+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 --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "foo
+baz
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update.at:31"
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_158
+#AT_START_159
+at_fn_group_banner 159 'sigpipe.at:21' \
+  "sigpipe handling" "                               " 23
+at_xfail=no
+(
+  $as_echo "159. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+# Description: Tar 1.23 ignored sigpipe which lead to spurious "write
+# error" diagnostics when piping output to another programs.
+# Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
+# References: http://lists.gnu.org/archive/html/bug-tar/2010-03/msg00039.html
+#             <20100319184141.GC30047@wo.int.altlinux.org>
+
+{ set +x
+$as_echo "$at_srcdir/sigpipe.at:30:
+
+case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #(
+?*) exit 77;;
+esac
+
+
+genfile --length 2048 --file first
+genfile --length 2048 --file second
+genfile --length 2049 --file third
+
+tar cf archive first second third
+
+# Discard diagnostics that some shells generate about broken pipes.
+(tar tf archive 2>&3 | :) 3>&2 2>/dev/null
+"
+at_fn_check_prepare_notrace 'a `...` command substitution' "sigpipe.at:30"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
 
+case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
+?*) exit 77;;
+esac
 
-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
+genfile --length 2048 --file first
+genfile --length 2048 --file second
+genfile --length 2049 --file third
+
+tar cf archive first second third
+
+# Discard diagnostics that some shells generate about broken pipes.
+(tar tf archive 2>&3 | :) 3>&2 2>/dev/null
 
-tar cf archive directory || exit 1
-echo separator
-tar uf archive directory || exit 1
-echo separator
-tar tf archive | sort || exit 1
-)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-directory/
-directory/file1
-directory/file2
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update.at:31"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/sigpipe.at:30"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
-
-
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_132
-#AT_START_133
-at_fn_group_banner 133 'update01.at:29' \
-  "update directories" "                             " 20
+#AT_STOP_159
+#AT_START_160
+at_fn_group_banner 160 'comperr.at:18' \
+  "compressor program failure" "                     " 23
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "133. $at_setup_line: testing $at_desc ..."
+  $as_echo "160. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# Description: If the --use-compress-program fails, then it is unsafe
+# to assume that the created archive is OK.  Tar should fail with a
+# prominent error message.
+# Reported by: Ole Tange <tange@gnu.org>
+# References: <CA+4vN7wLZ-+LK1t7WMkM_b9f3mV9JTnSuPamPn2ciX5PTN=9Xw@mail.gmail.com>,
+#        http://lists.gnu.org/archive/html/bug-tar/2015-03/msg00002.html
+
 
 
   { set +x
-$as_echo "$at_srcdir/update01.at:32:
+$as_echo "$at_srcdir/comperr.at:28:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -30243,24 +39070,12 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=\$?
+sed -n '\$p' err
+exit \$rc
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+at_fn_check_prepare_notrace 'an embedded newline' "comperr.at:28"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -30270,41 +39085,24 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=$?
+sed -n '$p' err
+exit $rc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/c
-separator
-a/
-a/b
-a/c
+echo >>"$at_stdout"; $as_echo "tar: Error is not recoverable: exiting now
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/comperr.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update01.at:32:
+$as_echo "$at_srcdir/comperr.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -30313,24 +39111,12 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=\$?
+sed -n '\$p' err
+exit \$rc
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+at_fn_check_prepare_notrace 'an embedded newline' "comperr.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -30340,41 +39126,24 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=$?
+sed -n '$p' err
+exit $rc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/c
-separator
-a/
-a/b
-a/c
+echo >>"$at_stdout"; $as_echo "tar: Error is not recoverable: exiting now
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/comperr.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update01.at:32:
+$as_echo "$at_srcdir/comperr.at:28:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -30383,24 +39152,12 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkdir a
-genfile --file a/b
-
-tar cf arc a
-
-echo \"separator\"
-
-sleep 2
-genfile --file a/c
-
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
+tar --use-compress-program false -cf a.tar . 2>err
+rc=\$?
+sed -n '\$p' err
+exit \$rc
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+at_fn_check_prepare_notrace 'an embedded newline' "comperr.at:28"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -30410,41 +39167,24 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir a
-genfile --file a/b
-
-tar cf arc a
-
-echo "separator"
-
-sleep 2
-genfile --file a/c
-
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
+tar --use-compress-program false -cf a.tar . 2>err
+rc=$?
+sed -n '$p' err
+exit $rc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/c
-separator
-a/
-a/b
-a/c
+echo >>"$at_stdout"; $as_echo "tar: Error is not recoverable: exiting now
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/comperr.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update01.at:32:
+$as_echo "$at_srcdir/comperr.at:28:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -30453,24 +39193,12 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=\$?
+sed -n '\$p' err
+exit \$rc
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+at_fn_check_prepare_notrace 'an embedded newline' "comperr.at:28"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -30480,41 +39208,24 @@ 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
+tar --use-compress-program false -cf a.tar . 2>err
+rc=$?
+sed -n '$p' err
+exit $rc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/c
-separator
-a/
-a/b
-a/c
+echo >>"$at_stdout"; $as_echo "tar: Error is not recoverable: exiting now
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/comperr.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/update01.at:32:
+$as_echo "$at_srcdir/comperr.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -30523,24 +39234,12 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkdir a
-genfile --file a/b
-
-tar cf arc a
-
-echo \"separator\"
-
-sleep 2
-genfile --file a/c
-
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
+tar --use-compress-program false -cf a.tar . 2>err
+rc=\$?
+sed -n '\$p' err
+exit \$rc
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update01.at:32"
+at_fn_check_prepare_notrace 'an embedded newline' "comperr.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -30550,36 +39249,19 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir a
-genfile --file a/b
-
-tar cf arc a
-
-echo "separator"
-
-sleep 2
-genfile --file a/c
-
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
+tar --use-compress-program false -cf a.tar . 2>err
+rc=$?
+sed -n '$p' err
+exit $rc
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/c
-separator
-a/
-a/b
-a/c
+echo >>"$at_stdout"; $as_echo "tar: Error is not recoverable: exiting now
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update01.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/comperr.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -30590,302 +39272,269 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_133
-#AT_START_134
-at_fn_group_banner 134 'update02.at:26' \
-  "update changed files" "                           " 20
+#AT_STOP_160
+#AT_START_161
+at_fn_group_banner 161 'remfiles01.at:28' \
+  "remove-files with compression" "                  " 24
 at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "134. $at_setup_line: testing $at_desc ..."
+  $as_echo "161. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+unset TAR_OPTIONS
+{ set +x
+$as_echo "$at_srcdir/remfiles01.at:32:
 
-
-  { set +x
-$as_echo "$at_srcdir/update02.at:29:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkdir a
-genfile --file a/b
-
-tar cf arc a
-
-echo \"separator\"
-
-sleep 2
-touch a/b
-
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
-( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-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
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-mkdir a
-genfile --file a/b
 
-tar cf arc a
+case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #(
+?*) exit 77;;
+esac
 
-echo "separator"
 
-sleep 2
-touch a/b
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/b
-separator
-a/
-a/b
-a/b
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/update02.at:29:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+mkdir dir
+cd dir
+genfile --file a --length 0
+chmod 0 a
+genfile --file b
+mkdir c
 
+# Depending on when the SIGPIPE gets delivered, the invocation below
+# may finish with either
+#  tar: a: Cannot write: Broken pipe
+# or
+#  tar: Child returned status 2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+# Discard diagnostics that some shells generate about broken pipes,
+# and discard all of tar's diagnostics except for the ones saying \"(child)\".
+# Gzip's exit code is propagated to the shell.  Usually it is 141.
+# Convert all non-zero exits to 2 to make it predictable.
+(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null
+EC=\$?
+sed -n '/(child)/p' err >&2
+rm err
+find . | sort
+exit \$EC
+"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles01.at:32"
+( $at_check_trace;
 
-mkdir a
-genfile --file a/b
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 && exit 77
 
-tar cf arc a
 
-echo \"separator\"
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-sleep 2
-touch a/b
 
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
+case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
+?*) exit 77;;
+esac
 
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir a
-genfile --file a/b
 
-tar cf arc a
+mkdir dir
+cd dir
+genfile --file a --length 0
+chmod 0 a
+genfile --file b
+mkdir c
 
-echo "separator"
+# Depending on when the SIGPIPE gets delivered, the invocation below
+# may finish with either
+#  tar: a: Cannot write: Broken pipe
+# or
+#  tar: Child returned status 2
 
-sleep 2
-touch a/b
+# Discard diagnostics that some shells generate about broken pipes,
+# and discard all of tar's diagnostics except for the ones saying "(child)".
+# Gzip's exit code is propagated to the shell.  Usually it is 141.
+# Convert all non-zero exits to 2 to make it predictable.
+(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null
+EC=$?
+sed -n '/(child)/p' err >&2
+rm err
+find . | sort
+exit $EC
 
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
-)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/b
-separator
-a/
-a/b
-a/b
+echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Permission denied
+tar (child): Error is not recoverable: exiting now
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./b
+./c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
+at_fn_check_status 2 $at_status "$at_srcdir/remfiles01.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/update02.at:29:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_161
+#AT_START_162
+at_fn_group_banner 162 'remfiles02.at:28' \
+  "remove-files with compression: grand-child" "     " 24
+at_xfail=no
+(
+  $as_echo "162. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkdir a
-genfile --file a/b
+unset TAR_OPTIONS
+{ set +x
+$as_echo "$at_srcdir/remfiles02.at:32:
 
-tar cf arc a
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-echo \"separator\"
 
-sleep 2
-touch a/b
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
+
+mkdir dir
+cd dir
+mkdir a
+genfile --file b
+mkdir c
+
+tar -c -f a -z --remove-files b c 2>err
+EC=\$?
+sed -n '/(child)/p' err >&2
+rm err
+find . | sort
+exit \$EC
+"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles02.at:32"
 ( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
 
+cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir a
-genfile --file a/b
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-tar cf arc a
 
-echo "separator"
+mkdir dir
+cd dir
+mkdir a
+genfile --file b
+mkdir c
 
-sleep 2
-touch a/b
+tar -c -f a -z --remove-files b c 2>err
+EC=$?
+sed -n '/(child)/p' err >&2
+rm err
+find . | sort
+exit $EC
 
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
-)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/b
-separator
-a/
-a/b
-a/b
+echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Is a directory
+tar (child): Error is not recoverable: exiting now
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./b
+./c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
+at_fn_check_status 2 $at_status "$at_srcdir/remfiles02.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_162
+#AT_START_163
+at_fn_group_banner 163 'remfiles03.at:28' \
+  "remove-files with symbolic links" "               " 24
+at_xfail=no
+(
+  $as_echo "163. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-echo \"separator\"
 
-sleep 2
-touch a/b
 
-tar ufv arc a
-echo \"separator\"
-tar tf arc | sort || exit 1
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
+{ set +x
+$as_echo "$at_srcdir/remfiles03.at:31:
+mkdir a
+mkdir a/b
+ln -s b a/c || exit 77
+tar --remove-files -cf a.tar a
+genfile --stat a
+"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles03.at:31"
 ( $at_check_trace;
-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
+mkdir a/b
+ln -s b a/c || exit 77
+tar --remove-files -cf a.tar a
+genfile --stat a
 
-tar ufv arc a
-echo "separator"
-tar tf arc | sort || exit 1
-)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/b
-separator
-a/
-a/b
-a/b
+echo >>"$at_stderr"; $as_echo "genfile: stat(a) failed: No such file or directory
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
+  $at_diff - "$at_stderr" || at_failed=:
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles03.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/update02.at:29:
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_163
+#AT_START_164
+at_fn_group_banner 164 'remfiles04a.at:25' \
+  "remove-files with -C:rel in -c/non-incr. mode" "  " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "164. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles04a.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -30897,21 +39546,14 @@ 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
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar --remove-files -C foo bar
+echo A
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "update02.at:29"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04a.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -30924,33 +39566,25 @@ 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
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar --remove-files -C foo bar
+echo A
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-a/b
-separator
-a/
-a/b
-a/b
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/update02.at:29"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles04a.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -30961,14 +39595,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_134
-#AT_START_135
-at_fn_group_banner 135 'verify.at:25' \
-  "verify" "                                         " 21
+#AT_STOP_164
+#AT_START_165
+at_fn_group_banner 165 'remfiles04b.at:33' \
+  "remove-files with -C:rel in -c/incr. mode" "      " 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "135. $at_setup_line: testing $at_desc ..."
+  $as_echo "165. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -30976,159 +39610,260 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/verify.at:28:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/remfiles04b.at:36:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar --incremental --remove-files -C foo bar
+echo A
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04b.at:36"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar --incremental --remove-files -C foo bar
+echo A
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-Verify foo
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles04b.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-Verify foo
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/verify.at:28:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_165
+#AT_START_166
+at_fn_group_banner 166 'remfiles04c.at:33' \
+  "remove-files with -C:rel in -r mode" "            " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "166. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles04c.at:36:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar -C foo bar
+echo A
+find . | sort
+tar -rf foo.tar --remove-files -C foo bar
+echo B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04c.at:36"
 ( $at_check_trace;
-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 *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+echo bar > bar
+echo foobar > foo/bar
+tar -cf foo.tar -C foo bar
+echo A
+find . | sort
+tar -rf foo.tar --remove-files -C foo bar
+echo B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-Verify foo
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./foo
+./foo.tar
+./foo/bar
+B
+.
+./bar
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles04c.at:36"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/verify.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_166
+#AT_START_167
+at_fn_group_banner 167 'remfiles05a.at:34' \
+  "remove-files with -C:rel,rel in -c/non-incr. mode" "" 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "167. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles05a.at:37:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+decho A
+tar -cvf foo.tar --remove-files -C foo file -C ../bar file
+decho B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05a.at:37"
 ( $at_check_trace;
-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 *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+decho A
+tar -cvf foo.tar --remove-files -C foo file -C ../bar file
+decho B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-Verify foo
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles05a.at:37"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/verify.at:28:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_167
+#AT_START_168
+at_fn_group_banner 168 'remfiles05b.at:25' \
+  "remove-files with -C:rel,rel in -c/incr. mode" "  " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "168. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles05b.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -31137,10 +39872,20 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+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
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "verify.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05b.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -31150,18 +39895,38 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar -cvf archive.tar --verify foo
+
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-Verify foo
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/verify.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles05b.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -31172,14 +39937,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_135
-#AT_START_136
-at_fn_group_banner 136 'volume.at:23' \
-  "volume" "                                         " 22
+#AT_STOP_168
+#AT_START_169
+at_fn_group_banner 169 'remfiles05c.at:25' \
+  "remove-files with -C:rel,rel in -r mode" "        " 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "136. $at_setup_line: testing $at_desc ..."
+  $as_echo "169. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -31187,7 +39952,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/volume.at:26:
+$as_echo "$at_srcdir/remfiles05c.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -31196,23 +39961,23 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-tar -cf archive -V label -T /dev/null || exit 1
 
-tar xfV archive label || exit 1
-tar xfV archive 'la?el' || exit 1
-tar xfV archive 'l*l' || exit 1
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-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
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+tar -cf foo.tar -C foo file -C ../bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo file -C ../bar file
+decho C
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "volume.at:26"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05c.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -31222,109 +39987,50 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-tar -cf archive -V label -T /dev/null || exit 1
 
-tar xfV archive label || exit 1
-tar xfV archive 'la?el' || exit 1
-tar xfV archive 'l*l' || exit 1
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-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
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+tar -cf foo.tar -C foo file -C ../bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo file -C ../bar file
+decho C
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: Volume 'label' does not match 'lab'
-tar: Error is not recoverable: exiting now
------
-tar: Volume 'label' does not match 'bel'
-tar: Error is not recoverable: exiting now
------
-tar: Volume 'label' does not match 'babel'
-tar: Error is not recoverable: exiting now
+echo >>"$at_stderr"; $as_echo "A
+B
+C
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volume.at:26"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/volume.at:26:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
-
-tar -cf archive -V label -T /dev/null || exit 1
-
-tar xfV archive label || exit 1
-tar xfV archive 'la?el' || exit 1
-tar xfV archive 'l*l' || exit 1
-
-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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "volume.at:26"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
-
-tar -cf archive -V label -T /dev/null || exit 1
-
-tar xfV archive label || exit 1
-tar xfV archive 'la?el' || exit 1
-tar xfV archive 'l*l' || exit 1
-
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "-----
-tar: Volume 'label' does not match 'lab'
-tar: Error is not recoverable: exiting now
------
-tar: Volume 'label' does not match 'bel'
-tar: Error is not recoverable: exiting now
------
-tar: Volume 'label' does not match 'babel'
-tar: Error is not recoverable: exiting now
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./bar/file
+./file
+./foo
+./foo.tar
+./foo/file
+B
+file
+file
+C
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volume.at:26"
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles05c.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -31335,14 +40041,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_136
-#AT_START_137
-at_fn_group_banner 137 'volsize.at:29' \
-  "volume header size" "                             " 22
+#AT_STOP_169
+#AT_START_170
+at_fn_group_banner 170 'remfiles06a.at:25' \
+  "remove-files with -C:rel,abs in -c/non-incr. mode" "" 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "137. $at_setup_line: testing $at_desc ..."
+  $as_echo "170. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -31350,283 +40056,189 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/volsize.at:32:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/remfiles06a.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf \$TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf \$TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf \$TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=\`pwd\`
+decho A
+tar -cvf foo.tar --remove-files -C foo file -C \$DIR/bar file
+decho B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06a.at:28"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf $TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf $TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf $TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=`pwd`
+decho A
+tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file
+decho B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Short Listing
-abc/not-a-file.gif
-abc/CCC
-Verbose Listing
-V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
--rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
-Extracted directory
-abc
-abc/CCC
+echo >>"$at_stderr"; $as_echo "A
+B
 " | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-              { set +x
-$as_echo "$at_srcdir/volsize.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
-
-
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf \$TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf \$TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf \$TEST_DATA_DIR/abc.tar
-find abc|sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf $TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf $TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf $TEST_DATA_DIR/abc.tar
-find abc|sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Short Listing
-abc/not-a-file.gif
-abc/CCC
-Verbose Listing
-V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
--rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
-Extracted directory
-abc
-abc/CCC
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles06a.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/volsize.at:32:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
-
-
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
 
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
 
-echo Short Listing
-tar tf \$TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf \$TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf \$TEST_DATA_DIR/abc.tar
-find abc|sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
 
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_170
+#AT_START_171
+at_fn_group_banner 171 'remfiles06b.at:25' \
+  "remove-files with -C:rel,abs in -c/incr. mode" "  " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "171. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
 
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
 
-echo Short Listing
-tar tf $TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf $TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf $TEST_DATA_DIR/abc.tar
-find abc|sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Short Listing
-abc/not-a-file.gif
-abc/CCC
-Verbose Listing
-V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
--rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
-Extracted directory
-abc
-abc/CCC
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/volsize.at:32:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+  { set +x
+$as_echo "$at_srcdir/remfiles06b.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 *
 
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf \$TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf \$TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf \$TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=\`pwd\`
+decho A
+tar -cvf foo.tar --incremental --remove-files -C foo file -C \$DIR/bar file
+decho B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06b.at:28"
 ( $at_check_trace;
-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 *
 
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf $TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf $TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf $TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=`pwd`
+decho A
+tar -cvf foo.tar --incremental --remove-files -C foo file -C $DIR/bar file
+decho B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Short Listing
-abc/not-a-file.gif
-abc/CCC
-Verbose Listing
-V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
--rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
-Extracted directory
-abc
-abc/CCC
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles06b.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/volsize.at:32:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_171
+#AT_START_172
+at_fn_group_banner 172 'remfiles06c.at:25' \
+  "remove-files with -C:rel,abs in -r mode" "        " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "172. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles06c.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -31638,19 +40250,21 @@ rm -rf *
 
 test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-
-test -z \"\$TEST_DATA_DIR\" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 \$TEST_DATA_DIR \$TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf \$TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf \$TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf \$TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=\`pwd\`
+tar -cf foo.tar -C foo file -C \$DIR/bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo file -C \$DIR/bar file
+decho C
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "volsize.at:32"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06c.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -31663,34 +40277,48 @@ rm -rf *
 
 test -z "`sort < /dev/null 2>&1`" || exit 77
 
-
-test -z "$TEST_DATA_DIR" && exit 77
-tarball_prereq abc.tar 540f196ceddcad9e7bd2f2d7533d0474 $TEST_DATA_DIR $TEST_DATA_URL || exit 77
-
-echo Short Listing
-tar tf $TEST_DATA_DIR/abc.tar
-echo Verbose Listing
-tar --utc -tvf $TEST_DATA_DIR/abc.tar
-echo Extracted directory
-tar xf $TEST_DATA_DIR/abc.tar
-find abc|sort
+mkdir foo
+mkdir bar
+echo file > file
+echo foo/file > foo/file
+echo bar/file > bar/file
+DIR=`pwd`
+tar -cf foo.tar -C foo file -C $DIR/bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo file -C $DIR/bar file
+decho C
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "Short Listing
-abc/not-a-file.gif
-abc/CCC
-Verbose Listing
-V--------- 0/0            1536 2006-05-08 22:07 abc/not-a-file.gif--Volume Header--
--rw-r--r-- tom/users         0 2006-04-22 19:52 abc/CCC
-Extracted directory
-abc
-abc/CCC
+echo >>"$at_stderr"; $as_echo "A
+B
+C
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./bar/file
+./file
+./foo
+./foo.tar
+./foo/file
+B
+file
+file
+C
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/volsize.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles06c.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -31701,243 +40329,310 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_137
-#AT_START_138
-at_fn_group_banner 138 'comprec.at:21' \
-  "compressed format recognition" "                  " 23
+#AT_STOP_172
+#AT_START_173
+at_fn_group_banner 173 'remfiles07a.at:25' \
+  "remove-files with -C:abs,rel in -c/non-incr. mode" "" 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "138. $at_setup_line: testing $at_desc ..."
+  $as_echo "173. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
-
   { set +x
-$as_echo "$at_srcdir/comprec.at:25:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/remfiles07a.at:28:
+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 *
 
 
-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
+DIR=\`pwd\`
+decho A
+tar -cvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file
+decho B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07a.at:28"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+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 *
 
 
-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
+DIR=`pwd`
+decho A
+tar -cvf foo.tar --remove-files -C $DIR/foo file -C ../bar file
+decho B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-file1
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles07a.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/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
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_173
+#AT_START_174
+at_fn_group_banner 174 'remfiles07b.at:25' \
+  "remove-files with -C:abs,rel in -c/incr. mode" "  " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "174. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
 
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-file1
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/comprec.at:25:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+  { set +x
+$as_echo "$at_srcdir/remfiles07b.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
+DIR=\`pwd\`
+decho A
+tar -cvf foo.tar --incremental --remove-files -C \$DIR/foo file -C ../bar file
+decho B
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07b.at:28"
 ( $at_check_trace;
-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 *
 
 
-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
+DIR=`pwd`
+decho A
+tar -cvf foo.tar --incremental --remove-files -C $DIR/foo file -C ../bar file
+decho B
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-file1
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+file
+file
+B
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles07b.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/comprec.at:25:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_174
+#AT_START_175
+at_fn_group_banner 175 'remfiles07c.at:25' \
+  "remove-files with -C:abs,rel in -r mode" "        " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "175. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles07c.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 *
 
 
-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
+DIR=\`pwd\`
+tar -cf foo.tar -C \$DIR/foo file -C ../bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file
+decho C
+find . | sort
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07c.at:28"
 ( $at_check_trace;
-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 *
 
 
-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
+DIR=`pwd`
+tar -cf foo.tar -C $DIR/foo file -C ../bar file
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C $DIR/foo file -C ../bar file
+decho C
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-file1
+echo >>"$at_stderr"; $as_echo "A
+B
+C
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./bar/file
+./file
+./foo
+./foo.tar
+./foo/file
+B
+file
+file
+C
+.
+./bar
+./file
+./foo
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles07c.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/comprec.at:25:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_175
+#AT_START_176
+at_fn_group_banner 176 'remfiles08a.at:28' \
+  "remove-files deleting two subdirs in -c/non-incr. mode" "" 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "176. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles08a.at:31:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -31946,18 +40641,16 @@ 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
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+decho A
+tar -cvf foo.tar --remove-files -C foo . -C ../bar .
+decho B
+find .
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "comprec.at:25"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles08a.at:31"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -31967,27 +40660,33 @@ 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
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+decho A
+tar -cvf foo.tar --remove-files -C foo . -C ../bar .
+decho B
+find .
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
-separator
-file1
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+./
+./foo_file
+./
+./bar_file
+B
+.
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/comprec.at:25"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles08a.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -31998,14 +40697,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_138
-#AT_START_139
-at_fn_group_banner 139 'shortfile.at:26' \
-  "short input files" "                              " 23
+#AT_STOP_176
+#AT_START_177
+at_fn_group_banner 177 'remfiles08b.at:31' \
+  "remove-files deleting two subdirs in -c/incr. mode" "" 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "139. $at_setup_line: testing $at_desc ..."
+  $as_echo "177. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -32013,7 +40712,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/shortfile.at:29:
+$as_echo "$at_srcdir/remfiles08b.at:34:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -32022,10 +40721,16 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 511 --file foo || exit 5
-tar tf foo
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+decho A
+tar -cvf foo.tar --incremental --remove-files -C foo . -C ../bar .
+decho B
+find .
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortfile.at:29"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles08b.at:34"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -32035,18 +40740,35 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --length 511 --file foo || exit 5
-tar tf foo
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+decho A
+tar -cvf foo.tar --incremental --remove-files -C foo . -C ../bar .
+decho B
+find .
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: This does not look like a tar archive
-tar: Exiting with failure status due to previous errors
+echo >>"$at_stderr"; $as_echo "A
+tar: .: Directory is new
+tar: .: Directory is new
+B
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/shortfile.at:29"
+echo >>"$at_stdout"; $as_echo "A
+./
+./
+./foo_file
+./bar_file
+B
+.
+./foo.tar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles08b.at:34"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -32057,14 +40779,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_139
-#AT_START_140
-at_fn_group_banner 140 'shortupd.at:31' \
-  "updating short archives" "                        " 23
+#AT_STOP_177
+#AT_START_178
+at_fn_group_banner 178 'remfiles08c.at:28' \
+  "remove-files deleting two subdirs in -r mode" "   " 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "140. $at_setup_line: testing $at_desc ..."
+  $as_echo "178. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -32072,147 +40794,107 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/shortupd.at:34:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
-export TAR_OPTIONS
-rm -rf *
-
-touch foo
-tar uf archive foo
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
-( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/remfiles08c.at:31:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar uf archive foo
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/shortupd.at:34:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-touch foo
-tar uf archive foo
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+tar -cf foo.tar -C foo . -C ../bar .
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo . -C ../bar .
+decho C
+find .
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08c.at:31"
 ( $at_check_trace;
-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 *
 
-touch foo
-tar uf archive foo
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+mkdir bar
+echo foo/foo_file > foo/foo_file
+echo bar/bar_file > bar/bar_file
+tar -cf foo.tar -C foo . -C ../bar .
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files -C foo . -C ../bar .
+decho C
+find .
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
+echo >>"$at_stderr"; $as_echo "A
+B
+C
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+.
+./bar
+./bar/bar_file
+./foo
+./foo.tar
+./foo/foo_file
+B
+./
+./foo_file
+./
+./bar_file
+C
+.
+./foo.tar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles08c.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/shortupd.at:34:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
 
-touch foo
-tar uf archive foo
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
 
-touch foo
-tar uf archive foo
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/shortupd.at:34:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_178
+#AT_START_179
+at_fn_group_banner 179 'remfiles09a.at:25' \
+  "remove-files on full directory in -c/non-incr. mode" "" 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "179. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-touch foo
-tar uf archive foo
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
-( $at_check_trace;
-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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/shortupd.at:34:
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles09a.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -32221,10 +40903,14 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar uf archive foo
+mkdir foo
+echo foo/file > foo/file
+decho A
+tar -cvf foo.tar --remove-files foo
+decho B
+find .
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "shortupd.at:34"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles09a.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -32234,15 +40920,29 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-touch foo
-tar uf archive foo
+mkdir foo
+echo foo/file > foo/file
+decho A
+tar -cvf foo.tar --remove-files foo
+decho B
+find .
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/shortupd.at:34"
+echo >>"$at_stderr"; $as_echo "A
+B
+" | \
+  $at_diff - "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "A
+foo/
+foo/file
+B
+.
+./foo.tar
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles09a.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -32253,14 +40953,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_140
-#AT_START_141
-at_fn_group_banner 141 'truncate.at:29' \
-  "truncate" "                                       " 23
+#AT_STOP_179
+#AT_START_180
+at_fn_group_banner 180 'remfiles09b.at:29' \
+  "remove-files on full directory in -c/incr. mode" "" 24
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "141. $at_setup_line: testing $at_desc ..."
+  $as_echo "180. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -32268,219 +40968,174 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/truncate.at:32:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+$as_echo "$at_srcdir/remfiles09b.at:32:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H v7\"
+TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: \$?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)"
-at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
+mkdir foo
+echo foo/file > foo/file
+decho A
+tar -cvf foo.tar --incremental --remove-files foo
+decho B
+find .
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles09b.at:32"
 ( $at_check_trace;
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H v7"
+TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: $?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)
+mkdir foo
+echo foo/file > foo/file
+decho A
+tar -cvf foo.tar --incremental --remove-files foo
+decho B
+find .
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+echo >>"$at_stderr"; $as_echo "A
+tar: foo: Directory is new
+B
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-Exit status: 1
-separator
-foo
-foo: Mod time differs
-baz
+echo >>"$at_stdout"; $as_echo "A
+foo/
+foo/file
+B
+.
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles09b.at:32"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/truncate.at:32:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: \$?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)"
-at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
-( $at_check_trace;
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H oldgnu"
-export TAR_OPTIONS
-rm -rf *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: $?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-Exit status: 1
-separator
-foo
-foo: Mod time differs
-baz
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/truncate.at:32:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H ustar\"
-export TAR_OPTIONS
-rm -rf *
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_180
+#AT_START_181
+at_fn_group_banner 181 'remfiles09c.at:25' \
+  "remove-files on full directory in -r mode" "      " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "181. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: \$?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)"
-at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
-( $at_check_trace;
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H ustar"
-export TAR_OPTIONS
-rm -rf *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: $?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-Exit status: 1
-separator
-foo
-foo: Mod time differs
-baz
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/truncate.at:32:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles09c.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 --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: \$?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)"
-at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
+
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
+mkdir foo
+echo foo/file > foo/file
+tar -cf foo.tar foo
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files foo
+decho C
+find . | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles09c.at:28"
 ( $at_check_trace;
-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 *
 
-genfile --file foo --length 200k
-genfile --file baz
-genfile --run --checkpoint 10 --length 195k --truncate foo -- tar --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: $?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)
+
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
+mkdir foo
+echo foo/file > foo/file
+tar -cf foo.tar foo
+decho A
+find . | sort
+decho B
+tar -rvf foo.tar --remove-files foo
+decho C
+find . | sort
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+echo >>"$at_stderr"; $as_echo "A
+B
+C
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-Exit status: 1
-separator
-foo
-foo: Mod time differs
-baz
+echo >>"$at_stdout"; $as_echo "A
+.
+./foo
+./foo.tar
+./foo/file
+B
+foo/
+foo/file
+C
+.
+./foo.tar
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/remfiles09c.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/truncate.at:32:
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_181
+#AT_START_182
+at_fn_group_banner 182 'remfiles10.at:20' \
+  "remove-files" "                                   " 24
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "182. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/remfiles10.at:23:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -32489,14 +41144,16 @@ 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 --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: \$?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)"
-at_fn_check_prepare_notrace 'an embedded newline' "truncate.at:32"
+mkdir foo
+echo foo/file > foo/file
+decho A
+(cd foo && tar -cvf ../foo.tar --remove-files .)
+tar_status=\$?
+decho B
+find foo
+exit \$tar_status
+)"
+at_fn_check_prepare_notrace 'an embedded newline' "remfiles10.at:23"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -32506,29 +41163,32 @@ 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 --checkpoint --checkpoint-action=echo --checkpoint-action=sleep=1 -vcf bar foo baz
-echo Exit status: $?
-echo separator
-genfile --file foo --seek 195k --length 5k --pattern=zeros
-tar dvf bar)
+mkdir foo
+echo foo/file > foo/file
+decho A
+(cd foo && tar -cvf ../foo.tar --remove-files .)
+tar_status=$?
+decho B
+find foo
+exit $tar_status
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: File shrank by 5120 bytes; padding with zeros
+echo >>"$at_stderr"; $as_echo "A
+tar: .: Cannot rmdir: Invalid argument
+tar: Exiting with failure status due to previous errors
+B
 " | \
   $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-Exit status: 1
-separator
+echo >>"$at_stdout"; $as_echo "A
+./
+./file
+B
 foo
-foo: Mod time differs
-baz
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/truncate.at:32"
+at_fn_check_status 2 $at_status "$at_srcdir/remfiles10.at:23"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -32539,14 +41199,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_141
-#AT_START_142
-at_fn_group_banner 142 'grow.at:24' \
-  "grow" "                                           " 23
+#AT_STOP_182
+#AT_START_183
+at_fn_group_banner 183 'xattr01.at:25' \
+  "xattrs: basic functionality" "                    " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "142. $at_setup_line: testing $at_desc ..."
+  $as_echo "183. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -32554,7 +41214,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/grow.at:27:
+$as_echo "$at_srcdir/xattr01.at:28:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -32563,11 +41223,45 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj \$file
+  # check whether tar fails to store xattrs
+  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^\$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -32577,26 +41271,58 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj $file
+  # check whether tar fails to store xattrs
+  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
+user.test=\"OurFileValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/grow.at:27:
+$as_echo "$at_srcdir/xattr01.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -32605,11 +41331,45 @@ TAR_OPTIONS=\"-H oldgnu\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj \$file
+  # check whether tar fails to store xattrs
+  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^\$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -32619,26 +41379,58 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj $file
+  # check whether tar fails to store xattrs
+  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
+user.test=\"OurFileValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/grow.at:27:
+$as_echo "$at_srcdir/xattr01.at:28:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -32647,11 +41439,45 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj \$file
+  # check whether tar fails to store xattrs
+  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^\$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -32661,26 +41487,58 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj $file
+  # check whether tar fails to store xattrs
+  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+mkdir dir
+genfile --file dir/file
+
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
+
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
+user.test=\"OurFileValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/grow.at:27:
+$as_echo "$at_srcdir/xattr01.at:28:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -32689,858 +41547,781 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
-( $at_check_trace;
-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 --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/grow.at:27:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "grow.at:27"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-genfile --file foo --length 50000k
-genfile --file baz
-genfile --run --checkpoint 10 --length 1024 --append foo -- tar --checkpoint -vcf bar foo baz
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "tar: foo: file changed as we read it
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "foo
-baz
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 1 $at_status "$at_srcdir/grow.at:27"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+
+  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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_142
-#AT_START_143
-at_fn_group_banner 143 'sigpipe.at:21' \
-  "sigpipe handling" "                               " 23
-at_xfail=no
-(
-  $as_echo "143. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
 
+tar --xattrs -cf archive.tar dir
 
+rm -rf dir
+tar --xattrs -xf archive.tar
 
-# Description: Tar 1.23 ignored sigpipe which lead to spurious "write
-# error" diagnostics when piping output to another programs.
-# Reported-by: "Dmitry V. Levin" <ldv@altlinux.org>
-# References: http://lists.gnu.org/archive/html/bug-tar/2010-03/msg00039.html
-#             <20100319184141.GC30047@wo.int.altlinux.org>
+getfattr -h -d dir         | grep -v -e '^#' -e ^\$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+)"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
-{ set +x
-$as_echo "$at_srcdir/sigpipe.at:30:
 
-case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #(
-?*) exit 77;;
-esac
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-genfile --length 2048 --file first
-genfile --length 2048 --file second
-genfile --length 2049 --file third
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-tar cf archive first second third
 
-# Discard diagnostics that some shells generate about broken pipes.
-(tar tf archive 2>&3 | :) 3>&2 2>/dev/null
-"
-at_fn_check_prepare_notrace 'a `...` command substitution' "sigpipe.at:30"
-( $at_check_trace;
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
-?*) exit 77;;
-esac
 
+  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
 
-genfile --length 2048 --file first
-genfile --length 2048 --file second
-genfile --length 2049 --file third
+mkdir dir
+genfile --file dir/file
 
-tar cf archive first second third
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
 
-# Discard diagnostics that some shells generate about broken pipes.
-(tar tf archive 2>&3 | :) 3>&2 2>/dev/null
+tar --xattrs -cf archive.tar dir
 
+rm -rf dir
+tar --xattrs -xf archive.tar
+
+getfattr -h -d dir         | grep -v -e '^#' -e ^$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/sigpipe.at:30"
+echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
+user.test=\"OurFileValue\"
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_143
-#AT_START_144
-at_fn_group_banner 144 'remfiles01.at:28' \
-  "remove-files with compression" "                  " 24
-at_xfail=no
-(
-  $as_echo "144. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
+              { set +x
+$as_echo "$at_srcdir/xattr01.at:28:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
-unset TAR_OPTIONS
-{ set +x
-$as_echo "$at_srcdir/remfiles01.at:32:
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 && exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-case \`(cat \"\$at_myself\" 2>&3 | :) 3>&1 >/dev/null\` in #(
-?*) exit 77;;
-esac
 
+  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
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+mkdir dir
+genfile --file dir/file
 
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
 
-mkdir dir
-cd dir
-genfile --file a --length 0
-chmod 0 a
-genfile --file b
-mkdir c
+tar --xattrs -cf archive.tar dir
 
-# Depending on when the SIGPIPE gets delivered, the invocation below
-# may finish with either
-#  tar: a: Cannot write: Broken pipe
-# or
-#  tar: Child returned status 2
+rm -rf dir
+tar --xattrs -xf archive.tar
 
-# Discard diagnostics that some shells generate about broken pipes,
-# and discard all of tar's diagnostics except for the ones saying \"(child)\".
-# Gzip's exit code is propagated to the shell.  Usually it is 141.
-# Convert all non-zero exits to 2 to make it predictable.
-(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null
-EC=\$?
-sed -n '/(child)/p' err >&2
-rm err
-find . | sort
-exit \$EC
-"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles01.at:32"
+getfattr -h -d dir         | grep -v -e '^#' -e ^\$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+)"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
 ( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 && exit 77
 
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-case `(cat "$at_myself" 2>&3 | :) 3>&1 >/dev/null` in #(
-?*) exit 77;;
-esac
 
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
+  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
-cd dir
-genfile --file a --length 0
-chmod 0 a
-genfile --file b
-mkdir c
+genfile --file dir/file
 
-# Depending on when the SIGPIPE gets delivered, the invocation below
-# may finish with either
-#  tar: a: Cannot write: Broken pipe
-# or
-#  tar: Child returned status 2
+setfattr -n user.test -v OurDirValue dir
+setfattr -n user.test -v OurFileValue dir/file
 
-# Discard diagnostics that some shells generate about broken pipes,
-# and discard all of tar's diagnostics except for the ones saying "(child)".
-# Gzip's exit code is propagated to the shell.  Usually it is 141.
-# Convert all non-zero exits to 2 to make it predictable.
-(tar -c -f a -z --remove-files b c 2>err || (exit 2) ) 2>/dev/null
-EC=$?
-sed -n '/(child)/p' err >&2
-rm err
-find . | sort
-exit $EC
+tar --xattrs -cf archive.tar dir
+
+rm -rf dir
+tar --xattrs -xf archive.tar
 
+getfattr -h -d dir         | grep -v -e '^#' -e ^$
+getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Permission denied
-tar (child): Error is not recoverable: exiting now
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo ".
-./a
-./b
-./c
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
+user.test=\"OurFileValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/remfiles01.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
 
+
+
   set +x
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_144
-#AT_START_145
-at_fn_group_banner 145 'remfiles02.at:28' \
-  "remove-files with compression: grand-child" "     " 24
+#AT_STOP_183
+#AT_START_184
+at_fn_group_banner 184 'xattr02.at:25' \
+  "xattrs: change directory with -C option" "        " 25
 at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "145. $at_setup_line: testing $at_desc ..."
+  $as_echo "184. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
-unset TAR_OPTIONS
-{ set +x
-$as_echo "$at_srcdir/remfiles02.at:32:
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
+
+  { set +x
+$as_echo "$at_srcdir/xattr02.at:28:
+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
+
+  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
-cd dir
-mkdir a
-genfile --file b
-mkdir c
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-tar -c -f a -z --remove-files b c 2>err
-EC=\$?
-sed -n '/(child)/p' err >&2
-rm err
-find . | sort
-exit \$EC
-"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles02.at:32"
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
+
+getfattr -h -d file1        | grep -v -e '^#' -e ^\$
+getfattr -h -d file2        | grep -v -e '^#' -e ^\$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+)"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
 ( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H v7"
+export TAR_OPTIONS
+rm -rf *
 
-cat /dev/null | gzip - > /dev/null 2>&1 || exit 77
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  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
-cd dir
-mkdir a
-genfile --file b
-mkdir c
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-tar -c -f a -z --remove-files b c 2>err
-EC=$?
-sed -n '/(child)/p' err >&2
-rm err
-find . | sort
-exit $EC
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
 
+getfattr -h -d file1        | grep -v -e '^#' -e ^$
+getfattr -h -d file2        | grep -v -e '^#' -e ^$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+)
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "tar (child): a: Cannot open: Is a directory
-tar (child): Error is not recoverable: exiting now
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo ".
-./a
-./b
-./c
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
+user.test=\"OurFile2Value\"
+user.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 2 $at_status "$at_srcdir/remfiles02.at:32"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr02.at:28:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_145
-#AT_START_146
-at_fn_group_banner 146 'remfiles03.at:28' \
-  "remove-files with symbolic links" "               " 24
-at_xfail=no
-(
-  $as_echo "146. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-{ set +x
-$as_echo "$at_srcdir/remfiles03.at:31:
-mkdir a
-mkdir a/b
-ln -s b a/c || exit 77
-tar --remove-files -cf a.tar a
-genfile --stat a
-"
-at_fn_check_prepare_notrace 'an embedded newline' "remfiles03.at:31"
-( $at_check_trace;
-mkdir a
-mkdir a/b
-ln -s b a/c || exit 77
-tar --remove-files -cf a.tar a
-genfile --stat a
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "genfile: stat(a) failed: No such file or directory
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles03.at:31"
-$at_failed && at_fn_log_failure
-$at_traceon; }
 
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_146
-#AT_START_147
-at_fn_group_banner 147 'remfiles04a.at:25' \
-  "remove-files with -C:rel in -c/non-incr. mode" "  " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "147. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
 
-  { set +x
-$as_echo "$at_srcdir/remfiles04a.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar --xattrs -xf archive.tar
 
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar --remove-files -C foo bar
-echo A
-find . | sort
+getfattr -h -d file1        | grep -v -e '^#' -e ^\$
+getfattr -h -d file2        | grep -v -e '^#' -e ^\$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04a.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar --remove-files -C foo bar
-echo A
-find . | sort
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
+
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
+
+getfattr -h -d file1        | grep -v -e '^#' -e ^$
+getfattr -h -d file2        | grep -v -e '^#' -e ^$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./foo
-./foo.tar
+echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
+user.test=\"OurFile2Value\"
+user.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles04a.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr02.at:28:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_147
-#AT_START_148
-at_fn_group_banner 148 'remfiles04b.at:33' \
-  "remove-files with -C:rel in -c/incr. mode" "      " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "148. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
 
-  { set +x
-$as_echo "$at_srcdir/remfiles04b.at:36:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+  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
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+mkdir dir
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar --incremental --remove-files -C foo bar
-echo A
-find . | sort
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
+
+getfattr -h -d file1        | grep -v -e '^#' -e ^\$
+getfattr -h -d file2        | grep -v -e '^#' -e ^\$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04b.at:36"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar --incremental --remove-files -C foo bar
-echo A
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles04b.at:36"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_148
-#AT_START_149
-at_fn_group_banner 149 'remfiles04c.at:33' \
-  "remove-files with -C:rel in -r mode" "            " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "149. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles04c.at:36:
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
 
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar -C foo bar
-echo A
-find . | sort
-tar -rf foo.tar --remove-files -C foo bar
-echo B
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles04c.at:36"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs -xf archive.tar
 
-mkdir foo
-echo bar > bar
-echo foobar > foo/bar
-tar -cf foo.tar -C foo bar
-echo A
-find . | sort
-tar -rf foo.tar --remove-files -C foo bar
-echo B
-find . | sort
+getfattr -h -d file1        | grep -v -e '^#' -e ^$
+getfattr -h -d file2        | grep -v -e '^#' -e ^$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./foo
-./foo.tar
-./foo/bar
-B
-.
-./bar
-./foo
-./foo.tar
+echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
+user.test=\"OurFile2Value\"
+user.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles04c.at:36"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr02.at:28:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_149
-#AT_START_150
-at_fn_group_banner 150 'remfiles05a.at:34' \
-  "remove-files with -C:rel,rel in -c/non-incr. mode" "" 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "150. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
 
-  { set +x
-$as_echo "$at_srcdir/remfiles05a.at:37:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+  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
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+mkdir dir
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C ../bar file
-decho B
-find . | sort
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
+
+getfattr -h -d file1        | grep -v -e '^#' -e ^\$
+getfattr -h -d file2        | grep -v -e '^#' -e ^\$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05a.at:37"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
 ( $at_check_trace;
-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 *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C ../bar file
-decho B
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles05a.at:37"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+  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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_150
-#AT_START_151
-at_fn_group_banner 151 'remfiles05b.at:25' \
-  "remove-files with -C:rel,rel in -c/incr. mode" "  " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "151. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
 
-  { set +x
-$as_echo "$at_srcdir/remfiles05b.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar --xattrs -xf archive.tar
 
-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
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05b.at:28"
-( $at_check_trace;
+getfattr -h -d file1        | grep -v -e '^#' -e ^$
+getfattr -h -d file2        | grep -v -e '^#' -e ^$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
+user.test=\"OurFile2Value\"
+user.test=\"OurDirValue\"
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
+
+              { set +x
+$as_echo "$at_srcdir/xattr02.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles05b.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+  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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_151
-#AT_START_152
-at_fn_group_banner 152 'remfiles05c.at:25' \
-  "remove-files with -C:rel,rel in -r mode" "        " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "152. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
 
-  { set +x
-$as_echo "$at_srcdir/remfiles05c.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar --xattrs -xf archive.tar
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-tar -cf foo.tar -C foo file -C ../bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C ../bar file
-decho C
-find . | sort
+getfattr -h -d file1        | grep -v -e '^#' -e ^\$
+getfattr -h -d file2        | grep -v -e '^#' -e ^\$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles05c.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -33551,49 +42332,60 @@ 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
-tar -cf foo.tar -C foo file -C ../bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C ../bar file
-decho C
-find . | sort
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfattr -n user.test -v ahoj $file
+  # check whether tar fails to store xattrs
+  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+
+mkdir dir
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
+
+setfattr -n user.test -v OurFile1Value dir/file1
+setfattr -n user.test -v OurFile2Value dir/subdir/file2
+setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs -xf archive.tar
+
+getfattr -h -d file1        | grep -v -e '^#' -e ^$
+getfattr -h -d file2        | grep -v -e '^#' -e ^$
+getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-C
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./bar/file
-./file
-./foo
-./foo.tar
-./foo/file
-B
-file
-file
-C
-.
-./bar
-./file
-./foo
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
+user.test=\"OurFile2Value\"
+user.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles05c.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -33604,14 +42396,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_152
-#AT_START_153
-at_fn_group_banner 153 'remfiles06a.at:25' \
-  "remove-files with -C:rel,abs in -c/non-incr. mode" "" 24
+#AT_STOP_184
+#AT_START_185
+at_fn_group_banner 185 'xattr03.at:25' \
+  "xattrs: trusted.* attributes" "                   " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "153. $at_setup_line: testing $at_desc ..."
+  $as_echo "185. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -33619,871 +42411,563 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/remfiles06a.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/xattr03.at:28:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
-
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C \$DIR/bar file
-decho B
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06a.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 || exit 77
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file
-decho B
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles06a.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+  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
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_153
-#AT_START_154
-at_fn_group_banner 154 'remfiles06b.at:25' \
-  "remove-files with -C:rel,abs in -c/incr. mode" "  " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "154. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-  { set +x
-$as_echo "$at_srcdir/remfiles06b.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C foo file -C \$DIR/bar file
-decho B
-find . | sort
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06b.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C foo file -C $DIR/bar file
-decho B
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles06b.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 || exit 77
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_154
-#AT_START_155
-at_fn_group_banner 155 'remfiles06c.at:25' \
-  "remove-files with -C:rel,abs in -r mode" "        " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "155. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles06c.at:28:
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-tar -cf foo.tar -C foo file -C \$DIR/bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C ../bar file
-decho C
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles06c.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-tar -cf foo.tar -C foo file -C $DIR/bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C ../bar file
-decho C
-find . | sort
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-C
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./bar/file
-./file
-./foo
-./foo.tar
-./foo/file
-B
-file
-file
-C
-.
-./bar
-./file
-./foo
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
+trusted.test=\"OurFile2Value\"
+trusted.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles06c.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr03.at:28:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 || exit 77
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_155
-#AT_START_156
-at_fn_group_banner 156 'remfiles07a.at:25' \
-  "remove-files with -C:rel,abs in -c/non-incr. mode" "" 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "156. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
 
-  { set +x
-$as_echo "$at_srcdir/remfiles07a.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+  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 foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C \$DIR/bar file
-decho B
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07a.at:28"
-( $at_check_trace;
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --remove-files -C foo file -C $DIR/bar file
-decho B
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles07a.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+)"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
 
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 || exit 77
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_156
-#AT_START_157
-at_fn_group_banner 157 'remfiles07b.at:25' \
-  "remove-files with -C:rel,abs in -c/incr. mode" "  " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "157. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles07b.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
 
+  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
 
-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
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C foo file -C \$DIR/bar file
-decho B
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07b.at:28"
-( $at_check_trace;
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C foo file -C $DIR/bar file
-decho B
-find . | sort
+rm -rf dir
+
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
+trusted.test=\"OurFile2Value\"
+trusted.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles07b.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr03.at:28:
+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
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_157
-#AT_START_158
-at_fn_group_banner 158 'remfiles07c.at:25' \
-  "remove-files with -C:rel,abs in -r mode" "        " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "158. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles07c.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
 
+  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
 
-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
-DIR=\`pwd\`
-tar -cf foo.tar -C foo file -C \$DIR/bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C \$DIR/bar file
-decho C
-find . | sort
+mkdir dir
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
+
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles07c.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
-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
-DIR=`pwd`
-tar -cf foo.tar -C foo file -C $DIR/bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C foo file -C $DIR/bar file
-decho C
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-C
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./bar/file
-./file
-./foo
-./foo.tar
-./foo/file
-B
-file
-file
-C
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles07c.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 || exit 77
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_158
-#AT_START_159
-at_fn_group_banner 159 'remfiles08a.at:25' \
-  "remove-files with -C:abs,rel in -c/non-incr. mode" "" 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "159. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles08a.at:28:
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file
-decho B
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08a.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --remove-files -C $DIR/foo file -C ../bar file
-decho B
-find . | sort
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
+trusted.test=\"OurFile2Value\"
+trusted.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles08a.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/xattr03.at:28:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
 
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 || exit 77
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_159
-#AT_START_160
-at_fn_group_banner 160 'remfiles08b.at:25' \
-  "remove-files with -C:abs,rel in -c/incr. mode" "  " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "160. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
 
-  { set +x
-$as_echo "$at_srcdir/remfiles08b.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+  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 foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=\`pwd\`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C \$DIR/foo file -C ../bar file
-decho B
-find . | sort
+
+mkdir dir
+mkdir dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
+
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+
+rm -rf dir
+
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08b.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
 ( $at_check_trace;
-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 *
 
 
-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
-DIR=`pwd`
-decho A
-tar -cvf foo.tar --incremental --remove-files -C $DIR/foo file -C ../bar file
-decho B
-find . | sort
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-file
-file
-B
-.
-./bar
-./file
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles08b.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
-
-
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 || exit 77
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_160
-#AT_START_161
-at_fn_group_banner 161 'remfiles08c.at:25' \
-  "remove-files with -C:abs,rel in -r mode" "        " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "161. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles08c.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
 
+  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
 
-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
-DIR=\`pwd\`
-tar -cf foo.tar -C \$DIR/foo file -C ../bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C \$DIR/foo file -C ../bar file
-decho C
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles08c.at:28"
-( $at_check_trace;
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
-mkdir foo
-mkdir bar
-echo file > file
-echo foo/file > foo/file
-echo bar/file > bar/file
-DIR=`pwd`
-tar -cf foo.tar -C $DIR/foo file -C ../bar file
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files -C $DIR/foo file -C ../bar file
-decho C
-find . | sort
+rm -rf dir
+
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-C
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./bar
-./bar/file
-./file
-./foo
-./foo.tar
-./foo/file
-B
-file
-file
-C
-.
-./bar
-./file
-./foo
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
+trusted.test=\"OurFile2Value\"
+trusted.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles08c.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_161
-#AT_START_162
-at_fn_group_banner 162 'remfiles09a.at:25' \
-  "remove-files on full directory in -c/non-incr. mode" "" 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "162. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/remfiles09a.at:28:
+              { set +x
+$as_echo "$at_srcdir/xattr03.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -34492,94 +42976,60 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
-mkdir foo
-echo foo/file > foo/file
-decho A
-tar -cvf foo.tar --remove-files foo
-decho B
-find .
-)"
-at_fn_check_prepare_notrace 'an embedded newline' "remfiles09a.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
 
-mkdir foo
-echo foo/file > foo/file
-decho A
-tar -cvf foo.tar --remove-files foo
-decho B
-find .
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-foo/
-foo/file
-B
-.
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles09a.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 || exit 77
+
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_162
-#AT_START_163
-at_fn_group_banner 163 'remfiles09b.at:29' \
-  "remove-files on full directory in -c/incr. mode" "" 24
-at_xfail=yes
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "163. $at_setup_line: testing $at_desc ..."
-  $at_traceon
 
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
 
- # we expect to fail in tar 1.27
+  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 dir/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-  { set +x
-$as_echo "$at_srcdir/remfiles09b.at:34:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
-export TAR_OPTIONS
-rm -rf *
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+rm -rf dir
 
-mkdir foo
-echo foo/file > foo/file
-decho A
-tar -cvf foo.tar --incremental --remove-files foo
-TARSTAT=\$?
-decho B
-find .
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
+
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
 )"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles09b.at:34"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -34590,126 +43040,68 @@ export TAR_OPTIONS
 rm -rf *
 
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
-
-mkdir foo
-echo foo/file > foo/file
-decho A
-tar -cvf foo.tar --incremental --remove-files foo
-TARSTAT=$?
-decho B
-find .
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-tar: foo: Directory is new
-B
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-foo/
-foo/file
-B
-.
-./foo
-./foo.tar
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles09b.at:34"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+echo "test" > $$
+chmod 0 $$
+cat $$ > /dev/null 2>&1
+result=$?
+rm -f $$
+test $result -eq 0 || exit 77
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_163
-#AT_START_164
-at_fn_group_banner 164 'remfiles09c.at:25' \
-  "remove-files on full directory in -r mode" "      " 24
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "164. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+  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
 
-  { set +x
-$as_echo "$at_srcdir/remfiles09c.at:28:
-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/subdir
+mkdir dir/subdir/subsubdir
+genfile --file dir/file1
+genfile --file dir/subdir/file2
 
-test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+setfattr -n trusted.test -v OurFile1Value dir/file1
+setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
+setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
 
-mkdir foo
-echo foo/file > foo/file
-tar -cf foo.tar foo
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files foo
-decho C
-find . | sort
-)"
-at_fn_check_prepare_notrace 'a `...` command substitution' "remfiles09c.at:28"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
 
+rm -rf dir
 
-test -z "`sort < /dev/null 2>&1`" || exit 77
+tar --xattrs --xattrs-include=trusted* -xf archive.tar
 
-mkdir foo
-echo foo/file > foo/file
-tar -cf foo.tar foo
-decho A
-find . | sort
-decho B
-tar -rvf foo.tar --remove-files foo
-decho C
-find . | sort
+getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
+getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
-echo >>"$at_stderr"; $as_echo "A
-B
-C
-" | \
-  $at_diff - "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "A
-.
-./foo
-./foo.tar
-./foo/file
-B
-foo/
-foo/file
-C
-.
-./foo.tar
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
+trusted.test=\"OurFile2Value\"
+trusted.test=\"OurDirValue\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/remfiles09c.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -34720,14 +43112,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_164
-#AT_START_165
-at_fn_group_banner 165 'xattr01.at:25' \
-  "xattrs: basic functionality" "                    " 25
+#AT_STOP_185
+#AT_START_186
+at_fn_group_banner 186 'xattr04.at:26' \
+  "xattrs: s/open/openat/ regression" "              " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "165. $at_setup_line: testing $at_desc ..."
+  $as_echo "186. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -34735,7 +43127,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/xattr01.at:28:
+$as_echo "$at_srcdir/xattr04.at:29:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -34768,21 +43160,22 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^\$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+ret=\$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^\$
+exit \$ret
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -34816,34 +43209,34 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+ret=$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^$
+exit $ret
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
-user.test=\"OurFileValue\"
+echo >>"$at_stdout"; $as_echo "user.test=\"value\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr01.at:28:
+$as_echo "$at_srcdir/xattr04.at:29:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -34876,21 +43269,22 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^\$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+ret=\$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^\$
+exit \$ret
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -34924,34 +43318,34 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+ret=$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^$
+exit $ret
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
-user.test=\"OurFileValue\"
+echo >>"$at_stdout"; $as_echo "user.test=\"value\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr01.at:28:
+$as_echo "$at_srcdir/xattr04.at:29:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -34984,21 +43378,22 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^\$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+ret=\$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^\$
+exit \$ret
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -35032,34 +43427,34 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+ret=$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^$
+exit $ret
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
-user.test=\"OurFileValue\"
+echo >>"$at_stdout"; $as_echo "user.test=\"value\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr01.at:28:
+$as_echo "$at_srcdir/xattr04.at:29:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -35092,21 +43487,22 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^\$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+ret=\$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^\$
+exit \$ret
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -35140,34 +43536,34 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+ret=$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^$
+exit $ret
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
-user.test=\"OurFileValue\"
+echo >>"$at_stdout"; $as_echo "user.test=\"value\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr01.at:28:
+$as_echo "$at_srcdir/xattr04.at:29:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -35200,21 +43596,22 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^\$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+ret=\$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^\$
+exit \$ret
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -35248,29 +43645,29 @@ rm -rf *
     exit 77
   fi
 
+
 mkdir dir
+mkdir output
 genfile --file dir/file
 
-setfattr -n user.test -v OurDirValue dir
-setfattr -n user.test -v OurFileValue dir/file
-
-tar --xattrs -cf archive.tar dir
+setfattr -n user.test -v value dir/file
 
-rm -rf dir
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d dir         | grep -v -e '^#' -e ^$
-getfattr -h -d dir/file    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+ret=$?
+getfattr -h -d output/file | grep -v -e '^#' -e ^$
+exit $ret
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurDirValue\"
-user.test=\"OurFileValue\"
+echo >>"$at_stdout"; $as_echo "user.test=\"value\"
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -35281,14 +43678,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_165
-#AT_START_166
-at_fn_group_banner 166 'xattr02.at:25' \
-  "xattrs: change directory with -C option" "        " 25
+#AT_STOP_186
+#AT_START_187
+at_fn_group_banner 187 'xattr05.at:28' \
+  "xattrs: keywords with '=' and '%'" "              " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "166. $at_setup_line: testing $at_desc ..."
+  $as_echo "187. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -35296,7 +43693,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/xattr02.at:28:
+$as_echo "$at_srcdir/xattr05.at:31:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -35331,26 +43728,20 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^\$
-getfattr -h -d file2        | grep -v -e '^#' -e ^\$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -35386,40 +43777,30 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^$
-getfattr -h -d file2        | grep -v -e '^#' -e ^$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
-user.test=\"OurFile2Value\"
-user.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr02.at:28:
+$as_echo "$at_srcdir/xattr05.at:31:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -35454,26 +43835,20 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^\$
-getfattr -h -d file2        | grep -v -e '^#' -e ^\$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -35509,40 +43884,30 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^$
-getfattr -h -d file2        | grep -v -e '^#' -e ^$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
-user.test=\"OurFile2Value\"
-user.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr02.at:28:
+$as_echo "$at_srcdir/xattr05.at:31:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -35577,26 +43942,20 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^\$
-getfattr -h -d file2        | grep -v -e '^#' -e ^\$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -35632,40 +43991,30 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^$
-getfattr -h -d file2        | grep -v -e '^#' -e ^$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
-user.test=\"OurFile2Value\"
-user.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr02.at:28:
+$as_echo "$at_srcdir/xattr05.at:31:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -35700,26 +44049,20 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^\$
-getfattr -h -d file2        | grep -v -e '^#' -e ^\$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -35755,40 +44098,30 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^$
-getfattr -h -d file2        | grep -v -e '^#' -e ^$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
-user.test=\"OurFile2Value\"
-user.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr02.at:28:
+$as_echo "$at_srcdir/xattr05.at:31:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -35823,26 +44156,20 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^\$
-getfattr -h -d file2        | grep -v -e '^#' -e ^\$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^\$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -35878,35 +44205,25 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
-
-setfattr -n user.test -v OurFile1Value dir/file1
-setfattr -n user.test -v OurFile2Value dir/subdir/file2
-setfattr -n user.test -v OurDirValue   dir/subdir/subsubdir
-
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+mkdir output
+genfile --file dir/file
 
-rm -rf dir
+setfattr -n user.=NAME%3D= -v value dir/file
+getfattr -d dir/file | grep -v '# ' > before
 
-tar --xattrs -xf archive.tar
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar -C dir .
 
-getfattr -h -d file1        | grep -v -e '^#' -e ^$
-getfattr -h -d file2        | grep -v -e '^#' -e ^$
-getfattr -h -d subsubdir    | grep -v -e '^#' -e ^$
+tar --xattrs -xf archive.tar -C output
+getfattr -d output/file | grep -v '# ' > after
+diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"OurFile1Value\"
-user.test=\"OurFile2Value\"
-user.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr02.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -35917,14 +44234,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_166
-#AT_START_167
-at_fn_group_banner 167 'xattr03.at:25' \
-  "xattrs: trusted.* attributes" "                   " 25
+#AT_STOP_187
+#AT_START_188
+at_fn_group_banner 188 'acls01.at:25' \
+  "acls: basic functionality" "                      " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "167. $at_setup_line: testing $at_desc ..."
+  $as_echo "188. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -35932,7 +44249,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/xattr03.at:28:
+$as_echo "$at_srcdir/acls01.at:28:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -35942,59 +44259,66 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfattr \$file &> /dev/null
+  getfacl \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
+  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=\$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:\$MYNAME:--x dir/file
+setfacl -m u:\$MYNAME:--x dir
 
+getfattr -h -m. -d dir dir/file > before
+
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -36005,73 +44329,76 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:$MYNAME:--x dir/file
+setfacl -m u:$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
-trusted.test=\"OurFile2Value\"
-trusted.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr03.at:28:
+$as_echo "$at_srcdir/acls01.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -36081,59 +44408,66 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfattr \$file &> /dev/null
+  getfacl \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
+  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=\$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:\$MYNAME:--x dir/file
+setfacl -m u:\$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -36144,73 +44478,76 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:$MYNAME:--x dir/file
+setfacl -m u:$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
-trusted.test=\"OurFile2Value\"
-trusted.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr03.at:28:
+$as_echo "$at_srcdir/acls01.at:28:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -36220,59 +44557,66 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfattr \$file &> /dev/null
+  getfacl \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
+  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=\$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:\$MYNAME:--x dir/file
+setfacl -m u:\$MYNAME:--x dir
 
+getfattr -h -m. -d dir dir/file > before
+
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -36283,73 +44627,76 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:$MYNAME:--x dir/file
+setfacl -m u:$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
-trusted.test=\"OurFile2Value\"
-trusted.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr03.at:28:
+$as_echo "$at_srcdir/acls01.at:28:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -36359,59 +44706,66 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfattr \$file &> /dev/null
+  getfacl \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
+  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=\$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:\$MYNAME:--x dir/file
+setfacl -m u:\$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -36422,73 +44776,76 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:$MYNAME:--x dir/file
+setfacl -m u:$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
-trusted.test=\"OurFile2Value\"
-trusted.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr03.at:28:
+$as_echo "$at_srcdir/acls01.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -36498,59 +44855,66 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfattr \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfattr \$file &> /dev/null
+  getfacl \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
+  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=\$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:\$MYNAME:--x dir/file
+setfacl -m u:\$MYNAME:--x dir
 
+getfattr -h -m. -d dir dir/file > before
+
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^\$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^\$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr03.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -36561,68 +44925,71 @@ export TAR_OPTIONS
 rm -rf *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfattr -n user.test -v test $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfattr $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
 
 
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir dir/subdir
-mkdir dir/subdir/subsubdir
-genfile --file dir/file1
-genfile --file dir/subdir/file2
+genfile --file dir/file
 
-setfattr -n trusted.test -v OurFile1Value dir/file1
-setfattr -n trusted.test -v OurFile2Value dir/subdir/file2
-setfattr -n trusted.test -v OurDirValue   dir/subdir/subsubdir
+MYNAME=$( id -un )
 
-tar --xattrs -cf archive.tar -C dir file1 -C subdir file2 subsubdir
+setfacl -m u:$MYNAME:--x dir/file
+setfacl -m u:$MYNAME:--x dir
+
+getfattr -h -m. -d dir dir/file > before
 
+tar --acls -cf archive.tar dir
 rm -rf dir
 
-tar --xattrs --xattrs-include=trusted* -xf archive.tar
+tar --acls -xf archive.tar
 
-getfattr -mtrusted. -d file1        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d file2        | grep -v -e '^#' -e ^$
-getfattr -mtrusted. -d subsubdir    | grep -v -e '^#' -e ^$
+getfattr -h -m. -d dir dir/file > after
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "trusted.test=\"OurFile1Value\"
-trusted.test=\"OurFile2Value\"
-trusted.test=\"OurDirValue\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr03.at:28"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -36633,14 +45000,14 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_167
-#AT_START_168
-at_fn_group_banner 168 'xattr04.at:26' \
-  "xattrs: s/open/openat/ regression" "              " 25
+#AT_STOP_188
+#AT_START_189
+at_fn_group_banner 189 'acls02.at:25' \
+  "acls: work with -C" "                             " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "168. $at_setup_line: testing $at_desc ..."
+  $as_echo "189. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -36648,7 +45015,7 @@ at_xfail=no
 
 
   { set +x
-$as_echo "$at_srcdir/xattr04.at:29:
+$as_echo "$at_srcdir/acls02.at:28:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -36658,7 +45025,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -36673,30 +45039,58 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
-
-setfattr -n user.test -v value dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
+
+MYNAME=\$( id -un )
+
+setfacl -m u:\$MYNAME:--x dir/subdir
+setfacl -m u:\$MYNAME:--x dir/subdir/file
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
 
-tar --xattrs -xf archive.tar -C output
-ret=\$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^\$
-exit \$ret
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -36707,7 +45101,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -36722,42 +45115,68 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:$MYNAME:--x dir/subdir
+setfacl -m u:$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^$
-exit $ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"value\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr04.at:29:
+$as_echo "$at_srcdir/acls02.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -36767,7 +45186,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -36782,30 +45200,58 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=\$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:\$MYNAME:--x dir/subdir
+setfacl -m u:\$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=\$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^\$
-exit \$ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -36816,7 +45262,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -36831,42 +45276,68 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:$MYNAME:--x dir/subdir
+setfacl -m u:$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^$
-exit $ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"value\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr04.at:29:
+$as_echo "$at_srcdir/acls02.at:28:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -36876,7 +45347,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -36891,30 +45361,58 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=\$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:\$MYNAME:--x dir/subdir
+setfacl -m u:\$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=\$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^\$
-exit \$ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -36925,7 +45423,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -36940,42 +45437,68 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:$MYNAME:--x dir/subdir
+setfacl -m u:$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^$
-exit $ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"value\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr04.at:29:
+$as_echo "$at_srcdir/acls02.at:28:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -36985,7 +45508,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37000,30 +45522,58 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=\$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:\$MYNAME:--x dir/subdir
+setfacl -m u:\$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=\$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^\$
-exit \$ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -37034,7 +45584,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -37049,42 +45598,68 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:$MYNAME:--x dir/subdir
+setfacl -m u:$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^$
-exit $ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"value\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr04.at:29:
+$as_echo "$at_srcdir/acls02.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -37094,7 +45669,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37109,30 +45683,58 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
 mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir/subdir
+genfile --file dir/subdir/file
 
-setfattr -n user.test -v value dir/file
+MYNAME=\$( id -un )
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+setfacl -m u:\$MYNAME:--x dir/subdir
+setfacl -m u:\$MYNAME:--x dir/subdir/file
 
-tar --xattrs -xf archive.tar -C output
-ret=\$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^\$
-exit \$ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
+
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
+
+mkdir dir
+tar --acls -xf archive.tar -C dir
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr04.at:29"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -37143,7 +45745,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -37158,37 +45759,63 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+mkdir dir
+mkdir dir/subdir
+genfile --file dir/subdir/file
+
+MYNAME=$( id -un )
+
+setfacl -m u:$MYNAME:--x dir/subdir
+setfacl -m u:$MYNAME:--x dir/subdir/file
+
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../before
+cd ..
 
-setfattr -n user.test -v value dir/file
+tar --acls -cf archive.tar -C dir subdir
+rm -rf dir
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+mkdir dir
+tar --acls -xf archive.tar -C dir
 
-tar --xattrs -xf archive.tar -C output
-ret=$?
-getfattr -h -d output/file | grep -v -e '^#' -e ^$
-exit $ret
+cd dir
+getfattr -h -m. -d subdir subdir/file > ../after
+cd ..
+
+diff before after
+test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "user.test=\"value\"
-" | \
-  $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr04.at:29"
+at_fn_diff_devnull "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -37199,22 +45826,26 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_168
-#AT_START_169
-at_fn_group_banner 169 'xattr05.at:28' \
-  "xattrs: keywords with '=' and '%'" "              " 25
+#AT_STOP_189
+#AT_START_190
+at_fn_group_banner 190 'acls03.at:30' \
+  "acls: default ACLs" "                             " 25
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "169. $at_setup_line: testing $at_desc ..."
+  $as_echo "190. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
 
 
+
+
+
+
   { set +x
-$as_echo "$at_srcdir/xattr05.at:31:
+$as_echo "$at_srcdir/acls03.at:47:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -37224,7 +45855,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37239,30 +45869,200 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
+at_fn_check_prepare_notrace 'a `...` command substitution' "acls03.at:47"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -37273,7 +46073,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -37288,40 +46087,210 @@ rm -rf *
   fi
 
 
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
   if test "$err" != "0"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/acls03.at:47"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr05.at:31:
+$as_echo "$at_srcdir/acls03.at:47:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
@@ -37331,7 +46300,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37346,30 +46314,200 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
+at_fn_check_prepare_notrace 'a `...` command substitution' "acls03.at:47"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -37380,7 +46518,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -37395,40 +46532,210 @@ rm -rf *
   fi
 
 
+
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -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
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/acls03.at:47"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr05.at:31:
+$as_echo "$at_srcdir/acls03.at:47:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -37438,7 +46745,6 @@ export TAR_OPTIONS
 rm -rf *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37453,30 +46759,200 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
+at_fn_check_prepare_notrace 'a `...` command substitution' "acls03.at:47"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -37487,172 +46963,233 @@ 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 test $file &> /dev/null
+  setfacl -m u:$UID:rwx $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfattr $file &> /dev/null
+  getfacl $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
+  rm -rf $file
 
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj $file
-  # check whether tar fails to store xattrs
-  err=$( tar --xattrs -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  setfacl -m u:$UID:rwx $file
+  err=$( tar --acls -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
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+MYNAME=$( id -un )
+MYGROUP=$( id -gn )
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+# 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
 
-              { set +x
-$as_echo "$at_srcdir/xattr05.at:31:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H posix\"
-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
 
+# 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
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
+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
 
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+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
 
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+    cd pure
+    pure="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-  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
+    cd sacl_def_optacl
+    sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
-)"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
-( $at_check_trace;
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H posix"
-export TAR_OPTIONS
-rm -rf *
 
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+    cd sacl_nodef_optnoacl
+    sacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
+    cd nosacl_def_optacl
+    nosacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-  getfattr $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 ..
 
-  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
 
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-mkdir dir
-mkdir output
-genfile --file dir/file
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
 
-# 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
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
+
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
+at_fn_check_status 0 $at_status "$at_srcdir/acls03.at:47"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/xattr05.at:31:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/acls03.at:47:
+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 *
 
 
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -37667,185 +47204,206 @@ rm -rf *
   fi
 
 
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfattr -n user.test -v ahoj \$file
-  # check whether tar fails to store xattrs
-  err=\$( tar --xattrs -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  setfacl -m u:\$UID:rwx \$file
+  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
   if test \"\$err\" != \"0\"; then
     exit 77
   fi
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar -C dir .
+MYNAME=\$( id -un )
+MYGROUP=\$( id -gn )
 
-tar --xattrs -xf archive.tar -C output
-getfattr -d output/file | grep -v '# ' > after
-diff before after
-)"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "xattr05.at:31"
-( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
-export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
-export TAR_OPTIONS
-rm -rf *
+# 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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+# 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
 
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+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
 
-  getfattr $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
 
 
-  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
+    cd pure
+    pure=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
 
-mkdir dir
-mkdir output
-genfile --file dir/file
 
-setfattr -n user.=NAME%3D= -v value dir/file
-getfattr -d dir/file | grep -v '# ' > before
+    cd sacl_def_optacl
+    sacl_def_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
-# 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
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/xattr05.at:31"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
 
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_169
-#AT_START_170
-at_fn_group_banner 170 'acls01.at:25' \
-  "acls: basic functionality" "                      " 25
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "170. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+    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 ..
 
 
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
-  { set +x
-$as_echo "$at_srcdir/acls01.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_optacl
+    nosacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
 
 
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+    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)
+    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
 
-  setfacl -m u:\$UID:rwx \$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
 
-  getfacl \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
-  rm -rf \$file
+    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)
-  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
 
+    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
 
-mkdir dir
-genfile --file dir/file
 
-MYNAME=\$( id -un )
+    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
 
-setfacl -m u:\$MYNAME:--x dir/file
-setfacl -m u:\$MYNAME:--x dir
 
-getfattr -h -m. -d dir dir/file > before
 
-tar --acls -cf archive.tar dir
-rm -rf dir
+    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
 
-tar --acls -xf archive.tar
 
-getfattr -h -m. -d dir dir/file > after
+    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
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "acls03.at:47"
 ( $at_check_trace;
-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 *
 
@@ -37889,42 +47447,190 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
 
 MYNAME=$( id -un )
+MYGROUP=$( id -gn )
 
-setfacl -m u:$MYNAME:--x dir/file
-setfacl -m u:$MYNAME:--x dir
+# 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
 
-getfattr -h -m. -d dir dir/file > before
+# use default format (no acls stored)
+tar -cf noacl.tar -C pure d1
 
-tar --acls -cf archive.tar dir
-rm -rf dir
+# use posix format, acls stored
+tar --acls -cf acl.tar -C pure d1
 
-tar --acls -xf archive.tar
+# 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
 
-getfattr -h -m. -d dir dir/file > after
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/acls03.at:47"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls01.at:28:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/acls03.at:47:
+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 *
 
@@ -37968,33 +47674,181 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
+
 
 MYNAME=\$( id -un )
+MYGROUP=\$( id -gn )
 
-setfacl -m u:\$MYNAME:--x dir/file
-setfacl -m u:\$MYNAME:--x dir
+# 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
 
-getfattr -h -m. -d dir dir/file > before
+# use default format (no acls stored)
+tar -cf noacl.tar -C pure d1
 
-tar --acls -cf archive.tar dir
-rm -rf dir
+# use posix format, acls stored
+tar --acls -cf acl.tar -C pure d1
 
-tar --acls -xf archive.tar
+# 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
 
-getfattr -h -m. -d dir dir/file > after
+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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl=\"\$(find d1 | sort | xargs -n 1 getfacl)\"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "acls03.at:47"
 ( $at_check_trace;
-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 *
 
@@ -38038,42 +47892,211 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
+test -z "`sort < /dev/null 2>&1`" || exit 77
+
 
 MYNAME=$( id -un )
+MYGROUP=$( id -gn )
 
-setfacl -m u:$MYNAME:--x dir/file
-setfacl -m u:$MYNAME:--x dir
+# 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
 
-getfattr -h -m. -d dir dir/file > before
+# use default format (no acls stored)
+tar -cf noacl.tar -C pure d1
 
-tar --acls -cf archive.tar dir
-rm -rf dir
+# 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 ..
+
+
+
+    cd sacl_def_optacl
+    sacl_def_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_def_optnoacl
+    sacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd sacl_nodef_optacl
+    sacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    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 ..
+
+
+    cd nosacl_def_optnoacl
+    nosacl_def_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optacl
+    nosacl_nodef_optacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+    cd nosacl_nodef_optnoacl
+    nosacl_nodef_optnoacl="$(find d1 | sort | xargs -n 1 getfacl)"
+    cd ..
+
+
+
+    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
+
+
+
+    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
+
+
+    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
+
+
+    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
+
+
+    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
 
-tar --acls -xf archive.tar
 
-getfattr -h -m. -d dir dir/file > after
+    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
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
 at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/acls03.at:47"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/acls01.at:28:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_190
+#AT_START_191
+at_fn_group_banner 191 'selnx01.at:25' \
+  "selinux: basic store/restore" "                   " 25
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "191. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/selnx01.at:28:
+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 *
 
@@ -38096,13 +48119,13 @@ rm -rf *
 
   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
@@ -38110,8 +48133,7 @@ rm -rf *
   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
@@ -38119,31 +48141,71 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=\$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:\$MYNAME:--x dir/file
-setfacl -m u:\$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
+    grep -v -e '^#' -e ^\$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test \"\$?\" -eq \"0\"; then
+    echo \"selinux contexts probably restored while --selinux is off\"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test \"\$?\" -ne \"0\"; then
+    echo \"bad result\"
+fi
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -38166,13 +48228,13 @@ rm -rf *
 
   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
@@ -38180,8 +48242,7 @@ rm -rf *
   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
@@ -38189,40 +48250,84 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:$MYNAME:--x dir/file
-setfacl -m u:$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
+    grep -v -e '^#' -e ^$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test "$?" -eq "0"; then
+    echo "selinux contexts probably restored while --selinux is off"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test "$?" -ne "0"; then
+    echo "bad result"
+fi
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
+echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
+security.selinux=\"unconfined_u
+security.selinux=\"system_u
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls01.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/selnx01.at:28:
+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 *
 
@@ -38245,13 +48350,13 @@ rm -rf *
 
   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
@@ -38259,8 +48364,7 @@ rm -rf *
   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
@@ -38268,31 +48372,71 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=\$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:\$MYNAME:--x dir/file
-setfacl -m u:\$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
+    grep -v -e '^#' -e ^\$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test \"\$?\" -eq \"0\"; then
+    echo \"selinux contexts probably restored while --selinux is off\"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test \"\$?\" -ne \"0\"; then
+    echo \"bad result\"
+fi
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -38315,13 +48459,13 @@ rm -rf *
 
   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
@@ -38329,8 +48473,7 @@ rm -rf *
   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
@@ -38338,40 +48481,84 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:$MYNAME:--x dir/file
-setfacl -m u:$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
+    grep -v -e '^#' -e ^$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test "$?" -eq "0"; then
+    echo "selinux contexts probably restored while --selinux is off"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test "$?" -ne "0"; then
+    echo "bad result"
+fi
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
+echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
+security.selinux=\"unconfined_u
+security.selinux=\"system_u
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls01.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/selnx01.at:28:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
@@ -38394,13 +48581,13 @@ rm -rf *
 
   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
@@ -38408,8 +48595,7 @@ rm -rf *
   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
@@ -38417,31 +48603,71 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=\$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:\$MYNAME:--x dir/file
-setfacl -m u:\$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
+    grep -v -e '^#' -e ^\$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test \"\$?\" -eq \"0\"; then
+    echo \"selinux contexts probably restored while --selinux is off\"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test \"\$?\" -ne \"0\"; then
+    echo \"bad result\"
+fi
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
@@ -38464,13 +48690,13 @@ rm -rf *
 
   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
@@ -38478,8 +48704,7 @@ rm -rf *
   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
@@ -38487,61 +48712,84 @@ rm -rf *
 
 mkdir dir
 genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:$MYNAME:--x dir/file
-setfacl -m u:$MYNAME:--x dir
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-getfattr -h -m. -d dir dir/file > before
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar dir
+# clear the directory
 rm -rf dir
 
-tar --acls -xf archive.tar
+# ================================================
+# check if selinux contexts are correctly restored
 
-getfattr -h -m. -d dir dir/file > after
+tar --selinux -xf archive.tar
 
-diff before after
-test "$?" = 0
-)
-) >>"$at_stdout" 2>>"$at_stderr" 5>&-
-at_status=$? at_failed=false
-$at_check_filter
-at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls01.at:28"
-$at_failed && at_fn_log_failure
-$at_traceon; }
+# archive for later debugging
+cp archive.tar archive_origin.tar
 
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
+    grep -v -e '^#' -e ^$ | cut -d: -f1
 
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
 
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
 
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_170
-#AT_START_171
-at_fn_group_banner 171 'acls02.at:25' \
-  "acls: work with -C" "                             " 25
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "171. $at_setup_line: testing $at_desc ..."
-  $at_traceon
+diff with_selinux without_selinux > diff_with_without
+if test "$?" -eq "0"; then
+    echo "selinux contexts probably restored while --selinux is off"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
 
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
 
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
 
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test "$?" -ne "0"; then
+    echo "bad result"
+fi
 
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
+security.selinux=\"unconfined_u
+security.selinux=\"system_u
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  { set +x
-$as_echo "$at_srcdir/acls02.at:28:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+              { set +x
+$as_echo "$at_srcdir/selnx01.at:28:
+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 *
 
@@ -38564,13 +48812,13 @@ rm -rf *
 
   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
@@ -38578,46 +48826,79 @@ rm -rf *
   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
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=\$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:\$MYNAME:--x dir/subdir
-setfacl -m u:\$MYNAME:--x dir/subdir/file
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
+# clear the directory
 rm -rf dir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+# ================================================
+# check if selinux contexts are correctly restored
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
+    grep -v -e '^#' -e ^\$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test \"\$?\" -eq \"0\"; then
+    echo \"selinux contexts probably restored while --selinux is off\"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test \"\$?\" -ne \"0\"; then
+    echo \"bad result\"
+fi
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -38640,13 +48921,13 @@ rm -rf *
 
   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
@@ -38654,55 +48935,92 @@ rm -rf *
   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
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:$MYNAME:--x dir/subdir
-setfacl -m u:$MYNAME:--x dir/subdir/file
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
+# clear the directory
 rm -rf dir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+# ================================================
+# check if selinux contexts are correctly restored
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
+    grep -v -e '^#' -e ^$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test "$?" -eq "0"; then
+    echo "selinux contexts probably restored while --selinux is off"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test "$?" -ne "0"; then
+    echo "bad result"
+fi
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
+echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
+security.selinux=\"unconfined_u
+security.selinux=\"system_u
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls02.at:28:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/selnx01.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 *
 
@@ -38725,13 +49043,13 @@ rm -rf *
 
   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
@@ -38739,46 +49057,79 @@ rm -rf *
   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
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=\$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:\$MYNAME:--x dir/subdir
-setfacl -m u:\$MYNAME:--x dir/subdir/file
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
+# clear the directory
 rm -rf dir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+# ================================================
+# check if selinux contexts are correctly restored
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
+    grep -v -e '^#' -e ^\$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test \"\$?\" -eq \"0\"; then
+    echo \"selinux contexts probably restored while --selinux is off\"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test \"\$?\" -ne \"0\"; then
+    echo \"bad result\"
+fi
 
-diff before after
-test \"\$?\" = 0
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -38801,13 +49152,13 @@ rm -rf *
 
   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
@@ -38815,59 +49166,125 @@ rm -rf *
   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
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+genfile --file dir/file
+ln -s file dir/link
 
-MYNAME=$( id -un )
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
 
-setfacl -m u:$MYNAME:--x dir/subdir
-setfacl -m u:$MYNAME:--x dir/subdir/file
+restorecon -R dir
+chcon -h --user=system_u     dir
+chcon -h --user=unconfined_u dir/file
+chcon -h --user=system_u     dir/link
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+# archive whole directory including selinux contexts
+tar --selinux -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
+# clear the directory
 rm -rf dir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+# ================================================
+# check if selinux contexts are correctly restored
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+tar --selinux -xf archive.tar
+
+# archive for later debugging
+cp archive.tar archive_origin.tar
+
+# check if selinux contexts were restored
+getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
+    grep -v -e '^#' -e ^$ | cut -d: -f1
+
+# ===========================================================================
+# check if selinux contexts are not restored when --selinux option is missing
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
+rm -rf dir
+tar -xf archive.tar
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+
+diff with_selinux without_selinux > diff_with_without
+if test "$?" -eq "0"; then
+    echo "selinux contexts probably restored while --selinux is off"
+fi
+
+# =================================================================
+# check if selinux is not archived when --selinux option is missing
+
+tar -cf archive.tar dir
+
+# clear the directory
+rm -rf dir
+
+# restore (with --selinux)
+tar --selinux -xf archive.tar dir
+
+getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
+diff start final > final_diff
+if test "$?" -ne "0"; then
+    echo "bad result"
+fi
 
-diff before after
-test "$?" = 0
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
+echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
+security.selinux=\"unconfined_u
+security.selinux=\"system_u
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/acls02.at:28:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_191
+#AT_START_192
+at_fn_group_banner 192 'selacl01.at:25' \
+  "acls/selinux: special files & fifos" "            " 25
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "192. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/selacl01.at:28:
+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 *
 
 
+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
@@ -38884,6 +49301,29 @@ rm -rf *
 
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:\$UID:rwx \$file &> /dev/null
@@ -38908,42 +49348,52 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
+MINOR=\$( stat /dev/urandom --printf=\"%T\" )
+mknod dir/chartype c \$MAJOR \$MINOR
 
-MYNAME=\$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:\$UID:--- dir/fifo
+setfacl -m u:\$UID:rwx dir/chartype
 
-setfacl -m u:\$MYNAME:--x dir/subdir
-setfacl -m u:\$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test \"\$?\" = 0
+echo separator
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -38960,6 +49410,29 @@ rm -rf *
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:$UID:rwx $file &> /dev/null
@@ -38984,51 +49457,63 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=$( stat /dev/urandom --printf="%t" )
+MINOR=$( stat /dev/urandom --printf="%T" )
+mknod dir/chartype c $MAJOR $MINOR
 
-MYNAME=$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:$UID:--- dir/fifo
+setfacl -m u:$UID:rwx dir/chartype
 
-setfacl -m u:$MYNAME:--x dir/subdir
-setfacl -m u:$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test "$?" = 0
+echo separator
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
+echo >>"$at_stdout"; $as_echo "separator
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls02.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/selacl01.at:28:
+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 *
 
 
+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
@@ -39045,6 +49530,29 @@ rm -rf *
 
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:\$UID:rwx \$file &> /dev/null
@@ -39069,42 +49577,52 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
+MINOR=\$( stat /dev/urandom --printf=\"%T\" )
+mknod dir/chartype c \$MAJOR \$MINOR
 
-MYNAME=\$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:\$UID:--- dir/fifo
+setfacl -m u:\$UID:rwx dir/chartype
 
-setfacl -m u:\$MYNAME:--x dir/subdir
-setfacl -m u:\$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test \"\$?\" = 0
+echo separator
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -39121,6 +49639,29 @@ rm -rf *
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:$UID:rwx $file &> /dev/null
@@ -39145,51 +49686,63 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=$( stat /dev/urandom --printf="%t" )
+MINOR=$( stat /dev/urandom --printf="%T" )
+mknod dir/chartype c $MAJOR $MINOR
 
-MYNAME=$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:$UID:--- dir/fifo
+setfacl -m u:$UID:rwx dir/chartype
 
-setfacl -m u:$MYNAME:--x dir/subdir
-setfacl -m u:$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test "$?" = 0
+echo separator
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
+echo >>"$at_stdout"; $as_echo "separator
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/acls02.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/selacl01.at:28:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
 
+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
@@ -39206,6 +49759,29 @@ rm -rf *
 
 
 
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
+
+  rm -rf \$file
+
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
+  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  if test \"\$err\" != \"0\"; then
+    exit 77
+  fi
+
+
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:\$UID:rwx \$file &> /dev/null
@@ -39230,42 +49806,52 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
+MINOR=\$( stat /dev/urandom --printf=\"%T\" )
+mknod dir/chartype c \$MAJOR \$MINOR
 
-MYNAME=\$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:\$UID:--- dir/fifo
+setfacl -m u:\$UID:rwx dir/chartype
 
-setfacl -m u:\$MYNAME:--x dir/subdir
-setfacl -m u:\$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test \"\$?\" = 0
+echo separator
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "acls02.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
+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
@@ -39282,6 +49868,29 @@ rm -rf *
 
 
 
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+
+  restorecon $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+
+  chcon -h --user=unconfined_u $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
+
+  rm -rf $file
+
+  file=$(TMPDIR=. mktemp fiXXXXXX)
+  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  if test "$err" != "0"; then
+    exit 77
+  fi
+
+
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfacl -m u:$UID:rwx $file &> /dev/null
@@ -39306,72 +49915,63 @@ rm -rf *
 
 
 mkdir dir
-mkdir dir/subdir
-genfile --file dir/subdir/file
+mkfifo dir/fifo
+MAJOR=$( stat /dev/urandom --printf="%t" )
+MINOR=$( stat /dev/urandom --printf="%T" )
+mknod dir/chartype c $MAJOR $MINOR
 
-MYNAME=$( id -un )
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:$UID:--- dir/fifo
+setfacl -m u:$UID:rwx dir/chartype
 
-setfacl -m u:$MYNAME:--x dir/subdir
-setfacl -m u:$MYNAME:--x dir/subdir/file
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../before
-cd ..
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-tar --acls -cf archive.tar -C dir subdir
-rm -rf dir
+mv dir olddir
 
-mkdir dir
-tar --acls -xf archive.tar -C dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-cd dir
-getfattr -h -m. -d subdir subdir/file > ../after
-cd ..
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
 diff before after
-test "$?" = 0
+echo separator
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-at_fn_diff_devnull "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/acls02.at:28"
+echo >>"$at_stdout"; $as_echo "separator
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_171
-#AT_START_172
-at_fn_group_banner 172 'selnx01.at:25' \
-  "selinux: basic store/restore" "                   " 25
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "172. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/selnx01.at:28:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+              { set +x
+$as_echo "$at_srcdir/selacl01.at:28:
+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 *
 
 
+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
@@ -39410,77 +50010,77 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
 
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-# clear the directory
-rm -rf dir
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# ================================================
-# check if selinux contexts are correctly restored
 
-tar --selinux -xf archive.tar
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# archive for later debugging
-cp archive.tar archive_origin.tar
+  rm -rf \$file
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
-    grep -v -e '^#' -e ^\$ | cut -d: -f1
+  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
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+mkdir dir
+mkfifo dir/fifo
+MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
+MINOR=\$( stat /dev/urandom --printf=\"%T\" )
+mknod dir/chartype c \$MAJOR \$MINOR
 
-diff with_selinux without_selinux > diff_with_without
-if test \"\$?\" -eq \"0\"; then
-    echo \"selinux contexts probably restored while --selinux is off\"
-fi
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:\$UID:--- dir/fifo
+setfacl -m u:\$UID:rwx dir/chartype
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-tar -cf archive.tar dir
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-# clear the directory
-rm -rf dir
+mv dir olddir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test \"\$?\" -ne \"0\"; then
-    echo \"bad result\"
-fi
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
+diff before after
+echo separator
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -39519,90 +50119,88 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
 
-# ================================================
-# check if selinux contexts are correctly restored
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-tar --selinux -xf archive.tar
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-# archive for later debugging
-cp archive.tar archive_origin.tar
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
-    grep -v -e '^#' -e ^$ | cut -d: -f1
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
+  rm -rf $file
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+  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
 
-diff with_selinux without_selinux > diff_with_without
-if test "$?" -eq "0"; then
-    echo "selinux contexts probably restored while --selinux is off"
-fi
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+mkdir dir
+mkfifo dir/fifo
+MAJOR=$( stat /dev/urandom --printf="%t" )
+MINOR=$( stat /dev/urandom --printf="%T" )
+mknod dir/chartype c $MAJOR $MINOR
 
-tar -cf archive.tar dir
+# 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
 
-# clear the directory
-rm -rf dir
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test "$?" -ne "0"; then
-    echo "bad result"
-fi
+mv dir olddir
 
+tar --xattrs --selinux --acls -xf archive.tar
+
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
+
+diff before after
+echo separator
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
-security.selinux=\"unconfined_u
-security.selinux=\"system_u
+echo >>"$at_stdout"; $as_echo "separator
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selnx01.at:28:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/selacl01.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 *
 
 
+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
@@ -39641,77 +50239,77 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
 
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-# clear the directory
-rm -rf dir
+  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# ================================================
-# check if selinux contexts are correctly restored
 
-tar --selinux -xf archive.tar
+  getfacl \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# archive for later debugging
-cp archive.tar archive_origin.tar
+  rm -rf \$file
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
-    grep -v -e '^#' -e ^\$ | cut -d: -f1
+  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
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+mkdir dir
+mkfifo dir/fifo
+MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
+MINOR=\$( stat /dev/urandom --printf=\"%T\" )
+mknod dir/chartype c \$MAJOR \$MINOR
 
-diff with_selinux without_selinux > diff_with_without
-if test \"\$?\" -eq \"0\"; then
-    echo \"selinux contexts probably restored while --selinux is off\"
-fi
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:\$UID:--- dir/fifo
+setfacl -m u:\$UID:rwx dir/chartype
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-tar -cf archive.tar dir
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-# clear the directory
-rm -rf dir
+mv dir olddir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test \"\$?\" -ne \"0\"; then
-    echo \"bad result\"
-fi
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
+diff before after
+echo separator
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -39750,90 +50348,110 @@ rm -rf *
   fi
 
 
-mkdir dir
-genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
 
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
+  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-# clear the directory
-rm -rf dir
+  setfacl -m u:$UID:rwx $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-# ================================================
-# check if selinux contexts are correctly restored
 
-tar --selinux -xf archive.tar
+  getfacl $file &> /dev/null
+  if test "$?" != 0; then
+    exit 77
+  fi
 
-# archive for later debugging
-cp archive.tar archive_origin.tar
+  rm -rf $file
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
-    grep -v -e '^#' -e ^$ | cut -d: -f1
+  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
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
+mkdir dir
+mkfifo dir/fifo
+MAJOR=$( stat /dev/urandom --printf="%t" )
+MINOR=$( stat /dev/urandom --printf="%T" )
+mknod dir/chartype c $MAJOR $MINOR
 
-diff with_selinux without_selinux > diff_with_without
-if test "$?" -eq "0"; then
-    echo "selinux contexts probably restored while --selinux is off"
-fi
+# setup attributes
+restorecon -R dir
+chcon -h --user=system_u dir/fifo
+chcon -h --user=system_u dir/chartype
+setfacl -m u:$UID:--- dir/fifo
+setfacl -m u:$UID:rwx dir/chartype
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+getfacl dir/fifo >> before
+getfattr -msecurity.selinux dir/chartype >> before
 
-tar -cf archive.tar dir
+tar --xattrs --selinux --acls -cf archive.tar dir
 
-# clear the directory
-rm -rf dir
+mv dir olddir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
+tar --xattrs --selinux --acls -xf archive.tar
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test "$?" -ne "0"; then
-    echo "bad result"
-fi
+getfacl dir/fifo >> after
+getfattr -msecurity.selinux dir/chartype >> after
 
+diff before after
+echo separator
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
-security.selinux=\"unconfined_u
-security.selinux=\"system_u
+echo >>"$at_stdout"; $as_echo "separator
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/selnx01.at:28:
-mkdir ustar
-(cd ustar
-TEST_TAR_FORMAT=ustar
+
+
+
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_192
+#AT_START_193
+at_fn_group_banner 193 'capabs_raw01.at:25' \
+  "capabilities: binary store/restore" "             " 25
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "193. $at_setup_line: testing $at_desc ..."
+  $at_traceon
+
+
+
+
+
+  { set +x
+$as_echo "$at_srcdir/capabs_raw01.at:28:
+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 *
 
 
+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
@@ -39848,101 +50466,67 @@ rm -rf *
   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)
 
-  restorecon \$file &> /dev/null
+  setcap \"= cap_chown=ei\" \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u \$file &> /dev/null
+  getcap \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
   rm -rf \$file
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
 
 mkdir dir
 genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
-
-# ================================================
-# check if selinux contexts are correctly restored
-
-tar --selinux -xf archive.tar
-
-# archive for later debugging
-cp archive.tar archive_origin.tar
-
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
-    grep -v -e '^#' -e ^\$ | cut -d: -f1
-
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
 
-diff with_selinux without_selinux > diff_with_without
-if test \"\$?\" -eq \"0\"; then
-    echo \"selinux contexts probably restored while --selinux is off\"
-fi
-
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap \"= cap_chown=ei\" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test \"\$?\" -ne \"0\"; then
-    echo \"bad result\"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -39957,223 +50541,153 @@ rm -rf *
   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)
 
-  restorecon $file &> /dev/null
+  setcap "= cap_chown=ei" $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u $file &> /dev/null
+  getcap $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
   rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
-
 
 mkdir dir
 genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
-
-# ================================================
-# check if selinux contexts are correctly restored
-
-tar --selinux -xf archive.tar
-
-# archive for later debugging
-cp archive.tar archive_origin.tar
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
-    grep -v -e '^#' -e ^$ | cut -d: -f1
-
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
-
-diff with_selinux without_selinux > diff_with_without
-if test "$?" -eq "0"; then
-    echo "selinux contexts probably restored while --selinux is off"
-fi
-
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap "= cap_chown=ei" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test "$?" -ne "0"; then
-    echo "bad result"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
-security.selinux=\"unconfined_u
-security.selinux=\"system_u
+echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selnx01.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/capabs_raw01.at:28:
+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 *
 
 
-  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
-
+echo \"test\" > \$\$
+chmod 0 \$\$
+cat \$\$ > /dev/null 2>&1
+result=\$?
+rm -f \$\$
+test \$result -eq 0 || exit 77
 
 
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  restorecon \$file &> /dev/null
+  setfattr -n user.test -v test \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u \$file &> /dev/null
+  getfattr \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
-  rm -rf \$file
 
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
-
-mkdir dir
-genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
+  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
 
-# clear the directory
-rm -rf dir
 
-# ================================================
-# check if selinux contexts are correctly restored
+  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-tar --selinux -xf archive.tar
+  setcap \"= cap_chown=ei\" \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# archive for later debugging
-cp archive.tar archive_origin.tar
 
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
-    grep -v -e '^#' -e ^\$ | cut -d: -f1
+  getcap \$file &> /dev/null
+  if test \"\$?\" != 0; then
+    exit 77
+  fi
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
+  rm -rf \$file
 
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
 
-diff with_selinux without_selinux > diff_with_without
-if test \"\$?\" -eq \"0\"; then
-    echo \"selinux contexts probably restored while --selinux is off\"
-fi
+mkdir dir
+genfile --file dir/file
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap \"= cap_chown=ei\" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test \"\$?\" -ne \"0\"; then
-    echo \"bad result\"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
 ( $at_check_trace;
-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 *
 
 
+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
@@ -40188,114 +50702,78 @@ rm -rf *
   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)
 
-  restorecon $file &> /dev/null
+  setcap "= cap_chown=ei" $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u $file &> /dev/null
+  getcap $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
   rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
-
 
 mkdir dir
 genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
 
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
-
-# ================================================
-# check if selinux contexts are correctly restored
-
-tar --selinux -xf archive.tar
-
-# archive for later debugging
-cp archive.tar archive_origin.tar
-
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
-    grep -v -e '^#' -e ^$ | cut -d: -f1
-
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
-
-diff with_selinux without_selinux > diff_with_without
-if test "$?" -eq "0"; then
-    echo "selinux contexts probably restored while --selinux is off"
-fi
-
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap "= cap_chown=ei" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test "$?" -ne "0"; then
-    echo "bad result"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
-security.selinux=\"unconfined_u
-security.selinux=\"system_u
+echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selnx01.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/capabs_raw01.at:28:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS=\"-H gnu\"
+TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
 
+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
@@ -40310,101 +50788,67 @@ rm -rf *
   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)
 
-  restorecon \$file &> /dev/null
+  setcap \"= cap_chown=ei\" \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u \$file &> /dev/null
+  getcap \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
   rm -rf \$file
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
 
 mkdir dir
 genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
-
-# ================================================
-# check if selinux contexts are correctly restored
-
-tar --selinux -xf archive.tar
-
-# archive for later debugging
-cp archive.tar archive_origin.tar
-
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \\
-    grep -v -e '^#' -e ^\$ | cut -d: -f1
-
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
-
-diff with_selinux without_selinux > diff_with_without
-if test \"\$?\" -eq \"0\"; then
-    echo \"selinux contexts probably restored while --selinux is off\"
-fi
 
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap \"= cap_chown=ei\" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test \"\$?\" -ne \"0\"; then
-    echo \"bad result\"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selnx01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
 export TEST_TAR_FORMAT
-TAR_OPTIONS="-H gnu"
+TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
 
+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
@@ -40419,131 +50863,65 @@ rm -rf *
   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)
 
-  restorecon $file &> /dev/null
+  setcap "= cap_chown=ei" $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  chcon -h --user=unconfined_u $file &> /dev/null
+  getcap $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
   rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
-
 
 mkdir dir
 genfile --file dir/file
-ln -s file dir/link
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > start
-
-restorecon -R dir
-chcon -h --user=system_u     dir
-chcon -h --user=unconfined_u dir/file
-chcon -h --user=system_u     dir/link
-
-# archive whole directory including selinux contexts
-tar --selinux -cf archive.tar dir
-
-# clear the directory
-rm -rf dir
-
-# ================================================
-# check if selinux contexts are correctly restored
-
-tar --selinux -xf archive.tar
-
-# archive for later debugging
-cp archive.tar archive_origin.tar
-
-# check if selinux contexts were restored
-getfattr -h -d dir dir/file dir/link -msecurity.selinux | \
-    grep -v -e '^#' -e ^$ | cut -d: -f1
 
-# ===========================================================================
-# check if selinux contexts are not restored when --selinux option is missing
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > with_selinux
-rm -rf dir
-tar -xf archive.tar
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > without_selinux
-
-diff with_selinux without_selinux > diff_with_without
-if test "$?" -eq "0"; then
-    echo "selinux contexts probably restored while --selinux is off"
-fi
-
-# =================================================================
-# check if selinux is not archived when --selinux option is missing
+setcap "= cap_chown=ei" dir/file
 
-tar -cf archive.tar dir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
 # clear the directory
 rm -rf dir
 
-# restore (with --selinux)
-tar --selinux -xf archive.tar dir
-
-getfattr -h -d -msecurity.selinux dir dir/file dir/link > final
-diff start final > final_diff
-if test "$?" -ne "0"; then
-    echo "bad result"
-fi
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
+getcap dir/file
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "security.selinux=\"system_u
-security.selinux=\"unconfined_u
-security.selinux=\"system_u
+echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selnx01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-
-
-
-  set +x
-  $at_times_p && times >"$at_times_file"
-) 5>&1 2>&1 7>&- | eval $at_tee_pipe
-read at_status <"$at_status_file"
-#AT_STOP_172
-#AT_START_173
-at_fn_group_banner 173 'selacl01.at:25' \
-  "acls/selinux: special files & fifos" "            " 25
-at_xfail=no
-      test -f $XFAILFILE && at_xfail=yes
-(
-  $as_echo "173. $at_setup_line: testing $at_desc ..."
-  $at_traceon
-
-
-
-
-
-  { set +x
-$as_echo "$at_srcdir/selacl01.at:28:
-mkdir v7
-(cd v7
-TEST_TAR_FORMAT=v7
+              { set +x
+$as_echo "$at_srcdir/capabs_raw01.at:28:
+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 *
 
@@ -40556,6 +50934,7 @@ rm -f \$\$
 test \$result -eq 0 || exit 77
 
 
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -40570,89 +50949,54 @@ test \$result -eq 0 || exit 77
   fi
 
 
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  restorecon \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  chcon -h --user=unconfined_u \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  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)
 
-  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  setcap \"= cap_chown=ei\" \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfacl \$file &> /dev/null
+  getcap \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
   rm -rf \$file
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfacl -m u:\$UID:rwx \$file
-  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
 
 mkdir dir
-mkfifo dir/fifo
-MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
-MINOR=\$( stat /dev/urandom --printf=\"%T\" )
-mknod dir/chartype c \$MAJOR \$MINOR
-
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:\$UID:--- dir/fifo
-setfacl -m u:\$UID:rwx dir/chartype
-
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+genfile --file dir/file
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+setcap \"= cap_chown=ei\" dir/file
 
-mv dir olddir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
-tar --xattrs --selinux --acls -xf archive.tar
+# clear the directory
+rm -rf dir
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
-diff before after
-echo separator
+getcap dir/file
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -40665,6 +51009,7 @@ rm -f $$
 test $result -eq 0 || exit 77
 
 
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -40679,100 +51024,65 @@ test $result -eq 0 || exit 77
   fi
 
 
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  restorecon $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  chcon -h --user=unconfined_u $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  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)
 
-  setfacl -m u:$UID:rwx $file &> /dev/null
+  setcap "= cap_chown=ei" $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfacl $file &> /dev/null
+  getcap $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
   rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfacl -m u:$UID:rwx $file
-  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
-
 
 mkdir dir
-mkfifo dir/fifo
-MAJOR=$( stat /dev/urandom --printf="%t" )
-MINOR=$( stat /dev/urandom --printf="%T" )
-mknod dir/chartype c $MAJOR $MINOR
-
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:$UID:--- dir/fifo
-setfacl -m u:$UID:rwx dir/chartype
-
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+genfile --file dir/file
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+setcap "= cap_chown=ei" dir/file
 
-mv dir olddir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
-tar --xattrs --selinux --acls -xf archive.tar
+# clear the directory
+rm -rf dir
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
-diff before after
-echo separator
+getcap dir/file
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selacl01.at:28:
-mkdir oldgnu
-(cd oldgnu
-TEST_TAR_FORMAT=oldgnu
+$as_echo "$at_srcdir/capabs_raw01.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 *
 
@@ -40785,6 +51095,7 @@ rm -f \$\$
 test \$result -eq 0 || exit 77
 
 
+
   file=\$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test \$file &> /dev/null
@@ -40799,89 +51110,54 @@ test \$result -eq 0 || exit 77
   fi
 
 
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  restorecon \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  chcon -h --user=unconfined_u \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
   file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
+  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)
 
-  setfacl -m u:\$UID:rwx \$file &> /dev/null
+  setcap \"= cap_chown=ei\" \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
 
-  getfacl \$file &> /dev/null
+  getcap \$file &> /dev/null
   if test \"\$?\" != 0; then
     exit 77
   fi
 
   rm -rf \$file
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  setfacl -m u:\$UID:rwx \$file
-  err=\$( tar --acls -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
 
 mkdir dir
-mkfifo dir/fifo
-MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
-MINOR=\$( stat /dev/urandom --printf=\"%T\" )
-mknod dir/chartype c \$MAJOR \$MINOR
-
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:\$UID:--- dir/fifo
-setfacl -m u:\$UID:rwx dir/chartype
-
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+genfile --file dir/file
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+setcap \"= cap_chown=ei\" dir/file
 
-mv dir olddir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
-tar --xattrs --selinux --acls -xf archive.tar
+# clear the directory
+rm -rf dir
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
-diff before after
-echo separator
+getcap dir/file
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
 ( $at_check_trace;
-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 *
 
@@ -40894,6 +51170,7 @@ rm -f $$
 test $result -eq 0 || exit 77
 
 
+
   file=$(TMPDIR=. mktemp fiXXXXXX)
 
   setfattr -n user.test -v test $file &> /dev/null
@@ -40908,203 +51185,218 @@ test $result -eq 0 || exit 77
   fi
 
 
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  restorecon $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  chcon -h --user=unconfined_u $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
   file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
+  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)
 
-  setfacl -m u:$UID:rwx $file &> /dev/null
+  setcap "= cap_chown=ei" $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
 
-  getfacl $file &> /dev/null
+  getcap $file &> /dev/null
   if test "$?" != 0; then
     exit 77
   fi
 
   rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfacl -m u:$UID:rwx $file
-  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
-
 
 mkdir dir
-mkfifo dir/fifo
-MAJOR=$( stat /dev/urandom --printf="%t" )
-MINOR=$( stat /dev/urandom --printf="%T" )
-mknod dir/chartype c $MAJOR $MINOR
-
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:$UID:--- dir/fifo
-setfacl -m u:$UID:rwx dir/chartype
-
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+genfile --file dir/file
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+setcap "= cap_chown=ei" dir/file
 
-mv dir olddir
+# archive whole directory including binary xattrs
+tar --xattrs -cf archive.tar dir
 
-tar --xattrs --selinux --acls -xf archive.tar
+# clear the directory
+rm -rf dir
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+# restore _all_ xattrs (not just the user.* domain)
+tar --xattrs --xattrs-include='*' -xf archive.tar
 
-diff before after
-echo separator
+getcap dir/file
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
-              { set +x
-$as_echo "$at_srcdir/selacl01.at:28:
-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
-
-
-  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)
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_193
+#AT_START_194
+at_fn_group_banner 194 'onetop01.at:21' \
+  "tar --one-top-level" "                            " 26
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "194. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-  restorecon \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
 
-  chcon -h --user=unconfined_u \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
-  rm -rf \$file
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
+  { set +x
+$as_echo "$at_srcdir/onetop01.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
 
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop01.at:24"
+( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H v7"
+export TAR_OPTIONS
+rm -rf *
 
-  setfacl -m u:\$UID:rwx \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  getfacl \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  rm -rf \$file
+              { set +x
+$as_echo "$at_srcdir/onetop01.at:24:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-  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
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
-MINOR=\$( stat /dev/urandom --printf=\"%T\" )
-mknod dir/chartype c \$MAJOR \$MINOR
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop01.at:24"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:\$UID:--- dir/fifo
-setfacl -m u:\$UID:rwx dir/chartype
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-mv dir olddir
+              { set +x
+$as_echo "$at_srcdir/onetop01.at:24:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level -x -f ../a.tar
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop01.at:24"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -41115,225 +51407,374 @@ 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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+              { set +x
+$as_echo "$at_srcdir/onetop01.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
 
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level -x -f ../a.tar
+find . | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop01.at:24"
+( $at_check_trace;
+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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  restorecon $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+              { set +x
+$as_echo "$at_srcdir/onetop01.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
-  chcon -h --user=unconfined_u $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  rm -rf $file
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop01.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-  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
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level -x -f ../a.tar
+find . | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop01.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfacl -m u:$UID:rwx $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
 
-  getfacl $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_194
+#AT_START_195
+at_fn_group_banner 195 'onetop02.at:21' \
+  "tar --one-top-level --show-transformed" "         " 26
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "195. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-  rm -rf $file
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  setfacl -m u:$UID:rwx $file
-  err=$( tar --acls -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
 
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=$( stat /dev/urandom --printf="%t" )
-MINOR=$( stat /dev/urandom --printf="%T" )
-mknod dir/chartype c $MAJOR $MINOR
 
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:$UID:--- dir/fifo
-setfacl -m u:$UID:rwx dir/chartype
+  { set +x
+$as_echo "$at_srcdir/onetop02.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mv dir olddir
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop02.at:24"
+( $at_check_trace;
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H v7"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level --show-transformed  -v -x -f ../a.tar
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/c
+.
+./a
+./a/b
+./a/c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop02.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selacl01.at:28:
-mkdir posix
-(cd posix
-TEST_TAR_FORMAT=posix
+$as_echo "$at_srcdir/onetop02.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 *
 
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  restorecon \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  chcon -h --user=unconfined_u \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  err=\$( tar --selinux -cf /dev/null \$file 2>&1 >/dev/null | wc -l )
-  if test \"\$err\" != \"0\"; then
-    exit 77
-  fi
-
-
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop02.at:24"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-  setfacl -m u:\$UID:rwx \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  getfacl \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level --show-transformed  -v -x -f ../a.tar
+find . | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/c
+.
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  rm -rf \$file
+              { set +x
+$as_echo "$at_srcdir/onetop02.at:24:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-  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
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
-MINOR=\$( stat /dev/urandom --printf=\"%T\" )
-mknod dir/chartype c \$MAJOR \$MINOR
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop02.at:24"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:\$UID:--- dir/fifo
-setfacl -m u:\$UID:rwx dir/chartype
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/c
+.
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-mv dir olddir
+              { set +x
+$as_echo "$at_srcdir/onetop02.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level --show-transformed  -v -x -f ../a.tar
+find . | sort
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop02.at:24"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -41344,341 +51785,679 @@ 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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/c
+.
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+              { set +x
+$as_echo "$at_srcdir/onetop02.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
 
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level --show-transformed  -v -x -f ../a.tar
+find . | sort
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop02.at:24"
+( $at_check_trace;
+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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/c
+.
+./a
+./a/b
+./a/c
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop02.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  restorecon $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
 
-  chcon -h --user=unconfined_u $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
-  rm -rf $file
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_195
+#AT_START_196
+at_fn_group_banner 196 'onetop03.at:21' \
+  "tar --one-top-level --transform" "                " 26
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "196. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
 
 
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfacl -m u:$UID:rwx $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+  { set +x
+$as_echo "$at_srcdir/onetop03.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
 
 
-  getfacl $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  rm -rf $file
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop03.at:24"
+( $at_check_trace;
+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)
-  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
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=$( stat /dev/urandom --printf="%t" )
-MINOR=$( stat /dev/urandom --printf="%T" )
-mknod dir/chartype c $MAJOR $MINOR
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop03.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-# 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
+              { set +x
+$as_echo "$at_srcdir/onetop03.at:24:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mv dir olddir
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop03.at:24"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+mkdir out
+cd out
+tar --one-top-level --transform 's/c/d/' -x -f ../a.tar
+find . | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/d
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop03.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/selacl01.at:28:
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+$as_echo "$at_srcdir/onetop03.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 *
 
 
-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
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop03.at:24"
+( $at_check_trace;
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H ustar"
+export TAR_OPTIONS
+rm -rf *
 
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop03.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/onetop03.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
 
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop03.at:24"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
-  restorecon \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  chcon -h --user=unconfined_u \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop03.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  rm -rf \$file
+              { set +x
+$as_echo "$at_srcdir/onetop03.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-  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
 
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop03.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
 
-  setfacl -m u:\$UID:rwx \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo ".
+./a
+./a/b
+./a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop03.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  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
 
+  set +x
+  $at_times_p && times >"$at_times_file"
+) 5>&1 2>&1 7>&- | eval $at_tee_pipe
+read at_status <"$at_status_file"
+#AT_STOP_196
+#AT_START_197
+at_fn_group_banner 197 'onetop04.at:21' \
+  "tar --one-top-level --transform" "                " 26
+at_xfail=no
+      test -f $XFAILFILE && at_xfail=yes
+(
+  $as_echo "197. $at_setup_line: testing $at_desc ..."
+  $at_traceon
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=\$( stat /dev/urandom --printf=\"%t\" )
-MINOR=\$( stat /dev/urandom --printf=\"%T\" )
-mknod dir/chartype c \$MAJOR \$MINOR
 
-# setup attributes
-restorecon -R dir
-chcon -h --user=system_u dir/fifo
-chcon -h --user=system_u dir/chartype
-setfacl -m u:\$UID:--- dir/fifo
-setfacl -m u:\$UID:rwx dir/chartype
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
 
-tar --xattrs --selinux --acls -cf archive.tar dir
 
-mv dir olddir
+  { set +x
+$as_echo "$at_srcdir/onetop04.at:24:
+mkdir v7
+(cd v7
+TEST_TAR_FORMAT=v7
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H v7\"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "selacl01.at:28"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop04.at:24"
 ( $at_check_trace;
-mkdir gnu
-(cd gnu
-TEST_TAR_FORMAT=gnu
+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 *
 
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop04.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/onetop04.at:24:
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H oldgnu\"
+export TAR_OPTIONS
+rm -rf *
 
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop04.at:24"
+( $at_check_trace;
+mkdir oldgnu
+(cd oldgnu
+TEST_TAR_FORMAT=oldgnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H oldgnu"
+export TAR_OPTIONS
+rm -rf *
 
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-  restorecon $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop04.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
+              { set +x
+$as_echo "$at_srcdir/onetop04.at:24:
+mkdir ustar
+(cd ustar
+TEST_TAR_FORMAT=ustar
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H ustar\"
+export TAR_OPTIONS
+rm -rf *
 
-  chcon -h --user=unconfined_u $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
 
-  rm -rf $file
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  err=$( tar --selinux -cf /dev/null $file 2>&1 >/dev/null | wc -l )
-  if test "$err" != "0"; then
-    exit 77
-  fi
+mkdir 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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop04.at:24"
+( $at_check_trace;
+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
 
-  file=$(TMPDIR=. mktemp fiXXXXXX)
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop04.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-  setfacl -m u:$UID:rwx $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+              { set +x
+$as_echo "$at_srcdir/onetop04.at:24:
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H posix\"
+export TAR_OPTIONS
+rm -rf *
 
 
-  getfacl $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-  rm -rf $file
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop04.at:24"
+( $at_check_trace;
+mkdir posix
+(cd posix
+TEST_TAR_FORMAT=posix
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H posix"
+export TAR_OPTIONS
+rm -rf *
 
-  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
 
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-mkdir dir
-mkfifo dir/fifo
-MAJOR=$( stat /dev/urandom --printf="%t" )
-MINOR=$( stat /dev/urandom --printf="%T" )
-mknod dir/chartype c $MAJOR $MINOR
+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
+)
+) >>"$at_stdout" 2>>"$at_stderr" 5>&-
+at_status=$? at_failed=false
+$at_check_filter
+at_fn_diff_devnull "$at_stderr" || at_failed=:
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/d
+" | \
+  $at_diff - "$at_stdout" || at_failed=:
+at_fn_check_status 0 $at_status "$at_srcdir/onetop04.at:24"
+$at_failed && at_fn_log_failure
+$at_traceon; }
 
-# 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
+              { set +x
+$as_echo "$at_srcdir/onetop04.at:24:
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS=\"-H gnu\"
+export TAR_OPTIONS
+rm -rf *
 
-getfacl dir/fifo >> before
-getfattr -msecurity.selinux dir/chartype >> before
 
-tar --xattrs --selinux --acls -cf archive.tar dir
+test -z \"\`sort < /dev/null 2>&1\`\" || exit 77
 
-mv dir olddir
+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
+)"
+at_fn_check_prepare_notrace 'a `...` command substitution' "onetop04.at:24"
+( $at_check_trace;
+mkdir gnu
+(cd gnu
+TEST_TAR_FORMAT=gnu
+export TEST_TAR_FORMAT
+TAR_OPTIONS="-H gnu"
+export TAR_OPTIONS
+rm -rf *
 
-tar --xattrs --selinux --acls -xf archive.tar
 
-getfacl dir/fifo >> after
-getfattr -msecurity.selinux dir/chartype >> after
+test -z "`sort < /dev/null 2>&1`" || exit 77
 
-diff before after
-echo separator
+mkdir a
+genfile --file a/b
+genfile --file c
+tar cf a.tar a c
+tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "separator
+echo >>"$at_stdout"; $as_echo "a/
+a/b
+a/d
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/selacl01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop04.at:24"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -41689,22 +52468,26 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_173
-#AT_START_174
-at_fn_group_banner 174 'capabs_raw01.at:25' \
-  "capabilities: binary store/restore" "             " 25
+#AT_STOP_197
+#AT_START_198
+at_fn_group_banner 198 'onetop05.at:21' \
+  "tar --one-top-level restoring permissions" "      " 26
 at_xfail=no
       test -f $XFAILFILE && at_xfail=yes
 (
-  $as_echo "174. $at_setup_line: testing $at_desc ..."
+  $as_echo "198. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
 
+# When extracting an archive that contains ./ with the --one-top-level option,
+# the mode and ownership of ./ would be incorrectly applied to the current
+# working directory, instead of the requested top-level directory.
+
 
 
   { set +x
-$as_echo "$at_srcdir/capabs_raw01.at:28:
+$as_echo "$at_srcdir/onetop05.at:28:
 mkdir v7
 (cd v7
 TEST_TAR_FORMAT=v7
@@ -41713,72 +52496,45 @@ TAR_OPTIONS=\"-H v7\"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod \$orig_mode d
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getcap \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap \"= cap_chown=ei\" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=\$(genfile --stat=mode.7777 d)
+test \$mode = \$orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "onetop05.at:28"
 ( $at_check_trace;
 mkdir v7
 (cd v7
@@ -41788,158 +52544,106 @@ TAR_OPTIONS="-H v7"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod $orig_mode d
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getcap $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap "= cap_chown=ei" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
+echo >>"$at_stdout"; $as_echo "CWD: OK
+DIR: OK
+TOP: OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop05.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/capabs_raw01.at:28:
+$as_echo "$at_srcdir/onetop05.at:28:
 mkdir oldgnu
 (cd oldgnu
 TEST_TAR_FORMAT=oldgnu
 export TEST_TAR_FORMAT
 TAR_OPTIONS=\"-H oldgnu\"
-export TAR_OPTIONS
-rm -rf *
-
-
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-
-  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
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setcap \"= cap_chown=ei\" \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getcap \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-
-mkdir dir
-genfile --file dir/file
+export TAR_OPTIONS
+rm -rf *
 
-setcap \"= cap_chown=ei\" dir/file
+orig_mode=3702
+mkdir d
+chmod \$orig_mode d
 
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=\$(genfile --stat=mode.7777 d)
+test \$mode = \$orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "onetop05.at:28"
 ( $at_check_trace;
 mkdir oldgnu
 (cd oldgnu
@@ -41949,84 +52653,59 @@ TAR_OPTIONS="-H oldgnu"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod $orig_mode d
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getcap $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap "= cap_chown=ei" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
+echo >>"$at_stdout"; $as_echo "CWD: OK
+DIR: OK
+TOP: OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop05.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/capabs_raw01.at:28:
+$as_echo "$at_srcdir/onetop05.at:28:
 mkdir ustar
 (cd ustar
 TEST_TAR_FORMAT=ustar
@@ -42035,72 +52714,45 @@ TAR_OPTIONS=\"-H ustar\"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod \$orig_mode d
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getcap \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap \"= cap_chown=ei\" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=\$(genfile --stat=mode.7777 d)
+test \$mode = \$orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "onetop05.at:28"
 ( $at_check_trace;
 mkdir ustar
 (cd ustar
@@ -42110,84 +52762,59 @@ TAR_OPTIONS="-H ustar"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod $orig_mode d
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getcap $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap "= cap_chown=ei" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
+echo >>"$at_stdout"; $as_echo "CWD: OK
+DIR: OK
+TOP: OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop05.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/capabs_raw01.at:28:
+$as_echo "$at_srcdir/onetop05.at:28:
 mkdir posix
 (cd posix
 TEST_TAR_FORMAT=posix
@@ -42196,72 +52823,45 @@ TAR_OPTIONS=\"-H posix\"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod \$orig_mode d
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getcap \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap \"= cap_chown=ei\" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=\$(genfile --stat=mode.7777 d)
+test \$mode = \$orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "onetop05.at:28"
 ( $at_check_trace;
 mkdir posix
 (cd posix
@@ -42271,84 +52871,59 @@ TAR_OPTIONS="-H posix"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod $orig_mode d
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getcap $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap "= cap_chown=ei" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
+echo >>"$at_stdout"; $as_echo "CWD: OK
+DIR: OK
+TOP: OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop05.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
               { set +x
-$as_echo "$at_srcdir/capabs_raw01.at:28:
+$as_echo "$at_srcdir/onetop05.at:28:
 mkdir gnu
 (cd gnu
 TEST_TAR_FORMAT=gnu
@@ -42357,72 +52932,45 @@ TAR_OPTIONS=\"-H gnu\"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod \$orig_mode d
 
-echo \"test\" > \$\$
-chmod 0 \$\$
-cat \$\$ > /dev/null 2>&1
-result=\$?
-rm -f \$\$
-test \$result -eq 0 || exit 77
-
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getfattr \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  file=\$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-
-  getcap \$file &> /dev/null
-  if test \"\$?\" != 0; then
-    exit 77
-  fi
-
-  rm -rf \$file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap \"= cap_chown=ei\" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=\$(genfile --stat=mode.7777 d)
+test \$mode = \$orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )"
-at_fn_check_prepare_notrace 'a $(...) command substitution' "capabs_raw01.at:28"
+at_fn_check_prepare_notrace 'a $(...) command substitution' "onetop05.at:28"
 ( $at_check_trace;
 mkdir gnu
 (cd gnu
@@ -42432,79 +52980,54 @@ TAR_OPTIONS="-H gnu"
 export TAR_OPTIONS
 rm -rf *
 
+orig_mode=3702
+mkdir d
+chmod $orig_mode d
 
-echo "test" > $$
-chmod 0 $$
-cat $$ > /dev/null 2>&1
-result=$?
-rm -f $$
-test $result -eq 0 || exit 77
-
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-
-  setfattr -n user.test -v test $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getfattr $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  file=$(TMPDIR=. mktemp fiXXXXXX)
-  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
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-
-  getcap $file &> /dev/null
-  if test "$?" != 0; then
-    exit 77
-  fi
-
-  rm -rf $file
-
-
-mkdir dir
-genfile --file dir/file
-
-setcap "= cap_chown=ei" dir/file
-
-# archive whole directory including binary xattrs
-tar --xattrs -cf archive.tar dir
+mode=$(genfile --stat=mode.7777 d)
+test $mode = $orig_mode || exit 77
 
-# clear the directory
-rm -rf dir
+genfile --file d/file
+tar -cf d.tar -C d .
+rm -rf d
 
-# restore _all_ xattrs (not just the user.* domain)
-tar --xattrs --xattrs-include='*' -xf archive.tar
+(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
 
-getcap dir/file
+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
 )
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
 at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "dir/file = cap_chown+ei
+echo >>"$at_stdout"; $as_echo "CWD: OK
+DIR: OK
+TOP: OK
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/capabs_raw01.at:28"
+at_fn_check_status 0 $at_status "$at_srcdir/onetop05.at:28"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42515,13 +53038,13 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_174
-#AT_START_175
-at_fn_group_banner 175 'gtarfail.at:21' \
-  "gtarfail" "                                       " 26
+#AT_STOP_198
+#AT_START_199
+at_fn_group_banner 199 'gtarfail.at:22' \
+  "gtarfail" "                                       " 27
 at_xfail=no
 (
-  $as_echo "175. $at_setup_line: testing $at_desc ..."
+  $as_echo "199. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42529,7 +53052,7 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/gtarfail.at:26:
+$as_echo "$at_srcdir/gtarfail.at:27:
 
 test -z \"\$STAR_TESTSCRIPTS\" && exit 77
 tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77
@@ -42537,7 +53060,7 @@ tarball_prereq gtarfail.tar bf7612e401aaa679edbb07ae1183811b \$STAR_TESTSCRIPTS
 
 tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail.tar
 "
-at_fn_check_prepare_notrace 'an embedded newline' "gtarfail.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "gtarfail.at:27"
 ( $at_check_trace;
 
 test -z "$STAR_TESTSCRIPTS" && exit 77
@@ -42558,7 +53081,7 @@ echo >>"$at_stdout"; $as_echo "-rw-r--r-- jes/glone       518 2001-05-25 14:41 v
 -rw-rw-rw- jes/glone    148753 1998-09-15 13:08 billyboy.jpg
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/gtarfail.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/gtarfail.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42567,13 +53090,13 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_175
-#AT_START_176
-at_fn_group_banner 176 'gtarfail2.at:21' \
-  "gtarfail2" "                                      " 26
+#AT_STOP_199
+#AT_START_200
+at_fn_group_banner 200 'gtarfail2.at:22' \
+  "gtarfail2" "                                      " 27
 at_xfail=no
 (
-  $as_echo "176. $at_setup_line: testing $at_desc ..."
+  $as_echo "200. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42581,14 +53104,14 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/gtarfail2.at:26:
+$as_echo "$at_srcdir/gtarfail2.at:27:
 
 test -z \"\$STAR_TESTSCRIPTS\" && exit 77
 tarball_prereq gtarfail2.tar 6b607d1faec14b82f69525d9c5b66e53 \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77
 
 tar --utc -tvf \$STAR_TESTSCRIPTS/gtarfail2.tar
 "
-at_fn_check_prepare_notrace 'an embedded newline' "gtarfail2.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "gtarfail2.at:27"
 ( $at_check_trace;
 
 test -z "$STAR_TESTSCRIPTS" && exit 77
@@ -42612,7 +53135,7 @@ lrwxrwxrwx jes/glone         0 2001-08-29 10:53 build/psmake/archconf.c -> ../ar
 lrwxrwxrwx jes/glone         0 2001-08-29 10:54 build/psmake/astoi.c -> ../../lib/astoi.c
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/gtarfail2.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/gtarfail2.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42621,13 +53144,13 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_176
-#AT_START_177
-at_fn_group_banner 177 'multi-fail.at:21' \
-  "multi-fail" "                                     " 26
+#AT_STOP_200
+#AT_START_201
+at_fn_group_banner 201 'multi-fail.at:22' \
+  "multi-fail" "                                     " 27
 at_xfail=no
 (
-  $as_echo "177. $at_setup_line: testing $at_desc ..."
+  $as_echo "201. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42635,7 +53158,7 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/multi-fail.at:26:
+$as_echo "$at_srcdir/multi-fail.at:27:
 
 test -z \"\$STAR_TESTSCRIPTS\" && exit 77
 tarball_prereq gnu-multi-fail-volume1.gtar 7c28663dd98b0bd91ceb4be7af55254e \$STAR_TESTSCRIPTS \$STAR_DATA_URL || exit 77
@@ -42648,7 +53171,7 @@ tarball_prereq gnu-multi-fail-volume2.gtar b5d41c4c3ec440687d4a44957b5079a8 \$ST
 tar --utc -tvM -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume1.gtar \\
                -f \$STAR_TESTSCRIPTS/gnu-multi-fail-volume2.gtar <&-
 "
-at_fn_check_prepare_notrace 'an embedded newline' "multi-fail.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "multi-fail.at:27"
 ( $at_check_trace;
 
 test -z "$STAR_TESTSCRIPTS" && exit 77
@@ -42720,7 +53243,7 @@ echo >>"$at_stdout"; $as_echo "drwxrwsr-x joerg/bs          0 2003-10-11 14:32 O
 -rw-r--r-- joerg/bs       2756 2003-10-07 17:53 OBJ/i386-sunos5-gcc/table.o
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/multi-fail.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/multi-fail.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42729,13 +53252,13 @@ $at_traceon; }
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_177
-#AT_START_178
-at_fn_group_banner 178 'ustar-big-2g.at:21' \
-  "ustar-big-2g" "                                   " 26
+#AT_STOP_201
+#AT_START_202
+at_fn_group_banner 202 'ustar-big-2g.at:22' \
+  "ustar-big-2g" "                                   " 27
 at_xfail=no
 (
-  $as_echo "178. $at_setup_line: testing $at_desc ..."
+  $as_echo "202. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42743,7 +53266,7 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/ustar-big-2g.at:26:
+$as_echo "$at_srcdir/ustar-big-2g.at:27:
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
 
@@ -42754,7 +53277,7 @@ tarball_prereq ustar-big-2g.tar.bz2 b63979733629c8fcdf40b60065422767 \$STAR_TEST
 
 tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-2g.tar.bz2
 "
-at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-2g.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-2g.at:27"
 ( $at_check_trace;
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
@@ -42774,7 +53297,7 @@ echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 2147483647 2002-06-15 14:53
 -rw-r--r-- jes/glone          0 2002-06-15 14:53 file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-2g.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-2g.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42796,13 +53319,13 @@ done
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_178
-#AT_START_179
-at_fn_group_banner 179 'ustar-big-8g.at:21' \
-  "ustar-big-8g" "                                   " 26
+#AT_STOP_202
+#AT_START_203
+at_fn_group_banner 203 'ustar-big-8g.at:22' \
+  "ustar-big-8g" "                                   " 27
 at_xfail=no
 (
-  $as_echo "179. $at_setup_line: testing $at_desc ..."
+  $as_echo "203. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42810,7 +53333,7 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/ustar-big-8g.at:26:
+$as_echo "$at_srcdir/ustar-big-8g.at:27:
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
 
@@ -42821,7 +53344,7 @@ tarball_prereq ustar-big-8g.tar.bz2 60ff503fa4b8288bef7ada89e9c91b0f \$STAR_TEST
 
 tar --utc -tvjf \$STAR_TESTSCRIPTS/ustar-big-8g.tar.bz2
 "
-at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-8g.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "ustar-big-8g.at:27"
 ( $at_check_trace;
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
@@ -42841,7 +53364,7 @@ echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 8589934591 2002-06-15 15:08
 -rw-r--r-- jes/glone          0 2002-06-15 14:53 file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-8g.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/ustar-big-8g.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42863,13 +53386,13 @@ done
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_179
-#AT_START_180
-at_fn_group_banner 180 'pax-big-10g.at:21' \
-  "pax-big-10g" "                                    " 26
+#AT_STOP_203
+#AT_START_204
+at_fn_group_banner 204 'pax-big-10g.at:22' \
+  "pax-big-10g" "                                    " 27
 at_xfail=no
 (
-  $as_echo "180. $at_setup_line: testing $at_desc ..."
+  $as_echo "204. $at_setup_line: testing $at_desc ..."
   $at_traceon
 
 
@@ -42877,7 +53400,7 @@ at_xfail=no
 unset TAR_OPTIONS
 
 { set +x
-$as_echo "$at_srcdir/pax-big-10g.at:26:
+$as_echo "$at_srcdir/pax-big-10g.at:27:
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
 
@@ -42888,7 +53411,7 @@ tarball_prereq pax-big-10g.tar.bz2 ca15c23acc8d8bb1f27e60113a5f8bff \$STAR_TESTS
 
 tar --utc -tvjf \$STAR_TESTSCRIPTS/pax-big-10g.tar.bz2
 "
-at_fn_check_prepare_notrace 'an embedded newline' "pax-big-10g.at:26"
+at_fn_check_prepare_notrace 'an embedded newline' "pax-big-10g.at:27"
 ( $at_check_trace;
 
 cat /dev/null | bzip2 - > /dev/null 2>&1 || exit 77
@@ -42908,7 +53431,7 @@ echo >>"$at_stdout"; $as_echo "-rw------- jes/glone 10737418240 2002-06-15 21:18
 -rw-r--r-- jes/glone           0 2002-06-15 14:53 file
 " | \
   $at_diff - "$at_stdout" || at_failed=:
-at_fn_check_status 0 $at_status "$at_srcdir/pax-big-10g.at:26"
+at_fn_check_status 0 $at_status "$at_srcdir/pax-big-10g.at:27"
 $at_failed && at_fn_log_failure
 $at_traceon; }
 
@@ -42930,4 +53453,4 @@ done
   $at_times_p && times >"$at_times_file"
 ) 5>&1 2>&1 7>&- | eval $at_tee_pipe
 read at_status <"$at_status_file"
-#AT_STOP_180
+#AT_STOP_204