tazpkg diff lib/tazpkgbox/package_infos @ rev 81

Add Tazpkgbox libraries
author Christophe Lincoln <pankso@slitaz.org>
date Fri May 09 17:26:15 2008 +0200 (2008-05-09)
parents
children 8ea97bf01b2f
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/tazpkgbox/package_infos	Fri May 09 17:26:15 2008 +0200
     1.3 @@ -0,0 +1,99 @@
     1.4 +#!/bin/sh
     1.5 +#
     1.6 +# Dialog box to provide package infos and actions
     1.7 +#
     1.8 +
     1.9 +XTERM_OPTS="-geometry 80x16+120+120"
    1.10 +
    1.11 +PKG=`cat /tmp/tazpkgbox/pkg | sed s/" "/""/g`
    1.12 +
    1.13 +# Installed or not installed, that the question.
    1.14 +if [ -d /var/lib/tazpkg/installed/$PKG ]; then
    1.15 +	. /var/lib/tazpkg/installed/$PKG/receipt
    1.16 +	export PACKAGE_INFOS="
    1.17 +<window title=\"Package: $PKG\" icon-name=\"package-x-generic\">
    1.18 +<vbox>
    1.19 +
    1.20 +	<tree>
    1.21 +		<width>460</width><height>160</height>
    1.22 +		<label>Package|$PKG</label>
    1.23 +		<item icon=\"tazpkg\">Version: | $VERSION</item>
    1.24 +		<item icon=\"tazpkg\">Category: | $CATEGORY</item>
    1.25 +		<item icon=\"tazpkg\">Depends: | $DEPENDS</item>
    1.26 +		<item icon=\"system-users\">Maintainer: | $MAINTAINER</item>
    1.27 +		<item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
    1.28 +	</tree>
    1.29 +
    1.30 +	<hbox>
    1.31 +		<button>
    1.32 +			<label>Remove</label>
    1.33 +			<input file icon=\"edit-delete\"></input>
    1.34 +			<action>xterm -T \"Remove $PACKAGE\" $XTERM_OPTS -e \"\
    1.35 +			tazpkg remove $PACKAGE; sleep 2\"</action>
    1.36 +			<action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
    1.37 +		</button>
    1.38 +		<button>
    1.39 +			<label>Repack</label>
    1.40 +			<input file icon=\"edit-redo\"></input>
    1.41 +			<action>xterm -T \"Repack $PACKAGE\" $XTERM_OPTS -e \"\
    1.42 +			cd /var/cache/tazpkg; \
    1.43 +			tazpkg repack $PACKAGE; sleep 2\"</action>
    1.44 +			<action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
    1.45 +		</button>
    1.46 +		<button>
    1.47 +			<input file icon=\"gtk-close\"></input>
    1.48 +			<action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
    1.49 +		</button>
    1.50 +	</hbox>
    1.51 +
    1.52 +</vbox>
    1.53 +</window>
    1.54 +"
    1.55 +else
    1.56 +	RES=`grep "^$PKG" /var/lib/tazpkg/packages.desc | head -n 1`
    1.57 +	PACKAGE=`echo "$RES" | cut -d "|" -f 1`
    1.58 +	VERSION=`echo "$RES" | cut -d "|" -f 2`
    1.59 +	CATEGORY=`echo "$RES" | cut -d "|" -f 4`
    1.60 +	WEB_SITE=`echo "$RES" | cut -d "|" -f 5`
    1.61 +	export PACKAGE_INFOS="
    1.62 +<window title=\"Package: $PACKAGE\" icon-name=\"package-x-generic\">
    1.63 +<vbox>
    1.64 +
    1.65 +	<tree>
    1.66 +		<width>460</width><height>140</height>
    1.67 +		<label>Package|$PKG</label>
    1.68 +		<item icon=\"tazpkg\">Name: | $PACKAGE</item>
    1.69 +		<item icon=\"tazpkg\">Version: | $VERSION</item>
    1.70 +		<item icon=\"tazpkg\">category: | $CATEGORY</item>
    1.71 +		<item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
    1.72 +	</tree>
    1.73 +
    1.74 +	<hbox>
    1.75 +		<button>
    1.76 +			<label>Get-install</label>
    1.77 +			<input file icon=\"go-next\"></input>
    1.78 +			<action>xterm -T \"Install $PACKAGE\" $XTERM_OPTS -e \"\
    1.79 +			tazpkg get-install $PACKAGE; sleep 2\"</action>
    1.80 +			<action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
    1.81 +		</button>
    1.82 +		<button>
    1.83 +			<label>Get</label>
    1.84 +			<input file icon=\"go-next\"></input>
    1.85 +			<action>xterm -T \"Get $PACKAGE\" $XTERM_OPTS -e \"\
    1.86 +			cd /var/cache/tazpkg; tazpkg get $PACKAGE; sleep 2\"</action>
    1.87 +			<action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
    1.88 +		</button>
    1.89 +		<button>
    1.90 +			<input file icon=\"gtk-close\"></input>
    1.91 +			<action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
    1.92 +		</button>
    1.93 +	</hbox>
    1.94 +
    1.95 +</vbox>
    1.96 +</window>
    1.97 +"
    1.98 +fi
    1.99 +
   1.100 +gtkdialog --center --program=PACKAGE_INFOS
   1.101 +
   1.102 +exit 0