spk rev 101

Clean spk-ls, fix output I broke in libspk
author Christian Mesh <meshca@clarkson.edu>
date Sat Jun 02 18:17:00 2012 -0500 (2012-06-02)
parents 37137af42a77
children adda870c4845
files lib/libspk.sh spk-ls
line diff
     1.1 --- a/lib/libspk.sh	Sat Jun 02 17:58:18 2012 -0500
     1.2 +++ b/lib/libspk.sh	Sat Jun 02 18:17:00 2012 -0500
     1.3 @@ -62,7 +62,7 @@
     1.4  	cat $list | while read package version desc category
     1.5  	do
     1.6  		if [ "$short" ]; then
     1.7 -			colorize 32 "$package"; indent 28 " $version"
     1.8 +			echo $(colorize 32 "$package") $(indent 28 " $version")
     1.9  		else
    1.10  			newline
    1.11  			gettext "Package    :"; colorize 32 " $package"
    1.12 @@ -245,7 +245,7 @@
    1.13  check_installed() {
    1.14  	local name="$1"
    1.15  	if [ -d "$installed/$name" ]; then
    1.16 -		boldify "$name"; gettext "package is already installed"
    1.17 +		echo $(boldify "$name") $(gettext "package is already installed")
    1.18  		[ "$forced" ] || rm -rf $tmpdir
    1.19  		continue
    1.20  	fi
     2.1 --- a/spk-ls	Sat Jun 02 17:58:18 2012 -0500
     2.2 +++ b/spk-ls	Sat Jun 02 18:17:00 2012 -0500
     2.3 @@ -40,18 +40,6 @@
     2.4  	exit 0
     2.5  }
     2.6  
     2.7 -# Source a package receipt
     2.8 -source_receipt() {
     2.9 -	local receipt=$1
    2.10 -	if [ ! -f $receipt ]; then
    2.11 -		echo -n $(colorize 31 "$pkg")
    2.12 -		indent 28 $(gettext "missing receipt")
    2.13 -		continue
    2.14 -	else
    2.15 -		. $receipt
    2.16 -	fi
    2.17 -}
    2.18 -
    2.19  #
    2.20  # Handle --options
    2.21  #
    2.22 @@ -106,7 +94,7 @@
    2.23  			for pkg in $(ls -1 $installed)
    2.24  			do
    2.25  				source_receipt $installed/$pkg/receipt
    2.26 -				echo -n "$(colorize 32 $pkg)"; indent 28 "$VERSION"
    2.27 +				echo -n $(colorize 32 $pkg) $(indent 28 "$VERSION")
    2.28  			done
    2.29  			separator
    2.30  			boldify $(count_installed)
    2.31 @@ -139,7 +127,7 @@
    2.32  				separator
    2.33  				cat $installed/$pkg/files.list
    2.34  				separator
    2.35 -				echo -n "$(gettext "Installed files by") $pkg: "
    2.36 +				echo -n $(gettext "Installed files by") $pkg: 
    2.37  				colorize 32 "$nb" && newline
    2.38  			done
    2.39  			exit 0 ;;
    2.40 @@ -158,7 +146,7 @@
    2.41  for pkg in $installed/*
    2.42  do
    2.43  	unset_receipt
    2.44 -	. $pkg/receipt
    2.45 +	source_receipt $pkg/receipt
    2.46  	count=$(($count + 1))
    2.47  	[ "$count" != 1 ] && newline
    2.48  	gettext "Package    :"; colorize 32 " $PACKAGE"