Skip to content

Commit

Permalink
fix: updated old Debian ISOS (UPC#1713)
Browse files Browse the repository at this point in the history
Also improved web crawling
  • Loading branch information
frankiejol authored Mar 2, 2022
1 parent a3c530e commit 8ce3a69
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions lib/Ravada.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
11 changes: 7 additions & 4 deletions lib/Ravada/VM/KVM.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit 8ce3a69

Please sign in to comment.