tazpkg view tazpkgbox @ rev 84

add-flavor, install-flavor documentation
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 11 22:29:42 2008 +0000 (2008-05-11)
parents
children 12472d81f352
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 SliTaz
44 packages manager aka Tazpkg. You can install, remove, repack or
45 get packages by clicking on the package item. Search engine let
46 you find and install new applications in a few mouse click.
47 Downloaded and repacked are stored in: /var/cache/tazpkg"
48 </label>
49 </text>
50 </frame>
52 <frame Français>
53 <text wrap="false">
54 <label>"
55 Tazpkgbox est une interface graphique au gestionnaire de paquet
56 de Slitaz aka Tazpkg. Simple et facile à utiliser, vous pouvez
57 installer, télécharger ou supprimer des paquet en double-cliquant
58 sur sa ligne. Les paquets téléchargés ou recréés sont stocké
59 dans: /var/cache/tazpkg"
60 </label>
61 </text>
62 </frame>
64 <hbox>
65 <button ok>
66 <action type="closewindow">HELP</action>
67 </button>
68 </hbox>
69 </vbox>
70 </window>
71 '
73 # Main dialog
74 export TAZPKG_DIALOG='
75 <window title="SliTaz Packages Manager" icon-name="package-x-generic">
76 <vbox>
78 <hbox>
79 <text use-markup="true">
80 <label>"<b>Packages Manager</b>"</label>
81 </text>
82 <pixmap>
83 <input file>/usr/share/pixmaps/tazpkg.png</input>
84 </pixmap>
85 </hbox>
87 <notebook labels="Installed|Mirrored|Search|Configuration">
89 <vbox>
90 <tree>
91 <width>580</width><height>240</height>
92 <variable>PKG</variable>
93 <label>Package name|Version|Description</label>
94 <input>/usr/lib/slitaz/tazpkgbox/list installed</input>
95 <action>echo "$PKG" > /tmp/tazpkgbox/pkg</action>
96 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
97 <action>refresh:PKG</action>
98 <action>refresh:PKG_STATS</action>
99 <action>refresh:CACHE_STATS</action>
100 </tree>
101 <hbox>
102 <text>
103 <label>"Category:"</label>
104 </text>
105 <combobox>
106 <variable>INSTALLED_CAT</variable>
107 <item>all</item>
108 <item>base-system</item>
109 <item>utilities</item>
110 <item>network</item>
111 <item>graphics</item>
112 <item>multimedia</item>
113 <item>office</item>
114 <item>development</item>
115 <item>system-tools</item>
116 <item>security</item>
117 <item>games</item>
118 <item>misc</item>
119 <item>meta</item>
120 <item>non-free</item>
121 </combobox>
122 <button>
123 <label>List</label>
124 <input file icon="reload"></input>
125 <action>echo "$INSTALLED_CAT" > /tmp/tazpkgbox/installed-category</action>
126 <action>refresh:PKG</action>
127 </button>
128 <button>
129 <label>Upgrade all</label>
130 <input file icon="system-software-update"></input>
131 <action>xterm -T "Package upgrade" -geometry 80x16+120+120 -e "tazpkg upgrade; sleep 2"</action>
132 <action>refresh:PKG</action>
133 <action>refresh:PKG_STATS</action>
134 <action>refresh:CACHE_STATS</action>
135 </button>
136 </hbox>
137 </vbox>
139 <vbox>
140 <tree>
141 <width>580</width><height>240</height>
142 <variable>GET</variable>
143 <label>Package name|Version|Description</label>
144 <input>/usr/lib/slitaz/tazpkgbox/list mirrored</input>
145 <action>echo "$GET" > /tmp/tazpkgbox/pkg</action>
146 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
147 <action>refresh:PKG</action>
148 <action>refresh:PKG_STATS</action>
149 <action>refresh:CACHE_STATS</action>
150 </tree>
151 <hbox>
152 <combobox>
153 <variable>MIRRORED_CAT</variable>
154 <item>all</item>
155 <item>base-system</item>
156 <item>utilities</item>
157 <item>network</item>
158 <item>graphics</item>
159 <item>multimedia</item>
160 <item>office</item>
161 <item>development</item>
162 <item>system-tools</item>
163 <item>security</item>
164 <item>games</item>
165 <item>misc</item>
166 <item>meta</item>
167 <item>non-free</item>
168 </combobox>
169 <button>
170 <label>List</label>
171 <input file icon="reload"></input>
172 <action>echo "$MIRRORED_CAT" > /tmp/tazpkgbox/mirrored-category</action>
173 <action>refresh:GET</action>
174 </button>
175 <button>
176 <label>Recharge list</label>
177 <input file icon="system-software-update"></input>
178 <action>xterm -T "Recharge" -geometry 80x16+120+120 -e "tazpkg recharge; sleep 2"</action>
179 <action>refresh:GET</action>
180 <action>refresh:PKG_STATS</action>
181 </button>
182 </hbox>
183 </vbox>
185 <vbox>
186 <tree icon="tazpkg">
187 <width>580</width><height>120</height>
188 <variable>RESULT_INSTALLED</variable>
189 <label>Installed packages|Version|Description</label>
190 <input>cat /tmp/tazpkgbox/search-installed</input>
191 <action>echo "$RESULT_INSTALLED" > /tmp/tazpkgbox/pkg</action>
192 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
193 <action>/usr/lib/slitaz/tazpkgbox/search</action>
194 <action>refresh:RESULT_INSTALLED</action>
195 <action>refresh:PKG</action>
196 <action>refresh:PKG_STATS</action>
197 <action>refresh:CACHE_STATS</action>
198 </tree>
199 <tree icon="tazpkg">
200 <width>580</width><height>120</height>
201 <variable>RESULT_MIRROR</variable>
202 <label>Mirrored packages|Version|Description</label>
203 <input>cat /tmp/tazpkgbox/search-mirrored</input>
204 <action>echo "$RESULT_MIRROR" > /tmp/tazpkgbox/pkg</action>
205 <action>/usr/lib/slitaz/tazpkgbox/package_infos</action>
206 <action>/usr/lib/slitaz/tazpkgbox/search</action>
207 <action>refresh:RESULT_INSTALLED</action>
208 <action>refresh:PKG</action>
209 <action>refresh:PKG_STATS</action>
210 <action>refresh:CACHE_STATS</action>
211 </tree>
212 <hbox>
213 <entry>
214 <variable>SEARCH</variable>
215 </entry>
216 <button>
217 <label>Search</label>
218 <input file icon="system-search"></input>
219 <action>/usr/lib/slitaz/tazpkgbox/search</action>
220 <action>refresh:RESULT_INSTALLED</action>
221 <action>refresh:RESULT_MIRROR</action>
222 </button>
223 </hbox>
224 </vbox>
226 <vbox>
227 <frame Cache directory>
228 <text use-markup="true" width-chars="60">
229 <label>
230 "The cache directory is used to store downloaded or repacked packages."
231 </label>
232 </text>
233 <hbox>
234 <entry editable="false">
235 <input>cd /var/cache/tazpkg; echo "Packages: `ls | wc -l`, size: `du -sh $PWD`"</input>
236 <variable>CACHE_STATS</variable>
237 </entry>
238 <button>
239 <label>Clean cache</label>
240 <input file icon="go-next"></input>
241 <action>rm -rf /var/cache/tazpkg/*</action>
242 <action>refresh:CACHE_STATS</action>
243 </button>
244 </hbox>
245 </frame>
246 <frame Mirror URL>
247 <hbox>
248 <entry>
249 <input>head -n 1 /var/lib/tazpkg/mirror</input>
250 <variable>MIRROR</variable>
251 </entry>
252 <button>
253 <label>Setup</label>
254 <input file icon="go-next"></input>
255 <action>echo "$MIRROR" > /var/lib/tazpkg/mirror</action>
256 <action>clear:MIRROR</action>
257 <action>refresh:MIRROR</action>
258 </button>
259 <button>
260 <label>Add</label>
261 <input file icon="gtk-add"></input>
262 <action>echo "$MIRROR" >> /var/lib/tazpkg/mirror</action>
263 <action>clear:MIRROR</action>
264 <action>refresh:MIRROR</action>
265 </button>
266 </hbox>
267 </frame>
268 <frame Files path>
269 <text use-markup="true" width-chars="60">
270 <label>
271 "Lists, mirror URL and installed packages: <b>/var/lib/tazpkg</b>"
272 </label>
273 </text>
274 </frame>
275 </vbox>
277 </notebook>
279 <hbox>
280 <text>
281 <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>
282 <variable>PKG_STATS</variable>
283 </text>
284 </hbox>
286 <hbox>
287 <button help>
288 <label>Help</label>
289 <action type="launch">HELP</action>
290 </button>
291 <button>
292 <label>Exit</label>
293 <input file icon="exit"></input>
294 <action type="exit">Exit</action>
295 </button>
296 </hbox>
298 </vbox>
300 </window>
301 '
303 gtkdialog --center --program=TAZPKG_DIALOG >/dev/null
305 exit 0