rudimentary support for tor:// URIs

This commit is contained in:
Johannes 'josch' Schauer 2018-09-21 08:05:39 +02:00
parent 58004816d1
commit 550562cf6f
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -788,9 +788,15 @@ sub setup {
open(my $pipe_apt, '-|', 'apt-get', 'indextargets', '--format', '$(URI)', 'Created-By: Packages') or die "cannot start apt-get indextargets: $!";
while (my $uri = <$pipe_apt>) {
if ($uri =~ /^https:\/\//) {
# FIXME: support for https is part of apt >= 1.5
$pkgs_to_install_from_outside{'apt-transport-https'} = ();
$pkgs_to_install_from_outside{'ca-certificates'} = ();
last;
} elsif ($uri =~ /^tor(\+[a-z]+)*:\/\//) {
# tor URIs can be tor+http://, tor+https:// or even
# tor+mirror+file://
$pkgs_to_install_from_outside{'apt-transport-tor'} = ();
last;
}
}
close $pipe_apt;