diff --git a/scripts/install b/scripts/install index ae48ed6..e52e0f6 100644 --- a/scripts/install +++ b/scripts/install @@ -38,11 +38,12 @@ ynh_app_setting_set $app path $path ynh_app_setting_set $app admin $admin # Copy files to the right place -version=$(cat ../conf/upstream_version) -sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O ../phpMyAdmin.tar.gz -#sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo cp -r ../phpMyAdmin-$version-all-languages/* $final_path +version=$(cat ../sources/upstream_version) +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O phpMyAdmin-$version-all-languages.tar.gz +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz.sha256 -O phpMyAdmin-$version-all-languages.tar.gz.sha256 +sudo sha256sum -c phpMyAdmin-$version-all-languages.tar.gz.sha256 --status || (echo "Corrupt source" >&2 && false) +sudo tar xzf phpMyAdmin-$version-all-languages.tar.gz -C ../sources/ > /dev/null 2>&1 +sudo cp -r ../sources/phpMyAdmin-$version-all-languages/* $final_path # Create db #GENERATE_DB $app # Créer une base de données et un utilisateur dédié au nom de l'app. diff --git a/scripts/upgrade b/scripts/upgrade index f45be58..a5d8183 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,11 +18,12 @@ db_user=$(ynh_app_setting_get $app db_user) CHECK_PATH # Vérifie et corrige la syntaxe du path. # Copy files to the right place -version=$(cat ../conf/upstream_version) -sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O ../phpMyAdmin.tar.gz -#sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo tar xvzf ../phpMyAdmin.tar.gz -C .. > /dev/null 2>&1 -sudo cp -r ../phpMyAdmin-$version-all-languages/* $final_path +version=$(cat ../sources/upstream_version) +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz -O phpMyAdmin-$version-all-languages.tar.gz +sudo wget -nv https://files.phpmyadmin.net/phpMyAdmin/$version/phpMyAdmin-$version-all-languages.tar.gz.sha256 -O phpMyAdmin-$version-all-languages.tar.gz.sha256 +sudo sha256sum -c phpMyAdmin-$version-all-languages.tar.gz.sha256 --status || (echo "Corrupt source" >&2 && false) +sudo tar xzf phpMyAdmin-$version-all-languages.tar.gz -C ../sources/ > /dev/null 2>&1 +sudo cp -r ../sources/phpMyAdmin-$version-all-languages/* $final_path # Update tables sudo sed -i "s@phpmyadmin@$db_user@g" $final_path/sql/upgrade_column_info_4_3_0+.sql diff --git a/conf/upstream_version b/sources/upstream_version similarity index 100% rename from conf/upstream_version rename to sources/upstream_version