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
|
pascal@3551
|
155 PACKAGES_REPOSITORY=/home/slitaz/$SLITAZ_VERSION/packages
|
pankso@3521
|
156
|
pankso@3521
|
157 echo Content-type: text/html
|
pankso@3521
|
158 echo
|
pankso@3521
|
159
|
pankso@3521
|
160 # Search form
|
pankso@3521
|
161 search_form()
|
pankso@3521
|
162 {
|
pankso@3521
|
163 cat << _EOT_
|
pankso@3521
|
164
|
pankso@3521
|
165 <div style="text-align: center; padding: 20px;">
|
pankso@3521
|
166 <form method="post" action="search.cgi">
|
pankso@3521
|
167 <input type="hidden" name="lang" value="$LANG" />
|
pankso@3521
|
168 <select name="object">
|
pankso@3521
|
169 <option value="Package">$package</option>
|
pankso@3521
|
170 <option $selected_desc value="Desc">$desc</option>
|
pankso@3521
|
171 <option $selected_tags value="Tags">$tags</option>
|
pankso@3521
|
172 <option $selected_receipt value="Receipt">$receipt</option>
|
pankso@3521
|
173 <option $selected_depends value="Depends">$depends</option>
|
pankso@3521
|
174 <option $selected_file value="File">$file</option>
|
pankso@3521
|
175 <option $selected_file_list value="File_list">$file_list</option>
|
pankso@3521
|
176 </select>
|
pankso@3521
|
177 <strong>:</strong>
|
pankso@3521
|
178 <input type="text" name="query" size="32" value="$SEARCH" />
|
pankso@3521
|
179 <select name="version">
|
pankso@3521
|
180 <option value="cooking">$cooking</option>
|
pankso@3521
|
181 <option $selected_stable value="stable">$stable</option>
|
pankso@3521
|
182 <option $selected_1 value="1.0">1.0</option>
|
pankso@3521
|
183 </select>
|
pankso@3521
|
184 <input type="submit" name="search" value="$search" />
|
pankso@3521
|
185 </form>
|
pankso@3521
|
186 </div>
|
pankso@3521
|
187 _EOT_
|
pankso@3521
|
188 }
|
pankso@3521
|
189
|
pankso@3521
|
190 # xHTML Header.
|
pankso@3521
|
191 xhtml_header()
|
pankso@3521
|
192 {
|
pankso@3521
|
193 cat << _EOF_
|
pankso@3521
|
194 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
pankso@3521
|
195 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
pankso@3521
|
196 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$LANG" lang="$LANG">
|
pankso@3521
|
197 <head>
|
pankso@3521
|
198 <title>SliTaz Packages - Search $SEARCH</title>
|
pankso@3521
|
199 <meta http-equiv="content-type" content="text/html; charset=$charset" />
|
pankso@3521
|
200 <meta name="description" content="Au sujet de SliTaz GNU/Linux mini système d'exploitation" />
|
pankso@3521
|
201 <meta name="keywords" lang="fr" content="Système, libre, gnu, linux, opensource, livecd" />
|
pankso@3521
|
202 <meta name="robots" content="index, follow, all" />
|
pankso@3521
|
203 <meta name="revisit-after" content="7 days" />
|
pankso@3521
|
204 <meta name="expires" content="never" />
|
pankso@3521
|
205 <meta name="modified" content="$DATE" />
|
pankso@3521
|
206 <meta name="author" content="ash, awk, grep, sed and cat"/>
|
pankso@3521
|
207 <meta name="publisher" content="www.slitaz.org" />
|
pankso@3521
|
208 <link rel="shortcut icon" href="http://pkgs.slitaz.org/favicon.ico" />
|
pankso@3521
|
209 <link rel="stylesheet" type="text/css" href="http://pkgs.slitaz.org/slitaz.css" />
|
pankso@3521
|
210 </head>
|
pankso@3521
|
211 <body bgcolor="#ffffff">
|
pankso@3521
|
212
|
pankso@3521
|
213 <!-- Header -->
|
pankso@3521
|
214 <div id="header">
|
pankso@3521
|
215 <a name="top"></a>
|
pankso@3521
|
216 <!-- Access -->
|
pankso@3521
|
217 <div id="access">
|
pankso@3521
|
218 <a href="http://www.slitaz.org/" title="SliTaz Web site">Website</a> |
|
pankso@3521
|
219 <a href="http://wiki.slitaz.org/" title="SliTaz Community Wiki">Wiki</a> |
|
pankso@3521
|
220 <a href="http://labs.slitaz.org/" title="SliTaz laboratories">Labs</a>
|
pankso@3521
|
221 </div>
|
pankso@3521
|
222 <a href="http://pkgs.slitaz.org/"><img id="logo"
|
pankso@3521
|
223 src="http://pkgs.slitaz.org/pics/website/logo.png" title="pkgs.slitaz.org" alt="pkgs.slitaz.org"
|
pankso@3521
|
224 style="border: 0px solid ; width: 200px; height: 74px;" /></a>
|
pankso@3521
|
225 <p id="titre">#!/tazpkg/packages</p>
|
pankso@3521
|
226 </div>
|
pankso@3521
|
227 _EOF_
|
pankso@3521
|
228 }
|
pankso@3521
|
229
|
pankso@3521
|
230 # xHTML Footer.
|
pankso@3521
|
231 xhtml_footer()
|
pankso@3521
|
232 {
|
pankso@3521
|
233 cat << _EOT_
|
pankso@3521
|
234 <center>
|
pascal@3551
|
235 <i>$(ls $WOK/ | wc -l) packages and $(unlzma -c $PACKAGES_REPOSITORY/files.list.lzma | wc -l) files in $SLITAZ_VERSION database</i>
|
pankso@3521
|
236 </center>
|
pankso@3521
|
237
|
pankso@3521
|
238 <!-- End of content with round corner -->
|
pankso@3521
|
239 </div>
|
pankso@3521
|
240 <div id="content_bottom">
|
pankso@3521
|
241 <div class="bottom_left"></div>
|
pankso@3521
|
242 <div class="bottom_right"></div>
|
pankso@3521
|
243 </div>
|
pankso@3521
|
244
|
pankso@3521
|
245 <!-- Start of footer and copy notice -->
|
pankso@3521
|
246 <div id="copy">
|
pankso@3521
|
247 <p>
|
pankso@3521
|
248 Dernière modification : $DATE -
|
pankso@3521
|
249 <a href="#top">Top of the page</a>
|
pankso@3521
|
250 </p>
|
pankso@3521
|
251 <p>
|
pankso@3521
|
252 Copyright © 2009 <a href="http://www.slitaz.org/">SliTaz</a> -
|
pankso@3521
|
253 <a href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
|
pankso@3521
|
254 </p>
|
pankso@3521
|
255 <!-- End of copy -->
|
pankso@3521
|
256 </div>
|
pankso@3521
|
257
|
pankso@3521
|
258 <!-- Bottom and logo's -->
|
pankso@3521
|
259 <div id="bottom">
|
pankso@3521
|
260 <p>
|
pankso@3521
|
261 <a href="http://validator.w3.org/check?uri=referer"><img
|
pankso@3521
|
262 src="http://pkgs.slitaz.org/pics/website/xhtml10.png" alt="Valid XHTML 1.0"
|
pankso@3521
|
263 title="Code validé XHTML 1.0"
|
pankso@3521
|
264 style="width: 80px; height: 15px;" /></a>
|
pankso@3521
|
265 </p>
|
pankso@3521
|
266 </div>
|
pankso@3521
|
267
|
pankso@3521
|
268 </body>
|
pankso@3521
|
269 </html>
|
pankso@3521
|
270 _EOT_
|
pankso@3521
|
271 }
|
pankso@3521
|
272
|
pascal@3780
|
273 # recursive dependencies scan
|
pascal@3780
|
274 dep_scan()
|
pascal@3780
|
275 {
|
pankso@3521
|
276 for i in $1; do
|
pankso@3521
|
277 case " $ALL_DEPS " in
|
pankso@3521
|
278 *\ $i\ *) continue;;
|
pankso@3521
|
279 esac
|
pankso@3521
|
280 ALL_DEPS="$ALL_DEPS $i"
|
pankso@3521
|
281 if [ -n "$2" ]; then
|
pankso@3521
|
282 echo -n "$2"
|
pankso@3521
|
283 (
|
pankso@3521
|
284 . $WOK/$i/receipt
|
pankso@3521
|
285 cat << _EOT_
|
pankso@3521
|
286 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
287 _EOT_
|
pankso@3521
|
288 )
|
pankso@3521
|
289 fi
|
pankso@3521
|
290 [ -f $WOK/$i/receipt ] || continue
|
pankso@3521
|
291 DEPENDS=""
|
pankso@3521
|
292 . $WOK/$i/receipt
|
pankso@3521
|
293 [ -n "$DEPENDS" ] && dep_scan "$DEPENDS" "$2 "
|
pankso@3521
|
294 done
|
pankso@3521
|
295 }
|
pankso@3521
|
296
|
pascal@3780
|
297 # recursive reverse dependencies scan
|
pascal@3780
|
298 rdep_scan()
|
pascal@3780
|
299 {
|
pankso@3521
|
300 SEARCH=$1
|
pankso@3521
|
301 case "$SEARCH" in
|
pankso@3521
|
302 glibc-base|gcc-lib-base) cat <<EOT
|
paul@3528
|
303 glibc-base and gcc-lib-base are implicit dependencies,
|
paul@3528
|
304 <b>every</b> package is supposed to depend on them.
|
pankso@3521
|
305 EOT
|
pankso@3521
|
306 return;;
|
pankso@3521
|
307 esac
|
pankso@3521
|
308 for i in $WOK/* ; do
|
pankso@3521
|
309 DEPENDS=""
|
pankso@3521
|
310 . $i/receipt
|
pankso@3521
|
311 echo "$(basename $i) $(echo $DEPENDS)"
|
pankso@3521
|
312 done | awk -v search=$SEARCH '
|
pankso@3521
|
313 function show_deps(deps, all_deps, pkg, space)
|
pankso@3521
|
314 {
|
pankso@3521
|
315 if (all_deps[pkg] == 1) return
|
pankso@3521
|
316 all_deps[pkg] = 1
|
pankso@3521
|
317 if (space != "") printf "%s%s\n",space,pkg
|
pankso@3521
|
318 for (i = 1; i <= split(deps[pkg], mydeps, " "); i++) {
|
pankso@3521
|
319 show_deps(deps, all_deps, mydeps[i],"////" space)
|
pankso@3521
|
320 }
|
pankso@3521
|
321 }
|
pankso@3521
|
322
|
pankso@3521
|
323 {
|
pankso@3521
|
324 all_deps[$1] = 0
|
pankso@3521
|
325 for (i = 2; i <= NF; i++)
|
pankso@3521
|
326 deps[$i] = deps[$i] " " $1
|
pankso@3521
|
327 }
|
pankso@3521
|
328
|
pankso@3521
|
329 END {
|
pankso@3521
|
330 show_deps(deps, all_deps, search, "")
|
pankso@3521
|
331 }
|
pankso@3521
|
332 ' | while read pkg; do
|
pankso@3521
|
333 . $WOK/${pkg##*/}/receipt
|
pankso@3521
|
334 cat << _EOT_
|
pankso@3521
|
335 $(echo ${pkg%/*} | sed 's|/| |g') <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
336 _EOT_
|
pankso@3521
|
337 done
|
pankso@3521
|
338 }
|
pankso@3521
|
339
|
pankso@3521
|
340 # Check package exists
|
pankso@3521
|
341 package_exist()
|
pankso@3521
|
342 {
|
pankso@3521
|
343 [ -f $WOK/$1/receipt ] && return 0
|
pankso@3521
|
344 cat << _EOT_
|
pankso@3521
|
345
|
pankso@3521
|
346 <h3>$noresult</h3>
|
pankso@3521
|
347 <pre class="package">
|
pankso@3521
|
348 _EOT_
|
pankso@3521
|
349 return 1
|
pankso@3521
|
350 }
|
pankso@3521
|
351
|
pascal@3780
|
352 # Display < > &
|
pascal@3780
|
353 htmlize()
|
pascal@3780
|
354 {
|
pascal@3780
|
355 sed -e 's/&/\&/g' -e 's/</\</g' -e 's/>/\>/g'
|
pascal@3780
|
356 }
|
pascal@3780
|
357
|
pankso@3521
|
358 # Display search form and result if requested.
|
pankso@3521
|
359 if [ "$REQUEST_METHOD" != "POST" ]; then
|
pankso@3521
|
360 xhtml_header
|
pankso@3521
|
361 cat << _EOT_
|
pankso@3521
|
362
|
pankso@3521
|
363 <!-- Content top. -->
|
pankso@3521
|
364 <div id="content_top">
|
pankso@3521
|
365 <div class="top_left"></div>
|
pankso@3521
|
366 <div class="top_right"></div>
|
pankso@3521
|
367 </div>
|
pankso@3521
|
368
|
pankso@3521
|
369 <!-- Content -->
|
pankso@3521
|
370 <div id="content">
|
pankso@3521
|
371 <a name="content"></a>
|
pankso@3521
|
372
|
pankso@3521
|
373 <h1><font color="#3E1220">$package</font></h1>
|
pankso@3521
|
374 <h2><font color="#DF8F06">$search</font></h2>
|
pankso@3521
|
375 _EOT_
|
pankso@3521
|
376 search_form
|
pankso@3521
|
377 xhtml_footer
|
pankso@3521
|
378 else
|
pankso@3521
|
379 xhtml_header
|
pankso@3521
|
380 cat << _EOT_
|
pankso@3521
|
381
|
pankso@3521
|
382 <!-- Content top. -->
|
pankso@3521
|
383 <div id="content_top">
|
pankso@3521
|
384 <div class="top_left"></div>
|
pankso@3521
|
385 <div class="top_right"></div>
|
pankso@3521
|
386 </div>
|
pankso@3521
|
387
|
pankso@3521
|
388 <!-- Content -->
|
pankso@3521
|
389 <div id="content">
|
pankso@3521
|
390 <a name="content"></a>
|
pankso@3521
|
391
|
pankso@3521
|
392 <h1><font color="#3E1220">$package</font></h1>
|
pankso@3521
|
393 <h2><font color="#DF8F06">$search</font></h2>
|
pankso@3521
|
394 _EOT_
|
pankso@3521
|
395 search_form
|
pankso@3521
|
396 if [ "$OBJECT" = "Depends" ]; then
|
pankso@3521
|
397 if package_exist $SEARCH ; then
|
pankso@3521
|
398 cat << _EOT_
|
pankso@3521
|
399
|
pankso@3521
|
400 <h3>$deptree</h3>
|
pankso@3521
|
401 <pre class="package">
|
pankso@3521
|
402 _EOT_
|
pankso@3521
|
403 ALL_DEPS=""
|
pankso@3521
|
404 dep_scan $SEARCH ""
|
pankso@3521
|
405 SUGGESTED=""
|
pankso@3521
|
406 . $WOK/$SEARCH/receipt
|
pankso@3521
|
407 if [ -n "$SUGGESTED" ]; then
|
pankso@3521
|
408 cat << _EOT_
|
pankso@3521
|
409 </pre>
|
pankso@3521
|
410
|
pankso@3521
|
411 <h3>$deptree (SUGGESTED)</h3>
|
pankso@3521
|
412 <pre class="package">
|
pankso@3521
|
413 _EOT_
|
pankso@3521
|
414 ALL_DEPS=""
|
pankso@3521
|
415 dep_scan "$SUGGESTED" " "
|
pankso@3521
|
416 fi
|
pankso@3521
|
417 cat << _EOT_
|
pankso@3521
|
418 </pre>
|
pankso@3521
|
419
|
pankso@3521
|
420 <h3>$rdeptree</h3>
|
pankso@3521
|
421 <pre class="package">
|
pankso@3521
|
422 _EOT_
|
pankso@3521
|
423 ALL_DEPS=""
|
pankso@3521
|
424 rdep_scan $SEARCH
|
pankso@3521
|
425 fi
|
pankso@3521
|
426 elif [ "$OBJECT" = "File" ]; then
|
pankso@3521
|
427 cat << _EOT_
|
pankso@3521
|
428
|
pankso@3521
|
429 <h3>$result</h3>
|
pankso@3521
|
430 <pre class="package">
|
pankso@3521
|
431 _EOT_
|
pankso@3521
|
432 last=""
|
pascal@3551
|
433 unlzma -c $PACKAGES_REPOSITORY/files.list.lzma \
|
pankso@3521
|
434 | grep $SEARCH | while read pkg file; do
|
pankso@3521
|
435 echo "$file" | grep -q $SEARCH || continue
|
pankso@3521
|
436 if [ "$last" != "${pkg%:}" ]; then
|
pankso@3521
|
437 last=${pkg%:}
|
pankso@3521
|
438 (
|
pankso@3521
|
439 . $WOK/$last/receipt
|
pankso@3521
|
440 cat << _EOT_
|
pankso@3521
|
441
|
pankso@3521
|
442 <i><b><a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a></b> $SHORT_DESC</i>
|
pankso@3521
|
443 _EOT_
|
pankso@3521
|
444 )
|
pankso@3521
|
445 fi
|
pankso@3521
|
446 echo " $file"
|
pankso@3521
|
447 done
|
pankso@3521
|
448 elif [ "$OBJECT" = "File_list" ]; then
|
pankso@3521
|
449 package_exist $SEARCH && cat << _EOT_
|
pankso@3521
|
450
|
pankso@3521
|
451 <h3>$result</h3>
|
pankso@3521
|
452 <pre class="package">
|
pankso@3521
|
453 _EOT_
|
pankso@3521
|
454 last=""
|
pascal@3551
|
455 unlzma -c $PACKAGES_REPOSITORY/files.list.lzma \
|
pankso@3521
|
456 | grep ^$SEARCH: | sed 's/.*: / /' | sort
|
pankso@3521
|
457 elif [ "$OBJECT" = "Desc" ]; then
|
pascal@3780
|
458 if [ -f $WOK/$SEARCH/description.txt ]; then
|
pascal@3780
|
459 cat << _EOT_
|
pascal@3780
|
460
|
pascal@3780
|
461 <h3>$result</h3>
|
pascal@3780
|
462 <pre class="package">
|
pascal@3780
|
463 <pre>
|
pascal@3780
|
464 $(htmlize < $WOK/$SEARCH/description.txt)
|
pascal@3780
|
465 </pre>
|
pascal@3780
|
466 _EOT_
|
pascal@3780
|
467 else
|
pascal@3780
|
468 cat << _EOT_
|
pankso@3521
|
469
|
pankso@3521
|
470 <h3>$result</h3>
|
pankso@3521
|
471 <pre class="package">
|
pankso@3521
|
472 _EOT_
|
pascal@3780
|
473 last=""
|
pascal@3780
|
474 grep -i $SEARCH $PACKAGES_REPOSITORY/packages.desc | \
|
pascal@3780
|
475 sort | while read pkg extras ; do
|
pankso@3521
|
476 . $WOK/$pkg/receipt
|
pankso@3521
|
477 cat << _EOT_
|
pankso@3521
|
478 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
479 _EOT_
|
pankso@3521
|
480 done
|
pascal@3780
|
481 fi
|
pankso@3521
|
482 elif [ "$OBJECT" = "Tags" ]; then
|
pankso@3521
|
483 cat << _EOT_
|
pankso@3521
|
484
|
pankso@3521
|
485 <h3>$result</h3>
|
pankso@3521
|
486 <pre class="package">
|
pankso@3521
|
487 _EOT_
|
pankso@3521
|
488 last=""
|
pankso@3521
|
489 grep ^TAGS= $WOK/*/receipt | grep -i $SEARCH | \
|
pankso@3521
|
490 sed "s|$WOK/\(.*\)/receipt:.*|\1|" | sort | while read pkg ; do
|
pankso@3521
|
491 . $WOK/$pkg/receipt
|
pankso@3521
|
492 cat << _EOT_
|
pankso@3521
|
493 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
494 _EOT_
|
pankso@3521
|
495 done
|
pankso@3521
|
496 elif [ "$OBJECT" = "Receipt" ]; then
|
pankso@3521
|
497 package_exist $SEARCH && cat << _EOT_
|
pankso@3521
|
498
|
pankso@3521
|
499 <h3>$result</h3>
|
pankso@3521
|
500 <pre class="package">
|
pankso@3521
|
501 <pre>
|
pankso@3521
|
502 $(if [ -f $WOK/$SEARCH/taz/*/receipt ]; then
|
pankso@3521
|
503 cat $WOK/$SEARCH/taz/*/receipt
|
pankso@3521
|
504 else
|
pascal@3780
|
505 cat $WOK/$SEARCH/receipt
|
pascal@3780
|
506 fi | htmlize)
|
pankso@3521
|
507 </pre>
|
pankso@3521
|
508 _EOT_
|
pankso@3521
|
509 else
|
pankso@3521
|
510 cat << _EOT_
|
pankso@3521
|
511
|
pankso@3521
|
512 <h3>$result</h3>
|
pankso@3521
|
513 <pre class="package">
|
pankso@3521
|
514 _EOT_
|
pankso@3521
|
515 for pkg in `ls $WOK | grep $SEARCH`
|
pankso@3521
|
516 do
|
pankso@3521
|
517 . $WOK/$pkg/receipt
|
pascal@3780
|
518 DESC=" <a href=\"?desc=$pkg\">description</a>"
|
pascal@3780
|
519 [ -f $WOK/$pkg/description.txt ] || DESC=""
|
pankso@3521
|
520 cat << _EOT_
|
pascal@3780
|
521 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC$DESC
|
pankso@3521
|
522 _EOT_
|
pankso@3521
|
523 done
|
pascal@3551
|
524 equiv=$PACKAGES_REPOSITORY/packages.equiv
|
pankso@3521
|
525 vpkgs="$(cat $equiv | cut -d= -f1 | grep $SEARCH)"
|
pankso@3521
|
526 for vpkg in $vpkgs ; do
|
pankso@3521
|
527 cat << _EOT_
|
pankso@3521
|
528 </pre>
|
pankso@3521
|
529
|
pankso@3521
|
530 <h3>$result (package providing $vpkg)</h3>
|
pankso@3521
|
531 <pre class="package">
|
pankso@3521
|
532 _EOT_
|
pankso@3521
|
533 for pkg in $(grep $vpkg= $equiv | sed "s/$vpkg=//"); do
|
pankso@3521
|
534 . $WOK/${pkg#*:}/receipt
|
pankso@3521
|
535 cat << _EOT_
|
pankso@3521
|
536 <a href="$SLITAZ_VERSION/$CATEGORY.html#$PACKAGE">$PACKAGE</a> : $SHORT_DESC
|
pankso@3521
|
537 _EOT_
|
pankso@3521
|
538 done
|
pankso@3521
|
539 done
|
pankso@3521
|
540 fi
|
pankso@3521
|
541 cat << _EOT_
|
pankso@3521
|
542 </pre>
|
pankso@3521
|
543 _EOT_
|
pankso@3521
|
544 xhtml_footer
|
pankso@3521
|
545 fi
|
pankso@3521
|
546
|
pankso@3521
|
547 exit 0
|