tazpkg view 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 source
1 #!/bin/sh
2 #
3 # Dialog box to provide package infos and actions
4 #
6 XTERM_OPTS="-geometry 80x16+120+120"
8 PKG=`cat /tmp/tazpkgbox/pkg | sed s/" "/""/g`
10 # Installed or not installed, that the question.
11 if [ -d /var/lib/tazpkg/installed/$PKG ]; then
12 . /var/lib/tazpkg/installed/$PKG/receipt
13 export PACKAGE_INFOS="
14 <window title=\"Package: $PKG\" icon-name=\"package-x-generic\">
15 <vbox>
17 <tree>
18 <width>460</width><height>160</height>
19 <label>Package|$PKG</label>
20 <item icon=\"tazpkg\">Version: | $VERSION</item>
21 <item icon=\"tazpkg\">Category: | $CATEGORY</item>
22 <item icon=\"tazpkg\">Depends: | $DEPENDS</item>
23 <item icon=\"system-users\">Maintainer: | $MAINTAINER</item>
24 <item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
25 </tree>
27 <hbox>
28 <button>
29 <label>Remove</label>
30 <input file icon=\"edit-delete\"></input>
31 <action>xterm -T \"Remove $PACKAGE\" $XTERM_OPTS -e \"\
32 tazpkg remove $PACKAGE; sleep 2\"</action>
33 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
34 </button>
35 <button>
36 <label>Repack</label>
37 <input file icon=\"edit-redo\"></input>
38 <action>xterm -T \"Repack $PACKAGE\" $XTERM_OPTS -e \"\
39 cd /var/cache/tazpkg; \
40 tazpkg repack $PACKAGE; sleep 2\"</action>
41 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
42 </button>
43 <button>
44 <input file icon=\"gtk-close\"></input>
45 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
46 </button>
47 </hbox>
49 </vbox>
50 </window>
51 "
52 else
53 RES=`grep "^$PKG" /var/lib/tazpkg/packages.desc | head -n 1`
54 PACKAGE=`echo "$RES" | cut -d "|" -f 1`
55 VERSION=`echo "$RES" | cut -d "|" -f 2`
56 CATEGORY=`echo "$RES" | cut -d "|" -f 4`
57 WEB_SITE=`echo "$RES" | cut -d "|" -f 5`
58 export PACKAGE_INFOS="
59 <window title=\"Package: $PACKAGE\" icon-name=\"package-x-generic\">
60 <vbox>
62 <tree>
63 <width>460</width><height>140</height>
64 <label>Package|$PKG</label>
65 <item icon=\"tazpkg\">Name: | $PACKAGE</item>
66 <item icon=\"tazpkg\">Version: | $VERSION</item>
67 <item icon=\"tazpkg\">category: | $CATEGORY</item>
68 <item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
69 </tree>
71 <hbox>
72 <button>
73 <label>Get-install</label>
74 <input file icon=\"go-next\"></input>
75 <action>xterm -T \"Install $PACKAGE\" $XTERM_OPTS -e \"\
76 tazpkg get-install $PACKAGE; sleep 2\"</action>
77 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
78 </button>
79 <button>
80 <label>Get</label>
81 <input file icon=\"go-next\"></input>
82 <action>xterm -T \"Get $PACKAGE\" $XTERM_OPTS -e \"\
83 cd /var/cache/tazpkg; tazpkg get $PACKAGE; sleep 2\"</action>
84 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
85 </button>
86 <button>
87 <input file icon=\"gtk-close\"></input>
88 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
89 </button>
90 </hbox>
92 </vbox>
93 </window>
94 "
95 fi
97 gtkdialog --center --program=PACKAGE_INFOS
99 exit 0