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>
* 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.
When a patch references a file more than once, patch may override
reject files it had just created.
Avoid this by first checking whether we have created reject files
ourselves, and append to such files instead of overwriting them in
that case. (This is similar to the backup file case except that
in the backup case, we must skip creating another backup instead
of appending.)