From 97b0e23484f013d3478cc77bad73ac2ec2afa52e Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sun, 12 May 2019 00:30:18 +0200 Subject: [PATCH] Use PACKAGE_CHECK_EXEC variable --- scripts/_common.sh | 8 -------- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index cfe8cdb..f8ec859 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,14 +6,6 @@ pkg_dependencies="openssh-server" -#================================================= -# PACKAGE CHECK BYPASSING... -#================================================= - -IS_PACKAGE_CHECK () { - return $(env | grep -c container=lxc) -} - #================================================= # BOOLEAN CONVERTER #================================================= diff --git a/scripts/install b/scripts/install index c55991e..ba52a59 100644 --- a/scripts/install +++ b/scripts/install @@ -185,7 +185,7 @@ tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture -if IS_PACKAGE_CHECK; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_exec_warn_less dpkg --configure gitlab-ce diff --git a/scripts/restore b/scripts/restore index 601e1bb..f370e86 100644 --- a/scripts/restore +++ b/scripts/restore @@ -117,7 +117,7 @@ tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture -if IS_PACKAGE_CHECK; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_exec_warn_less dpkg --configure gitlab-ce diff --git a/scripts/upgrade b/scripts/upgrade index 5978325..5312cdf 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -254,7 +254,7 @@ then ynh_setup_source --dest_dir=$tempdir --source_id=$architecture - if IS_PACKAGE_CHECK; then + if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then if ! ynh_exec_warn_less dpkg -i $tempdir/$gitlab_filename ; then # This command will fail in lxc env ynh_replace_string --match_string="command \"cat \/etc\/sysctl.conf \/etc\/sysctl.d\/\*.conf | sysctl -e -p -\"" --replace_string="command \"cat \/etc\/sysctl.conf\"" --target_file="$final_path/embedded/cookbooks/package/resources/sysctl.rb" ynh_exec_warn_less dpkg --configure gitlab-ce