1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/piwigo_ynh.git synced 2024-09-03 20:06:03 +02:00

Upgrade to Piwigo 2.8.5

This commit is contained in:
Jimmy Monin 2017-01-03 18:32:00 +01:00
parent c5d7cfdbf3
commit 86d4bc2833
4 changed files with 35 additions and 15 deletions

View file

@ -5,7 +5,7 @@ Piwigo for YunoHost
Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource. Extensions make Piwigo easily customizable. Icing on the cake, Piwigo is free and opensource.
**Shipped version:** 2.8.3 **Shipped version:** 2.8.5
![](http://piwigo.org/screenshots/homepage/piwigo-batch-manager.png) ![](http://piwigo.org/screenshots/homepage/piwigo-batch-manager.png)

21
scripts/_common.sh Normal file
View file

@ -0,0 +1,21 @@
#
# Common variables
#
# Application version
VERSION="2.8.5"
# Remote URL to fetch application source archive
APPLICATION_SOURCE_URL="http://piwigo.org/download/dlcounter.php?code=${VERSION}"
# Download and extract application sources to the given directory
# usage: extract_application_to DESTDIR
extract_application() {
local DESTDIR=$1
archive="${DESTDIR}/application.zip"
wget -q -O "$archive" "$APPLICATION_SOURCE_URL" \
|| ynh_die "Unable to download application archive"
sudo unzip -qq "$archive" -d "$DESTDIR" \
|| ynh_die "Unable to extract application archive"
rm "$archive"
}

View file

@ -5,6 +5,9 @@ set -eu
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Source local helpers
source ./_common.sh
# Retrieve arguments # Retrieve arguments
domain=$YNH_APP_ARG_DOMAIN domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH path=$YNH_APP_ARG_PATH
@ -30,11 +33,8 @@ ynh_app_setting_set "$app" language "$language"
sudo yunohost app checkurl "${domain}${path}" -a "$app" \ sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|| ynh_die "Path not available: ${domain}${path}" || ynh_die "Path not available: ${domain}${path}"
# Download sources # Download and extract application
sudo wget -q http://piwigo.org/download/dlcounter.php?code=2.8.3 -O piwigo.zip extract_application ..
# Uncompress
sudo unzip -qq piwigo.zip -d ..
# Copy source files # Copy source files
src_path=/var/www/$app src_path=/var/www/$app

View file

@ -1,13 +1,15 @@
#!/bin/bash #!/bin/bash
# =====================
# TODO
# =====================
# Exit on command errors and treat unset variables as an error # Exit on command errors and treat unset variables as an error
set -eu set -eu
shopt -s extglob # sets extended pattern matching options in the bash shell
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Source local helpers
source ./_common.sh
# Source YunoHost helpers # Source YunoHost helpers
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
@ -21,16 +23,13 @@ language=$(ynh_app_setting_get "$app" language)
# Remove trailing "/" for next commands # Remove trailing "/" for next commands
path=${path%/} path=${path%/}
# Download sources # Download and extract application
sudo wget -q http://piwigo.org/download/dlcounter.php?code=2.8.3 -O piwigo.zip extract_application ..
# Uncompress
sudo unzip -qq piwigo.zip -d ../
# Copy source files # Copy source files
src_path=/var/www/$app src_path=/var/www/$app
sudo mkdir -p $src_path sudo mkdir -p $src_path
sudo cp -Raf ../piwigo/. $src_path sudo cp -Raf ../piwigo/!(upload) $src_path
datapath=/home/yunohost.app/$app datapath=/home/yunohost.app/$app