tazpkg rev 736
pkgs.cgi: unification - single function to list packages by category or name.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Dec 30 04:15:55 2014 +0200 (2014-12-30) |
parents | 21e01cc4fa1f |
children | 3b6602629dc0 |
files | tazpanel/pkgs.cgi |
line diff
1.1 --- a/tazpanel/pkgs.cgi Mon Dec 29 13:45:57 2014 -0500 1.2 +++ b/tazpanel/pkgs.cgi Tue Dec 30 04:15:55 2014 +0200 1.3 @@ -156,7 +156,7 @@ 1.4 [ -z "$repo" ] && repo="Any" 1.5 cat << EOT 1.6 <div class="search"> 1.7 - <form method="get" action="$SCRIPT_NAME"> 1.8 + <form method="get" action=""> 1.9 <p> 1.10 <input type="text" name="search" size="20"> 1.11 <input type="submit" value="$(gettext 'Search')"> 1.12 @@ -172,14 +172,16 @@ 1.13 1.14 table_head() { 1.15 cat << EOT 1.16 - <thead> 1.17 +<table class="zebra outbox pkglist"> 1.18 + <thead> 1.19 <tr> 1.20 <td>$(_ 'Name')</td> 1.21 <td>$(_ 'Version')</td> 1.22 <td>$(_ 'Description')</td> 1.23 <td>$(_ 'Web')</td> 1.24 </tr> 1.25 - </thead> 1.26 + </thead> 1.27 + <tbody> 1.28 EOT 1.29 } 1.30 1.31 @@ -256,22 +258,6 @@ 1.32 } 1.33 1.34 1.35 -make_mixed_list() { 1.36 - for L in $LANG ${LANG%%_*}; do 1.37 - if [ -e "$PKGS_DB/packages-desc.$L" ]; then 1.38 - sed '/^#/d' $PKGS_DB/packages-desc.$L 1.39 - break 1.40 - fi 1.41 - done 1.42 - 1.43 - [ -e "$i/blocked-packages.list" ] && cat $i/blocked-packages.list 1.44 - 1.45 - sed 's|.*|&\ti|' $i/installed.info 1.46 - 1.47 - cat $i/packages.info 1.48 -} 1.49 - 1.50 - 1.51 # Print links to the pages 1.52 1.53 pager() { 1.54 @@ -297,6 +283,53 @@ 1.55 } 1.56 1.57 1.58 +# Show packages list by category or tag 1.59 + 1.60 +show_list() { 1.61 + cached=$(mktemp) 1.62 + { 1.63 + for L in $LANG ${LANG%%_*}; do 1.64 + if [ -e "$PKGS_DB/packages-desc.$L" ]; then 1.65 + sed '/^#/d' $PKGS_DB/packages-desc.$L; break 1.66 + fi 1.67 + done 1.68 + [ -e "$i/blocked-packages.list" ] && cat $i/blocked-packages.list 1.69 + sed 's|.*|&\ti|' $i/installed.info 1.70 + [ $1 == 'extra' ] || [ $1 == 'my' ] || cat $i/packages.info 1.71 + [ $1 == 'extra' ] && sed 's|.*|&\t-\textra\t-\thttp://mirror.slitaz.org/packages/get/&\t-\t-\t-|' $PKGS_DB/extra.list 1.72 + } | sort -t$'\t' -k1,1 | sed '/^$/d' | awk -F$'\t' -vc="${category:--}" -vt="${tag:--}" ' 1.73 +{ 1.74 + if (PKG && PKG != $1) { 1.75 + if (SEL) { 1.76 + if (DSCL) DSC = DSCL 1.77 + printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\"><a class=\"pkg%s%s\" href=\"?info=%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\"></a></td></tr>\n", PKG, INS, BLK, gensub(/\+/, "%2B", "g", PKG), PKG, VER, DSC, WEB 1.78 + } 1.79 + VER = DSC = WEB = DSCL = INS = BLK = SEL = "" 1.80 + } 1.81 + 1.82 + PKG = $1 1.83 + if (NF == 1) { BLK = "b"; next } 1.84 + if (NF == 2) { DSCL = $2; next } 1.85 + if (c == "all" || $3 == c || index(" "$6" ", " "t" ")) { SEL = 1 } 1.86 + if (SEL) { 1.87 + if ($9 == "i") { VER = $2; DSC = $4; WEB = $5; INS = "i"; next} 1.88 + if (! INS) { VER = $2; DSC = $4; WEB = $5 } 1.89 + } 1.90 +}' > $cached 1.91 + page=$(GET page); [ -z "$page" ] && page=1 1.92 + 1.93 + pager="$(pager $cached)" 1.94 + echo "$pager" 1.95 + 1.96 + table_head 1.97 + tail -n+$((($page-1)*100+1)) $cached | head -n100 1.98 + echo "</tbody></table>" 1.99 + 1.100 + echo "$pager" 1.101 + rm -f $cached 1.102 +} 1.103 + 1.104 + 1.105 # Show links for "info" page 1.106 1.107 show_info_links() { 1.108 @@ -319,52 +352,29 @@ 1.109 case " $(GET) " in 1.110 *\ list\ *) 1.111 # 1.112 - # List installed packages. This is the default because parsing 1.113 - # the full packages.desc can be long and take up some resources 1.114 + # List installed packages. 1.115 # 1.116 - cd $INSTALLED 1.117 + category=$(GET category) 1.118 search_form 1.119 sidebar 1.120 LOADING_MSG="$(_ 'Listing packages...')" 1.121 loading_msg 1.122 cat << EOT 1.123 <h2>$(_ 'My packages')</h2> 1.124 -<form method='get' action='$SCRIPT_NAME'> 1.125 + 1.126 +<form method="get" action=""> 1.127 <input type="hidden" name="do" value="Remove" /> 1.128 -<div id="actions"> 1.129 - <div class="float-left"> 1.130 - $(_ 'Selection:') 1.131 - <input type="submit" value="$(_ 'Remove')" /> 1.132 + <div id="actions"> 1.133 + <div class="float-left"> 1.134 + $(_ 'Selection:') 1.135 + <input type="submit" value="$(_ 'Remove')" /> 1.136 + </div> 1.137 + <div class="float-right"> 1.138 + $(show_button recharge) 1.139 + $(show_button up) 1.140 + </div> 1.141 </div> 1.142 - <div class="float-right"> 1.143 - $(show_button recharge) 1.144 - $(show_button up) 1.145 - </div> 1.146 -</div> 1.147 - 1.148 -<table class="zebra outbox pkglist"> 1.149 -$(table_head) 1.150 -<tbody> 1.151 -EOT 1.152 - for pkg in *; do 1.153 - . $pkg/receipt 1.154 - echo '<tr>' 1.155 - # Use default tazpkg icon since all packages displayed are 1.156 - # installed 1.157 - blocked= 1.158 - grep -qs "^$pkg$" $PKGS_DB/blocked-packages.list && blocked="b" 1.159 - i18n_desc $pkg 1.160 - cat << EOT 1.161 -<td><input type="checkbox" name="pkg" value="$pkg" />$(pkg_info_link $pkg pkgi$blocked)</td> 1.162 -<td>$VERSION</td> 1.163 -<td>$SHORT_DESC</td> 1.164 -<td><a class="w" href="$WEB_SITE"></a></td> 1.165 -</tr> 1.166 -EOT 1.167 - done 1.168 - cat << EOT 1.169 -</tbody> 1.170 -</table> 1.171 + $(i=$PKGS_DB; category=${category:-all}; show_list my) 1.172 </form> 1.173 EOT 1.174 ;; 1.175 @@ -374,7 +384,6 @@ 1.176 # 1.177 # List linkable packages. 1.178 # 1.179 - cd $INSTALLED 1.180 search_form 1.181 sidebar 1.182 LOADING_MSG=$(_ 'Listing linkable packages...') 1.183 @@ -382,24 +391,20 @@ 1.184 cat << EOT 1.185 <h2>$(_ 'Linkable packages')</h2> 1.186 1.187 -<form method='get' action='$SCRIPT_NAME'> 1.188 +<form method="get" action=""> 1.189 <input type="hidden" name="do" value="Link" /> 1.190 -<div id="actions"> 1.191 - <div class="float-left"> 1.192 - $(_ 'Selection:') 1.193 - <input type="submit" value="$(_ 'Link')" /> 1.194 + <div id="actions"> 1.195 + <div class="float-left"> 1.196 + $(_ 'Selection:') 1.197 + <input type="submit" value="$(_ 'Link')" /> 1.198 + </div> 1.199 + <div class="float-right"> 1.200 + $(show_button recharge) 1.201 + $(show_button up) 1.202 + </div> 1.203 </div> 1.204 - <div class="float-right"> 1.205 - $(show_button recharge) 1.206 - $(show_button up) 1.207 - </div> 1.208 -</div> 1.209 EOT 1.210 - cat << EOT 1.211 -<table class="zebra outbox pkglist"> 1.212 -$(table_head) 1.213 -<tbody> 1.214 -EOT 1.215 + table_head 1.216 target=$(readlink $PKGS_DB/fslink) 1.217 for pkg in $(ls $target/$INSTALLED); do 1.218 [ -s $pkg/receipt ] && continue 1.219 @@ -407,7 +412,7 @@ 1.220 i18n_desc $pkg 1.221 cat << EOT 1.222 <tr> 1.223 - <td><input type="checkbox" name="pkg" value="$pkg" />$(pkg_info_link $pkg pkg)</td> 1.224 + <td><input type="checkbox" name="pkg" value="$pkg" /><a class="pkg" href="?info=${pkg//+/%2B}">$pkg</a></td> 1.225 <td>$VERSION</td> 1.226 <td>$SHORT_DESC</td> 1.227 <td><a class="w" href="$WEB_SITE"></a></td> 1.228 @@ -415,8 +420,8 @@ 1.229 EOT 1.230 done 1.231 cat << EOT 1.232 -</tbody> 1.233 -</table> 1.234 + </tbody> 1.235 + </table> 1.236 </form> 1.237 EOT 1.238 ;; 1.239 @@ -426,7 +431,6 @@ 1.240 # 1.241 # List all available packages by category on mirror. 1.242 # 1.243 - cd $PKGS_DB 1.244 repo=$(GET repo) 1.245 category=$(GET cat) 1.246 search_form 1.247 @@ -434,10 +438,24 @@ 1.248 if [ -z "$category" ] || [ "$category" == 'cat' ]; then 1.249 cat << EOT 1.250 <h2>$(_ 'Categories list')</h2> 1.251 + 1.252 +<form method="get" action=""> 1.253 + <div id="actions"> 1.254 + <div class="float-right"> 1.255 + $(show_button tag=) 1.256 + $(show_button list) 1.257 + </div> 1.258 + </div> 1.259 + 1.260 <table class="zebra outbox"> 1.261 -<thead> 1.262 -<tr><td>$(_ 'Category')</td><td>$(_ 'Repository')</td><td>$(_ 'Installed')</td></tr> 1.263 -</thead><tbody> 1.264 + <thead> 1.265 + <tr> 1.266 + <td>$(_ 'Category')</td> 1.267 + <td>$(_ 'Repository')</td> 1.268 + <td>$(_ 'Installed')</td> 1.269 + </tr> 1.270 + </thead> 1.271 + <tbody> 1.272 EOT 1.273 { 1.274 awk -F$'\t' '{print $3}' $PKGS_DB/packages.info | sort | uniq -c 1.275 @@ -459,74 +477,24 @@ 1.276 cat << EOT 1.277 <h2>$(_ 'Category: %s' $category)</h2> 1.278 1.279 -<form method='get' action='$SCRIPT_NAME'> 1.280 -<div id="actions"> 1.281 -<div class="float-left"> 1.282 - $(_ 'Selection:') 1.283 - <input type="submit" name="do" value="Install" /> 1.284 - <input type="submit" name="do" value="Remove" /> 1.285 - <input type="hidden" name="repo" value="$repo" /> 1.286 -</div> 1.287 -<div class="float-right"> 1.288 - $(show_button recharge) 1.289 - $(show_button up) 1.290 - $(show_button list) 1.291 -</div> 1.292 -</div> 1.293 +<form method="get" action=""> 1.294 + <div id="actions"> 1.295 + <div class="float-left"> 1.296 + $(_ 'Selection:') 1.297 + <input type="submit" name="do" value="Install" /> 1.298 + <input type="submit" name="do" value="Remove" /> 1.299 + <input type="hidden" name="repo" value="$repo" /> 1.300 + </div> 1.301 + <div class="float-right"> 1.302 + $(show_button recharge) 1.303 + $(show_button up) 1.304 + $(show_button list) 1.305 + </div> 1.306 + </div> 1.307 EOT 1.308 for i in $(repo_list ""); do 1.309 [ "$repo" != "Public" ] && echo "<h3>$(_ 'Repository: %s' $(repo_name $i))</h3>" 1.310 - 1.311 - case $category in 1.312 - extra) 1.313 - echo '<table class="zebra outbox pkglist">' 1.314 - table_head 1.315 - echo '<tbody>' 1.316 - NA="$(_n 'n/a')" 1.317 - for pkg in $(cat $i/extra.list); do 1.318 - PKG="$(grep ^$pkg$'\t' $i/installed.info)" 1.319 - if [ -n "$PKG" ]; then 1.320 - echo "$PKG" 1.321 - else 1.322 - echo "$pkg $NA - $NA http://mirror.slitaz.org/packages/get/$pkg - - -" 1.323 - fi 1.324 - done | parse_packages_info 1.325 - echo "</tbody></table>" 1.326 - ;; 1.327 - *) 1.328 - cached="$CACHE_DIR/$repo-$category" 1.329 - make_mixed_list | sort -t$'\t' -k1,1 | awk -F$'\t' -vc="$category" ' 1.330 -{ 1.331 - if (PKG && PKG != $1) { 1.332 - if (SEL) { 1.333 - if (DSCL) DSC = DSCL 1.334 - printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\"><a class=\"pkg%s%s\" href=\"?info=%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\"></a></td></tr>\n", PKG, INS, BLK, gensub(/\+/, "%2B", "g", PKG), PKG, VER, DSC, WEB 1.335 - } 1.336 - VER = DSC = WEB = DSCL = INS = BLK = SEL = "" 1.337 - } 1.338 - 1.339 - PKG = $1 1.340 - if (NF == 1) { BLK = "b"; next } 1.341 - if (NF == 2) { DSCL = $2; next } 1.342 - if (c == "all" || $3 == c) { 1.343 - SEL = $1 1.344 - if ($9 == "i") { VER = $2; DSC = $4; WEB = $5; INS = "i"; next} 1.345 - if (! INS) { VER = $2; DSC = $4; WEB = $5 } 1.346 - } 1.347 -}' > $cached 1.348 - page=$(GET page); [ -z "$page" ] && page=1 1.349 - pager="$(pager $cached)" 1.350 - 1.351 - echo "$pager" 1.352 - echo '<table class="zebra outbox pkglist">' 1.353 - table_head 1.354 - echo '<tbody>' 1.355 - tail -n+$((($page-1)*100+1)) $cached | head -n100 1.356 - echo "</tbody></table>" 1.357 - echo "$pager" 1.358 - rm -f $cached 1.359 - ;; 1.360 - esac 1.361 + show_list $category 1.362 done 1.363 echo '</form>' 1.364 fi 1.365 @@ -547,20 +515,21 @@ 1.366 loading_msg 1.367 cat << EOT 1.368 <h2>$(_ 'Search packages')</h2> 1.369 -<form method="get" action="$SCRIPT_NAME"> 1.370 -<div id="actions"> 1.371 -<div class="float-left"> 1.372 - $(_ 'Selection:') 1.373 - <input type="submit" name="do" value="Install" /> 1.374 - <input type="submit" name="do" value="Remove" /> 1.375 - <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 1.376 -</div> 1.377 -<div class="float-right"> 1.378 - $(show_button recharge) 1.379 - $(show_button up) 1.380 - $(show_button list) 1.381 -</div> 1.382 -</div> 1.383 + 1.384 +<form method="get" action=""> 1.385 + <div id="actions"> 1.386 + <div class="float-left"> 1.387 + $(_ 'Selection:') 1.388 + <input type="submit" name="do" value="Install" /> 1.389 + <input type="submit" name="do" value="Remove" /> 1.390 + <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 1.391 + </div> 1.392 + <div class="float-right"> 1.393 + $(show_button recharge) 1.394 + $(show_button up) 1.395 + $(show_button list) 1.396 + </div> 1.397 + </div> 1.398 <input type="hidden" name="repo" value="$repo" /> 1.399 EOT 1.400 if [ -n "$(GET files)" ]; then 1.401 @@ -586,9 +555,7 @@ 1.402 EOT 1.403 done 1.404 else 1.405 - echo ' <table class="zebra outbox pkglist">' 1.406 table_head 1.407 - echo " <tbody>" 1.408 awk -F$'\t' 'BEGIN{IGNORECASE = 1} 1.409 $1 $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info 1.410 fi 1.411 @@ -611,7 +578,7 @@ 1.412 cat << EOT 1.413 <h2>$(_ 'Recharge')</h2> 1.414 1.415 -<form method='get' action='$SCRIPT_NAME'> 1.416 +<form method="get" action=""> 1.417 <div id="actions"> 1.418 <div class="float-left"> 1.419 <p>$(_ 'Recharge checks for new or updated packages')</p> 1.420 @@ -646,26 +613,22 @@ 1.421 cat << EOT 1.422 <h2>$(_ 'Up packages')</h2> 1.423 1.424 -<form method="get" action="$SCRIPT_NAME"> 1.425 -<div id="actions"> 1.426 - <div class="float-left"> 1.427 - $(_ 'Selection:') 1.428 - <input type="submit" name="do" value="Install" /> 1.429 - <input type="submit" name="do" value="Remove" /> 1.430 - <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 1.431 +<form method="get" action=""> 1.432 + <div id="actions"> 1.433 + <div class="float-left"> 1.434 + $(_ 'Selection:') 1.435 + <input type="submit" name="do" value="Install" /> 1.436 + <input type="submit" name="do" value="Remove" /> 1.437 + <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 1.438 + </div> 1.439 + <div class="float-right"> 1.440 + $(show_button recharge) 1.441 + $(show_button list) 1.442 + </div> 1.443 </div> 1.444 - <div class="float-right"> 1.445 - $(show_button recharge) 1.446 - $(show_button list) 1.447 - </div> 1.448 -</div> 1.449 EOT 1.450 tazpkg up --check >/dev/null 1.451 - cat << EOT 1.452 -<table class="zebra outbox"> 1.453 -$(table_head) 1.454 -<tbody> 1.455 -EOT 1.456 + table_head 1.457 for pkg in $(cat packages.up); do 1.458 grep -hs "^$pkg |" $PKGS_DB/packages.desc $PKGS_DB/undigest/*/packages.desc | \ 1.459 parse_packages_desc 1.460 @@ -706,18 +669,18 @@ 1.461 cat << EOT 1.462 <h2>TazPkg: $cmd</h2> 1.463 1.464 -<form method="get" action="$SCRIPT_NAME"> 1.465 -<div id="actions"> 1.466 - <div class="float-left"> 1.467 - <p>$(_ 'Performing tasks on packages')</p> 1.468 +<form method="get" action=""> 1.469 + <div id="actions"> 1.470 + <div class="float-left"> 1.471 + <p>$(_ 'Performing tasks on packages')</p> 1.472 + </div> 1.473 + <div class="float-right"> 1.474 + $(show_button list) 1.475 + </div> 1.476 </div> 1.477 - <div class="float-right"> 1.478 - $(show_button list) 1.479 + <div class="box"> 1.480 + $(_ 'Executing %s for: %s' $cmd $pkgs) 1.481 </div> 1.482 -</div> 1.483 -<div class="box"> 1.484 -$(_ 'Executing %s for: %s' $cmd $pkgs) 1.485 -</div> 1.486 EOT 1.487 for pkg in $pkgs; do 1.488 echo '<pre>' 1.489 @@ -859,6 +822,7 @@ 1.490 [ "$cmd" == "$(_n 'Set link')" ] && 1.491 [ -d "$(GET link)/$INSTALLED" ] && ln -fs $(GET link) $PKGS_DB/fslink 1.492 [ "$cmd" == "$(_n 'Remove link')" ] && rm -f $PKGS_DB/fslink 1.493 + 1.494 cache_files=$(find $CACHE_DIR -name *.tazpkg | wc -l) 1.495 cache_size=$(du -sh $CACHE_DIR | cut -f1 | sed 's|\.0||') 1.496 sidebar 1.497 @@ -912,11 +876,10 @@ 1.498 <h3>$(_ 'Packages cache')</h3> 1.499 1.500 <div> 1.501 - <form method="get" action="$SCRIPT_NAME"> 1.502 - <p> 1.503 - $(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size) 1.504 + <form method="get" action=""> 1.505 + <p>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size) 1.506 <input type="hidden" name="admin" value="clean" /> 1.507 - <input type="submit" value="Clean" /> 1.508 + <input type="submit" value="$(_n 'Clean')" /> 1.509 </p> 1.510 </form> 1.511 </div> 1.512 @@ -939,12 +902,12 @@ 1.513 echo "</ul>" 1.514 cat << EOT 1.515 </div> 1.516 -<form method="get" action="$SCRIPT_NAME"> 1.517 +<form method="get" action=""> 1.518 <p> 1.519 <input type="hidden" name="admin" value="add-mirror" /> 1.520 <input type="hidden" name="file" value="$i" /> 1.521 <input type="text" name="mirror" size="60"> 1.522 - <input type="submit" value="Add mirror" /> 1.523 + <input type="submit" value="$(_n 'Add mirror')" /> 1.524 </p> 1.525 </form> 1.526 EOT 1.527 @@ -958,13 +921,13 @@ 1.528 </div> 1.529 EOT 1.530 cat << EOT 1.531 -<form method="get" action="$SCRIPT_NAME"> 1.532 +<form method="get" action=""> 1.533 <p> 1.534 <input type="hidden" name="admin" value="add-repo" /> 1.535 $(_ 'Name') <input type="text" name="repository" size="10"> 1.536 $(_ 'mirror') 1.537 <input type="text" name="mirror" value="http://" size="50"> 1.538 - <input type="submit" value="Add repository" /> 1.539 + <input type="submit" value="$(_n 'Add repository')" /> 1.540 </p> 1.541 </form> 1.542 1.543 @@ -973,11 +936,9 @@ 1.544 <p>$(_ "This link points to the root of another SliTaz installation. \ 1.545 You will be able to install packages using soft links to it.")</p> 1.546 1.547 -<form method="get" action="$SCRIPT_NAME"> 1.548 +<form method="get" action=""> 1.549 <p> 1.550 - <input type="hidden" name="admin" value="add-link" /> 1.551 - <input type="text" name="link" 1.552 - value="$(readlink $PKGS_DB/fslink 2> /dev/null)" size="50"> 1.553 + <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)" size="50"> 1.554 <input type="submit" name="admin" value="$(_ 'Set link')" /> 1.555 <input type="submit" name="admin" value="$(_ 'Remove link')" /> 1.556 </p> 1.557 @@ -1131,7 +1092,7 @@ 1.558 cat << EOT 1.559 <h2>$(_ 'Tag "%s"' $tag)</h2> 1.560 1.561 -<form method='get' action='$SCRIPT_NAME'> 1.562 +<form method="get" action=""> 1.563 <div id="actions"> 1.564 <div class="float-left"> 1.565 $(_ 'Selection:') 1.566 @@ -1147,30 +1108,7 @@ 1.567 EOT 1.568 for i in $(repo_list ""); do 1.569 [ "$repo" != "Public" ] && echo "<h3>$(_ 'Repository: %s' $(repo_name $i))</h3>" 1.570 - 1.571 - echo '<table class="zebra outbox pkglist">' 1.572 - table_head 1.573 - echo '<tbody>' 1.574 - make_mixed_list | sort -t$'\t' -k1,1 | awk -F$'\t' -vt="$tag" ' 1.575 -{ 1.576 - if (PKG && PKG != $1) { 1.577 - if (SEL) { 1.578 - if (DSCL) DSC = DSCL 1.579 - printf "<tr><td><input type=\"checkbox\" name=\"pkg\" value=\"%s\"><a class=\"pkg%s%s\" href=\"?info=%s\">%s</a></td><td>%s</td><td>%s</td><td><a href=\"%s\"></a></td></tr>\n", PKG, INS, BLK, gensub(/\+/, "%2B", "g", PKG), PKG, VER, DSC, WEB 1.580 - } 1.581 - VER = DSC = WEB = DSCL = INS = BLK = SEL = "" 1.582 - } 1.583 - 1.584 - PKG = $1 1.585 - if (NF == 1) { BLK = "b"; next } 1.586 - if (NF == 2) { DSCL = $2; next } 1.587 - if (index(" "$6" ", " "t" ")) { 1.588 - SEL = $1 1.589 - if ($9 == "i") { VER = $2; DSC = $4; WEB = $5; INS = "i"; next} 1.590 - if (! INS) { VER = $2; DSC = $4; WEB = $5 } 1.591 - } 1.592 -}' 1.593 - echo "</tbody></table>" 1.594 + show_list all 1.595 done 1.596 echo '</form>' 1.597