From: Alex Tomlins Date: Thu, 31 Mar 2011 10:35:14 +0000 (+0100) Subject: Allow specifying apt_proxy on the commandline. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=accbe9e4e76806a33986bd024d58d58ca1e7ec48;p=people%2Fdariof%2Fxen-tools.git Allow specifying apt_proxy on the commandline. --- diff --git a/bin/xen-create-image b/bin/xen-create-image index dbfb865..70ebe9e 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -204,6 +204,10 @@ xen-create-image - Easily create new Xen instances with networking and OpenSSH. to choose a more or less close Debian mirror. See http://wiki.debian.org/DebianGeoMirror for details. + --apt_proxy=url + Specify a proxy to be used by debootstrap, and within + the guest. + --template=tmpl Specify which template file to use when creating the Xen configuration file. @@ -1364,6 +1368,7 @@ sub setupDefaultOptions foreach my $ubuntudist (qw(edgy feisty gutsy intrepid)) { $CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu'; } + $CONFIG{ 'apt_proxy' } = ''; $CONFIG{ 'arch' } = ''; $CONFIG{ 'fs' } = 'ext3'; $CONFIG{ 'force' } = 0; @@ -1705,6 +1710,7 @@ sub parseCommandLineArguments "kernel=s", \&checkOption, "initrd=s", \&checkOption, "mirror=s", \&checkOption, + "apt_proxy=s", \&checkOption, "modules=s", \&checkOption, "lvm=s", \$install{ 'lvm' }, "image-dev=s", \$install{ 'image-dev' }, @@ -3571,6 +3577,15 @@ sub installSystem } + # + # Propagate --apt_proxy + # + if ( $CONFIG{ 'apt_proxy' } ) + { + $cmd .= " --apt_proxy=$CONFIG{'apt_proxy'}"; + } + + # # Show the user what they are installing # diff --git a/bin/xt-install-image b/bin/xt-install-image index acc4fad..37eb11e 100755 --- a/bin/xt-install-image +++ b/bin/xt-install-image @@ -27,6 +27,7 @@ xt-install-image - Install a fresh copy of GNU/Linux into a directory --config Read the specified config file in addition to the global configuration file. --mirror The mirror to use when installing with 'debootstrap'. + --apt_proxy The proxy to use when installing with 'debootstrap'. Installation Options: --install-method Specify the installation method to use. @@ -395,6 +396,7 @@ sub parseCommandLineArguments "cachedir=s", \$CONFIG{ 'cachedir' }, "config=s", \$CONFIG{ 'config' }, "mirror=s", \$CONFIG{ 'mirror' }, + "apt_proxy=s", \$CONFIG{ 'apt_proxy' }, # Help. "verbose", \$CONFIG{ 'verbose' },