tazpkg view tazpkgbox @ rev 94

tazpkgbox: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 19 21:17:31 2008 +0000 (2008-05-19)
parents 3cdc61b655ec
children c333d478954b
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=24080508
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>580</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>580</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>580</width><height>120</height>
189 <variable>RESULT_INSTALLED</variable>
190 <label>Installed packages|Version|Description</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>580</width><height>120</height>
202 <variable>RESULT_MIRROR</variable>
203 <label>Mirrored packages|Version|Description</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</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 </hbox>
225 </vbox>
227 <vbox>
228 <frame Cache directory>
229 <text use-markup="true" width-chars="60">
230 <label>
231 "The cache directory is used to store downloaded or repacked packages."
232 </label>
233 </text>
234 <hbox>
235 <entry editable="false">
236 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
237 <variable>CACHE_STATS</variable>
238 </entry>
239 <button>
240 <label>Clean cache</label>
241 <input file icon="go-next"></input>
242 <action>rm -rf /var/cache/tazpkg/*</action>
243 <action>refresh:CACHE_STATS</action>
244 </button>
245 </hbox>
246 </frame>
247 <frame Mirror URL>
248 <hbox>
249 <entry>
250 <input>head -n 1 /var/lib/tazpkg/mirror</input>
251 <variable>MIRROR</variable>
252 </entry>
253 <button>
254 <label>Setup</label>
255 <input file icon="go-next"></input>
256 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
257 <action>clear:MIRROR</action>
258 <action>refresh:MIRROR</action>
259 </button>
260 <button>
261 <label>Add</label>
262 <input file icon="gtk-add"></input>
263 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
264 <action>clear:MIRROR</action>
265 <action>refresh:MIRROR</action>
266 </button>
267 </hbox>
268 </frame>
269 <frame Files path>
270 <hbox>
271 <text use-markup="true" width-chars="60">
272 <label>
273 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
274 </label>
275 </text>
276 <button>
277 <label>Quick check</label>
278 <input file icon="go-next"></input>
279 <action>xterm -fa MiscFixed -fs 11 -bg
280 gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check | less "</action>
281 </button>
282 <button>
283 <label>Full check</label>
284 <input file icon="go-next"></input>
285 <action>xterm -fa MiscFixed -fs 11 -bg
286 gray93 -fg black -T "Check packages (q to quit)" -geometry 80x25+120+120 -e "tazpkg check --full | less "</action>
287 </button>
288 </hbox>
289 </frame>
290 </vbox>
292 </notebook>
294 <hbox>
295 <text>
296 <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>
297 <variable>PKG_STATS</variable>
298 </text>
299 </hbox>
301 <hbox>
302 <button help>
303 <label>Help</label>
304 <action type="launch">HELP</action>
305 </button>
306 <button>
307 <label>Exit</label>
308 <input file icon="exit"></input>
309 <action type="exit">Exit</action>
310 </button>
311 </hbox>
313 </vbox>
315 </window>
316 '
318 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
320 exit 0