tazpkg rev 595

Use boldify and output in raw for tazpkg-box (now gui install display messages in realtime)
author Christophe Lincoln <pankso@slitaz.org>
date Tue Apr 24 11:35:44 2012 +0200 (2012-04-24)
parents 3bcf2536dd03
children 5116bb8e5c6b
files tazpkg tazpkg-box
line diff
     1.1 --- a/tazpkg	Mon Apr 23 23:36:29 2012 +0200
     1.2 +++ b/tazpkg	Tue Apr 24 11:35:44 2012 +0200
     1.3 @@ -1,18 +1,15 @@
     1.4  #!/bin/sh
     1.5  # Tazpkg - Tiny autonomous zone packages manager.
     1.6  #
     1.7 -# This is a lightwight packages manager for *.tazpkg files written in
     1.8 -# SHell script. It works well with Busybox ash shell and bash. Tazpkg lets you
     1.9 +# This is a lightwight packages manager for *.tazpkg files written in SHell 
    1.10 +# script. It works well with Busybox ash shell and bash. Tazpkg lets you
    1.11  # list, install, remove, download or get information about a package. You can
    1.12  # use 'tazpkg usage' to get a list of commands with short descriptions. Tazpkg
    1.13 -# also resolves dependencies and can upgrade packages from a mirror. I18n is
    1.14 -# done using gettext and eval_gettext, ex:
    1.15 -# 	gettext "displayed text"; echo
    1.16 -# 	eval_gettext "display \$VARIABLE"; echo
    1.17 +# also resolves dependencies and can upgrade packages from a mirror.
    1.18  #
    1.19  # (C) 2007-2012 SliTaz - GNU General Public License v3.
    1.20  #
    1.21 -# Authors : Seee AUTHORS files
    1.22 +# Authors : See the AUTHORS files
    1.23  #
    1.24  
    1.25  ####################
    1.26 @@ -20,17 +17,15 @@
    1.27  ####################
    1.28  
    1.29  # TazPKG version
    1.30 -VERSION=4.9.2
    1.31 +VERSION=5.0
    1.32  
    1.33  . /etc/slitaz/slitaz.conf
    1.34  . /etc/slitaz/tazpkg.conf
    1.35  
    1.36  . /lib/libtaz.sh
    1.37  
    1.38 -# Include gettext helper script.
    1.39 +# Internationalization.
    1.40  . /usr/bin/gettext.sh
    1.41 -
    1.42 -# Export package name for gettext.
    1.43  TEXTDOMAIN='tazpkg'
    1.44  export TEXTDOMAIN
    1.45  
    1.46 @@ -85,7 +80,7 @@
    1.47    list-config      `gettext \"List the configuration files.\"`
    1.48    search|-s        `gettext \"Search for a package by pattern or name (options: -i|-l|-m).\"`
    1.49    search-pkgname   `gettext \"Search on mirror for package having a particular file.\"`
    1.50 -  search-file	   `gettext \"Search for file(s) in all installed packages files.\"`
    1.51 +  search-file|-sf  `gettext \"Search for file(s) in all installed packages files.\"`
    1.52    install|-i       `gettext \"Install a local (*.tazpkg) package (--forced to force).\"`
    1.53    install-list     `gettext \"Install all packages from a list of packages.\"`
    1.54    remove|-r        `gettext \"Remove the specified package and all installed files.\"`
    1.55 @@ -501,7 +496,7 @@
    1.56  	mkdir -p $TMP_DIR
    1.57  	[ -n "$INSTALL_LIST" ] && echo "$PACKAGE_FILE" >> $INSTALL_LIST-processed
    1.58  	echo ""
    1.59 -	echo -e "\033[1m`gettext \"Installation of :\"`\033[0m $PACKAGE"
    1.60 +	boldify "$(gettext "Installation of :") $PACKAGE"
    1.61  	separator
    1.62  	eval_gettext "Copying \$PACKAGE... "
    1.63  	cp $PACKAGE_FILE $TMP_DIR
    1.64 @@ -984,7 +979,7 @@
    1.65  		cp -f $1/mirror $1/mirror.bak
    1.66  	fi
    1.67  	echo ""
    1.68 -	echo -e "\033[1m`gettext \"Current mirror(s)\"`\033[0m"
    1.69 +	boldify "$(gettext "Current mirror(s)")"
    1.70  	separator
    1.71  	echo "  `cat $1/mirror 2> /dev/null`"
    1.72  	gettext \
    1.73 @@ -2739,7 +2734,7 @@
    1.74  		check_root
    1.75  		files=$(find $CACHE_DIR -name *.tazpkg | wc -l)
    1.76  		echo ""
    1.77 -		echo -e "\033[1m`gettext \"Clean cache:\"`\033[0m $CACHE_DIR"
    1.78 +		boldify "$(gettext "Clean cache:") $CACHE_DIR"
    1.79  		separator
    1.80  		gettext "Cleaning cache directory..."
    1.81  		rm -rf $CACHE_DIR/*
    1.82 @@ -2754,7 +2749,7 @@
    1.83  			done
    1.84  		else
    1.85  			echo ""
    1.86 -			echo -e "\033[1m`gettext \"Current undigest(s)\"`\033[0m"
    1.87 +			boldify "$(gettext "Current undigest(s)")"
    1.88  			separator
    1.89  			for i in $LOCALSTATE/undigest/*/mirror; do
    1.90  				if [ ! -f $i ]; then
     2.1 --- a/tazpkg-box	Mon Apr 23 23:36:29 2012 +0200
     2.2 +++ b/tazpkg-box	Tue Apr 24 11:35:44 2012 +0200
     2.3 @@ -38,8 +38,8 @@
     2.4  	# Deal with --button values
     2.5  	case $ret in
     2.6  		1) exit 0 ;;
     2.7 -		2) tazpkg extract $pkg | output ;;
     2.8 -		3) tazpkg -i $pkg --forced | output ;;
     2.9 +		2) tazpkg extract $pkg --output="raw" | output ;;
    2.10 +		3) tazpkg -i $pkg --forced --output="raw" | output ;;
    2.11  	esac
    2.12  }
    2.13  
    2.14 @@ -48,7 +48,7 @@
    2.15  	pkg=$(basename $url) 
    2.16  	gettext "Downloading: $pkg"; echo -e "\n"
    2.17  	cd /tmp && wget $url 2>&1
    2.18 -	tazpkg -i $pkg --forced 2>&1
    2.19 +	tazpkg -i $pkg --forced --output="raw" 2>&1
    2.20  	rm -f $pkg
    2.21  }
    2.22