Check for chmod, hardlink, symlink, and special character support to
prevent test suite failures in feature constrained environments.
Thanks to Bruno Haible and Nelson H. F. Beebe for their testing and
analysis.
* tests/test-lib.sh: Add new feature tests.
* tests/hardlinks: Split this hardlinks related test off from
tests/remember-backup-files.
* tests/Makefile.am (TESTS): Add new hardlinks test here.
* tests/file-create-modes, tests/file-modes, tests/read-only-files,
tests/preserve-mode-and-timestamp, tests/no-mode-change-git-diff: These
tests require chmod support.
* tests/hardlinks, tests/unmodified-files: These tests require hardlink
support.
* tests/symlinks: This test requires symlink support.
* tests/quoted-filenames: This test requires special character support
in filenames.
Switch to single intervals for FSF notices,
and consistently put them first.
Update copyright notices for 2024.
* cfg.mk (update-copyright-env): Use UPDATE_COPYRIGHT_FORCE=1,
UPDATE_COPYRIGHT_USE_INTERVALS=2.
* patch.man: Always use \(co, so that update-copyright
updates these dates.
* src/version.c: Correct Larry Wall copyright years.
Since the code is identical when just checking if a utility is present on
the system or not, we can factorize it.
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
* src/util.c (create_backup): Document patch's backup file logic.
(create_backup, create_backup_copy): Add a flag to remember the backup
file; use when a patch deletes a file.
(move_file, copy_file): Better error messages.
* tests/Makefile.am (TESTS): Remove remember-backup-files-2.
* tests/remember-backup-files: Add tests from remember-backup-files-2.
* tests/symlinks: Add a symlink backup file test.
* tests/test-lib.sh: Flag tests with missing pre-requirements as
SKIPped instead of PASSed. Do not use GNU diff extensions, but
still require a diff that understands "-u".
* tests: Do not unnecessarily require GNU diff in a lot of tests.
Make the sed utility optional.
* src/patch.c (main): Refuse to patch read-only files, or at least warn
when patching such files with --force or --batch.
* patch.man: Document the changed behavior.
* tests/read-only-files: Split read-only file test case off from
tests/remember-backup-files.
* tests/Makefile.am: Add new test case.