tazpkg view tazpkgbox @ rev 138

Add md5sum for tazpkg pack
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 27 11:17:50 2008 +0000 (2008-07-27)
parents 0217427a955e
children be0dfeb8dc88
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 # Main dialog
76 export TAZPKG_DIALOG='
77 <window title="SliTaz Packages Manager" icon-name="package-x-generic">
78 <vbox>
80 <hbox>
81 <text use-markup="true">
82 <label>"<b>Packages Manager</b>"</label>
83 </text>
84 <pixmap>
85 <input file>/usr/share/pixmaps/tazpkg.png</input>
86 </pixmap>
87 </hbox>
89 <notebook labels="Installed|Installable|Mirrored|Search|Configuration">
91 <vbox>
92 <tree>
93 <width>620</width><height>240</height>
94 <variable>PKG</variable>
95 <label>Package name|Version|Description</label>
96 <input>/usr/lib/slitaz/tazpkgbox/list installed</input>
97 <action>echo "$PKG" > /tmp/tazpkgbox/pkg</action>
98 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
99 <action>refresh:PKG</action>
100 <action>refresh:PKG_STATS</action>
101 <action>refresh:CACHE_STATS</action>
102 </tree>
103 <hbox>
104 <text>
105 <label>"Category:"</label>
106 </text>
107 <combobox>
108 <variable>INSTALLED_CAT</variable>
109 <item>all</item>
110 <item>base-system</item>
111 <item>utilities</item>
112 <item>network</item>
113 <item>graphics</item>
114 <item>multimedia</item>
115 <item>office</item>
116 <item>development</item>
117 <item>system-tools</item>
118 <item>security</item>
119 <item>games</item>
120 <item>misc</item>
121 <item>meta</item>
122 <item>non-free</item>
123 </combobox>
124 <button>
125 <label>List</label>
126 <input file icon="reload"></input>
127 <action>echo "$INSTALLED_CAT" > /tmp/tazpkgbox/installed-category</action>
128 <action>refresh:PKG</action>
129 </button>
130 <button>
131 <label>Upgrade all</label>
132 <input file icon="system-software-update"></input>
133 <action>xterm -T "Package upgrade" -geometry 80x16+120+120 -e "tazpkg upgrade; sleep 2" 2>/dev/null</action>
134 <action>refresh:PKG</action>
135 <action>refresh:PKG_STATS</action>
136 <action>refresh:CACHE_STATS</action>
137 </button>
138 </hbox>
139 </vbox>
141 <vbox>
142 <tree>
143 <width>620</width><height>240</height>
144 <variable>GETIT</variable>
145 <label>Package name|Version|Description</label>
146 <input>/usr/lib/slitaz/tazpkgbox/list installable</input>
147 <action>echo "$GETIT" > /tmp/tazpkgbox/pkg</action>
148 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
149 <action>refresh:PKG</action>
150 <action>refresh:GETIT</action>
151 <action>refresh:PKG_STATS</action>
152 <action>refresh:CACHE_STATS</action>
153 </tree>
154 <hbox>
155 <text>
156 <label>"Category:"</label>
157 </text>
158 <combobox>
159 <variable>INSTALLABLE_CAT</variable>
160 <item>all</item>
161 <item>base-system</item>
162 <item>utilities</item>
163 <item>network</item>
164 <item>graphics</item>
165 <item>multimedia</item>
166 <item>office</item>
167 <item>development</item>
168 <item>system-tools</item>
169 <item>security</item>
170 <item>games</item>
171 <item>misc</item>
172 <item>meta</item>
173 <item>non-free</item>
174 </combobox>
175 <button>
176 <label>List</label>
177 <input file icon="reload"></input>
178 <action>echo "$INSTALLABLE_CAT" > /tmp/tazpkgbox/installable-category</action>
179 <action>refresh:GETIT</action>
180 </button>
181 <button>
182 <label>Recharge list</label>
183 <input file icon="system-software-update"></input>
184 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
185 <action>refresh:GETIT</action>
186 <action>refresh:PKG_STATS</action>
187 </button>
188 </hbox>
189 </vbox>
191 <vbox>
192 <tree>
193 <width>620</width><height>240</height>
194 <variable>GET</variable>
195 <label>Package name|Version|Description</label>
196 <input>/usr/lib/slitaz/tazpkgbox/list mirrored</input>
197 <action>echo "$GET" > /tmp/tazpkgbox/pkg</action>
198 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
199 <action>refresh:PKG</action>
200 <action>refresh:PKG_STATS</action>
201 <action>refresh:CACHE_STATS</action>
202 </tree>
203 <hbox>
204 <combobox>
205 <variable>MIRRORED_CAT</variable>
206 <item>all</item>
207 <item>base-system</item>
208 <item>utilities</item>
209 <item>network</item>
210 <item>graphics</item>
211 <item>multimedia</item>
212 <item>office</item>
213 <item>development</item>
214 <item>system-tools</item>
215 <item>security</item>
216 <item>games</item>
217 <item>misc</item>
218 <item>meta</item>
219 <item>non-free</item>
220 </combobox>
221 <button>
222 <label>List</label>
223 <input file icon="reload"></input>
224 <action>echo "$MIRRORED_CAT" > /tmp/tazpkgbox/mirrored-category</action>
225 <action>refresh:GET</action>
226 </button>
227 <button>
228 <label>Recharge list</label>
229 <input file icon="system-software-update"></input>
230 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2" 2>/dev/null</action>
231 <action>refresh:GET</action>
232 <action>refresh:PKG_STATS</action>
233 </button>
234 </hbox>
235 </vbox>
237 <vbox>
238 <tree icon="tazpkg">
239 <width>620</width><height>120</height>
240 <variable>RESULT_INSTALLED</variable>
241 <label>Installed packages|Version|Description / File</label>
242 <input>cat /tmp/tazpkgbox/search-installed</input>
243 <action>echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg</action>
244 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
245 <action>/usr/lib/slitaz/tazpkgbox/search</action>
246 <action>refresh:RESULT_INSTALLED</action>
247 <action>refresh:PKG</action>
248 <action>refresh:PKG_STATS</action>
249 <action>refresh:CACHE_STATS</action>
250 </tree>
251 <tree icon="tazpkg">
252 <width>620</width><height>120</height>
253 <variable>RESULT_MIRROR</variable>
254 <label>Mirrored packages|Version|Description / File</label>
255 <input>cat /tmp/tazpkgbox/search-mirrored</input>
256 <action>echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg</action>
257 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
258 <action>/usr/lib/slitaz/tazpkgbox/search</action>
259 <action>refresh:RESULT_INSTALLED</action>
260 <action>refresh:PKG</action>
261 <action>refresh:PKG_STATS</action>
262 <action>refresh:CACHE_STATS</action>
263 </tree>
264 <hbox>
265 <entry>
266 <variable>SEARCH</variable>
267 </entry>
268 <button>
269 <label>Search Packages</label>
270 <input file icon="system-search"></input>
271 <action>/usr/lib/slitaz/tazpkgbox/search</action>
272 <action>refresh:RESULT_INSTALLED</action>
273 <action>refresh:RESULT_MIRROR</action>
274 </button>
275 <button>
276 <label>Search Files</label>
277 <input file icon="system-search"></input>
278 <action>/usr/lib/slitaz/tazpkgbox/search --files</action>
279 <action>refresh:RESULT_INSTALLED</action>
280 <action>refresh:RESULT_MIRROR</action>
281 </button>
282 </hbox>
283 </vbox>
285 <vbox>
286 <frame Cache directory>
287 <text use-markup="true" width-chars="60">
288 <label>
289 "The cache directory is used to store downloaded or repacked packages."
290 </label>
291 </text>
292 <hbox>
293 <entry editable="false">
294 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
295 <variable>CACHE_STATS</variable>
296 </entry>
297 <button>
298 <label>Clean cache</label>
299 <input file icon="go-next"></input>
300 <action>rm -rf /var/cache/tazpkg/*</action>
301 <action>refresh:CACHE_STATS</action>
302 </button>
303 </hbox>
304 </frame>
305 <frame Mirror URL>
306 <hbox>
307 <entry>
308 <input>head -n 1 /var/lib/tazpkg/mirror</input>
309 <variable>MIRROR</variable>
310 </entry>
311 <button>
312 <label>Setup</label>
313 <input file icon="go-next"></input>
314 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
315 <action>clear:MIRROR</action>
316 <action>refresh:MIRROR</action>
317 </button>
318 <button>
319 <label>Add</label>
320 <input file icon="gtk-add"></input>
321 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
322 <action>clear:MIRROR</action>
323 <action>refresh:MIRROR</action>
324 </button>
325 </hbox>
326 </frame>
327 <frame Files path and packages check>
328 <hbox>
329 <text use-markup="true" width-chars="60">
330 <label>
331 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
332 </label>
333 </text>
334 </hbox>
335 <hbox>
336 <button>
337 <label>Quick check</label>
338 <input file icon="go-next"></input>
339 <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>
340 </button>
341 <button>
342 <label>Full check</label>
343 <input file icon="go-next"></input>
344 <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>
345 </button>
346 </hbox>
347 </frame>
348 </vbox>
350 </notebook>
352 <hbox>
353 <text>
354 <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 2> /dev/null | wc -l` to upgrade "</input>
355 <variable>PKG_STATS</variable>
356 </text>
357 </hbox>
359 <hbox>
360 <button>
361 <label>Wok</label>
362 <input file icon="gtk-open"></input>
363 <action>firefox http://hg.slitaz.org/wok/file/</action>
364 </button>
365 <button help>
366 <label>Help</label>
367 <action type="launch">HELP</action>
368 </button>
369 <button>
370 <label>Exit</label>
371 <input file icon="exit"></input>
372 <action type="exit">Exit</action>
373 </button>
374 </hbox>
376 </vbox>
378 </window>
379 '
381 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
383 exit 0