]> git.ipfire.org Git - thirdparty/tar.git/commitdiff
tar: revamp "file is the archive" diagnostic
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Feb 2022 01:40:34 +0000 (17:40 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Feb 2022 01:42:51 +0000 (17:42 -0800)
* src/create.c (dump_file0): For clarity, change diagnostic
wording from "file is the archive; not dumped" to "archive cannot
contain itself; not dumped".  All test cases and documentation changed.

doc/tar.1
doc/tar.texi
src/create.c
tests/positional02.at

index 4eaea0ca2b41fbd5d80e83a8e53c70b5d8771675..180f4cbb03cfad1a91d8e15166ca602c0b0fdb8f 100644 (file)
--- a/doc/tar.1
+++ b/doc/tar.1
@@ -13,7 +13,7 @@
 .\"
 .\" You should have received a copy of the GNU General Public License
 .\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
-.TH TAR 1 "July 13, 2020" "TAR" "GNU TAR Manual"
+.TH TAR 1 "February 15, 2022" "TAR" "GNU TAR Manual"
 .SH NAME
 tar \- an archiving utility
 .SH SYNOPSIS
@@ -1168,7 +1168,7 @@ Keywords applicable for \fBtar --create\fR:
 "%s: file is unchanged; not dumped"
 .TP
 .B ignore-archive
-"%s: file is the archive; not dumped"
+"%s: archive cannot contain itself; not dumped"
 .TP
 .B file-removed
 "%s: File removed before we read it"
index e9564b69d0acdc55795aef92b6639dc4de03b06d..a70e8898992022727d5d7c389ec2a6c86cbcc8be 100644 (file)
@@ -4634,11 +4634,9 @@ Disable all warning messages.
 @item file-unchanged
 @samp{%s: file is unchanged; not dumped}
 @kwindex ignore-archive
-@cindex @samp{file is the archive; not dumped}, warning message
-@kwindex ignore-archive
-@cindex @samp{file is the archive; not dumped}, warning message
+@cindex @samp{archive cannot contain itself; not dumped}, warning message
 @item ignore-archive
-@samp{%s: file is the archive; not dumped}
+@samp{%s: archive cannot contain itself; not dumped}
 @kwindex file-removed
 @cindex @samp{File removed before we read it}, warning message
 @item file-removed
index 1ffc328137cab816e1f8d37337dc8fd87ec335f8..30db2b5cdc211f3b90311837c5bd0e46d93bd3be 100644 (file)
@@ -1723,7 +1723,7 @@ dump_file0 (struct tar_stat_info *st, char const *name, char const *p)
   if (sys_file_is_archive (st))
     {
       WARNOPT (WARN_IGNORE_ARCHIVE,
-              (0, 0, _("%s: file is the archive; not dumped"),
+              (0, 0, _("%s: archive cannot contain itself; not dumped"),
                quotearg_colon (p)));
       return;
     }
index fa6260270d8293e41032127d82b50ed956573c48..ac1ed7b79a24b8d627b592429555ece867157dc8 100644 (file)
@@ -39,11 +39,10 @@ tar -cf a.tar . -C dir
 ./A.b
 ./B.a
 ],
-[tar: ./a.tar: file is the archive; not dumped
+[tar: ./a.tar: archive cannot contain itself; not dumped
 tar: The following options were used after any non-optional arguments in archive create or update mode.  These options are positional and affect only arguments that follow them.  Please, rearrange them properly.
 tar: -C 'dir' has no effect
 tar: Exiting with failure status due to previous errors
 ])
 
 AT_CLEANUP
-