From 147e1f6902ddb288930ec0d6d622e192c6e4d374 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 3 Aug 2008 11:53:19 +0200 Subject: bin/pkg: Added dependencies on perl libraries --- bin/pkg | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bin/pkg b/bin/pkg index 600be8b..bee546f 100755 --- a/bin/pkg +++ b/bin/pkg @@ -272,18 +272,28 @@ check_path_dep () { which $1 > /dev/null } +check_perl_dep () { + perl -M$1 < /dev/null 2> /dev/null +} + check_deps () { [[ -r $PDIR/$1/dependencies ]] || return 0 dependencies=($(cat $PDIR/$1/dependencies)) install=() path_install=() + perl_install=() for dep in $dependencies; { pathdep=${dep#=} + perldep=${dep#perl=} if [[ $dep != $pathdep ]] { if (! check_path_dep $pathdep) { path_install+=$pathdep } + } elif [[ $dep != $perldep ]] { + if (! check_perl_dep $perldep) { + perl_install+=$perldep + } } else { if [[ ! -d $PDIR/$dep ]] { install+=$dep @@ -303,10 +313,16 @@ check_deps () { } if [[ -n $path_install ]] { clear_line - info "$1 has unmet dependencies: " + info "$1 requires the following executables: " echo $path_install echo 'Please make sure these files are within $PATH' } + if [[ -n $perl_install ]] { + clear_line + info "$1 requires the following perl libraries: " + echo $perl_install + echo 'Please make sure they are installed correctly' + } } check_conflicts () { -- cgit v1.2.3