support/scripts/apply-patches.sh: do not blindly remove *.orig files
authorPeter Korsgaard <peter@korsgaard.com>
Tue, 6 Oct 2020 20:46:20 +0000 (22:46 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Tue, 6 Oct 2020 21:40:25 +0000 (23:40 +0200)
commit42f61e759a977d75a2c8a1580c3187c92e155b04
tree2bb805a3ca945b3eab9c6e257b4bc26761b1e695
parent3930fd2ddd290a275b1ec707088becdbcde0fef4
support/scripts/apply-patches.sh: do not blindly remove *.orig files

apply-patches currently blindly removes *.orig / .*.orig files as GNU patch
by default writes these as backup files when patches only apply with fuzz.

This is unfortunate as package sources may contain files ending in .orig as
well, breaking the build.  Luckily GNU patch can be told to not write these
backup files using the --no-backup-if-mismatch option, so used that instead
of the .orig removal step.

--no-backup-if-mismatch is supported since GNU patch 2.3.8 (1997-06-17) and
busybox patch if built with CONFIG_DESKTOP, but E.G.  isn't supported by the
BSD patch, so add logic to dependencies.sh to error out if patch doesn't
support the flag.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
support/dependencies/dependencies.sh
support/scripts/apply-patches.sh