tazpkg view tazpkgbox @ rev 141

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