Commit 164f2803 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

fix: updated old Debian ISOS

Also improved web crawling
parent b225727c
......@@ -540,7 +540,7 @@ sub _update_isos {
,debian_jessie_32 => {
name =>'Debian Jessie 32 bits'
,description => 'Debian 8 Jessie 32 bits'
,url => 'http://cdimage.debian.org/cdimage/archive/^8\..*/i386/iso-cd/'
,url => 'http://cdimage.debian.org/cdimage/archive/^8\.1\d+\.\d$/i386/iso-cd/'
,file_re => 'debian-8.[\d\.]+-i386-xfce-CD-1.iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-i386.xml'
......@@ -551,7 +551,7 @@ sub _update_isos {
,debian_jessie_64 => {
name =>'Debian Jessie 64 bits'
,description => 'Debian 8 Jessie 64 bits'
,url => 'http://cdimage.debian.org/cdimage/archive/^8\..*/amd64/iso-cd/'
,url => 'http://cdimage.debian.org/cdimage/archive/^8\.1\d+.*\d$/amd64/iso-cd/'
,file_re => 'debian-8.[\d\.]+-amd64-xfce-CD-1.iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-amd64.xml'
......@@ -562,7 +562,7 @@ sub _update_isos {
,debian_stretch_32 => {
name =>'Debian Stretch 32 bits'
,description => 'Debian 9 Stretch 32 bits (XFCE desktop)'
,url => 'https://cdimage.debian.org/cdimage/archive/^9\..*\d$/i386/iso-cd/'
,url => 'https://cdimage.debian.org/cdimage/archive/^9\.1\d.*\d$/i386/iso-cd/'
,file_re => 'debian-9.[\d\.]+-i386-xfce-CD-1.iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-i386.xml'
......@@ -573,7 +573,7 @@ sub _update_isos {
,debian_stretch_64 => {
name =>'Debian Stretch 64 bits'
,description => 'Debian 9 Stretch 64 bits (XFCE desktop)'
,url => 'https://cdimage.debian.org/cdimage/archive/^9\..*/amd64/iso-cd/'
,url => 'https://cdimage.debian.org/cdimage/archive/^9\.1\d.*/amd64/iso-cd/'
,file_re => 'debian-9.[\d\.]+-amd64-xfce-CD-1.iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-amd64.xml'
......@@ -584,7 +584,7 @@ sub _update_isos {
,debian_buster_64=> {
name =>'Debian Buster 64 bits'
,description => 'Debian 10 Buster 64 bits (XFCE desktop)'
,url => 'https://cdimage.debian.org/cdimage/archive/^10\..*\d$/amd64/iso-cd/'
,url => 'https://cdimage.debian.org/cdimage/archive/^10\.1\d+.*\d$/amd64/iso-cd/'
,file_re => 'debian-10.[\d\.]+-amd64-xfce-CD-1.iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-amd64.xml'
......@@ -595,7 +595,7 @@ sub _update_isos {
,debian_buster_32=> {
name =>'Debian Buster 32 bits'
,description => 'Debian 10 Buster 32 bits (XFCE desktop)'
,url => 'https://cdimage.debian.org/cdimage/archive/^10\..*\d$/i386/iso-cd/'
,url => 'https://cdimage.debian.org/cdimage/archive/^10\.1\d+.*\d$/i386/iso-cd/'
,file_re => 'debian-10.[\d\.]+-i386-(netinst|xfce-CD-1).iso'
,md5_url => '$url/MD5SUMS'
,xml => 'jessie-i386.xml'
......
......@@ -1418,8 +1418,7 @@ sub _ua_get($self, $url) {
sleep 1+$try;
}
confess "Error getting '$url'" if !$res;
confess "ERROR ".$res->code." ".$res->message." : $url"
unless $res->code == 200 || $res->code == 301;
return unless $res->code == 200 || $res->code == 301;
$self->_cache_store($url,$res->body);
return $res->dom;
......@@ -1520,13 +1519,16 @@ sub _search_url_file($self, $url_re, $file_re=undef) {
($url_re, $file_re) = $old_url_re =~ m{(.*)/(.*)};
confess "ERROR: Missing file part in $old_url_re"
if !$file_re;
if ($url_re =~ /\.\.$/) {
$url_re =~ s{(.*)/.*/\.\.$}{$1};
}
}
$file_re .= '$' if $file_re !~ m{\$$};
my @found;
for my $url ($self->_match_url($url_re)) {
push @found,
$self->_match_file($url, $file_re);
my @file = $self->_match_file($url, $file_re);
push @found, @file if scalar @file;
}
return (sort @found);
}
......@@ -1545,6 +1547,7 @@ sub _match_file($self, $url, $file_re) {
$url .= '/' if $url !~ m{/$};
my $dom = $self->_ua_get($url);
return if !$dom;
my @found;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment