rev |
line source |
pankso@3521
|
1 #!/bin/sh
|
pankso@3521
|
2 # Tiny CGI search engine for SliTaz packages on http://pkgs.slitaz.org/
|
pankso@3521
|
3 # Christophe Lincoln <pankso@slitaz.org>
|
pankso@3521
|
4 #
|
pankso@3521
|
5
|
pankso@3521
|
6 read QUERY_STRING
|
pankso@3521
|
7 for i in $(echo $QUERY_STRING | sed 's/&/ /g'); do
|
pankso@3521
|
8 eval $i
|
pankso@3521
|
9 done
|
pankso@3521
|
10 LANG=$lang
|
pankso@3521
|
11 SEARCH=$query
|
pankso@3521
|
12 SLITAZ_VERSION=$version
|
pankso@3521
|
13 OBJECT=$object
|
pankso@3521
|
14 DATE=`date +%Y-%m-%d\ \%H:%M:%S`
|
pankso@3521
|
15 VERSION=cooking
|
pankso@3521
|
16 if [ "$REQUEST_METHOD" = "GET" ]; then
|
pankso@3521
|
17 SEARCH=""
|
pankso@3521
|
18 for i in $(echo $REQUEST_URI | sed 's/[?&]/ /g'); do
|
pankso@3521
|
19 SLITAZ_VERSION=cooking
|
pankso@3521
|
20 case "$i" in
|
pankso@3521
|
21 lang=*)
|
pankso@3521
|
22 LANG=${i#*=};;
|
pankso@3521
|
23 file=*)
|
pankso@3521
|
24 SEARCH=${i#*=}
|
pankso@3521
|
25 OBJECT=File;;
|
pankso@3521
|
26 desc=*)
|
pankso@3521
|
27 SEARCH=${i#*=}
|
pankso@3521
|
28 OBJECT=Desc;;
|
pankso@3521
|
29 tags=*)
|
pankso@3521
|
30 SEARCH=${i#*=}
|
pankso@3521
|
31 OBJECT=Tags;;
|
pankso@3521
|
32 receipt=*)
|
pankso@3521
|
33 SEARCH=${i#*=}
|
pankso@3521
|
34 OBJECT=Receipt;;
|
pankso@3521
|
35 filelist=*)
|
pankso@3521
|
36 SEARCH=${i#*=}
|
pankso@3521
|
37 OBJECT=File_list;;
|
pankso@3521
|
38 package=*)
|
pankso@3521
|
39 SEARCH=${i#*=}
|
pankso@3521
|
40 OBJECT=Package;;
|
pankso@3521
|
41 depends=*)
|
pankso@3521
|
42 SEARCH=${i#*=}
|
pankso@3521
|
43 OBJECT=Depends;;
|
pankso@3521
|
44 version=s*|version=2*)
|
pankso@3521
|
45 SLITAZ_VERSION=stable;;
|
pankso@3521
|
46 version=1*)
|
pankso@3521
|
47 SLITAZ_VERSION=1.0;;
|
pankso@3521
|
48 esac
|
pankso@3521
|
49 done
|
pankso@3521
|
50 [ -n "$SEARCH" ] && REQUEST_METHOD="POST"
|
pankso@3521
|
51 fi
|
pankso@3521
|
52
|
pankso@3521
|
53 case "$OBJECT" in
|
pankso@3521
|
54 File) selected_file="selected";;
|
pankso@3521
|
55 Desc) selected_desc="selected";;
|
pankso@3521
|
56 Tags) selected_tags="selected";;
|
pankso@3521
|
57 Receipt) selected_receipt="selected";;
|
pankso@3521
|
58 File_list) selected_file_list="selected";;
|
pankso@3521
|
59 Depends) selected_depends="selected";;
|
pankso@3521
|
60 esac
|
pankso@3521
|
61
|
pankso@3521
|
62 case "$SLITAZ_VERSION" in
|
pankso@3521
|
63 1.0) selected_1="selected";;
|
pankso@3521
|
64 stable) selected_stable="selected";;
|
pankso@3521
|
65 esac
|
pankso@3521
|
66
|
pankso@3521
|
67 # unescape query
|
pankso@3521
|
68 SEARCH="$(echo $SEARCH | sed 's/%2B/+/g' | sed 's/%3A/:/g' | sed 's|%2F|/|g')"
|
pankso@3521
|
69
|
pankso@3521
|
70 if [ -z "$LANG" ]; then
|
pankso@3521
|
71 for i in $(echo $HTTP_ACCEPT_LANGUAGE | sed 's/[,;]/ /g'); do
|
pankso@3521
|
72 case "$i" in
|
pankso@3521
|
73 fr|de|pt|cn)
|
pankso@3521
|
74 LANG=$i
|
pankso@3521
|
75 break;;
|
pankso@3521
|
76 esac
|
pankso@3521
|
77 done
|
pankso@3521
|
78 fi
|
pankso@3521
|
79
|
pankso@3521
|
80 package="Package"
|
pankso@3521
|
81 file="File"
|
pankso@3521
|
82 desc="Description"
|
pankso@3521
|
83 tags="Tags"
|
pankso@3521
|
84 receipt="Receipt"
|
pankso@3521
|
85 file_list="File list"
|
pankso@3521
|
86 depends="Depends"
|
pankso@3521
|
87 search="Search"
|
pankso@3521
|
88 cooking="cooking"
|
pankso@3521
|
89 stable="stable"
|
pankso@3521
|
90 result="Result for : $SEARCH"
|
pankso@3521
|
91 noresult="No package $SEARCH"
|
pankso@3521
|
92 deptree="Dependency tree for : $SEARCH"
|
pankso@3521
|
93 rdeptree="Reverse dependency tree for : $SEARCH"
|
pankso@3521
|
94 charset="ISO-8859-1"
|
pankso@3521
|
95
|
pankso@3521
|
96 case "$LANG" in
|
pankso@3521
|
97
|
pankso@3521
|
98 fr) package="Paquet"
|
pankso@3521
|
99 receipt="Recette"
|
pankso@3521
|
100 depends="Dépendances"
|
pankso@3521
|
101 search="Recherche"
|
pankso@3521
|
102 result="Recherche de : $SEARCH"
|
pankso@3521
|
103 noresult="Paquet $SEARCH introuvable"
|
pankso@3521
|
104 deptree="Arbre des dépendances de $SEARCH"
|
pankso@3521
|
105 rdeptree="Arbre inversé des dépendances de $SEARCH"
|
pankso@3521
|
106 file_list="Liste des fichiers"
|
pankso@3521
|
107 file="Fichier";;
|
pankso@3521
|
108
|
pankso@3521
|
109 de) package="Paket"
|
pankso@3521
|
110 depends="Abhängigkeiten"
|
pankso@3521
|
111 desc="Beschreibung"
|
pankso@3521
|
112 search="Suche"
|
pankso@3521
|
113 cooking="Cooking"
|
pankso@3521
|
114 stable="Stable"
|
pankso@3521
|
115 result="Resultate für : $SEARCH"
|
pankso@3521
|
116 noresult="Kein Paket für $SEARCH"
|
pankso@3521
|
117 deptree="Abhängigkeiten von: $SEARCH"
|
pankso@3521
|
118 rdeptree="Abhängigkeit für: $SEARCH"
|
pankso@3521
|
119 file_list="Datei liste"
|
pankso@3521
|
120 file="Datei";;
|
pankso@3521
|
121
|
pankso@3521
|
122 pt) package="Pacote"
|
pankso@3521
|
123 search="Buscar"
|
pankso@3521
|
124 cooking="cooking"
|
pankso@3521
|
125 stable="stable"
|
pankso@3521
|
126 result="Resultado para : $SEARCH"
|
pankso@3521
|
127 noresult="Sem resultado: $SEARCH"
|
pankso@3521
|
128 deptree="Árvore de dependências para: $SEARCH"
|
pankso@3521
|
129 rdeptree="Árvore de dependências reversa para: $SEARCH"
|
pankso@3521
|
130 depends="Dependências"
|
pankso@3521
|
131 desc="Descrição"
|
pankso@3521
|
132 file_list="Arquivo lista"
|
pankso@3521
|
133 file="Arquivo";;
|
pankso@3521
|
134
|
pankso@3521
|
135 cn) package="软件包:"
|
pankso@3521
|
136 cooking="å¼€å‘版"
|
pankso@3521
|
137 stable="稳定版"
|
pankso@3521
|
138 desc="æè¿°"
|
pankso@3521
|
139 tags="æ ‡ç¾"
|
pankso@3521
|
140 depends="ä¾èµ–"
|
pankso@3521
|
141 file="文件"
|
pankso@3521
|
142 file_list="文件列表"
|
pankso@3521
|
143 search="Search"
|
pankso@3521
|
144 result="Result for : $SEARCH"
|
pankso@3521
|
145 noresult="No package $SEARCH"
|
pankso@3521
|
146 deptree="Dependency tree for : $SEARCH"
|
pankso@3521
|
147 rdeptree="Reverse dependency tree for : $SEARCH"
|
pankso@3521
|
148 charset="UTF-8";;
|
pankso@3521
|
149
|
pankso@3521
|
150 *) LANG="en";;
|
pankso@3521
|
151
|
pankso@3521
|
152 esac
|
pankso@3521
|
153
|
pankso@3521
|
154 WOK=/home/slitaz/$SLITAZ_VERSION/wok
|
pankso@3521
|
155
|
pankso@3521
|
156 echo Content-type: text/html
|
pankso@3521
|
157 echo
|
pankso@3521
|
158
|
pankso@3521
|
159 # Search form
|
pankso@3521
|
160 search_form()
|
pankso@3521
|
161 {
|
pankso@3521
|
162 cat << _EOT_
|
pankso@3521
|
163
|
pankso@3521
|
164 <div style="text-align: center; padding: 20px;">
|
pankso@3521
|
165 <form method="post" action="search.cgi">
|
pankso@3521
|
166 <input type="hidden" name="lang" value="$LANG" />
|
pankso@3521
|
167 <select name="object">
|
pankso@3521
|
168 <option value="Package">$package</option>
|
pankso@3521
|
169 <option $selected_desc value="Desc">$desc</option>
|
pankso@3521
|
170 <option $selected_tags value="Tags">$tags</option>
|
pankso@3521
|
171 <option $selected_receipt value="Receipt">$receipt</option>
|
pankso@3521
|
172 <option $selected_depends value="Depends">$depends</option>
|
pankso@3521
|
173 <option $selected_file value="File">$file</option>
|
pankso@3521
|
174 <option $selected_file_list value="File_list">$file_list</option>
|
pankso@3521
|
175 </select>
|
pankso@3521
|
176 <strong>:</strong>
|
pankso@3521
|
177 <input type="text" name="query" size="32" value="$SEARCH" />
|
pankso@3521
|
178 <select name="version">
|
pankso@3521
|
179 <option value="cooking">$cooking</option>
|
pankso@3521
|
180 <option $selected_stable value="stable">$stable</option>
|
pankso@3521
|
181 <option $selected_1 value="1.0">1.0</option>
|
pankso@3521
|
182 </select>
|
pankso@3521
|
183 <input type="submit" name="search" value="$search" />
|
pankso@3521
|
184 </form>
|
pankso@3521
|
185 </div>
|
pankso@3521
|
186 _EOT_
|
pankso@3521
|
187 }
|
pankso@3521
|
188
|
pankso@3521
|
189 # xHTML Header.
|
pankso@3521
|
190 xhtml_header()
|
pankso@3521
|
191 {
|
pankso@3521
|
192 cat << _EOF_
|
pankso@3521
|
193 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
pankso@3521
|
194 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
pankso@3521
|
195 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$LANG" lang="$LANG">
|
pankso@3521
|
196 <head>
|
pankso@3521
|
197 <title>SliTaz Packages - Search $SEARCH</title>
|
pankso@3521
|
198 <meta http-equiv="content-type" content="text/html; charset=$charset" />
|
pankso@3521
|
199 <meta name="description" content="Au sujet de SliTaz GNU/Linux mini système d'exploitation" />
|
pankso@3521
|
200 <meta name="keywords" lang="fr" content="Système, libre, gnu, linux, opensource, livecd" />
|
pankso@3521
|
201 <meta name="robots" content="index, follow, all" />
|
pankso@3521
|
202 <meta name="revisit-after" content="7 days" />
|
pankso@3521
|
203 <meta name="expires" content="never" />
|
pankso@3521
|
204 <meta name="modified" content="$DATE" />
|
pankso@3521
|
205 <meta name="author" content="ash, awk, grep, sed and cat"/>
|
pankso@3521
|
206 <meta name="publisher" content="www.slitaz.org" />
|
pankso@3521
|
207 <link rel="shortcut icon" href="http://pkgs.slitaz.org/favicon.ico" />
|
pankso@3521
|
208 <link rel="stylesheet" type="text/css" href="http://pkgs.slitaz.org/slitaz.css" />
|
pankso@3521
|
209 </head>
|
pankso@3521
|
210 <body bgcolor="#ffffff">
|
pankso@3521
|
211
|
pankso@3521
|
212 <!-- Header -->
|
pankso@3521
|
213 <div id="header">
|
pankso@3521
|
214 <a name="top"></a>
|
pankso@3521
|
215 <!-- Access -->
|
pankso@3521
|
216 <div id="access">
|
pankso@3521
|
217 <a href="http://www.slitaz.org/" title="SliTaz Web site">Website</a> |
|
pankso@3521
|
218 <a href="http://wiki.slitaz.org/" title="SliTaz Community Wiki">Wiki</a> |
|
pankso@3521
|
219 <a href="http://labs.slitaz.org/" title="SliTaz laboratories">Labs</a>
|
pankso@3521
|
220 </div>
|
pankso@3521
|
221 <a href="http://pkgs.slitaz.org/"><img id="logo"
|
pankso@3521
|
222 src="http://pkgs.slitaz.org/pics/website/logo.png" title="pkgs.slitaz.org" alt="pkgs.slitaz.org"
|
pankso@3521
|
223 style="border: 0px solid ; width: 200px; height: 74px;" /></a>
|
pankso@3521
|
224 <p id="titre">#!/tazpkg/packages</p>
|
pankso@3521
|
225 </div>
|
pankso@3521
|
226 _EOF_
|
pankso@3521
|
227 }
|
pankso@3521
|
228
|
pankso@3521
|
229 # xHTML Footer.
|
pankso@3521
|
230 xhtml_footer()
|
pankso@3521
|
231 {
|
pankso@3521
|
232 cat << _EOT_
|
pankso@3521
|
233 <center>
|
pankso@3521
|
234 <i>$(ls /home/slitaz/$SLITAZ_VERSION/wok | wc -l) packages and $(unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma | wc -l) files in $SLITAZ_VERSION database</i>
|
pankso@3521
|
235 </center>
|
pankso@3521
|
236
|
pankso@3521
|
237 <!-- End of content with round corner -->
|
pankso@3521
|
238 </div>
|
pankso@3521
|
239 <div id="content_bottom">
|
pankso@3521
|
240 <div class="bottom_left"></div>
|
pankso@3521
|
241 <div class="bottom_right"></div>
|
pankso@3521
|
242 </div>
|
pankso@3521
|
243
|
pankso@3521
|
244 <!-- Start of footer and copy notice -->
|
pankso@3521
|
245 <div id="copy">
|
pankso@3521
|
246 <p>
|
pankso@3521
|
247 Dernière modification : $DATE -
|
pankso@3521
|
248 <a href="#top">Top of the page</a>
|
pankso@3521
|
249 </p>
|
pankso@3521
|
250 <p>
|
pankso@3521
|
251 Copyright © 2009 <a href="http://www.slitaz.org/">SliTaz</a> -
|
pankso@3521
|
252 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
|
pankso@3521
|
253 </p>
|
pankso@3521
|
254 <!-- End of copy -->
|
pankso@3521
|
255 </div>
|
pankso@3521
|
256
|
pankso@3521
|
257 <!-- Bottom and logo's -->
|
pankso@3521
|
258 <div id="bottom">
|
pankso@3521
|
259 <p>
|
pankso@3521
|
260 <a href="http://validator.w3.org/check?uri=referer"><img
|
pankso@3521
|
261 src="http://pkgs.slitaz.org/pics/website/xhtml10.png" alt="Valid XHTML 1.0"
|
pankso@3521
|
262 title="Code validé XHTML 1.0"
|
pankso@3521
|
263 style="width: 80px; height: 15px;" /></a>
|
pankso@3521
|
264 </p>
|
pankso@3521
|
265 </div>
|
pankso@3521
|
266
|
pankso@3521
|
267 </body>
|
pankso@3521
|
268 </html>
|
pankso@3521
|
269 _EOT_
|
pankso@3521
|
270 }
|
pankso@3521
|
271
|
pankso@3521
|
272 # recursive dependencies scan
|
pankso@3521
|
273 dep_scan()
|
pankso@3521
|
274 {
|
pankso@3521
|
275 for i in $1; do
|
pankso@3521
|
276 case " $ALL_DEPS " in
|
pankso@3521
|
277 *\ $i\ *) continue;;
|
pankso@3521
|
278 esac
|
pankso@3521
|
279 ALL_DEPS="$ALL_DEPS $i"
|
pankso@3521
|
280 if [ -n "$2" ]; then
|
pankso@3521
|
281 echo -n "$2"
|
pankso@3521
|
282 (
|
pankso@3521
|
283 . $WOK/$i/receipt
|
pankso@3521
|
284 cat << _EOT_
|
pankso@3521
|
285 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
286 _EOT_
|
pankso@3521
|
287 )
|
pankso@3521
|
288 fi
|
pankso@3521
|
289 [ -f $WOK/$i/receipt ] || continue
|
pankso@3521
|
290 DEPENDS=""
|
pankso@3521
|
291 . $WOK/$i/receipt
|
pankso@3521
|
292 [ -n "$DEPENDS" ] && dep_scan "$DEPENDS" "$2 "
|
pankso@3521
|
293 done
|
pankso@3521
|
294 }
|
pankso@3521
|
295
|
pankso@3521
|
296 # recursive reverse dependencies scan
|
pankso@3521
|
297 rdep_scan()
|
pankso@3521
|
298 {
|
pankso@3521
|
299 SEARCH=$1
|
pankso@3521
|
300 case "$SEARCH" in
|
pankso@3521
|
301 glibc-base|gcc-lib-base) cat <<EOT
|
pankso@3521
|
302 glibc-base and gcc-lib-base are implicit dependencies
|
pankso@3521
|
303 <b>every</b> packages are supposed to depend on them.
|
pankso@3521
|
304 EOT
|
pankso@3521
|
305 return;;
|
pankso@3521
|
306 esac
|
pankso@3521
|
307 for i in $WOK/* ; do
|
pankso@3521
|
308 DEPENDS=""
|
pankso@3521
|
309 . $i/receipt
|
pankso@3521
|
310 echo "$(basename $i) $(echo $DEPENDS)"
|
pankso@3521
|
311 done | awk -v search=$SEARCH '
|
pankso@3521
|
312 function show_deps(deps, all_deps, pkg, space)
|
pankso@3521
|
313 {
|
pankso@3521
|
314 if (all_deps[pkg] == 1) return
|
pankso@3521
|
315 all_deps[pkg] = 1
|
pankso@3521
|
316 if (space != "") printf "%s%s\n",space,pkg
|
pankso@3521
|
317 for (i = 1; i <= split(deps[pkg], mydeps, " "); i++) {
|
pankso@3521
|
318 show_deps(deps, all_deps, mydeps[i],"////" space)
|
pankso@3521
|
319 }
|
pankso@3521
|
320 }
|
pankso@3521
|
321
|
pankso@3521
|
322 {
|
pankso@3521
|
323 all_deps[$1] = 0
|
pankso@3521
|
324 for (i = 2; i <= NF; i++)
|
pankso@3521
|
325 deps[$i] = deps[$i] " " $1
|
pankso@3521
|
326 }
|
pankso@3521
|
327
|
pankso@3521
|
328 END {
|
pankso@3521
|
329 show_deps(deps, all_deps, search, "")
|
pankso@3521
|
330 }
|
pankso@3521
|
331 ' | while read pkg; do
|
pankso@3521
|
332 . $WOK/${pkg##*/}/receipt
|
pankso@3521
|
333 cat << _EOT_
|
pankso@3521
|
334 $(echo ${pkg%/*} | sed 's|/| |g') <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
335 _EOT_
|
pankso@3521
|
336 done
|
pankso@3521
|
337 }
|
pankso@3521
|
338
|
pankso@3521
|
339 # Check package exists
|
pankso@3521
|
340 package_exist()
|
pankso@3521
|
341 {
|
pankso@3521
|
342 [ -f $WOK/$1/receipt ] && return 0
|
pankso@3521
|
343 cat << _EOT_
|
pankso@3521
|
344
|
pankso@3521
|
345 <h3>$noresult</h3>
|
pankso@3521
|
346 <pre class="package">
|
pankso@3521
|
347 _EOT_
|
pankso@3521
|
348 return 1
|
pankso@3521
|
349 }
|
pankso@3521
|
350
|
pankso@3521
|
351 # Display search form and result if requested.
|
pankso@3521
|
352 if [ "$REQUEST_METHOD" != "POST" ]; then
|
pankso@3521
|
353 xhtml_header
|
pankso@3521
|
354 cat << _EOT_
|
pankso@3521
|
355
|
pankso@3521
|
356 <!-- Content top. -->
|
pankso@3521
|
357 <div id="content_top">
|
pankso@3521
|
358 <div class="top_left"></div>
|
pankso@3521
|
359 <div class="top_right"></div>
|
pankso@3521
|
360 </div>
|
pankso@3521
|
361
|
pankso@3521
|
362 <!-- Content -->
|
pankso@3521
|
363 <div id="content">
|
pankso@3521
|
364 <a name="content"></a>
|
pankso@3521
|
365
|
pankso@3521
|
366 <h1><font color="#3E1220">$package</font></h1>
|
pankso@3521
|
367 <h2><font color="#DF8F06">$search</font></h2>
|
pankso@3521
|
368 _EOT_
|
pankso@3521
|
369 search_form
|
pankso@3521
|
370 xhtml_footer
|
pankso@3521
|
371 else
|
pankso@3521
|
372 xhtml_header
|
pankso@3521
|
373 cat << _EOT_
|
pankso@3521
|
374
|
pankso@3521
|
375 <!-- Content top. -->
|
pankso@3521
|
376 <div id="content_top">
|
pankso@3521
|
377 <div class="top_left"></div>
|
pankso@3521
|
378 <div class="top_right"></div>
|
pankso@3521
|
379 </div>
|
pankso@3521
|
380
|
pankso@3521
|
381 <!-- Content -->
|
pankso@3521
|
382 <div id="content">
|
pankso@3521
|
383 <a name="content"></a>
|
pankso@3521
|
384
|
pankso@3521
|
385 <h1><font color="#3E1220">$package</font></h1>
|
pankso@3521
|
386 <h2><font color="#DF8F06">$search</font></h2>
|
pankso@3521
|
387 _EOT_
|
pankso@3521
|
388 search_form
|
pankso@3521
|
389 if [ "$OBJECT" = "Depends" ]; then
|
pankso@3521
|
390 if package_exist $SEARCH ; then
|
pankso@3521
|
391 cat << _EOT_
|
pankso@3521
|
392
|
pankso@3521
|
393 <h3>$deptree</h3>
|
pankso@3521
|
394 <pre class="package">
|
pankso@3521
|
395 _EOT_
|
pankso@3521
|
396 ALL_DEPS=""
|
pankso@3521
|
397 dep_scan $SEARCH ""
|
pankso@3521
|
398 SUGGESTED=""
|
pankso@3521
|
399 . $WOK/$SEARCH/receipt
|
pankso@3521
|
400 if [ -n "$SUGGESTED" ]; then
|
pankso@3521
|
401 cat << _EOT_
|
pankso@3521
|
402 </pre>
|
pankso@3521
|
403
|
pankso@3521
|
404 <h3>$deptree (SUGGESTED)</h3>
|
pankso@3521
|
405 <pre class="package">
|
pankso@3521
|
406 _EOT_
|
pankso@3521
|
407 ALL_DEPS=""
|
pankso@3521
|
408 dep_scan "$SUGGESTED" " "
|
pankso@3521
|
409 fi
|
pankso@3521
|
410 cat << _EOT_
|
pankso@3521
|
411 </pre>
|
pankso@3521
|
412
|
pankso@3521
|
413 <h3>$rdeptree</h3>
|
pankso@3521
|
414 <pre class="package">
|
pankso@3521
|
415 _EOT_
|
pankso@3521
|
416 ALL_DEPS=""
|
pankso@3521
|
417 rdep_scan $SEARCH
|
pankso@3521
|
418 fi
|
pankso@3521
|
419 elif [ "$OBJECT" = "File" ]; then
|
pankso@3521
|
420 cat << _EOT_
|
pankso@3521
|
421
|
pankso@3521
|
422 <h3>$result</h3>
|
pankso@3521
|
423 <pre class="package">
|
pankso@3521
|
424 _EOT_
|
pankso@3521
|
425 last=""
|
pankso@3521
|
426 unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma \
|
pankso@3521
|
427 | grep $SEARCH | while read pkg file; do
|
pankso@3521
|
428 echo "$file" | grep -q $SEARCH || continue
|
pankso@3521
|
429 if [ "$last" != "${pkg%:}" ]; then
|
pankso@3521
|
430 last=${pkg%:}
|
pankso@3521
|
431 (
|
pankso@3521
|
432 . $WOK/$last/receipt
|
pankso@3521
|
433 cat << _EOT_
|
pankso@3521
|
434
|
pankso@3521
|
435 <i><b><a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a></b> $SHORT_DESC</i>
|
pankso@3521
|
436 _EOT_
|
pankso@3521
|
437 )
|
pankso@3521
|
438 fi
|
pankso@3521
|
439 echo " $file"
|
pankso@3521
|
440 done
|
pankso@3521
|
441 elif [ "$OBJECT" = "File_list" ]; then
|
pankso@3521
|
442 package_exist $SEARCH && cat << _EOT_
|
pankso@3521
|
443
|
pankso@3521
|
444 <h3>$result</h3>
|
pankso@3521
|
445 <pre class="package">
|
pankso@3521
|
446 _EOT_
|
pankso@3521
|
447 last=""
|
pankso@3521
|
448 unlzma -c /home/slitaz/$SLITAZ_VERSION/packages/files.list.lzma \
|
pankso@3521
|
449 | grep ^$SEARCH: | sed 's/.*: / /' | sort
|
pankso@3521
|
450 elif [ "$OBJECT" = "Desc" ]; then
|
pankso@3521
|
451 cat << _EOT_
|
pankso@3521
|
452
|
pankso@3521
|
453 <h3>$result</h3>
|
pankso@3521
|
454 <pre class="package">
|
pankso@3521
|
455 _EOT_
|
pankso@3521
|
456 last=""
|
pankso@3521
|
457 grep -i $SEARCH /home/slitaz/$SLITAZ_VERSION/packages/packages.desc | \
|
pankso@3521
|
458 sort | while read pkg extras ; do
|
pankso@3521
|
459 . $WOK/$pkg/receipt
|
pankso@3521
|
460 cat << _EOT_
|
pankso@3521
|
461 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
462 _EOT_
|
pankso@3521
|
463 done
|
pankso@3521
|
464 elif [ "$OBJECT" = "Tags" ]; then
|
pankso@3521
|
465 cat << _EOT_
|
pankso@3521
|
466
|
pankso@3521
|
467 <h3>$result</h3>
|
pankso@3521
|
468 <pre class="package">
|
pankso@3521
|
469 _EOT_
|
pankso@3521
|
470 last=""
|
pankso@3521
|
471 grep ^TAGS= $WOK/*/receipt | grep -i $SEARCH | \
|
pankso@3521
|
472 sed "s|$WOK/\(.*\)/receipt:.*|\1|" | sort | while read pkg ; do
|
pankso@3521
|
473 . $WOK/$pkg/receipt
|
pankso@3521
|
474 cat << _EOT_
|
pankso@3521
|
475 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
476 _EOT_
|
pankso@3521
|
477 done
|
pankso@3521
|
478 elif [ "$OBJECT" = "Receipt" ]; then
|
pankso@3521
|
479 package_exist $SEARCH && cat << _EOT_
|
pankso@3521
|
480
|
pankso@3521
|
481 <h3>$result</h3>
|
pankso@3521
|
482 <pre class="package">
|
pankso@3521
|
483 <pre>
|
pankso@3521
|
484 $(if [ -f $WOK/$SEARCH/taz/*/receipt ]; then
|
pankso@3521
|
485 cat $WOK/$SEARCH/taz/*/receipt
|
pankso@3521
|
486 else
|
pankso@3521
|
487 cat $WOK/$SEARCH//receipt
|
pankso@3521
|
488 fi | sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g')
|
pankso@3521
|
489 </pre>
|
pankso@3521
|
490 _EOT_
|
pankso@3521
|
491 else
|
pankso@3521
|
492 cat << _EOT_
|
pankso@3521
|
493
|
pankso@3521
|
494 <h3>$result</h3>
|
pankso@3521
|
495 <pre class="package">
|
pankso@3521
|
496 _EOT_
|
pankso@3521
|
497 for pkg in `ls $WOK | grep $SEARCH`
|
pankso@3521
|
498 do
|
pankso@3521
|
499 . $WOK/$pkg/receipt
|
pankso@3521
|
500 cat << _EOT_
|
pankso@3521
|
501 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
502 _EOT_
|
pankso@3521
|
503 done
|
pankso@3521
|
504 equiv=/home/slitaz/$SLITAZ_VERSION/packages/packages.equiv
|
pankso@3521
|
505 vpkgs="$(cat $equiv | cut -d= -f1 | grep $SEARCH)"
|
pankso@3521
|
506 for vpkg in $vpkgs ; do
|
pankso@3521
|
507 cat << _EOT_
|
pankso@3521
|
508 </pre>
|
pankso@3521
|
509
|
pankso@3521
|
510 <h3>$result (package providing $vpkg)</h3>
|
pankso@3521
|
511 <pre class="package">
|
pankso@3521
|
512 _EOT_
|
pankso@3521
|
513 for pkg in $(grep $vpkg= $equiv | sed "s/$vpkg=//"); do
|
pankso@3521
|
514 . $WOK/${pkg#*:}/receipt
|
pankso@3521
|
515 cat << _EOT_
|
pankso@3521
|
516 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
517 _EOT_
|
pankso@3521
|
518 done
|
pankso@3521
|
519 done
|
pankso@3521
|
520 fi
|
pankso@3521
|
521 cat << _EOT_
|
pankso@3521
|
522 </pre>
|
pankso@3521
|
523 _EOT_
|
pankso@3521
|
524 xhtml_footer
|
pankso@3521
|
525 fi
|
pankso@3521
|
526
|
pankso@3521
|
527 exit 0
|