target_putfilecontents_root_stash
target_put_guest_image target_editfile
target_editfile_cancel target_fetchurl
+ http_proxy_envsettings
target_editfile_root target_file_exists
target_editfile_kvp_replace
target_run_apt
export CCACHE_PREFIX DISTCC_FALLBACK DISTCC_HOSTS
END
- my $httpproxy = defined($c{HttpProxy}) ? <<END : "";
- http_proxy=$c{HttpProxy}
- export http_proxy
-END
+ my $httpproxy = http_proxy_envsettings($ho);
- target_cmd($ho, <<END.$distcc.$httpproxy.<<END.$script, $timeout);
+ target_cmd($ho, <<END.$distcc.<<END.$script, $timeout);
set -xe
LC_ALL=C; export LC_ALL
PATH=/usr/lib/ccache:\$PATH:/usr/lib/git-core
+ $httpproxy
END
exec </dev/null
cd $builddir
sub target_fetchurl($$$;$) {
my ($ho, $url, $path, $timeo) = @_;
$timeo ||= 2000;
- my $useproxy = $c{HttpProxy} ? "export http_proxy=$c{HttpProxy};" : "";
+ my $useproxy = http_proxy_envsettings($ho);
target_cmd_root($ho, <<END, $timeo);
$useproxy wget --progress=dot:mega -O \Q$path\E \Q$url\E
END
}
+sub http_proxy_envsettings ($) {
+ # returns sh script fragment ending in ;
+ my ($ho) = @_;
+ my $proxy = $c{HttpProxy};
+ return unless $proxy;
+ my @script;
+ foreach my $var (qw(http_proxy)) {
+ push @script, "http_proxy=$proxy", "export http_proxy";
+ }
+ return (join '; ', @script).';';
+}
sub target_put_guest_image ($$;$) {
my ($ho, $gho, $default) = @_;