tazpkg view tazpkgbox @ rev 126

Change release string to 2.3
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jul 15 23:33:41 2008 +0200 (2008-07-15)
parents 877a7f9443d8
children 3ad89c4852fb
line source
1 #!/bin/sh
2 #
3 # GTKdialog interface to SliTaz Packages Manager aka Tazpkg. Functions
4 # path: /usr/lib/slitaz/tazpkgbox. Notes: Notebook tab are vbox, tab are
5 # used to indent.
6 #
7 # (C) GNU gpl v3 - SliTaz GNU/Linux 2008.
8 #
9 VERSION=2.3
11 # Tazpkgbox is only for root.
12 if test $(id -u) != 0 ; then
13 exec subox tazpkgbox
14 exit 0
15 fi
17 # We need at least a mirror URL.
18 if [ ! -f /var/lib/tazpkg/mirror ]; then
19 tazpkg >/dev/null
20 fi
22 # Tmp dir and files used to get pkgs infos on the fly. Clean also
23 # list and search files to load less data and have a faster start.
24 mkdir -p /tmp/tazpkgbox
25 echo "all" > /tmp/tazpkgbox/installed-category
26 echo "all" > /tmp/tazpkgbox/mirrored-category
27 echo "" > /tmp/tazpkgbox/search-installed
28 echo "" > /tmp/tazpkgbox/search-mirrored
30 # English/French help dialod.
31 export HELP='
32 <window title="Tazpkgbox Help" icon-name="help">
33 <vbox>
34 <text use-markup="true" width-chars="54">
35 <label>"
36 <b>Tazpkgbox - Packages Manager Help</b>"
37 </label>
38 </text>
40 <frame English>
41 <text wrap="false">
42 <label>"
43 Tazpkgbox is a simple and easy to use interface to the SliTaz
44 package manager - aka Tazpkg. You can install, remove, repack or
45 get packages by double-clicking on the package item. A Search engine
46 lets you find and install new applications in a few mouse clicks.
48 Downloaded and repacked packages are stored in: /var/cache/tazpkg"
49 </label>
50 </text>
51 </frame>
53 <frame Français>
54 <text wrap="false">
55 <label>"
56 Tazpkgbox est une interface graphique au gestionnaire de paquet
57 de Slitaz aka Tazpkg. Simple et facile à utiliser, vous pouvez
58 installer, télécharger ou supprimer des paquet en double-cliquant
59 sur sa ligne. Les paquets téléchargés ou recréés sont stocké
60 dans: /var/cache/tazpkg"
61 </label>
62 </text>
63 </frame>
65 <hbox>
66 <button ok>
67 <action type="closewindow">HELP</action>
68 </button>
69 </hbox>
70 </vbox>
71 </window>
72 '
74 # Main dialog
75 export TAZPKG_DIALOG='
76 <window title="SliTaz Packages Manager" icon-name="package-x-generic">
77 <vbox>
79 <hbox>
80 <text use-markup="true">
81 <label>"<b>Packages Manager</b>"</label>
82 </text>
83 <pixmap>
84 <input file>/usr/share/pixmaps/tazpkg.png</input>
85 </pixmap>
86 </hbox>
88 <notebook labels="Installed|Mirrored|Search|Configuration">
90 <vbox>
91 <tree>
92 <width>620</width><height>240</height>
93 <variable>PKG</variable>
94 <label>Package name|Version|Description</label>
95 <input>/usr/lib/slitaz/tazpkgbox/list installed</input>
96 <action>echo "$PKG" > /tmp/tazpkgbox/pkg</action>
97 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
98 <action>refresh:PKG</action>
99 <action>refresh:PKG_STATS</action>
100 <action>refresh:CACHE_STATS</action>
101 </tree>
102 <hbox>
103 <text>
104 <label>"Category:"</label>
105 </text>
106 <combobox>
107 <variable>INSTALLED_CAT</variable>
108 <item>all</item>
109 <item>base-system</item>
110 <item>utilities</item>
111 <item>network</item>
112 <item>graphics</item>
113 <item>multimedia</item>
114 <item>office</item>
115 <item>development</item>
116 <item>system-tools</item>
117 <item>security</item>
118 <item>games</item>
119 <item>misc</item>
120 <item>meta</item>
121 <item>non-free</item>
122 </combobox>
123 <button>
124 <label>List</label>
125 <input file icon="reload"></input>
126 <action>echo "$INSTALLED_CAT" > /tmp/tazpkgbox/installed-category</action>
127 <action>refresh:PKG</action>
128 </button>
129 <button>
130 <label>Upgrade all</label>
131 <input file icon="system-software-update"></input>
132 <action>xterm -T "Package upgrade" -geometry 80x16+120+120 -e "tazpkg upgrade; sleep 2"</action>
133 <action>refresh:PKG</action>
134 <action>refresh:PKG_STATS</action>
135 <action>refresh:CACHE_STATS</action>
136 </button>
137 </hbox>
138 </vbox>
140 <vbox>
141 <tree>
142 <width>620</width><height>240</height>
143 <variable>GET</variable>
144 <label>Package name|Version|Description</label>
145 <input>/usr/lib/slitaz/tazpkgbox/list mirrored</input>
146 <action>echo "$GET" > /tmp/tazpkgbox/pkg</action>
147 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
148 <action>refresh:PKG</action>
149 <action>refresh:PKG_STATS</action>
150 <action>refresh:CACHE_STATS</action>
151 </tree>
152 <hbox>
153 <combobox>
154 <variable>MIRRORED_CAT</variable>
155 <item>all</item>
156 <item>base-system</item>
157 <item>utilities</item>
158 <item>network</item>
159 <item>graphics</item>
160 <item>multimedia</item>
161 <item>office</item>
162 <item>development</item>
163 <item>system-tools</item>
164 <item>security</item>
165 <item>games</item>
166 <item>misc</item>
167 <item>meta</item>
168 <item>non-free</item>
169 </combobox>
170 <button>
171 <label>List</label>
172 <input file icon="reload"></input>
173 <action>echo "$MIRRORED_CAT" > /tmp/tazpkgbox/mirrored-category</action>
174 <action>refresh:GET</action>
175 </button>
176 <button>
177 <label>Recharge list</label>
178 <input file icon="system-software-update"></input>
179 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2"</action>
180 <action>refresh:GET</action>
181 <action>refresh:PKG_STATS</action>
182 </button>
183 </hbox>
184 </vbox>
186 <vbox>
187 <tree icon="tazpkg">
188 <width>620</width><height>120</height>
189 <variable>RESULT_INSTALLED</variable>
190 <label>Installed packages|Version|Description / File</label>
191 <input>cat /tmp/tazpkgbox/search-installed</input>
192 <action>echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg</action>
193 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
194 <action>/usr/lib/slitaz/tazpkgbox/search</action>
195 <action>refresh:RESULT_INSTALLED</action>
196 <action>refresh:PKG</action>
197 <action>refresh:PKG_STATS</action>
198 <action>refresh:CACHE_STATS</action>
199 </tree>
200 <tree icon="tazpkg">
201 <width>620</width><height>120</height>
202 <variable>RESULT_MIRROR</variable>
203 <label>Mirrored packages|Version|Description / File</label>
204 <input>cat /tmp/tazpkgbox/search-mirrored</input>
205 <action>echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg</action>
206 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
207 <action>/usr/lib/slitaz/tazpkgbox/search</action>
208 <action>refresh:RESULT_INSTALLED</action>
209 <action>refresh:PKG</action>
210 <action>refresh:PKG_STATS</action>
211 <action>refresh:CACHE_STATS</action>
212 </tree>
213 <hbox>
214 <entry>
215 <variable>SEARCH</variable>
216 </entry>
217 <button>
218 <label>Search Packages</label>
219 <input file icon="system-search"></input>
220 <action>/usr/lib/slitaz/tazpkgbox/search</action>
221 <action>refresh:RESULT_INSTALLED</action>
222 <action>refresh:RESULT_MIRROR</action>
223 </button>
224 <button>
225 <label>Search Files</label>
226 <input file icon="system-search"></input>
227 <action>/usr/lib/slitaz/tazpkgbox/search --files</action>
228 <action>refresh:RESULT_INSTALLED</action>
229 <action>refresh:RESULT_MIRROR</action>
230 </button>
231 </hbox>
232 </vbox>
234 <vbox>
235 <frame Cache directory>
236 <text use-markup="true" width-chars="60">
237 <label>
238 "The cache directory is used to store downloaded or repacked packages."
239 </label>
240 </text>
241 <hbox>
242 <entry editable="false">
243 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
244 <variable>CACHE_STATS</variable>
245 </entry>
246 <button>
247 <label>Clean cache</label>
248 <input file icon="go-next"></input>
249 <action>rm -rf /var/cache/tazpkg/*</action>
250 <action>refresh:CACHE_STATS</action>
251 </button>
252 </hbox>
253 </frame>
254 <frame Mirror URL>
255 <hbox>
256 <entry>
257 <input>head -n 1 /var/lib/tazpkg/mirror</input>
258 <variable>MIRROR</variable>
259 </entry>
260 <button>
261 <label>Setup</label>
262 <input file icon="go-next"></input>
263 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
264 <action>clear:MIRROR</action>
265 <action>refresh:MIRROR</action>
266 </button>
267 <button>
268 <label>Add</label>
269 <input file icon="gtk-add"></input>
270 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
271 <action>clear:MIRROR</action>
272 <action>refresh:MIRROR</action>
273 </button>
274 </hbox>
275 </frame>
276 <frame Files path and packages check>
277 <hbox>
278 <text use-markup="true" width-chars="60">
279 <label>
280 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
281 </label>
282 </text>
283 </hbox>
284 <hbox>
285 <button>
286 <label>Quick check</label>
287 <input file icon="go-next"></input>
288 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check | less "</action>
289 </button>
290 <button>
291 <label>Full check</label>
292 <input file icon="go-next"></input>
293 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check --full | less "</action>
294 </button>
295 </hbox>
296 </frame>
297 </vbox>
299 </notebook>
301 <hbox>
302 <text>
303 <input>echo "Packages: `ls /var/lib/tazpkg/installed | wc -l` installed, `cat /var/lib/tazpkg/packages.list | wc -l` mirrored, `cat /var/lib/tazpkg/upradable-packages.list | wc -l` to upgrade "</input>
304 <variable>PKG_STATS</variable>
305 </text>
306 </hbox>
308 <hbox>
309 <button>
310 <label>Wok</label>
311 <input file icon="gtk-open"></input>
312 <action>firefox http://hg.slitaz.org/wok/file/</action>
313 </button>
314 <button help>
315 <label>Help</label>
316 <action type="launch">HELP</action>
317 </button>
318 <button>
319 <label>Exit</label>
320 <input file icon="exit"></input>
321 <action type="exit">Exit</action>
322 </button>
323 </hbox>
325 </vbox>
327 </window>
328 '
330 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
332 exit 0