Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pkgsrc #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions version
Original file line number Diff line number Diff line change
Expand Up @@ -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

# pkgin 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 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
Expand Down Expand Up @@ -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'"
Expand Down