[FLUG] updaterpm.pl versione 0.2.0

  • From: Gecco under VNC <gecco@xxxxxxxxxxxx>
  • To: fanolug@xxxxxxxxxxxxx
  • Date: Wed, 24 Apr 2002 13:55:19 +0200

Mailing List del Fortunae LUG
=============================

#!/usr/bin/perl
use Net::FTP;

    $ftp = Net::FTP->new("216.148.218.201");
    $ftp->login("anonymous","xxx");
    $ftp->cwd("/pub/redhat/linux/updates/7.2/en/os/i386");
    @rpm_remoti=$ftp->ls();
    $ftp->quit;

@rpm_locali = `rpm -qa`;
$remoti = @rpm_remoti;
$locali = @rpm_locali;
print "ci sono installati $locali pacchetti\n";
print "quelli remoti sono $remoti in updates\n";
print "remoti    -    locali\n\n";
if($remoti < $locali)
        {
        $maggiore=$locali;
        $minore=$remoti;
        }

        else
        {
        $maggiore=$remoti;
        $minore=$locali;
        }
for ($a=0; $a<$minore; $a++)
{
        for($b=0; $b<$maggiore; $b++)
        {
        chomp($rpm_remoti[$a]);
        chomp($rpm_locali[$b]);
        @rem=split(/\d\.\d/, $rpm_remoti[$a]);
        @loc=split(/\d\.\d/, $rpm_locali[$b]);
                if ($rem[0] eq $loc[0] && $rem[1] ne $loc[1])
                {
                print "$rpm_remoti[$a] - $rpm_locali[$b]\n";
                }
        }
}


ora si connette all'ftp di redhat da solo, vuole l'ip numerico, non ho capito perche', e printa solo gli rpm con versioni diverse


bau
--
"Lavoratori: prrrrrrrrrrrrrrr" (A. Sordi)

--
Quite frankly, I don't want people using Linux for ideological reasons. I think 
ideology sucks. This world would be a much better place if people had less ideology 
and a whole lot more. I do this because it's FUN and because others might find it 
useful, not because I got religion" - Linus Torvalds

Other related posts:

  • » [FLUG] updaterpm.pl versione 0.2.0