#!/usr/local/bin/perl # search.cgi # Display a list of packages where the name or description matches some string require './cluster-software-lib.pl'; &ReadParse(); $s = $in{'search'}; @hosts = &list_software_hosts(); foreach $h (@hosts) { foreach $p (@{$h->{'packages'}}) { if ($p->{'name'} =~ /$s/i || $p->{'desc'} =~ /$s/i && !$already{$p->{'name'}}++) { push(@match, $p); } } } if (@match == 1) { &redirect("edit_pack.cgi?package=".&urlize($match[0]->{'name'})); exit; } &header($text{'search_title'}, ""); print "
| $text{'search_pack'} | ", "$text{'search_class'} | ", "$text{'search_desc'} |
| {'name'}),"\">$i->{'name'} | \n"; $c = $i->{'class'}; print "",$c ? $c : $text{'search_none'}," | \n"; print "$i->{'desc'} | \n"; print "
\n"; } else { print "