#!/usr/bin/perl -w $| = 1; $hostName = "user-mode-linux.sourceforge.net"; $host = $hostName; print "Downloading latest patchlist\n"; system("wget -N -q http://$host/patches.html"); $KernelVer = 'none'; open PATCHES, "patches.html"; while () { if (/name="(2.[^"]+)"/) { $KernelVer = $1; print "Kernel " . $KernelVer . "\n"; $outDir = $KernelVer; mkdir $KernelVer; open PATCHLIST, "> $KernelVer-series"; $currDate = `date`; chomp($currDate); print PATCHLIST "#\n#Downloading from Jeff Dike web-site on " . $currDate . "\n#\n"; } next if ($KernelVer eq 'none'); /href="(work[^"]+)"\>\s*([\w-]+)\<\/a\>/ or next; $url = "http://$host/$1"; $name = "$2.patch"; print PATCHLIST "$name\n"; print "...patch $name\n"; system("cd $outDir && http_proxy= wget -N -q -t 10 $url"); }