spk diff lib/libspk.sh @ rev 104
changed several tools to use lib functions
author | Christian Mesh <meshca@clarkson.edu> |
---|---|
date | Sat Jun 02 18:48:02 2012 -0500 (2012-06-02) |
parents | f017035fd1f5 |
children | c27b19df240c |
line diff
1.1 --- a/lib/libspk.sh Sat Jun 02 18:17:00 2012 -0500 1.2 +++ b/lib/libspk.sh Sat Jun 02 18:48:02 2012 -0500 1.3 @@ -244,7 +244,7 @@ 1.4 # Usage: check_installed package 1.5 check_installed() { 1.6 local name="$1" 1.7 - if [ -d "$installed/$name" ]; then 1.8 + if is_package_installed $name; then 1.9 echo $(boldify "$name") $(gettext "package is already installed") 1.10 [ "$forced" ] || rm -rf $tmpdir 1.11 continue 1.12 @@ -258,14 +258,14 @@ 1.13 if echo $i | fgrep -q : ; then 1.14 # format 'alternative:newname' 1.15 # if alternative is installed then substitute newname 1.16 - if [ -f $installed/${i%:*}/receipt ]; then 1.17 + if is_package_installed ${i%:*}; then 1.18 # substitute package dependancy 1.19 echo ${i#*:} 1.20 return 1.21 fi 1.22 else 1.23 # if alternative is installed then nothing to install 1.24 - if [ -f $installed/$i/receipt ]; then 1.25 + if is_package_installed $i/receipt; then 1.26 # substitute installed package 1.27 echo $i 1.28 return 1.29 @@ -292,7 +292,7 @@ 1.30 if [ ! -d "$installed/$pkg" ]; then 1.31 gettext "Missing:"; echo " $pkg" 1.32 deps=$(($deps+1)) 1.33 - elif [ ! -f "$installed/$pkg/receipt" ]; then 1.34 + elif [ ! is_package_installed $pkg/receipt ]; then 1.35 gettext "WARNING: Dependency loop between:"; newline 1.36 echo " $package --> $pkg" 1.37 fi