Fixed http_proxy handling in apt::repo

This commit is contained in:
Ossi Salmi 2011-03-09 14:02:43 +02:00 committed by Timo Mkinen
parent bbf8ad0750
commit 0d25368ce7

View file

@ -228,6 +228,12 @@ define apt::repo($source, $dist="", $components="main", $key="", $keyserver="",
$source_real = $source
}
if $http_proxy and $use_proxy {
$http_proxy_real = $http_proxy
} else {
$http_proxy_real = ""
}
if $use_source {
$content = "deb ${source_real} ${dist_real} ${components}\ndeb-src ${source_real} ${dist_real} ${components}\n"
} else {
@ -254,9 +260,9 @@ define apt::repo($source, $dist="", $components="main", $key="", $keyserver="",
}
exec { "apt-key-add-${key}":
environment => $http_proxy ? {
environment => $http_proxy_real ? {
"" => undef,
default => "http_proxy=${http_proxy}",
default => "http_proxy=${http_proxy_real}",
},
path => "/bin:/usr/bin:/sbin:/usr/sbin",
command => $command,