tazpkg rev 886

Change icons presentation in code - free to use anywhere, simplify icons substitution, minify html, misc
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 10 04:08:41 2015 +0200 (2015-12-10)
parents 2f3f84cea56f
children 1362693564d1
files Makefile applications/tazpkg-box.desktop modules/help modules/upgrade stripall.sh tazpanel/pkgs.cgi tazpkg-box
line diff
     1.1 --- a/Makefile	Sat Dec 05 17:21:54 2015 +0100
     1.2 +++ b/Makefile	Thu Dec 10 04:08:41 2015 +0200
     1.3 @@ -27,7 +27,7 @@
     1.4  	mkdir build
     1.5  	cp -a tazpkg tazpkg-box tazpkg-notify \
     1.6  		modules/* tazpanel/pkgs.cgi tazpanel/pkgs.css \
     1.7 -		build
     1.8 +		doc/tazpkg.*.html build
     1.9  	./stripall.sh
    1.10  
    1.11  	# Substitute "@@MODULES@@" with modules path
    1.12 @@ -85,7 +85,8 @@
    1.13  
    1.14  	# Documentation
    1.15  	install -m 0755 -d $(DESTDIR)$(docdir)
    1.16 -	cp -a doc/*        $(DESTDIR)$(docdir)
    1.17 +	cp -a build/tazpkg.*.html $(DESTDIR)$(docdir)
    1.18 +	ln -sf tazpkg.en.html $(DESTDIR)$(docdir)/tazpkg.html
    1.19  
    1.20  	# TazPanel files
    1.21  	install -m 0755 -d             $(DESTDIR)/var/www/tazpanel/menu.d
     2.1 --- a/applications/tazpkg-box.desktop	Sat Dec 05 17:21:54 2015 +0100
     2.2 +++ b/applications/tazpkg-box.desktop	Thu Dec 10 04:08:41 2015 +0200
     2.3 @@ -6,6 +6,6 @@
     2.4  Name[pt_BR]=Gerenciador de Pacotes TazPkg
     2.5  Name[ru]=Менеджер пакетов TazPkg
     2.6  Exec=tazbox su tazpkg-box actions %f
     2.7 -Icon=tazpkg
     2.8 +Icon=system-software-installer
     2.9  NoDisplay=true
    2.10  MimeType=application/x-tazpkg;
     3.1 --- a/modules/help	Sat Dec 05 17:21:54 2015 +0100
     3.2 +++ b/modules/help	Thu Dec 10 04:08:41 2015 +0200
     3.3 @@ -130,7 +130,7 @@
     3.4  
     3.5  
     3.6  # style: <article id="TOPIC">
     3.7 -HLP=$(sed "/article id=\"$T\"/,/<\/article/!d; /<article/d; /<\/article/d" $DOC)
     3.8 +HLP=$(sed "/article id=\"$T\"/,/<\/article/!d; s|</*article[^>]*>||; s|<h3>.*</h3>||" $DOC)
     3.9  
    3.10  if [ -z "$HLP" ]; then
    3.11  	_ 'Sorry, no help for "%s"' "$QUERY"
     4.1 --- a/modules/upgrade	Sat Dec 05 17:21:54 2015 +0100
     4.2 +++ b/modules/upgrade	Thu Dec 10 04:08:41 2015 +0200
     4.3 @@ -90,8 +90,8 @@
     4.4  	<tbody>
     4.5  EOT
     4.6  		sort -t$'\t' -k1,3 "$tmp_up_list" | awk -F$'\t' '{
     4.7 -			if($4=="Main"){repo_icon="slitaz"}else{repo_icon="web"}
     4.8 -			if($6=="b"){data_icon="pkgib"}else{data_icon="pkgi"}
     4.9 +			if($4=="Main"){repo_icon="@slitaz@"}else{repo_icon="@web@"}
    4.10 +			if($6=="b"){data_icon="@pkgib@"}else{data_icon="@pkgi@"}
    4.11  
    4.12  			printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\"/>", $1;
    4.13  			printf "<a data-icon=\"%s\" href=\"?info=%s\">%s</a></td>", data_icon, $1, $1;
     5.1 --- a/stripall.sh	Sat Dec 05 17:21:54 2015 +0100
     5.2 +++ b/stripall.sh	Thu Dec 10 04:08:41 2015 +0200
     5.3 @@ -42,16 +42,7 @@
     5.4  	msg				\n	msgerr			\n	msgwarn			\n	msgup	
     5.5  	msgtip			\n	vpn			" | \
     5.6  	while read icon symbol; do
     5.7 -		echo -n "s|data-icon=\"$icon\"|data-icon=\"$symbol\"|g; " >> "$sed_script"
     5.8 -		echo -n "s|data_icon=\"$icon\"|data_icon=\"$symbol\"|g; " >> "$sed_script"
     5.9 -		echo -n "s|repo_icon=\"$icon\"|repo_icon=\"$symbol\"|g; " >> "$sed_script"
    5.10 -		case $icon in
    5.11 -			clock)
    5.12 -				echo -n "s|dataset\.icon==\"$icon\"|dataset.icon==\"$symbol\"|g; " >> "$sed_script";;
    5.13 -			pkg|pkgi|pkgib)
    5.14 -				echo -n "s|data-icon=\\\\\"$icon\\\\\"|data-icon=\\\\\"$symbol\\\\\"|g; " >> "$sed_script";;
    5.15 -		esac
    5.16 -		echo -n "s|data-img=\"$icon\"|data-img=\"$symbol\"|g; " >> "$sed_script"
    5.17 +		echo -n "s|@$icon@|$symbol|g; " >> "$sed_script"
    5.18  	done
    5.19  	echo "' @@@" >> "$sed_script"
    5.20  
    5.21 @@ -62,20 +53,34 @@
    5.22  for CGI in $(ls | grep -v \.css$ | grep -v \.js$); do
    5.23  	echo "Processing $CGI"
    5.24  
    5.25 -	mv $CGI $CGI.old
    5.26 -	# Copy initial comment (down to empty line)
    5.27 -	sed '1,/^$/!d' $CGI.old > $CGI
    5.28 -	# Remove initial tabs, other comments and empty lines
    5.29 -	sed 's|^\t*||;/^ *#/d;/^$/d' $CGI.old >> $CGI
    5.30 -	rm $CGI.old
    5.31 +	case $CGI in
    5.32 +		tazpkg.*.html)
    5.33 +			# doc/tazpkg.*.html
    5.34 +			substitute_icons $CGI
    5.35 +			if [ -n "$(which tidy)" ]; then
    5.36 +				tidy  -m  -q  -w 0  -utf8  --new-inline-tags x-details  --quote-nbsp n  \
    5.37 +					--tidy-mark n  $CGI
    5.38 +			else
    5.39 +				sed -i 's|[ 	][ 	]*| |g; s|^ ||' $CGI
    5.40 +			fi
    5.41 +			;;
    5.42 +		*)
    5.43 +			mv $CGI $CGI.old
    5.44 +			# Copy initial comment (down to empty line)
    5.45 +			sed '1,/^$/!d' $CGI.old > $CGI
    5.46 +			# Remove initial tabs, other comments and empty lines
    5.47 +			sed 's|^\t*||;/^ *#/d;/^$/d' $CGI.old >> $CGI
    5.48 +			rm $CGI.old
    5.49  
    5.50 -	substitute_icons $CGI
    5.51 +			substitute_icons $CGI
    5.52  
    5.53 -	sed -i 's|" *>|">|g' $CGI
    5.54 -	sed -i "s|' *)|')|g" $CGI
    5.55 -	sed -i 's| *;;|;;|g' $CGI
    5.56 +			sed -i 's|" *>|">|g' $CGI
    5.57 +			sed -i "s|' *)|')|g" $CGI
    5.58 +			sed -i 's| *;;|;;|g' $CGI
    5.59  
    5.60 -	chmod a+x $CGI
    5.61 +			chmod a+x $CGI
    5.62 +			;;
    5.63 +	esac
    5.64  
    5.65  done
    5.66  
     6.1 --- a/tazpanel/pkgs.cgi	Sat Dec 05 17:21:54 2015 +0100
     6.2 +++ b/tazpanel/pkgs.cgi	Thu Dec 10 04:08:41 2015 +0200
     6.3 @@ -37,11 +37,11 @@
     6.4  <li tabindex="0">
     6.5  	<span>$(gettext 'Packages')</span>
     6.6  	<menu>
     6.7 -		<li><a data-icon="info" href="pkgs.cgi">$(gettext 'Summary')</a></li>
     6.8 -		<li><a data-icon="list" href="pkgs.cgi?list&amp;my=my&amp;cat=all&amp;repo=Any">$(gettext 'My packages')</a></li>
     6.9 -		<li><a data-icon="refresh" href="pkgs.cgi?recharge" data-root>$(gettext 'Recharge list')</a></li>
    6.10 -		<li><a data-icon="upgrade" href="pkgs.cgi?up" data-root>$(gettext 'Check updates')</a></li>
    6.11 -		<li><a data-icon="admin"   href="pkgs.cgi?admin" data-root>$(gettext 'Administration')</a></li>
    6.12 +		<li><a data-icon="@info@" href="pkgs.cgi">$(gettext 'Summary')</a></li>
    6.13 +		<li><a data-icon="@list@" href="pkgs.cgi?list&amp;my=my&amp;cat=all&amp;repo=Any">$(gettext 'My packages')</a></li>
    6.14 +		<li><a data-icon="@refresh@" href="pkgs.cgi?recharge" data-root>$(gettext 'Recharge list')</a></li>
    6.15 +		<li><a data-icon="@upgrade@" href="pkgs.cgi?up" data-root>$(gettext 'Check updates')</a></li>
    6.16 +		<li><a data-icon="@admin@"   href="pkgs.cgi?admin" data-root>$(gettext 'Administration')</a></li>
    6.17  	</menu>
    6.18  </li>
    6.19  EOT
    6.20 @@ -85,13 +85,12 @@
    6.21  		# Space at end is flag -> do not check equivalents
    6.22  		pkg=$(GET pkg | tr -d ' ')
    6.23  		orig_pkg=''
    6.24 -		# Small hack to get 'pkgi' symbol:
    6.25 -		data_icon="pkgi"; pkgi="$data_icon"
    6.26 +		data_icon="@pkgi@"
    6.27  		responce='i'
    6.28  
    6.29  		if ! grep -q "^$pkg"$'\t' "$PKGS_DB/installed.info"; then
    6.30  			# Package not installed
    6.31 -			data_icon="pkg"; responce='n'
    6.32 +			data_icon="@pkg@"; responce='n'
    6.33  			equivs=$(grep "^$pkg=" "$PKGS_DB/packages.equiv")
    6.34  			if [ "$(GET pkg)" == "$pkg" -a -n "$equivs" ]; then
    6.35  				# Check equivalent packages
    6.36 @@ -102,13 +101,13 @@
    6.37  							   grep -q "^${equiv#*:}"$'\t' "$PKGS_DB/installed.info"; then
    6.38  								# Equivalent installed
    6.39  								orig_pkg="$pkg→"; pkg="${equiv#*:}"
    6.40 -								data_icon="pkgi"; responce='i'; break
    6.41 +								data_icon="@pkgi@"; responce='i'; break
    6.42  							fi;;
    6.43  						*)
    6.44  							if grep -q "^$equiv"$'\t' "$PKGS_DB/installed.info"; then
    6.45  								# Equivalent installed
    6.46  								orig_pkg="$pkg→"; pkg="$equiv"
    6.47 -								data_icon="pkgi"; responce='i'; break
    6.48 +								data_icon="@pkgi@"; responce='i'; break
    6.49  							fi;;
    6.50  					esac
    6.51  				done
    6.52 @@ -116,7 +115,7 @@
    6.53  		fi
    6.54  
    6.55  		# Installed and blocked?
    6.56 -		[ "$data_icon" == "$pkgi" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="pkgib"
    6.57 +		[ "$data_icon" == "@pkgi@" ] && grep -q "^$pkg$" "$BLOCKED" && data_icon="@pkgib@"
    6.58  
    6.59  		if [ $(GET web) == 'y' ]; then
    6.60  			# Request from page http://pkgs.slitaz.org/ for example:
    6.61 @@ -230,10 +229,10 @@
    6.62  select_package_icon() {
    6.63  	if [ -d "$INSTALLED/$1" ]; then
    6.64  		if grep -q "^$1$" "$BLOCKED"
    6.65 -			then echo "pkgib"
    6.66 -			else echo "pkgi"
    6.67 +			then echo "@pkgib@"
    6.68 +			else echo "@pkgi@"
    6.69  		fi
    6.70 -		else echo "pkg"
    6.71 +		else echo "@pkg@"
    6.72  	fi
    6.73  }
    6.74  
    6.75 @@ -243,15 +242,10 @@
    6.76  parse_packages_info() {
    6.77  	IFS=$'\t'
    6.78  	while read PACKAGE VERSION CATEGORY SHORT_DESC WEB_SITE TAGS SIZES DEPENDS; do
    6.79 -		data_icon="pkg"
    6.80 -		if grep -q "^$PACKAGE"$'\t' "$PKGS_DB/installed.info"; then
    6.81 -			data_icon="pkgi"
    6.82 -			grep -q "^$PACKAGE$" "$BLOCKED" && data_icon="pkgib"
    6.83 -		fi
    6.84  		i18n_desc "$PACKAGE"
    6.85  		cat <<EOT
    6.86  <tr>
    6.87 -	<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link "$PACKAGE" "$data_icon")</td>
    6.88 +	<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link "$PACKAGE" "$(select_package_icon "$PACKAGE")")</td>
    6.89  	<td>$VERSION</td>
    6.90  	<td>$SHORT_DESC</td>
    6.91  </tr>
    6.92 @@ -267,35 +261,35 @@
    6.93  	for button in $@; do
    6.94  		class=''; misc=''
    6.95  		case $button in
    6.96 -		recharge)		data_icon="refresh";	label=$(_ 'Recharge list'); misc=' data-root';;
    6.97 -		up)				data_icon="upgrade";	label=$(_ 'Check upgrades'); misc=' data-root';;
    6.98 -		list)			data_icon="list";		label=$(_ 'My packages');;
    6.99 -		tags)			data_icon="tags";		label=$(_ 'Tags');;
   6.100 -		linkable)		data_icon="link";		label=$(_ 'Linkable packages');;
   6.101 -		admin)			data_icon="admin";		label=$(_ 'Administration'); misc=' data-root';;
   6.102 -		*Install*nf*)	data_icon="install";	label=$(_ 'Install (Non Free)');;
   6.103 -		*Install*)		data_icon="install";	label=$(_ 'Install');;
   6.104 -		*Remove*)		data_icon="remove";		label=$(_ 'Remove');;
   6.105 -		*Link*)			data_icon="link";		label=$(_ 'Link');;
   6.106 -		*Block*)		data_icon="lock";		label=$(_ 'Block');;
   6.107 -		*Unblock*)		data_icon="unlock";		label=$(_ 'Unblock');;
   6.108 -		*Chblock*)		data_icon="chlock";		label=$(_ '(Un)block');;
   6.109 -		*Repack*)		data_icon="repack";		label=$(_ 'Repack');;
   6.110 -		*saveconf*)		data_icon="save";		label=$(_ 'Save configuration');;
   6.111 -		*listconf*)		data_icon="list";		label=$(_ 'List configuration files');;
   6.112 -		*quickcheck*)	data_icon="check";		label=$(_ 'Quick check');;
   6.113 -		*fullcheck*)	data_icon="check";		label=$(_ 'Full check');;
   6.114 -		*clean*)		data_icon="remove";		label=$(_ 'Clean');;
   6.115 -		*setlink*)		data_icon="link";		label=$(_ 'Set link');;
   6.116 -		*removelink*)	data_icon="unlink";		label=$(_ 'Remove link');;
   6.117 -		*add-mirror)	data_icon="add";		label=$(_n 'Add mirror');;
   6.118 -		*add-repo)		data_icon="add";		label=$(_n 'Add repository');;
   6.119 -		toggle)			data_icon="toggle";		label=$(_n 'Toggle all');;
   6.120 +			recharge)		icon="@refresh@";	label=$(_ 'Recharge list'); misc=' data-root';;
   6.121 +			up)				icon="@upgrade@";	label=$(_ 'Check upgrades'); misc=' data-root';;
   6.122 +			list)			icon="@list@";		label=$(_ 'My packages');;
   6.123 +			tags)			icon="@tags@";		label=$(_ 'Tags');;
   6.124 +			linkable)		icon="@link@";		label=$(_ 'Linkable packages');;
   6.125 +			admin)			icon="@admin@";		label=$(_ 'Administration'); misc=' data-root';;
   6.126 +			*Install*nf*)	icon="@install@";	label=$(_ 'Install (Non Free)');;
   6.127 +			*Install*)		icon="@install@";	label=$(_ 'Install');;
   6.128 +			*Remove*)		icon="@remove@";	label=$(_ 'Remove');;
   6.129 +			*Link*)			icon="@link@";		label=$(_ 'Link');;
   6.130 +			*Block*)		icon="@lock@";		label=$(_ 'Block');;
   6.131 +			*Unblock*)		icon="@unlock@";	label=$(_ 'Unblock');;
   6.132 +			*Chblock*)		icon="@chlock@";	label=$(_ '(Un)block');;
   6.133 +			*Repack*)		icon="@repack@";	label=$(_ 'Repack');;
   6.134 +			*saveconf*)		icon="@save@";		label=$(_ 'Save configuration');;
   6.135 +			*listconf*)		icon="@list@";		label=$(_ 'List configuration files');;
   6.136 +			*quickcheck*)	icon="@check@";		label=$(_ 'Quick check');;
   6.137 +			*fullcheck*)	icon="@check@";		label=$(_ 'Full check');;
   6.138 +			*clean*)		icon="@remove@";	label=$(_ 'Clean');;
   6.139 +			*setlink*)		icon="@link@";		label=$(_ 'Set link');;
   6.140 +			*removelink*)	icon="@unlink@";	label=$(_ 'Remove link');;
   6.141 +			*add-mirror)	icon="@add@";		label=$(_n 'Add mirror');;
   6.142 +			*add-repo)		icon="@add@";		label=$(_n 'Add repository');;
   6.143 +			toggle)			icon="@toggle@";	label=$(_n 'Toggle all');;
   6.144  		esac
   6.145  		if [ "$button" == 'toggle' ]; then
   6.146 -			echo -n "<span class=\"float-right\"><button data-icon=\"$data_icon\" onclick=\"checkBoxes()\">$label</button></span>"
   6.147 +			echo -n "<span class=\"float-right\"><button data-icon=\"$icon\" onclick=\"checkBoxes()\">$label</button></span>"
   6.148  		else
   6.149 -			echo -n "<button data-icon=\"$data_icon\" name=\"${button%%=*}\" value=\"${button#*=}\"$misc>$label</button>"
   6.150 +			echo -n "<button data-icon=\"$icon\" name=\"${button%%=*}\" value=\"${button#*=}\"$misc>$label</button>"
   6.151  		fi
   6.152  	done
   6.153  }
   6.154 @@ -412,9 +406,9 @@
   6.155  			printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\" id=\"%s\">", PKG, PKG
   6.156  
   6.157  			if (INS) {
   6.158 -				if (BLK)	printf "<a data-icon=\"pkgib\" ";
   6.159 -				else		printf "<a data-icon=\"pkgi\" ";
   6.160 -			} else			printf "<a data-icon=\"pkg\" ";
   6.161 +				if (BLK)	printf "<a data-icon=\"@pkgib@\" ";
   6.162 +				else		printf "<a data-icon=\"@pkgi@\" ";
   6.163 +			} else			printf "<a data-icon=\"@pkg@\" ";
   6.164  
   6.165  			printf "href=\"?info=%s\">%s</a></td>", gensub(/\+/, "%2B", "g", PKG), PKG
   6.166  
   6.167 @@ -500,14 +494,14 @@
   6.168  
   6.169  show_info_links() {
   6.170  	if [ -n "$1" ]; then
   6.171 -		if [ "$3" == 'tag' ]; then data_icon="tag"; else data_icon="clock"; fi
   6.172 +		if [ "$3" == 'tag' ]; then icon="@tag@"; else icon="@clock@"; fi
   6.173  		case "$4" in
   6.174  			provide) echo -n "<tr><td><b>$2</b></td><td>"; noeq=' ';;
   6.175  			'')      echo -n "<tr><td><b>$2</b></td><td>"; noeq='';;
   6.176  			*)       echo -n "<tr><td><b><a href=\"?suggested=${4//+/%2B}\">$2</a></b></td><td>";;
   6.177  		esac
   6.178  
   6.179 -		echo $1 | tr ' ' $'\n' | awk -vt="$3" -vi="$data_icon" -vnoeq="$noeq" '{
   6.180 +		echo $1 | tr ' ' $'\n' | awk -vt="$3" -vi="$icon" -vnoeq="$noeq" '{
   6.181  			printf "<span><a data-icon=\"%s\" ", i;
   6.182  			printf "href=\"?%s=%s\">%s%s</a></span>", t, gensub(/\+/, "%2B", "g", $1), $1, noeq
   6.183  		}'
   6.184 @@ -523,7 +517,7 @@
   6.185  
   6.186  	cat <<EOT
   6.187  <form class="search">
   6.188 -	<a data-icon="web" href="http://pkgs.slitaz.org/" target="_blank" title="$(_n 'Web search tool')"></a>
   6.189 +	<a data-icon="@web@" href="http://pkgs.slitaz.org/" target="_blank" title="$(_n 'Web search tool')"></a>
   6.190  	<input type="search" name="search" value="$(GET search)" results="5" autosave="pkgsearch" autocomplete="on"><!--
   6.191  	--><button type="submit">$(_n 'Search')</button><!--
   6.192  	--><button name="files" value="yes">$(_n 'Files')</button><!--
   6.193 @@ -595,8 +589,8 @@
   6.194  	fi
   6.195  
   6.196  	cat <<EOT
   6.197 -	<a data-icon="tags" href="?tags">$(_ 'All tags...')</a><br/>
   6.198 -	<a data-icon="list" href="?cats">$(_ 'All categories...')</a>
   6.199 +	<a data-icon="@tags@" href="?tags">$(_ 'All tags...')</a><br/>
   6.200 +	<a data-icon="@list@" href="?cats">$(_ 'All categories...')</a>
   6.201  </div>
   6.202  </form>
   6.203  EOT
   6.204 @@ -633,10 +627,10 @@
   6.205  			i18n_desc "$pkg"
   6.206  			cat <<EOT
   6.207  <tr>
   6.208 -	<td><input type="checkbox" name="pkg" value="$pkg" /><a data-icon="pkg" href="?info=${pkg//+/%2B}">$pkg</a></td>
   6.209 +	<td><input type="checkbox" name="pkg" value="$pkg" /><a data-icon="@pkg@" href="?info=${pkg//+/%2B}">$pkg</a></td>
   6.210  	<td>$VERSION</td>
   6.211  	<td>$SHORT_DESC</td>
   6.212 -	<td><a data-img="web" href="$WEB_SITE"></a></td>
   6.213 +	<td><a data-img="@web@" href="$WEB_SITE"></a></td>
   6.214  </tr>
   6.215  EOT
   6.216  		done
   6.217 @@ -822,14 +816,9 @@
   6.218  			lzcat $(repo_list /files.list.lzma) | grep -Ei ": .*$(GET search)" | \
   6.219  			while read PACKAGE FILE; do
   6.220  				PACKAGE=${PACKAGE%:}
   6.221 -				data_icon="pkg"
   6.222 -				if [ -d $INSTALLED/$PACKAGE ]; then
   6.223 -					data_icon="pkgi"
   6.224 -					grep -q "^$PACKAGE$" "$BLOCKED" && data_icon="pkgib"
   6.225 -				fi
   6.226  				cat <<EOT
   6.227  <tr>
   6.228 -	<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link "$PACKAGE" "$data_icon")</td>
   6.229 +	<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link "$PACKAGE" "$(select_package_icon "$PACKAGE")")</td>
   6.230  	<td>$(echo "$FILE" | sed "s|$pkg|<span class=\"diff-add\">&</span>|gI")</td>
   6.231  </tr>
   6.232  EOT
   6.233 @@ -941,7 +930,7 @@
   6.234  		for pkg in $pkgs; do
   6.235  			[ "$pkgs_total" -ne 1 ] && sequence="$pkg_current/$pkgs_total"
   6.236  			#echo $(_n 'y') | 
   6.237 -			tazpkg $cmd $pkg $opt --sequence="$sequence" 2>/dev/null | filter_taztools_msgs
   6.238 +			tazpkg $cmd $pkg $opt --sequence="$sequence"
   6.239  			pkg_current=$((pkg_current+1))
   6.240  		done
   6.241  		;;
   6.242 @@ -984,19 +973,10 @@
   6.243  			xhtml_footer; exit 0
   6.244  		fi
   6.245  
   6.246 -		# Symbolic icon
   6.247 -		if [ -d "$INSTALLED/$pkg" ]; then
   6.248 -			if grep -q "^$pkg$" "$BLOCKED"
   6.249 -				then data_icon="pkgib"
   6.250 -				else data_icon="pkgi"
   6.251 -			fi
   6.252 -			else data_icon="pkg"
   6.253 -		fi
   6.254 -
   6.255  		cat <<EOT
   6.256  <section>
   6.257  	<header>
   6.258 -		<span data-icon="$data_icon">$(_ 'Package %s' "$pkg")</span>
   6.259 +		<span data-icon="$(select_package_icon "$pkg")">$(_ 'Package %s' "$pkg")</span>
   6.260  		<form>
   6.261  			<input type="hidden" name="pkg" value="${pkg#get-}"/>
   6.262  EOT
   6.263 @@ -1084,8 +1064,8 @@
   6.264  </table>
   6.265  
   6.266  	<footer>
   6.267 -		<a data-icon="text" href="?show_receipt=$pkg">$(_ 'View receipt')</a>
   6.268 -		<a data-icon="slitaz" href="?improve=$pkg">$(_ 'Improve package')</a>
   6.269 +		<a data-icon="@text@" href="?show_receipt=$pkg">$(_ 'View receipt')</a>
   6.270 +		<a data-icon="@slitaz@" href="?improve=$pkg">$(_ 'Improve package')</a>
   6.271  	</footer>
   6.272  </section>
   6.273  
   6.274 @@ -1110,7 +1090,7 @@
   6.275  <section>
   6.276  	<header>$(_ 'Installed files')</header>
   6.277  	<span id="fileList">
   6.278 -		<div style="text-align: center;"><span data-icon="clock">$(_ 'Please wait')</span></div>
   6.279 +		<div style="text-align: center;"><span data-icon="@clock@">$(_ 'Please wait')</span></div>
   6.280  	</span>
   6.281  </section>
   6.282  
   6.283 @@ -1118,7 +1098,7 @@
   6.284  <script type="text/javascript">
   6.285  	var links = document.getElementById('infoTable').getElementsByTagName('a');
   6.286  	for (var i = 0; i < links.length; i++) {
   6.287 -		if (links[i].dataset.icon=="clock") {
   6.288 +		if (links[i].dataset.icon=="@clock@") {
   6.289  			links[i].parentNode.id = 'link' + i;
   6.290  			pkg = links[i].textContent.replace(/\+/g, '%2B');
   6.291  			ajax('?status&pkg=' + pkg, '1', 'link' + i);
   6.292 @@ -1273,8 +1253,8 @@
   6.293  					<input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()"
   6.294  					$([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')>
   6.295  					<label for="$line"><code>$line</code></label></td>
   6.296 -				<td><a data-img="web"    href="$line" target="_blank"></a></td>
   6.297 -				<td><a data-img="remove" href="?admin=rm-mirror&amp;mirror=$line&amp;file=$i" title="$(_ 'Delete')"></a></td>
   6.298 +				<td><a data-img="@web@"    href="$line" target="_blank"></a></td>
   6.299 +				<td><a data-img="@remove@" href="?admin=rm-mirror&amp;mirror=$line&amp;file=$i" title="$(_ 'Delete')"></a></td>
   6.300  			</tr>
   6.301  EOT
   6.302  			done < $i
   6.303 @@ -1306,7 +1286,7 @@
   6.304  				cat <<EOT
   6.305  		<tr>
   6.306  			<td><code>$repo</code></td>
   6.307 -			<td><a data-img="remove" href="?admin=rm-repo&amp;repository=$repo" title="$(_ 'Delete')"></a></td>
   6.308 +			<td><a data-img="@remove@" href="?admin=rm-repo&amp;repository=$repo" title="$(_ 'Delete')"></a></td>
   6.309  		</tr>
   6.310  EOT
   6.311  			done
   6.312 @@ -1355,9 +1335,9 @@
   6.313  	</div>
   6.314  
   6.315  	<footer>
   6.316 -		<button data-icon="download" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'>
   6.317 +		<button data-icon="@download@" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'>
   6.318  			$(_ 'Download DVD image')</button>
   6.319 -		<button data-icon="link" onclick='?admin&amp;action=dvdusbkey'>
   6.320 +		<button data-icon="@link@" onclick='?admin&amp;action=dvdusbkey'>
   6.321  			$(_ 'Install from DVD/USB key')</button>
   6.322  	</footer>
   6.323  </section>
   6.324 @@ -1372,7 +1352,7 @@
   6.325  		<input type="hidden" name="admin" value="pager"/>
   6.326  		<input type="number" name="pager" value="$pager" min="0" step="10" size="4"/>
   6.327  		<footer>
   6.328 -			<button data-icon="ok" type="submit">$(_ 'Set')</button>
   6.329 +			<button data-icon="@ok@" type="submit">$(_ 'Set')</button>
   6.330  		</footer>
   6.331  	</form>
   6.332  </section>
   6.333 @@ -1535,10 +1515,10 @@
   6.334  EOT
   6.335  		table_head
   6.336  		for i in $(cat "$BLOCKED"); do
   6.337 -			awk -F$'\t' -vp="$i" -vi='data-icon="pkgib"' '
   6.338 +			awk -F$'\t' -vp="$i" '
   6.339  			$1 == p {
   6.340  				printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\">", $1
   6.341 -				printf "<a %s href=\"?info=%s\">%s</a>", i, gensub(/\+/, "%2B", "g", $1), $1
   6.342 +				printf "<a data-icon=\"@pkgib@\" href=\"?info=%s\">%s</a>", gensub(/\+/, "%2B", "g", $1), $1
   6.343  				printf "</td><td>%s</td><td>%s</td><td>", $2, $4
   6.344  				printf "<a href=\"%s\"></a></td></tr>\n", $5
   6.345  			}
   6.346 @@ -1604,7 +1584,7 @@
   6.347  			<tr><td colspan="2">
   6.348  				<label><input type="checkbox" name="rememberme"/>$(_ 'Remember me')</label></td></tr>
   6.349  			<tr><td colspan="2">
   6.350 -				<button type="submit" data-icon="user">$(_ 'Log in')</button></td></tr>
   6.351 +				<button type="submit" data-icon="@user@">$(_ 'Log in')</button></td></tr>
   6.352  		</table>
   6.353  	</form>
   6.354  	<footer>
   6.355 @@ -1636,7 +1616,7 @@
   6.356  <section>
   6.357  	<header>
   6.358  		$(_ 'Improve package "%s"' $pkg)
   6.359 -		<form><button name="info" value="$pkg" data-icon="back">$(_ 'Back')</button></form>
   6.360 +		<form><button name="info" value="$pkg" data-icon="@back@">$(_ 'Back')</button></form>
   6.361  	</header>
   6.362  
   6.363  	<div style="display:none">
   6.364 @@ -1683,7 +1663,7 @@
   6.365  
   6.366  		<textarea name="text" id="improveText" style="width:100%; resize: vertical; min-height:10rem"></textarea>
   6.367  		<footer>
   6.368 -			<button type="submit" data-icon="slitaz">$(_ 'Send')</button>
   6.369 +			<button type="submit" data-icon="@slitaz@">$(_ 'Send')</button>
   6.370  		</footer>
   6.371  	</form>
   6.372  </section>
   6.373 @@ -1693,7 +1673,7 @@
   6.374  <section>
   6.375  	<header>
   6.376  		$(_ 'Thank you!')
   6.377 -		<form><button name="info" value="$pkg" data-icon="back">$(_ 'Back')</button></form>
   6.378 +		<form><button name="info" value="$pkg" data-icon="@back@">$(_ 'Back')</button></form>
   6.379  	</header>
   6.380  <div>The following information was sent to SliTaz developers:</div>
   6.381  <pre class="scroll"><b>User:</b> $user
   6.382 @@ -1746,12 +1726,12 @@
   6.383  			[2-9]) echo $ago;;
   6.384  			*) echo "<span style='color:red'>$ago</span>"
   6.385  				_ 'It is recommended to [recharge] the lists.' | \
   6.386 -				sed 's|\[|<a data-icon="refresh" href="?recharge">|;s|\]|</a>|';;
   6.387 +				sed 's|\[|<a data-icon="@refresh@" href="?recharge">|;s|\]|</a>|';;
   6.388  		esac
   6.389  	else
   6.390  		_ 'never.'
   6.391  		_ 'You need to [download] the lists for further work.' | \
   6.392 -		sed 's|\[|<a data-icon="download" href="?recharge" data-root>|;s|\]|</a>|'
   6.393 +		sed 's|\[|<a data-icon="@download@" href="?recharge" data-root>|;s|\]|</a>|'
   6.394  	fi)</td></tr>
   6.395  		<tr>
   6.396  			<td>$(_ 'Installed packages:')</td>
   6.397 @@ -1784,7 +1764,7 @@
   6.398  	<header>
   6.399  		$(_ 'Latest log entries')
   6.400  		<form action="index.cgi">
   6.401 -			<button name="file" value="$LOG" data-icon="view">$(_ 'Show')</button>
   6.402 +			<button name="file" value="$LOG" data-icon="@view@">$(_ 'Show')</button>
   6.403  		</form>
   6.404  	</header>
   6.405  	<pre>$(tail -n 5 $LOG | tac | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}')</pre>
     7.1 --- a/tazpkg-box	Sat Dec 05 17:21:54 2015 +0100
     7.2 +++ b/tazpkg-box	Thu Dec 10 04:08:41 2015 +0200
     7.3 @@ -15,7 +15,7 @@
     7.4  text="<b>$(_ 'SliTaz Package Action')</b>"
     7.5  icon="system-software-install"
     7.6  opts="--window-icon=$icon --image=$icon --image-on-top --center --on-top \
     7.7 ---height=350 --width=570 --title=TazPkg"
     7.8 +--height=350 --width=550 --title=TazPkg"
     7.9  
    7.10  
    7.11  usage() {
    7.12 @@ -36,7 +36,7 @@
    7.13  # Nice GTK output for install and extract.
    7.14  
    7.15  output() {
    7.16 -	yad --text-info $opts --tail --margins='4' --text="$text" --fontname='monospace,8' \
    7.17 +	yad --text-info $opts --tail --margins='4' --text="$text" --fontname='monospace,10' \
    7.18  		--button='gtk-close:0'
    7.19  }
    7.20  
    7.21 @@ -66,8 +66,8 @@
    7.22  	# Deal with --button values
    7.23  	case "$?" in
    7.24  		1) exit 0 ;;
    7.25 -		2) tazpkg extract "$pkg" . --output='raw' | output ;;
    7.26 -		3) tazpkg -i "$pkg" . --forced --output='raw' | output ;;
    7.27 +		2) tazpkg extract "$pkg" . --output='raw' --cols=65 | output ;;
    7.28 +		3) tazpkg -i "$pkg" . --forced --output='raw' --cols=65 | output ;;
    7.29  	esac
    7.30  }
    7.31  
    7.32 @@ -79,7 +79,7 @@
    7.33  	_ 'Downloading: %s' "$pkg"; newline
    7.34  	TMP_DIR=$(mktemp); cd "$TMP_DIR"
    7.35  	wget "$url" 2>&1
    7.36 -	tazpkg -i "$TMP_DIR/$pkg" --forced --output='raw' 2>&1
    7.37 +	tazpkg -i "$TMP_DIR/$pkg" --forced --output='raw' --cols=65 2>&1
    7.38  	rm -f "$TMP_DIR"
    7.39  }
    7.40