#!/usr/local/bin/perl # rhn.cgi # Display a list of packages available for download from RHN require './software-lib.pl'; $bgcolor = defined($gconfig{'cs_page'}) ? $gconfig{'cs_page'} : "ffffff"; $link = defined($gconfig{'cs_link'}) ? $gconfig{'cs_link'} : "0000ee"; $text = defined($gconfig{'cs_text'}) ? $gconfig{'cs_text'} : "000000"; &PrintHeader(); print < $text{'rhn_title'} EOF $out = `up2date -l 2>&1`; if ($out =~ /Error Message:/i) { print "
$out
\n"; } else { print "\n"; foreach (split(/\n/, $out)) { if ($dashes && /^(\S+)\s+(\S+)\s+(\S+)/) { if (!$count++) { print " ", "\n"; } print "\n"; print "\n"; print "\n"; print "\n"; } elsif (/^----/) { last if ($dashes); $dashes++; } } print "
$text{'rhn_pack'}", "$text{'rhn_version'}
$1$2 - $3
\n"; if (!$count) { print "$text{'rhn_nonefound'}

\n"; } } print "\n";