tazpkg view tazpkgbox @ rev 145
Avoid warning for volatile.cpio.gz
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 30 11:02:29 2008 +0000 (2008-07-30) |
parents | 76d09109221b |
children | 1baf308955de |
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>utilities</item>
137 <item>network</item>
138 <item>graphics</item>
139 <item>multimedia</item>
140 <item>office</item>
141 <item>development</item>
142 <item>system-tools</item>
143 <item>security</item>
144 <item>games</item>
145 <item>misc</item>
146 <item>meta</item>
147 <item>non-free</item>
148 </combobox>
149 <button>
150 <label>List</label>
151 <input file icon="reload"></input>
152 <action>echo "$INSTALLED_CAT" > /tmp/tazpkgbox/installed-category</action>
153 <action>refresh:PKG</action>
154 </button>
155 <button>
156 <label>Upgrade all</label>
157 <input file icon="system-software-update"></input>
158 <action>xterm -T "Package upgrade" -geometry 80x16+120+120 -e "tazpkg upgrade; sleep 2" 2>/dev/null</action>
159 <action>refresh:PKG</action>
160 <action>refresh:PKG_STATS</action>
161 <action>refresh:CACHE_STATS</action>
162 </button>
163 </hbox>
164 </vbox>
166 <vbox>
167 <tree>
168 <width>620</width><height>240</height>
169 <variable>GETIT</variable>
170 <label>Package name|Version|Description</label>
171 <input>/usr/lib/slitaz/tazpkgbox/list installable</input>
172 <action>echo "$GETIT" > /tmp/tazpkgbox/pkg</action>
173 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
174 <action>refresh:PKG</action>
175 <action>refresh:GETIT</action>
176 <action>refresh:PKG_STATS</action>
177 <action>refresh:CACHE_STATS</action>
178 </tree>
179 <hbox>
180 <text>
181 <label>"Category:"</label>
182 </text>
183 <combobox>
184 <variable>INSTALLABLE_CAT</variable>
185 <item>all</item>
186 <item>base-system</item>
187 <item>utilities</item>
188 <item>network</item>
189 <item>graphics</item>
190 <item>multimedia</item>
191 <item>office</item>
192 <item>development</item>
193 <item>system-tools</item>
194 <item>security</item>
195 <item>games</item>
196 <item>misc</item>
197 <item>meta</item>
198 <item>non-free</item>
199 </combobox>
200 <button>
201 <label>List</label>
202 <input file icon="reload"></input>
203 <action>echo "$INSTALLABLE_CAT" > /tmp/tazpkgbox/installable-category</action>
204 <action>refresh:GETIT</action>
205 </button>
206 <button>
207 <label>Recharge list</label>
208 <input file icon="system-software-update"></input>
209 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
210 <action>refresh:GETIT</action>
211 <action>refresh:PKG_STATS</action>
212 </button>
213 </hbox>
214 </vbox>
216 <vbox>
217 <tree>
218 <width>620</width><height>240</height>
219 <variable>GET</variable>
220 <label>Package name|Version|Description</label>
221 <input>/usr/lib/slitaz/tazpkgbox/list mirrored</input>
222 <action>echo "$GET" > /tmp/tazpkgbox/pkg</action>
223 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
224 <action>refresh:PKG</action>
225 <action>refresh:PKG_STATS</action>
226 <action>refresh:CACHE_STATS</action>
227 </tree>
228 <hbox>
229 <combobox>
230 <variable>MIRRORED_CAT</variable>
231 <item>all</item>
232 <item>base-system</item>
233 <item>utilities</item>
234 <item>network</item>
235 <item>graphics</item>
236 <item>multimedia</item>
237 <item>office</item>
238 <item>development</item>
239 <item>system-tools</item>
240 <item>security</item>
241 <item>games</item>
242 <item>misc</item>
243 <item>meta</item>
244 <item>non-free</item>
245 </combobox>
246 <button>
247 <label>List</label>
248 <input file icon="reload"></input>
249 <action>echo "$MIRRORED_CAT" > /tmp/tazpkgbox/mirrored-category</action>
250 <action>refresh:GET</action>
251 </button>
252 <button>
253 <label>Recharge list</label>
254 <input file icon="system-software-update"></input>
255 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
256 <action>refresh:GET</action>
257 <action>refresh:PKG_STATS</action>
258 </button>
259 </hbox>
260 </vbox>
262 <vbox>
263 <tree icon="tazpkg">
264 <width>620</width><height>120</height>
265 <variable>RESULT_INSTALLED</variable>
266 <label>Installed packages|Version|Description / File</label>
267 <input>cat /tmp/tazpkgbox/search-installed</input>
268 <action>echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg</action>
269 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
270 <action>/usr/lib/slitaz/tazpkgbox/search</action>
271 <action>refresh:RESULT_INSTALLED</action>
272 <action>refresh:PKG</action>
273 <action>refresh:PKG_STATS</action>
274 <action>refresh:CACHE_STATS</action>
275 </tree>
276 <tree icon="tazpkg">
277 <width>620</width><height>120</height>
278 <variable>RESULT_MIRROR</variable>
279 <label>Mirrored packages|Version|Description / File</label>
280 <input>cat /tmp/tazpkgbox/search-mirrored</input>
281 <action>echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg</action>
282 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
283 <action>/usr/lib/slitaz/tazpkgbox/search</action>
284 <action>refresh:RESULT_INSTALLED</action>
285 <action>refresh:PKG</action>
286 <action>refresh:PKG_STATS</action>
287 <action>refresh:CACHE_STATS</action>
288 </tree>
289 <hbox>
290 <entry>
291 <variable>SEARCH</variable>
292 </entry>
293 <button>
294 <label>Search Packages</label>
295 <input file icon="system-search"></input>
296 <action>/usr/lib/slitaz/tazpkgbox/search</action>
297 <action>refresh:RESULT_INSTALLED</action>
298 <action>refresh:RESULT_MIRROR</action>
299 </button>
300 <button>
301 <label>Search Files</label>
302 <input file icon="system-search"></input>
303 <action>/usr/lib/slitaz/tazpkgbox/search --files</action>
304 <action>refresh:RESULT_INSTALLED</action>
305 <action>refresh:RESULT_MIRROR</action>
306 </button>
307 </hbox>
308 </vbox>
310 <vbox>
311 <frame Cache directory>
312 <text use-markup="true" width-chars="60" wrap="false">
313 <label>
314 "The cache directory is used to store downloaded or repacked packages."
315 </label>
316 </text>
317 <hbox>
318 <entry editable="false">
319 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
320 <variable>CACHE_STATS</variable>
321 </entry>
322 <button>
323 <label>Clean cache</label>
324 <input file icon="go-next"></input>
325 <action>rm -rf /var/cache/tazpkg/*</action>
326 <action>refresh:CACHE_STATS</action>
327 </button>
328 </hbox>
329 </frame>
330 <frame Mirror URL>
331 <hbox>
332 <entry>
333 <input>head -n 1 /var/lib/tazpkg/mirror</input>
334 <variable>MIRROR</variable>
335 </entry>
336 <button>
337 <label>Setup</label>
338 <input file icon="go-next"></input>
339 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
340 <action>clear:MIRROR</action>
341 <action>refresh:MIRROR</action>
342 </button>
343 <button>
344 <label>Add</label>
345 <input file icon="gtk-add"></input>
346 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
347 <action>clear:MIRROR</action>
348 <action>refresh:MIRROR</action>
349 </button>
350 </hbox>
351 </frame>
352 <frame Files path>
353 <hbox>
354 <text use-markup="true" width-chars="60">
355 <label>
356 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
357 </label>
358 </text>
359 </hbox>
360 </frame>
361 <hbox>
362 <frame Configuration files>
363 <hbox>
364 <button>
365 <label>Repack config</label>
366 <input file icon="edit-redo"></input>
367 <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>
368 </button>
369 <button>
370 <label>Config Files</label>
371 <input file icon="tazpkg"></input>
372 <action type="launch">LIST_CONFIG_FILES</action>
373 </button>
374 </hbox>
375 </frame>
376 <frame Packages check>
377 <hbox>
378 <button>
379 <label>Quick check</label>
380 <input file icon="go-next"></input>
381 <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>
382 </button>
383 <button>
384 <label>Full check</label>
385 <input file icon="go-next"></input>
386 <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>
387 </button>
388 </hbox>
389 </frame>
390 </hbox>
391 </vbox>
393 </notebook>
395 <hbox>
396 <text wrap="false">
397 <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>
398 <variable>PKG_STATS</variable>
399 </text>
400 </hbox>
402 <hbox>
403 <button>
404 <label>Wok</label>
405 <input file icon="gtk-open"></input>
406 <action>firefox http://hg.slitaz.org/wok/file/</action>
407 </button>
408 <button help>
409 <label>Help</label>
410 <action type="launch">HELP</action>
411 </button>
412 <button>
413 <label>Exit</label>
414 <input file icon="exit"></input>
415 <action type="exit">Exit</action>
416 </button>
417 </hbox>
419 </vbox>
421 </window>
422 '
424 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
426 exit 0