diff --git a/scripts/install b/scripts/install index add99ff..fd3a33f 100644 --- a/scripts/install +++ b/scripts/install @@ -166,22 +166,22 @@ ynh_store_file_checksum --file="$config_path/gitlab.rb" #================================================= ynh_script_progression --message="Setting up source files..." --weight=200 - source ./upgrade.d/upgrade.last.sh - cp ../conf/$architecture.src.default ../conf/$architecture.src - ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src" - ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="../conf/$architecture.src" +source ./upgrade.d/upgrade.last.sh +cp ../conf/$architecture.src.default ../conf/$architecture.src +ynh_replace_string --match_string="__VERSION__" --replace_string="$gitlab_version" --target_file="../conf/$architecture.src" +ynh_replace_string --match_string="__SOURCE_FILENAME__" --replace_string="$gitlab_filename" --target_file="../conf/$architecture.src" - if [ $architecture = "x86-64" ]; then - ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_x86_64_source_sha256" --target_file="../conf/$architecture.src" - elif [ $architecture = "arm" ]; then - ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src" - fi +if [ $architecture = "x86-64" ]; then + ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_x86_64_source_sha256" --target_file="../conf/$architecture.src" +elif [ $architecture = "arm" ]; then + ynh_replace_string --match_string="__SHA256_SUM__" --replace_string="$gitlab_arm_source_sha256" --target_file="../conf/$architecture.src" +fi tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; 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" diff --git a/scripts/restore b/scripts/restore index beb4807..1a33749 100644 --- a/scripts/restore +++ b/scripts/restore @@ -113,7 +113,7 @@ tempdir="$(mktemp -d)" ynh_setup_source --dest_dir=$tempdir --source_id=$architecture -if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then +if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; 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" diff --git a/scripts/upgrade b/scripts/upgrade index 69ab4a8..ccca20b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -250,7 +250,7 @@ then ynh_setup_source --dest_dir=$tempdir --source_id=$architecture - if [ ${PACKAGE_CHECK_EXEC:-0} -eq 0 ]; then + if [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; 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"