[fix] First source patches failure doesn't stop app script

This commit is contained in:
ljf (zamentur) 2023-12-15 01:23:49 +01:00
parent c0337bf1ef
commit 770fdb6861

View file

@ -351,13 +351,12 @@ ynh_setup_source() {
if [ -d "$YNH_APP_BASEDIR/sources/patches/" ]; then if [ -d "$YNH_APP_BASEDIR/sources/patches/" ]; then
local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/) local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/)
if (($(find $patches_folder -type f -name "${source_id}-*.patch" 2>/dev/null | wc --lines) > "0")); then if (($(find $patches_folder -type f -name "${source_id}-*.patch" 2>/dev/null | wc --lines) > "0")); then
( pushd "$dest_dir"
cd "$dest_dir" for p in $patches_folder/${source_id}-*.patch; do
for p in $patches_folder/${source_id}-*.patch; do echo $p
echo $p patch --strip=1 <$p || ynh_die --message="Unable to apply patches"
patch --strip=1 <$p done
done popd
) || ynh_die --message="Unable to apply patches"
fi fi
fi fi