spk rev 56

Show added/removed packages count in verbose mode + some and fixes
author Christophe Lincoln <pankso@slitaz.org>
date Thu May 17 14:07:25 2012 +0200 (2012-05-17)
parents 5cba598bd418
children 85543a2e118c
files lib/libspk.sh spk-add spk-rm
line diff
     1.1 --- a/lib/libspk.sh	Thu May 17 13:33:31 2012 +0200
     1.2 +++ b/lib/libspk.sh	Thu May 17 14:07:25 2012 +0200
     1.3 @@ -15,7 +15,6 @@
     1.4  installed="${root}${PKGS_DB}/installed"
     1.5  pkgsdesc="${root}${PKGS_DB}/packages.desc"
     1.6  pkgsmd5="${root}${PKGS_DB}/packages.$SUM"
     1.7 -# ????do we need packages.equiv????
     1.8  blocked="${root}${PKGS_DB}/blocked.list"
     1.9  activity="${root}${PKGS_DB}/activity"
    1.10  
    1.11 @@ -148,7 +147,8 @@
    1.12  			gettext "Missing:"; echo " $pkg"
    1.13  			deps=$(($deps+1))
    1.14  		elif [ ! -f "$installed/$pkg/receipt" ]; then
    1.15 -			gettext "WARNING: Dependency loop between \$package and \$pkg."; newline
    1.16 +			gettext "WARNING: Dependency loop between:"; newline
    1.17 +			echo "  $package --> $pkg"
    1.18  		fi
    1.19  	done
    1.20  
     2.1 --- a/spk-add	Thu May 17 13:33:31 2012 +0200
     2.2 +++ b/spk-add	Thu May 17 14:07:25 2012 +0200
     2.3 @@ -7,13 +7,9 @@
     2.4  # Author: See AUTHORS files
     2.5  #
     2.6  . /usr/lib/slitaz/libspk.sh
     2.7 -#. lib/libspk.sh
     2.8  
     2.9  tmpdir="/tmp/spk/$RANDOM"
    2.10  
    2.11 -# TODO: Handle packages.equiv: php dep on lighttpd, but id apache is installed
    2.12 -# we dont need lighttpd since apache is equivalent.
    2.13 -
    2.14  #
    2.15  # Functions
    2.16  #
    2.17 @@ -248,7 +244,8 @@
    2.18  		updatedepmod=yes
    2.19  	fi
    2.20  	separator
    2.21 -	eval_gettext "\$package_name (\$VERSION\$EXTRAVERSION) is installed."; newline
    2.22 +	echo -n "$package_name ({$VERSION}${EXTRAVERSION})"
    2.23 +	gettext "is installed."; newline
    2.24  	newline
    2.25  }
    2.26  
    2.27 @@ -272,6 +269,7 @@
    2.28  	extract_receipt $tmpdir $package_file
    2.29  	source $tmpdir/receipt
    2.30  	[ "$forced" ] || check_installed $PACKAGE
    2.31 +	[ "$count" == "1" ] && newline
    2.32  	install_package $package_file
    2.33  	update_databases
    2.34  }
    2.35 @@ -364,7 +362,7 @@
    2.36  do
    2.37  	case "$pkg" in
    2.38  		*.tazpkg|*.spk)
    2.39 -			#[ "$forced" ] || check_installed $(package_name $pkg)
    2.40 +			count=$(($count + 1))
    2.41  			install_local $pkg ;;
    2.42  		*.deb|.rmp)
    2.43  			echo "TODO: spk-convert then install" ;;
    2.44 @@ -376,4 +374,10 @@
    2.45  			install_web $pkg ;;
    2.46  	esac
    2.47  done
    2.48 +
    2.49 +# Show all new counted packages in verbose mode
    2.50 +if [ "$verbose" ]; then
    2.51 +	gettext "New installed packages:"; colorize " $count" 34
    2.52 +fi
    2.53 +
    2.54  exit 0
     3.1 --- a/spk-rm	Thu May 17 13:33:31 2012 +0200
     3.2 +++ b/spk-rm	Thu May 17 14:07:25 2012 +0200
     3.3 @@ -166,4 +166,10 @@
     3.4  	remove
     3.5  	log "Removed package: $pkg"
     3.6  done
     3.7 +
     3.8 +# Show all new counted packages in verbose mode
     3.9 +if [ "$verbose" ]; then
    3.10 +	gettext "Removed packages:"; colorize " $count" 34
    3.11 +fi
    3.12 +
    3.13  exit 0