]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Allow specifying apt_proxy on the commandline.
authorAlex Tomlins <alex.tomlins@unboxedconsulting.com>
Thu, 31 Mar 2011 10:35:14 +0000 (11:35 +0100)
committerAlex Tomlins <alex.tomlins@unboxedconsulting.com>
Thu, 31 Mar 2011 10:35:14 +0000 (11:35 +0100)
bin/xen-create-image
bin/xt-install-image

index dbfb865a77474b378e15700ae5eb90e1b7bf774f..70ebe9ebebe5edb68dd1827a65e72d19256d04d6 100755 (executable)
@@ -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
     #
index acc4fad9000e1137a2e137c3f06dab5290285aeb..37eb11e19106f65b75cf86b5a45c3e74eb895310 100755 (executable)
@@ -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' },