From 5263ae0848a7e7f3540543e300dbf8320a47ce6e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 22 Aug 2021 14:13:53 +0200 Subject: [PATCH] Less warnings --- scripts/install | 4 +++- scripts/remove | 2 +- scripts/restore | 8 ++++---- scripts/upgrade | 14 +++----------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/scripts/install b/scripts/install index 71b5141..656da08 100755 --- a/scripts/install +++ b/scripts/install @@ -178,7 +178,7 @@ ynh_secure_remove --file="$final_path/build-imagemagick" # Install rustup with the toolchain needed by pict-rs pushd "$final_path" - sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" @@ -190,6 +190,8 @@ popd mkdir -p "$final_path/pict-rs/" mv -f "$final_path/build-pict-rs/target/release/pict-rs" "$final_path/pict-rs/pict-rs" ynh_secure_remove --file="$final_path/build-pict-rs" + +# Remove rustup ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.rustup" diff --git a/scripts/remove b/scripts/remove index 09a217d..4086ae0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -92,7 +92,7 @@ ynh_script_progression --message="Removing dependencies..." # Remove metapackage and its dependencies ynh_remove_nodejs ynh_remove_app_dependencies -rm /lib/libc.musl-x86_64.so.1 +ynh_secure_remove --file="/lib/libc.musl-x86_64.so.1" #================================================= # REMOVE APP MAIN DIR diff --git a/scripts/restore b/scripts/restore index 9bb22a0..f86cd16 100755 --- a/scripts/restore +++ b/scripts/restore @@ -110,10 +110,10 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies $imagemagick_b # Install ImageMagick pushd "$final_path/build-imagemagick/" - ./configure --with-modules - make - make install - ldconfig /usr/local/lib + ynh_exec_warn_less ./configure --with-modules + ynh_exec_warn_less make + ynh_exec_warn_less make install + ynh_exec_warn_less ldconfig /usr/local/lib popd ynh_secure_remove --file="$final_path/build-imagemagick" diff --git a/scripts/upgrade b/scripts/upgrade index a6aae14..fad10dd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,16 +79,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -if ! ynh_permission_exists --permission="admin"; then - # Create the required permissions - ynh_permission_create --permission="admin" --url="/admin" --allowed=$admin -fi - -# Create a permission if needed -if ! ynh_permission_exists --permission="api"; then - ynh_permission_create --permission="api" --url="/api" --allowed="visitors" --show_tile="false" --protected="true" -fi - #================================================= # CREATE DEDICATED USER #================================================= @@ -174,7 +164,7 @@ then # Install rustup with the toolchain needed by pict-rs pushd "$final_path" - sudo -u "$app" RUSTUP_HOME="$final_path"/.rustup CARGO_HOME="$final_path"/.cargo bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' + ynh_exec_warn_less sudo -u "$app" RUSTUP_HOME="$final_path/.rustup" CARGO_HOME="$final_path/.cargo" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain nightly' popd export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin" @@ -186,6 +176,8 @@ then mkdir -p "$final_path/pict-rs/" mv -f "$final_path/build-pict-rs/target/release/pict-rs" "$final_path/pict-rs/pict-rs" ynh_secure_remove --file="$final_path/build-pict-rs" + + # Remove rustup ynh_secure_remove --file="$final_path/.cargo" ynh_secure_remove --file="$final_path/.rustup"