tazpkg view tazpkgbox @ rev 160

Add category x-window
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Sep 26 09:05:02 2008 +0000 (2008-09-26)
parents db7e865c0a11
children 2bf43ed75a02
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/installable-category
27 echo "all" > /tmp/tazpkgbox/mirrored-category
28 echo "" > /tmp/tazpkgbox/search-installed
29 echo "" > /tmp/tazpkgbox/search-mirrored
31 # English/French help dialod.
32 export HELP='
33 <window title="Tazpkgbox Help" icon-name="help">
34 <vbox>
35 <text use-markup="true" width-chars="54">
36 <label>"
37 <b>Tazpkgbox - Packages Manager Help</b>"
38 </label>
39 </text>
41 <frame English>
42 <text wrap="false">
43 <label>"
44 Tazpkgbox is a simple and easy to use interface to the SliTaz
45 package manager - aka Tazpkg. You can install, remove, repack or
46 get packages by double-clicking on the package item. A Search engine
47 lets you find and install new applications in a few mouse clicks.
49 Downloaded and repacked packages are stored in: /var/cache/tazpkg"
50 </label>
51 </text>
52 </frame>
54 <frame Français>
55 <text wrap="false">
56 <label>"
57 Tazpkgbox est une interface graphique au gestionnaire de paquet
58 de Slitaz aka Tazpkg. Simple et facile à utiliser, vous pouvez
59 installer, télécharger ou supprimer des paquet en double-cliquant
60 sur sa ligne. Les paquets téléchargés ou recréés sont stocké
61 dans: /var/cache/tazpkg"
62 </label>
63 </text>
64 </frame>
66 <hbox>
67 <button ok>
68 <action type="closewindow">HELP</action>
69 </button>
70 </hbox>
71 </vbox>
72 </window>
73 '
75 export LIST_CONFIG_FILES='
76 <window title="configuration files" icon-name="system-file-manager">
77 <vbox>
78 <tree exported_column="5">
79 <width>560</width><height>160</height>
80 <variable>CONF_FILE</variable>
81 <label>Access | User | Group | Size | Update Date | Name</label>
82 <input>tazpkg list-config --box</input>
83 <action>leafpad $CONF_FILE</action>
84 </tree>
85 <hbox>
86 <text wrap="false">
87 <label>
88 "Only files with Update Date have been modified after package installation"
89 </label>
90 </text>
91 <button>
92 <input file icon="gtk-close"></input>
93 <action type="closewindow">INSTALLED_PACKAGE_ACTIONS</action>
94 </button>
95 </hbox>
96 </vbox>
97 </window>
98 '
100 # Main dialog
101 export TAZPKG_DIALOG='
102 <window title="SliTaz Packages Manager" icon-name="package-x-generic">
103 <vbox>
105 <hbox>
106 <text use-markup="true">
107 <label>"<b>Packages Manager</b>"</label>
108 </text>
109 <pixmap>
110 <input file>/usr/share/pixmaps/tazpkg.png</input>
111 </pixmap>
112 </hbox>
114 <notebook labels="Installed|Installable|Mirrored|Search|Configuration">
116 <vbox>
117 <tree>
118 <width>620</width><height>240</height>
119 <variable>PKG</variable>
120 <label>Package name|Version|Description</label>
121 <input>/usr/lib/slitaz/tazpkgbox/list installed</input>
122 <action>echo "$PKG" > /tmp/tazpkgbox/pkg</action>
123 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
124 <action>refresh:PKG</action>
125 <action>refresh:PKG_STATS</action>
126 <action>refresh:CACHE_STATS</action>
127 </tree>
128 <hbox>
129 <text>
130 <label>"Category:"</label>
131 </text>
132 <combobox>
133 <variable>INSTALLED_CAT</variable>
134 <item>all</item>
135 <item>base-system</item>
136 <item>x-window</item>
137 <item>utilities</item>
138 <item>network</item>
139 <item>graphics</item>
140 <item>multimedia</item>
141 <item>office</item>
142 <item>development</item>
143 <item>system-tools</item>
144 <item>security</item>
145 <item>games</item>
146 <item>misc</item>
147 <item>meta</item>
148 <item>non-free</item>
149 </combobox>
150 <button>
151 <label>List</label>
152 <input file icon="reload"></input>
153 <action>echo "$INSTALLED_CAT" > /tmp/tazpkgbox/installed-category</action>
154 <action>refresh:PKG</action>
155 </button>
156 <button>
157 <label>Upgrade all</label>
158 <input file icon="system-software-update"></input>
159 <action>xterm -T "Package upgrade" -geometry 80x16+120+120 -e "tazpkg upgrade; sleep 2" 2>/dev/null</action>
160 <action>refresh:PKG</action>
161 <action>refresh:PKG_STATS</action>
162 <action>refresh:CACHE_STATS</action>
163 </button>
164 </hbox>
165 </vbox>
167 <vbox>
168 <tree>
169 <width>620</width><height>240</height>
170 <variable>GETIT</variable>
171 <label>Package name|Version|Description</label>
172 <input>/usr/lib/slitaz/tazpkgbox/list installable</input>
173 <action>echo "$GETIT" > /tmp/tazpkgbox/pkg</action>
174 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
175 <action>refresh:PKG</action>
176 <action>refresh:GETIT</action>
177 <action>refresh:PKG_STATS</action>
178 <action>refresh:CACHE_STATS</action>
179 </tree>
180 <hbox>
181 <text>
182 <label>"Category:"</label>
183 </text>
184 <combobox>
185 <variable>INSTALLABLE_CAT</variable>
186 <item>all</item>
187 <item>base-system</item>
188 <item>x-window</item>
189 <item>utilities</item>
190 <item>network</item>
191 <item>graphics</item>
192 <item>multimedia</item>
193 <item>office</item>
194 <item>development</item>
195 <item>system-tools</item>
196 <item>security</item>
197 <item>games</item>
198 <item>misc</item>
199 <item>meta</item>
200 <item>non-free</item>
201 </combobox>
202 <button>
203 <label>List</label>
204 <input file icon="reload"></input>
205 <action>echo "$INSTALLABLE_CAT" > /tmp/tazpkgbox/installable-category</action>
206 <action>refresh:GETIT</action>
207 </button>
208 <button>
209 <label>Recharge list</label>
210 <input file icon="system-software-update"></input>
211 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
212 <action>refresh:GETIT</action>
213 <action>refresh:PKG_STATS</action>
214 </button>
215 </hbox>
216 </vbox>
218 <vbox>
219 <tree>
220 <width>620</width><height>240</height>
221 <variable>GET</variable>
222 <label>Package name|Version|Description</label>
223 <input>/usr/lib/slitaz/tazpkgbox/list mirrored</input>
224 <action>echo "$GET" > /tmp/tazpkgbox/pkg</action>
225 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
226 <action>refresh:PKG</action>
227 <action>refresh:PKG_STATS</action>
228 <action>refresh:CACHE_STATS</action>
229 </tree>
230 <hbox>
231 <combobox>
232 <variable>MIRRORED_CAT</variable>
233 <item>all</item>
234 <item>base-system</item>
235 <item>x-window</item>
236 <item>utilities</item>
237 <item>network</item>
238 <item>graphics</item>
239 <item>multimedia</item>
240 <item>office</item>
241 <item>development</item>
242 <item>system-tools</item>
243 <item>security</item>
244 <item>games</item>
245 <item>misc</item>
246 <item>meta</item>
247 <item>non-free</item>
248 </combobox>
249 <button>
250 <label>List</label>
251 <input file icon="reload"></input>
252 <action>echo "$MIRRORED_CAT" > /tmp/tazpkgbox/mirrored-category</action>
253 <action>refresh:GET</action>
254 </button>
255 <button>
256 <label>Recharge list</label>
257 <input file icon="system-software-update"></input>
258 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
259 <action>refresh:GET</action>
260 <action>refresh:PKG_STATS</action>
261 </button>
262 </hbox>
263 </vbox>
265 <vbox>
266 <tree icon="tazpkg">
267 <width>620</width><height>120</height>
268 <variable>RESULT_INSTALLED</variable>
269 <label>Installed packages|Version|Description / File</label>
270 <input>cat /tmp/tazpkgbox/search-installed</input>
271 <action>echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg</action>
272 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
273 <action>/usr/lib/slitaz/tazpkgbox/search</action>
274 <action>refresh:RESULT_INSTALLED</action>
275 <action>refresh:PKG</action>
276 <action>refresh:PKG_STATS</action>
277 <action>refresh:CACHE_STATS</action>
278 </tree>
279 <tree icon="tazpkg">
280 <width>620</width><height>120</height>
281 <variable>RESULT_MIRROR</variable>
282 <label>Mirrored packages|Version|Description / File</label>
283 <input>cat /tmp/tazpkgbox/search-mirrored</input>
284 <action>echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg</action>
285 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
286 <action>/usr/lib/slitaz/tazpkgbox/search</action>
287 <action>refresh:RESULT_INSTALLED</action>
288 <action>refresh:PKG</action>
289 <action>refresh:PKG_STATS</action>
290 <action>refresh:CACHE_STATS</action>
291 </tree>
292 <hbox>
293 <entry>
294 <variable>SEARCH</variable>
295 </entry>
296 <button>
297 <label>Search Packages</label>
298 <input file icon="system-search"></input>
299 <action>/usr/lib/slitaz/tazpkgbox/search</action>
300 <action>refresh:RESULT_INSTALLED</action>
301 <action>refresh:RESULT_MIRROR</action>
302 </button>
303 <button>
304 <label>Search Files</label>
305 <input file icon="system-search"></input>
306 <action>/usr/lib/slitaz/tazpkgbox/search --files</action>
307 <action>refresh:RESULT_INSTALLED</action>
308 <action>refresh:RESULT_MIRROR</action>
309 </button>
310 </hbox>
311 </vbox>
313 <vbox>
314 <frame Cache directory>
315 <text use-markup="true" width-chars="60" wrap="false">
316 <label>
317 "The cache directory is used to store downloaded or repacked packages."
318 </label>
319 </text>
320 <hbox>
321 <entry editable="false">
322 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
323 <variable>CACHE_STATS</variable>
324 </entry>
325 <button>
326 <label>Clean cache</label>
327 <input file icon="go-next"></input>
328 <action>rm -rf /var/cache/tazpkg/*</action>
329 <action>refresh:CACHE_STATS</action>
330 </button>
331 </hbox>
332 </frame>
333 <frame Mirror URL>
334 <hbox>
335 <entry>
336 <input>head -n 1 /var/lib/tazpkg/mirror</input>
337 <variable>MIRROR</variable>
338 </entry>
339 <button>
340 <label>Setup</label>
341 <input file icon="go-next"></input>
342 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
343 <action>clear:MIRROR</action>
344 <action>refresh:MIRROR</action>
345 </button>
346 <button>
347 <label>Add</label>
348 <input file icon="gtk-add"></input>
349 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
350 <action>clear:MIRROR</action>
351 <action>refresh:MIRROR</action>
352 </button>
353 </hbox>
354 </frame>
355 <frame Files path>
356 <hbox>
357 <text use-markup="true" width-chars="60">
358 <label>
359 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
360 </label>
361 </text>
362 </hbox>
363 </frame>
364 <hbox>
365 <frame Configuration files>
366 <hbox>
367 <button>
368 <label>Repack config</label>
369 <input file icon="edit-redo"></input>
370 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Repack configs" -geometry 80x25+120+120 -e "tazpkg repack-config ; sleep 5" 2> /dev/null</action>
371 </button>
372 <button>
373 <label>Config Files</label>
374 <input file icon="tazpkg"></input>
375 <action type="launch">LIST_CONFIG_FILES</action>
376 </button>
377 </hbox>
378 </frame>
379 <frame Packages check>
380 <hbox>
381 <button>
382 <label>Quick check</label>
383 <input file icon="go-next"></input>
384 <action>xterm -fa MiscFixed -fs 11 -bg gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check | less " 2> /dev/null</action>
385 </button>
386 <button>
387 <label>Full check</label>
388 <input file icon="go-next"></input>
389 <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 " 2> /dev/null</action>
390 </button>
391 </hbox>
392 </frame>
393 </hbox>
394 </vbox>
396 </notebook>
398 <hbox>
399 <text wrap="false">
400 <input>installed=`ls /var/lib/tazpkg/installed | wc -l`; mirrored=`cat /var/lib/tazpkg/packages.list | wc -l`; echo "Packages: $installed installed, $(($mirrored - $installed)) installable, $mirrored mirrored, `cat /var/lib/tazpkg/upradable-packages.list 2> /dev/null | wc -l` to upgrade "</input>
401 <variable>PKG_STATS</variable>
402 </text>
403 </hbox>
405 <hbox>
406 <button>
407 <label>Wok</label>
408 <input file icon="gtk-open"></input>
409 <action>firefox http://hg.slitaz.org/wok/file/</action>
410 </button>
411 <button help>
412 <label>Help</label>
413 <action type="launch">HELP</action>
414 </button>
415 <button>
416 <label>Exit</label>
417 <input file icon="exit"></input>
418 <action type="exit">Exit</action>
419 </button>
420 </hbox>
422 </vbox>
424 </window>
425 '
427 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
429 exit 0