From 74f35d65501870a7b8d78b7cfa6a26ff1b7f0873 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 10 Jul 2013 21:48:33 +0200 Subject: [PATCH] Better document and check requirements for --apt_proxy See http://bugs.debian.org/623443 for the corresponding apt issue. Also add a dependency on libdata-validate-uri-perl which is used to do the syntax check. --- bin/xen-create-image | 11 +++++++++-- debian/changelog | 3 +++ debian/control | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index d05da64..b3c1b72 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -243,9 +243,10 @@ and EVMS EXAMPLE. Debian mirror. See http://http.debian.net/ for details. - --apt_proxy=url + --apt_proxy=protocol://hostname:port/ Specify a proxy to be used by debootstrap, and within - the guest. + the guest. Needs the same syntax as APT's + Acquire::http::Proxy. See apt.conf(5). --template=tmpl Specify which template file to use when creating the @@ -792,6 +793,7 @@ use File::Which; use Getopt::Long; use Pod::Usage; use Data::Dumper; +use Data::Validate::URI qw/ is_uri /; use Xen::Tools::Common; @@ -1489,6 +1491,10 @@ sub checkOption check => qr/^md5|sha256|sha512$/i, message => "must be md5, sha256 or sha512.\n", }, + uri => { + check => sub { is_uri($_[0]) }, + message => "must be an URI including the protocol\n", + }, ); # Define what argument each option accepts. @@ -1523,6 +1529,7 @@ sub checkOption mac => 'mac', ip => 'ipv4_or_auto', hash_method => 'hashMethod', + apt_proxy => 'uri', ); # If given option does not exists in optionsTypes, diff --git a/debian/changelog b/debian/changelog index e7d3e77..94dd544 100644 --- a/debian/changelog +++ b/debian/changelog @@ -51,6 +51,9 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low - Removes unused Perl modules Xen::Tools and Xen::Tools::Log from source code. Also removes the according tests from the test suite. → Remove no more needed build-dependency on Moose. + - Better documents and checks requirements for the --apt_proxy + value. (See #623443 for the corresponding apt issue.) Add dependency + on libdata-validate-uri-perl. * Add debian/gbp.conf to be able to to build xen-tools with git-buildpackage. * Clean up debian/rules: diff --git a/debian/control b/debian/control index e5e0edd..285e8dc 100644 --- a/debian/control +++ b/debian/control @@ -20,6 +20,7 @@ Package: xen-tools Architecture: all Depends: debootstrap | cdebootstrap, libconfig-inifiles-perl, + libdata-validate-uri-perl, libfile-slurp-perl, libfile-which-perl, libtext-template-perl,