tazpkg view lib/tazpkgbox/package_infos @ rev 90
tazpkgbox: add size for mirrored packages
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon May 19 11:04:00 2008 +0000 (2008-05-19) |
parents | ba8155966f13 |
children | fff4fbde912a |
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 PACKED_SIZE=""
13 DEPENDS=""
14 . /var/lib/tazpkg/installed/$PKG/receipt
15 PACKAGE_INFOS="
16 <window title=\"Package: $PKG\" icon-name=\"package-x-generic\">
17 <vbox>
19 <tree>
20 <width>460</width><height>160</height>
21 <label>Package|$PKG</label>
22 <item icon=\"tazpkg\">Version: | $VERSION</item>
23 <item icon=\"tazpkg\">Category: | $CATEGORY</item>"
24 [ -n "$DEPENDS" ] && PACKAGE_INFOS="$PACKAGE_INFOS
25 <item icon=\"tazpkg\">Depends: | $DEPENDS</item>"
26 [ -n "$PACKED_SIZE" ] && PACKAGE_INFOS="$PACKAGE_INFOS
27 <item icon=\"tazpkg\">Size: | $PACKED_SIZE ($UNPACKED_SIZE installed)</item>"
28 PACKAGE_INFOS="$PACKAGE_INFOS
29 <item icon=\"system-users\">Maintainer: | $MAINTAINER</item>
30 <item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
31 </tree>
33 <hbox>
34 <button>
35 <label>Remove</label>
36 <input file icon=\"edit-delete\"></input>
37 <action>xterm -T \"Remove $PACKAGE\" $XTERM_OPTS -e \"\
38 tazpkg remove $PACKAGE; sleep 2\"</action>
39 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
40 </button>
41 <button>
42 <label>Repack</label>
43 <input file icon=\"edit-redo\"></input>
44 <action>xterm -T \"Repack $PACKAGE\" $XTERM_OPTS -e \"\
45 cd /var/cache/tazpkg; \
46 tazpkg repack $PACKAGE; sleep 2\"</action>
47 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
48 </button>
49 <button>
50 <input file icon=\"gtk-close\"></input>
51 <action type=\"closewindow\">INSTALLED_PACKAGE_ACTIONS</action>
52 </button>
53 </hbox>
55 </vbox>
56 </window>
57 "
58 export PACKAGE_INFOS
59 else
60 RES=`grep "^$PKG" /var/lib/tazpkg/packages.desc | head -n 1`
61 PACKAGE=`echo "$RES" | cut -d "|" -f 1`
62 VERSION=`echo "$RES" | cut -d "|" -f 2`
63 CATEGORY=`echo "$RES" | cut -d "|" -f 4`
64 WEB_SITE=`echo "$RES" | cut -d "|" -f 5`
65 SIZES=`grep -A 3 "^$(echo $PACKAGE)$" /var/lib/tazpkg/packages.txt | tail -1`
66 PACKAGE_INFOS="
67 <window title=\"Package: $PACKAGE\" icon-name=\"package-x-generic\">
68 <vbox>
70 <tree>
71 <width>460</width><height>140</height>
72 <label>Package|$PKG</label>
73 <item icon=\"tazpkg\">Name: | $PACKAGE</item>
74 <item icon=\"tazpkg\">Version: | $VERSION</item>
75 <item icon=\"tazpkg\">Category: | $CATEGORY</item>"
76 [ -n "$SIZES" ] && PACKAGE_INFOS="$PACKAGE_INFOS
77 <item icon=\"tazpkg\">Size: | $SIZES</item>"
78 PACKAGE_INFOS="$PACKAGE_INFOS
79 <item icon=\"applications-internet\">Web site: | $WEB_SITE</item>
80 </tree>
82 <hbox>
83 <button>
84 <label>Get-install</label>
85 <input file icon=\"go-next\"></input>
86 <action>xterm -T \"Install $PACKAGE\" $XTERM_OPTS -e \"\
87 tazpkg get-install $PACKAGE; sleep 2\"</action>
88 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
89 </button>
90 <button>
91 <label>Get</label>
92 <input file icon=\"go-next\"></input>
93 <action>xterm -T \"Get $PACKAGE\" $XTERM_OPTS -e \"\
94 cd /var/cache/tazpkg; tazpkg get $PACKAGE; sleep 2\"</action>
95 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
96 </button>
97 <button>
98 <input file icon=\"gtk-close\"></input>
99 <action type=\"closewindow\">MIRRORED_PACKAGE_ACTIONS</action>
100 </button>
101 </hbox>
103 </vbox>
104 </window>
105 "
106 export PACKAGE_INFOS
107 fi
109 gtkdialog --center --program=PACKAGE_INFOS
111 exit 0