From dada1e24efe0706204892ae28b2ca706d02ed305 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 13 Jun 2020 23:03:15 +0200 Subject: [PATCH] remove now official helpers --- manifest.json | 6 +- scripts/_common.sh | 2 - scripts/_experimental.sh | 177 --------------------------------------- scripts/install | 1 - scripts/remove | 1 - scripts/restore | 1 - 6 files changed, 3 insertions(+), 185 deletions(-) delete mode 100644 scripts/_experimental.sh diff --git a/manifest.json b/manifest.json index c44e391..140641e 100644 --- a/manifest.json +++ b/manifest.json @@ -3,8 +3,8 @@ "id": "gitlab-runner", "packaging_format": 1, "description": { - "en": "GitLab Runner is a continuous integration tool to use with a GitLab instance (YNH or not).", - "fr": "GitLab Runner est un outil d'intégration continue à utiliser avec une instance GitLab (YNH ou non)." + "en": "Continuous integration tool to use with a GitLab instance (YNH or not).", + "fr": "Outil d'intégration continue à utiliser avec une instance GitLab (YNH ou non)." }, "version": "13.0.0~ynh1", "url": "https://gitlab.com/gitlab-org/gitlab-runner", @@ -14,7 +14,7 @@ "email": "pierre@kayou.io" }, "requirements": { - "yunohost": ">= 3.4" + "yunohost": ">= 3.8.1" }, "multi_instance": false, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 997ab9b..b511496 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -92,8 +92,6 @@ ynh_backup_before_action () { # EXPERIMENTAL HELPERS #================================================= -# Moved to _experimental.sh because of a bug of linter - #================================================= # FUTURE OFFICIAL HELPERS #================================================= diff --git a/scripts/_experimental.sh b/scripts/_experimental.sh deleted file mode 100644 index 6ebdc18..0000000 --- a/scripts/_experimental.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -# Pin a repository. -# -# usage: ynh_pin_repo --package=packages --pin=pin_filter --priority=priority_value [--name=name] [--append] -# | arg: -p, --package - Packages concerned by the pin. Or all, *. -# | arg: -i, --pin - Filter for the pin. -# | arg: -p, --priority - Priority for the pin -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -# -# See https://manpages.debian.org/stretch/apt/apt_preferences.5.en.html for information about pinning. -# -ynh_pin_repo () { - # Declare an array to define the options of this helper. - local legacy_args=pirna - declare -Ar args_array=( [p]=package= [i]=pin= [r]=priority= [n]=name= [a]=append ) - local package - local pin - local priority - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - package="${package:-*}" - priority=${priority:-50} - name="${name:-$app}" - append=${append:-0} - - if [ $append -eq 1 ] - then - append="tee -a" - else - append="tee" - fi - - mkdir -p "/etc/apt/preferences.d" - echo "Package: $package -Pin: $pin -Pin-Priority: $priority" \ - | $append "/etc/apt/preferences.d/$name" -} - -# Add a repository. -# -# usage: ynh_add_repo --uri=uri --suite=suite --component=component [--name=name] [--append] -# | arg: -u, --uri - Uri of the repository. -# | arg: -s, --suite - Suite of the repository. -# | arg: -c, --component - Component of the repository. -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -# -# Example for a repo like deb http://forge.yunohost.org/debian/ stretch stable -# uri suite component -# ynh_add_repo --uri=http://forge.yunohost.org/debian/ --suite=stretch --component=stable -# -ynh_add_repo () { - # Declare an array to define the options of this helper. - local legacy_args=uscna - declare -Ar args_array=( [u]=uri= [s]=suite= [c]=component= [n]=name= [a]=append ) - local uri - local suite - local component - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - append=${append:-0} - - if [ $append -eq 1 ] - then - append="tee -a" - else - append="tee" - fi - - mkdir -p "/etc/apt/sources.list.d" - # Add the new repo in sources.list.d - echo "deb $uri $suite $component" \ - | $append "/etc/apt/sources.list.d/$name.list" -} - -# Add an extra repository correctly, pin it and get the key. -# -# usage: ynh_install_extra_repo --repo="repo" [--key=key_url] [--name=name] [--append] -# | arg: -r, --repo - Complete url of the extra repository. -# | arg: -k, --key - url to get the public key. -# | arg: -n, --name - Name for the files for this repo, $app as default value. -# | arg: -a, --append - Do not overwrite existing files. -ynh_install_extra_repo () { - # Declare an array to define the options of this helper. - local legacy_args=rkna - declare -Ar args_array=( [r]=repo= [k]=key= [n]=name= [a]=append ) - local repo - local key - local name - local append - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - append=${append:-0} - key=${key:-0} - - if [ $append -eq 1 ] - then - append="--append" - wget_append="tee -a" - else - append="" - wget_append="tee" - fi - - # Split the repository into uri, suite and components. - # Remove "deb " at the beginning of the repo. - repo="${repo#deb }" - - # Get the uri - local uri="$(echo "$repo" | awk '{ print $1 }')" - - # Get the suite - local suite="$(echo "$repo" | awk '{ print $2 }')" - - # Get the components - local component="${repo##$uri $suite }" - - # Add the repository into sources.list.d - ynh_add_repo --uri="$uri" --suite="$suite" --component="$component" --name="$name" $append - - # Pin the new repo with the default priority, so it won't be used for upgrades. - # Build $pin from the uri without http and any sub path - local pin="${uri#*://}" - pin="${pin%%/*}" - ynh_pin_repo --package="*" --pin="origin \"$pin\"" --name="$name" $append - - # Get the public key for the repo - if [ -n "$key" ] - then - mkdir -p "/etc/apt/trusted.gpg.d" - if [[ "$(basename "$key")" =~ ".asc" ]] - then - local key_ext=asc - else - local key_ext=gpg - fi - wget -q "$key" -O - | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.$key_ext > /dev/null - fi - - # Update the list of package with the new repo - ynh_package_update -} - -# Remove an extra repository and the assiociated configuration. -# -# usage: ynh_remove_extra_repo [--name=name] -# | arg: -n, --name - Name for the files for this repo, $app as default value. -ynh_remove_extra_repo () { - # Declare an array to define the options of this helper. - local legacy_args=n - declare -Ar args_array=( [n]=name= ) - local name - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - name="${name:-$app}" - - ynh_secure_remove "/etc/apt/sources.list.d/$name.list" - ynh_secure_remove "/etc/apt/preferences.d/$name" - ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.gpg" - ynh_secure_remove "/etc/apt/trusted.gpg.d/$name.asc" - - # Update the list of package to exclude the old repo - ynh_package_update -} diff --git a/scripts/install b/scripts/install index a8228b6..c039cdf 100755 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source _experimental.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/remove b/scripts/remove index f69b473..ae8a4f1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -7,7 +7,6 @@ #================================================= source _common.sh -source _experimental.sh source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/restore b/scripts/restore index af8f229..b42b306 100755 --- a/scripts/restore +++ b/scripts/restore @@ -8,7 +8,6 @@ #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source ../settings/scripts/_experimental.sh source /usr/share/yunohost/helpers #=================================================