From 9da1fa4979079e4052175f1fd52d518ecd2c5759 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Holcroft Date: Fri, 6 Oct 2017 10:37:19 +0200 Subject: [PATCH] Correct typo in common, add armhf for raspberry, and comply with YEP-1.3 & YEP-2.4 --- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/backup | 3 +-- scripts/install | 3 +++ scripts/restore | 8 +------- scripts/upgrade | 3 ++- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/manifest.json b/manifest.json index 04132f4..ccfe9bd 100644 --- a/manifest.json +++ b/manifest.json @@ -10,7 +10,7 @@ }, "version": "2.16.0", "url": "https://weblate.org", - "license": "GNU GPL-3, or any later version.", + "license": "AGPL-3.0", "maintainer": { "name": "Jean-Baptiste Holcroft", "email": "jean-baptiste@holcroft.fr" diff --git a/scripts/_common.sh b/scripts/_common.sh index 88b232f..4384a8a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,7 +10,7 @@ ynh_psql_test_if_first_run() { systemctl start postgresql su --command="psql -c\"ALTER user postgres WITH PASSWORD '${pgsql}'\"" postgres # we can't use peer since YunoHost create users with nologin - sed -i '/local\s*all\s*all\s*peer/i + sed -i '/local\s*all\s*all\s*peer/i \ local all all password' /etc/postgresql/9.4/main/pg_hba.conf systemctl enable postgresql systemctl reload postgresql diff --git a/scripts/backup b/scripts/backup index 4a235ff..3c52289 100755 --- a/scripts/backup +++ b/scripts/backup @@ -6,8 +6,7 @@ # MANAGE SCRIPT FAILURE #================================================= -# Exit on command errors and treat access to unset variables as an error -set -eu +ynh_abort_if_errors #================================================= # IMPORT GENERIC HELPERS diff --git a/scripts/install b/scripts/install index 6264ff3..11ac7b8 100755 --- a/scripts/install +++ b/scripts/install @@ -116,6 +116,9 @@ chsh --shell /bin/bash "$app" #================================================= arch=$(dpkg --print-architecture) +# Rasberry Pi: Debian armhf (ARM hard float) refers to the ARMv7 +[[ $arch = "armhf" ]] && arch="arm" + version="hub-linux-${arch}-2.3.0-pre10" file_bin="hub-linux-${arch}-2.3.0-pre10.tgz" wget --quiet "https://github.com/github/hub/releases/download/v2.3.0-pre10/${file_bin}" diff --git a/scripts/restore b/scripts/restore index f0909a6..0ab61e6 100755 --- a/scripts/restore +++ b/scripts/restore @@ -6,18 +6,12 @@ # MANAGE SCRIPT FAILURE #================================================= -# Exit on command errors and treat access to unset variables as an error -set -eu +ynh_abort_if_errors #================================================= # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Get the _common.sh file if it's not in the current directory - cp ../settings/scripts/_common.sh ./_common.sh - chmod a+rx _common.sh -fi source _common.sh source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index 72ec4db..fe18bff 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,10 +5,11 @@ #================================================= # IMPORT GENERIC HELPERS #================================================= -set -eu source _common.sh source /usr/share/yunohost/helpers +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #=================================================