mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers.v2.1/utils: ynh_setup_source : replace --full_replace with --merge_with_existing, making cleanup before installation the default behaviour.
This commit is contained in:
parent
e510f0da88
commit
f2696fddab
1 changed files with 11 additions and 11 deletions
|
@ -60,7 +60,7 @@
|
||||||
# - Uncompress the archive to `$dest_dir`.
|
# - Uncompress the archive to `$dest_dir`.
|
||||||
# - If `in_subdir` is true, the first level directory of the archive will be removed.
|
# - If `in_subdir` is true, the first level directory of the archive will be removed.
|
||||||
# - If `in_subdir` is a numeric value, the N first level directories will be removed.
|
# - If `in_subdir` is a numeric value, the N first level directories will be removed.
|
||||||
# - Patches named `sources/patches/${src_id}-*.patch` will be applied to `$dest_dir`
|
# - Patches named `sources/patches/${src_id}/*.patch` will be applied to `$dest_dir`
|
||||||
# - Extra files in `sources/extra_files/$src_id` will be copied to dest_dir
|
# - Extra files in `sources/extra_files/$src_id` will be copied to dest_dir
|
||||||
#
|
#
|
||||||
# Requires YunoHost version 2.6.4 or higher.
|
# Requires YunoHost version 2.6.4 or higher.
|
||||||
|
@ -261,17 +261,17 @@ ynh_setup_source() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply patches
|
# Apply patches
|
||||||
if [ -d "$YNH_APP_BASEDIR/sources/patches/" ]; then
|
local patches_folder=$(realpath "$YNH_APP_BASEDIR/patches/$source_id")
|
||||||
local patches_folder=$(realpath $YNH_APP_BASEDIR/sources/patches/)
|
if [ -d "$patches_folder" ]; then
|
||||||
if (($(find $patches_folder -type f -name "${source_id}-*.patch" 2>/dev/null | wc --lines) > "0")); then
|
|
||||||
pushd "$dest_dir"
|
pushd "$dest_dir"
|
||||||
for p in $patches_folder/${source_id}-*.patch; do
|
for patchfile in "$patches_folder/"*.patch; do
|
||||||
echo $p
|
echo "$patchfile"
|
||||||
patch --strip=1 <$p || ynh_print_warn --message="Packagers /!\\ patch $p failed to apply"
|
if ! patch --strip=1 < "$patchfile"; then
|
||||||
|
ynh_print_warn --message="Warn your packagers /!\\ patch $patchfile failed to apply"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Add supplementary files
|
# Add supplementary files
|
||||||
if test -e "$YNH_APP_BASEDIR/sources/extra_files/${source_id}"; then
|
if test -e "$YNH_APP_BASEDIR/sources/extra_files/${source_id}"; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue