From d84a7877a0ecffa9f04cf2de3b0816e3561a2312 Mon Sep 17 00:00:00 2001 From: Cthulhux Date: Fri, 25 Sep 2020 16:40:56 +0200 Subject: [PATCH 1/3] Support for pkgsrc --- version | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/version b/version index e9ead60..c8911e9 100755 --- a/version +++ b/version @@ -340,6 +340,27 @@ function try_pip { fi } +function try_pkgin { + # is pkgin installed? + command -v pkgin &> /dev/null + if [ $? -ne 0 ] + then + return + fi + + # pip is installed. let's try it + echo " checking pkgin..." + + # pkgin returns a list of all installed applications + lines=$(pkgin list 2>/dev/null | grep -Ece ^$1) + if [ $lines -gt 0 ] + then + result="$(pkgin list $1 2>/dev/null | grep -Ee ^$1)" + echo $result | sed -Ene "s/^$1\-([[:graph:]]*).*/$1 version: \1/p" + exit + fi +} + function try_brew { # is brew installed? command -v brew &> /dev/null @@ -428,6 +449,7 @@ then try_npm $1 try_pip $1 try_brew $1 + try_pkgin $1 # should only get here if neither pacman or apt are installed echo "version was unable to find any info on '$1'" From c2a9d24e52215d0918697801d0bb139d2a8dd559 Mon Sep 17 00:00:00 2001 From: Cthulhux Date: Fri, 25 Sep 2020 16:43:19 +0200 Subject: [PATCH 2/3] removing pointless parameter --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index c8911e9..47873c3 100755 --- a/version +++ b/version @@ -355,7 +355,7 @@ function try_pkgin { lines=$(pkgin list 2>/dev/null | grep -Ece ^$1) if [ $lines -gt 0 ] then - result="$(pkgin list $1 2>/dev/null | grep -Ee ^$1)" + result="$(pkgin list 2>/dev/null | grep -Ee ^$1)" echo $result | sed -Ene "s/^$1\-([[:graph:]]*).*/$1 version: \1/p" exit fi From 416b788349d9e04568b38e579ef56c2d79067379 Mon Sep 17 00:00:00 2001 From: Cthulhux Date: Mon, 28 Sep 2020 07:40:59 +0200 Subject: [PATCH 3/3] Update version Nobody has seen this.. --- version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version b/version index 47873c3..1294a23 100755 --- a/version +++ b/version @@ -348,7 +348,7 @@ function try_pkgin { return fi - # pip is installed. let's try it + # pkgin is installed. let's try it echo " checking pkgin..." # pkgin returns a list of all installed applications