tazpkg diff tazpkg-box @ rev 752

Change VERSION
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Mon Mar 23 01:18:38 2015 +0100 (2015-03-23)
parents 192b971ccc93
children 0fc40a0f873f
line diff
     1.1 --- a/tazpkg-box	Sun Feb 16 12:29:56 2014 +0100
     1.2 +++ b/tazpkg-box	Mon Mar 23 01:18:38 2015 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  #!/bin/sh
     1.5  #
     1.6 -# Small GTK boxes to TazPkg for deep desktop integration. PcmanFM 0.5.x has a
     1.7 +# Small GTK boxes to TazPkg for deep desktop integration. PCManFM 0.5.x has a
     1.8  # patch to extract a TazPkg file but not Thunar and other FM. TazPkgBox tries
     1.9  # to follow freedesktop standards.
    1.10  #
    1.11 @@ -9,44 +9,52 @@
    1.12  # Authors: Christophe Lincoln <pankso@slitaz.org>
    1.13  #
    1.14  
    1.15 +
    1.16  # Internationalization.
    1.17 -. /usr/bin/gettext.sh
    1.18 +
    1.19 +. /lib/libtaz.sh
    1.20  TEXTDOMAIN='tazpkg'
    1.21  export TEXTDOMAIN
    1.22  
    1.23 -title=$(gettext "TazPKG")
    1.24 -text=$(gettext "SliTaz Package Action")
    1.25 +title="$(_ 'TazPkg')"
    1.26 +text="$(_ 'SliTaz Package Action')"
    1.27  icon="/usr/share/pixmaps/tazpkg.png"
    1.28  opts="--image=tazpkg --image-on-top --center --on-top"
    1.29  
    1.30 +
    1.31  usage() {
    1.32  	cat << EOT
    1.33 -$(gettext 'Usage:') $(basename $0) [actions|URL] [$(gettext 'package')]
    1.34 +$(_ 'Usage:') $(basename $0) [actions|URL] [$(_ 'package')]
    1.35  EOT
    1.36  }
    1.37  
    1.38 +
    1.39  # Nice GTK output for install and extract.
    1.40 +
    1.41  output() {
    1.42  	yad --text-info $opts --title="$title" --text="<b>$text</b>" \
    1.43  		--height=260 --width=520  --window-icon=$icon \
    1.44  		--tail --margins=4 --button="gtk-close:0"
    1.45  }
    1.46  
    1.47 +
    1.48  pkginfo() {
    1.49  	tmp=/tmp/$(basename $0)/$$
    1.50 -	mkdir -p $tmp && cd $tmp
    1.51 +	mkdir -p $tmp; cd $tmp
    1.52  	{ cpio --quiet -i receipt > /dev/null 2>&1; } < ${dir}/$pkg
    1.53  	. $tmp/receipt
    1.54  	#rm -rf /tmp/$(basename $0)
    1.55  	size=$(du -sh ${dir}/$pkg | awk '{print $1}')
    1.56 -	echo -e "Package\n$PACKAGE
    1.57 -Version\n$VERSION
    1.58 -Short desc\n$SHORT_DESC
    1.59 -Unpacked size\n$UNPACKED_SIZE
    1.60 -Depends\n$DEPENDS"
    1.61 +	echo -e "$(_ 'Package')\n$PACKAGE
    1.62 +$(_ 'Version')\n$VERSION
    1.63 +$(_ 'Short desc')\n$SHORT_DESC
    1.64 +$(_ 'Unpacked size')\n$UNPACKED_SIZE
    1.65 +$(_ 'Depends')\n$DEPENDS"
    1.66  }
    1.67  
    1.68 +
    1.69  # Main GUI box function with pure Yad spec
    1.70 +
    1.71  actions_main() {
    1.72  	pkgname=${pkg%.tazpkg}
    1.73  	pkginfo | yad $opts --title="$title" \
    1.74 @@ -54,13 +62,15 @@
    1.75  		--height=260 --width=520 \
    1.76  		--text="<b>$text</b>" \
    1.77  		--window-icon=$icon \
    1.78 -		--column "Name" --column "" \
    1.79 -		--button="$(gettext 'Install'):3" \
    1.80 -		--button="$(gettext 'Extract'):2" \
    1.81 +		--column "" --column "" \
    1.82 +		--button="$(_ 'Install'):3" \
    1.83 +		--button="$(_ 'Extract'):2" \
    1.84  		--button="gtk-cancel:1"
    1.85  }
    1.86  
    1.87 +
    1.88  # Actions user can do when clicking on a package.
    1.89 +
    1.90  actions() {
    1.91  	# Store box results
    1.92  	main=$(actions_main)
    1.93 @@ -73,15 +83,19 @@
    1.94  	esac
    1.95  }
    1.96  
    1.97 +
    1.98  # TazPkg URL Handler.
    1.99 +
   1.100  dl_inst() {
   1.101  	pkg=$(basename $url) 
   1.102 -	eval_gettext "Downloading: \$pkg"; echo -e "\n"
   1.103 -	cd /tmp && wget $url 2>&1
   1.104 +	_ 'Downloading: %s' $pkg; newline
   1.105 +	cd /tmp; wget $url 2>&1
   1.106  	tazpkg -i $pkg --forced --output="raw" 2>&1
   1.107  	rm -f $pkg
   1.108  }
   1.109  
   1.110 +
   1.111 +
   1.112  #
   1.113  # Script commands
   1.114  #