Fix --test-label' and --label -r' behavior.

* doc/tar.texi (Including a Label in the Archive): Revise
the section.
* NEWS: Update

* src/buffer.c (open_archive): Check volume label on
ACCESS_UPDATE as well.
* src/list.c (test_archive_label): Rewrite to match the
documentation.
* src/names.c (regex_usage_warning): Return int.
(names_notfound): Rewrite the conditional.
(label_notfound): New function.

* tests/label03.at: New testcase.
* tests/label04.at: New testcase.
* tests/label05.at: New testcase.
* tests/Makefile.am: Add new testcases.
* tests/testsuite.at: Likewise.
This commit is contained in:
Sergey Poznyakoff
2010-03-11 17:41:23 +02:00
parent 8d3cc6c3cf
commit 0ba8bdf5f3
10 changed files with 329 additions and 47 deletions

34
NEWS
View File

@@ -1,6 +1,32 @@
GNU tar NEWS - User visible changes. 2010-03-10
GNU tar NEWS - User visible changes. 2010-03-11
Please send GNU tar bug reports to <bug-tar@gnu.org>
* --test-label behavior
In case of a mismatch, `tar --test-label LABEL' exits with code 1,
not 2 as it did in previous versions.
The `--verbose' option used with `--test-label' provides additional
diagnostics.
Several volume labels may be specified in a command line, e.g.:
tar --test-label -f archive 'My volume' 'New volume' 'Test volume'
In this case, tar exits with code 0 if any one of the arguments
matches the actual volume label.
* --label used with --update
The `--label' option can be used with `--update' to prevent accidental
update of an archive:
tar -rf archive --label 'My volume' .
This did not work in previous versions, in spite of what the docs said.
version 1.23 - Sergey Poznyakoff, 2010-03-10
@@ -694,7 +720,7 @@ tar.
* New message translations fi (Finnish), gl (Galician), hr (Croatian),
hu (Hungarian), ms (Malaysian), nb (Norwegian), ro (Romanian), sk
(Slovak), zh_CN (Chinese simplified), zh_TW (Chinese traditional).
The code 'no' for Norwegian (Bokmål) has been withdrawn; use 'nb' instead.
The code 'no' for Norwegian (Bokm<EFBFBD>l) has been withdrawn; use 'nb' instead.
* Bug fixes.
@@ -1019,7 +1045,7 @@ version 1.13 - Paul Eggert, 1999-07-08.
but they have been removed to maintain compatibility with paxutils.
Please try --use=bzip2 instead of --bzip2.
Version 1.12 - François Pinard, 1997-04.
Version 1.12 - Fran<EFBFBD>ois Pinard, 1997-04.
Sensitive matters
* Use shell globbing patterns for --label, instead of regular expressions.
@@ -1062,7 +1088,7 @@ Various changes
Many bugs are squashed, while others still run free.
Version 1.11.8 - François Pinard, 1995-06.
Version 1.11.8 - Fran<EFBFBD>ois Pinard, 1995-06.
* Messages available in French, German, Portuguese and Swedish.
* The distribution provides a rudimentary Texinfo manual.