From c4f56db3216493f524da1dda5d4c94e31ba65f4b Mon Sep 17 00:00:00 2001 From: yalh76 Date: Wed, 17 Apr 2019 22:47:36 +0200 Subject: [PATCH 1/3] Update _common.sh --- scripts/_common.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 926b5524..c084b21c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -96,6 +96,9 @@ ynh_install_php () { ynh_add_app_dependencies --package="php${phpversion}-fpm" ynh_add_app_dependencies --package="php$phpversion php${phpversion}-common $package" + # Set php7.0 back as the default version for php-cli. + update-alternatives --set php /usr/bin/php7.0 + # Remove this extra repository after packages are installed ynh_remove_extra_repo --name=extra_php_version From 5dee139197f49202c197fc519f765a65c30dfc2a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 18 Apr 2019 12:03:56 +0200 Subject: [PATCH 2/3] update to v0.9.0 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 17bc4fa1..b5264f78 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to ## Overview The federated image sharing service Pixelfed, for YunoHost -**Shipped version:** 0.8.6 +**Shipped version:** 0.9.0 I'm waiting for an official release (alpha/beta or stable) to invest more time on this package. Don't hesitate to give a hand if you wish, I assume only the nginx file needs improvments. diff --git a/conf/app.src b/conf/app.src index a62243bc..d492ccde 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.8.6.tar.gz -SOURCE_SUM=56acbfe18752693d3312207d6955e65c9f6aa73c7e801a224248b2d4b8e2884f +SOURCE_URL=https://github.com/pixelfed/pixelfed/archive/v0.9.0.tar.gz +SOURCE_SUM=ea69f3441991c9122638b1476ba11ec1b7847fac569fa77a8ed7b03481b19d88 OURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true \ No newline at end of file diff --git a/manifest.json b/manifest.json index ef4cd63b..bcf4123e 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "ActivityPub Federated Image Sharing" }, - "version": "0.8.6~ynh2", + "version": "0.9.0~ynh1", "url": "https://pixelfed.org/", "license": "AGPL-3.0-or-later", "maintainer": { From 6f57b3db7c7fbaa5653523bcbd8796a4e71c6a85 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 23 Apr 2019 15:17:50 +0200 Subject: [PATCH 3/3] Define phpversion for composer to fix error: Your requirements could not be resolved to an installable set of packages --- scripts/_common.sh | 21 ++++++++++++--------- scripts/install | 6 +++++- scripts/upgrade | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index c084b21c..7263215e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -21,13 +21,14 @@ extra_pkg_dependencies="php7.2-bcmath php7.2-cli php7.2-curl php7.2-exif php7.2- # Execute a command with Composer # -# usage: ynh_composer_exec [--workdir=$final_path] --commands="commands" +# usage: ynh_composer_exec --phpversion=phpversion [--workdir=$final_path] --commands="commands" # | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. # | arg: -c, --commands - Commands to execute. ynh_composer_exec () { # Declare an array to define the options of this helper. - local legacy_args=wc - declare -Ar args_array=( [w]=workdir= [c]=commands= ) + local legacy_args=vwc + declare -Ar args_array=( [v]=phpversion= [w]=workdir= [c]=commands= ) + local phpversion local workdir local commands # Manage arguments with getopts @@ -35,18 +36,19 @@ ynh_composer_exec () { workdir="${workdir:-$final_path}" COMPOSER_HOME="$workdir/.composer" \ - php "$workdir/composer.phar" $commands \ + php${phpversion} "$workdir/composer.phar" $commands \ -d "$workdir" --quiet --no-interaction } # Install and initialize Composer in the given directory # -# usage: ynh_install_composer [--workdir=$final_path] +# usage: ynh_install_composer --phpversion=phpversion [--workdir=$final_path] # | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. ynh_install_composer () { # Declare an array to define the options of this helper. - local legacy_args=w - declare -Ar args_array=( [w]=workdir= ) + local legacy_args=vw + declare -Ar args_array=( [v]=phpversion= [w]=workdir= ) + local phpversion local workdir # Manage arguments with getopts ynh_handle_getopts_args "$@" @@ -54,14 +56,15 @@ ynh_install_composer () { curl -sS https://getcomposer.org/installer \ | COMPOSER_HOME="$workdir/.composer" \ - php -- --quiet --install-dir="$workdir" \ + php${phpversion} -- --quiet --install-dir="$workdir" \ || ynh_die "Unable to install Composer." # update dependencies to create composer.lock - ynh_composer_exec --workdir="$workdir" --commands="install --no-dev" \ + ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev" \ || ynh_die "Unable to update core dependencies with Composer." } + # Install another version of php. # # usage: ynh_install_php --phpversion=phpversion [--package=packages] diff --git a/scripts/install b/scripts/install index 10818d58..c30abeba 100644 --- a/scripts/install +++ b/scripts/install @@ -13,6 +13,10 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= +ynh_clean_setup () { + ### Remove this function if there's nothing to clean before calling the remove script. + read -p "key" +} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -117,7 +121,7 @@ ynh_add_fpm_config --phpversion="7.2" chown -R "$app": "$final_path" -ynh_install_composer --workdir="$final_path" +ynh_install_composer --phpversion="7.2" --workdir="$final_path" #================================================= # SPECIFIC SETUP diff --git a/scripts/upgrade b/scripts/upgrade index 775e04db..ae91acb7 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,7 +132,7 @@ ynh_add_fpm_config --phpversion="7.2" chown -R "$app": "$final_path" -ynh_install_composer --workdir="$final_path" +ynh_install_composer --phpversion="7.2" --workdir="$final_path" #================================================= # DEPLOYMENT