diff options
author | j1simon | 2019-06-25 11:37:06 +0200 |
---|---|---|
committer | j1simon | 2019-06-25 11:37:06 +0200 |
commit | da083386b8fec0e21ac54b62af747330a2db1bb5 (patch) | |
tree | acaf07d1762081803cbfb93bc508aa049f2c7dee | |
parent | 88fc204a2d1cfce84161a86985a1448547a3c474 (diff) | |
download | aur-da083386b8fec0e21ac54b62af747330a2db1bb5.tar.gz |
Supressed linux depends and added kernel check version in .install
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | gosearch.install | 51 |
3 files changed, 51 insertions, 14 deletions
@@ -1,14 +1,13 @@ pkgbase = gosearch-git - pkgdesc = A fast, real-time file searching program for linux - pkgver = r49.f8254a3 - pkgrel = 2 + pkgdesc = A fast, real-time file searching program for linux (Linux 5.1+) + pkgver = r51.10a3ea1 + pkgrel = 1 url = https://github.com/ozeidan/gosearch install = gosearch.install arch = x86_64 license = GPL3 makedepends = go-pie makedepends = git - depends = linux>=5.1 provides = gosearch conflicts = gosearch source = gosearch-git::git+https://github.com/ozeidan/gosearch @@ -1,14 +1,13 @@ # Maintainer: Juan Simón <play4pro@protonmail.com> pkgname=gosearch-git -pkgver=r49.f8254a3 -pkgrel=2 -pkgdesc="A fast, real-time file searching program for linux" +pkgver=r51.10a3ea1 +pkgrel=1 +pkgdesc="A fast, real-time file searching program for linux (Linux 5.1+)" url="https://github.com/ozeidan/gosearch" arch=('x86_64') license=('GPL3') makedepends=(go-pie git) -depends=('linux>=5.1') provides=("${pkgname%-git}") conflicts=("${provides[@]}") source=("${pkgname}::git+${url}") diff --git a/gosearch.install b/gosearch.install index e069800ced3a..662dedec180a 100644 --- a/gosearch.install +++ b/gosearch.install @@ -1,17 +1,56 @@ +colorize() { + # prefer terminal safe colored and bold text when tput is supported + if tput setaf 0 &>/dev/null; then + ALL_OFF="$(tput sgr0)" + BOLD="$(tput bold)" + BLUE="${BOLD}$(tput setaf 4)" + GREEN="${BOLD}$(tput setaf 2)" + RED="${BOLD}$(tput setaf 1)" + YELLOW="${BOLD}$(tput setaf 3)" + else + ALL_OFF="\e[0m" + BOLD="\e[1m" + BLUE="${BOLD}\e[34m" + GREEN="${BOLD}\e[32m" + RED="${BOLD}\e[31m" + YELLOW="${BOLD}\e[33m" + fi + readonly ALL_OFF BOLD BLUE GREEN RED YELLOW +} + +error() { + colorize + local mesg=$1; shift + printf "\n${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n\n" "$@" >&2 +} + +cmp_krnl_ver() { + # check kernel version installed + local krnl_ver="$(uname -r)" + local compare="$(printf "5.1\n$krnl_ver")" + if [ "$compare" != "$(sort --version-sort <<< "$compare")" ]; then + error "This program needs kernel version >= 5.1 \nand the current installed version is $krnl_ver" + fi +} + post_install() { - systemctl enable gosearch.service - systemctl start gosearch.service + cmp_krnl_ver + + systemctl enable gosearch.service + systemctl start gosearch.service } pre_upgrade() { - systemctl stop gosearch.service + systemctl stop gosearch.service } post_upgrade() { - systemctl daemon-reload - systemctl start gosearch.service + cmp_krnl_ver + + systemctl daemon-reload + systemctl start gosearch.service } pre_remove() { - systemctl stop gosearch.service + systemctl stop gosearch.service } |