]> xenbits.xensource.com Git - people/dariof/xen-tools.git/commitdiff
Handle Sarge amd64 case properly
authorAxel Beckert <abe@deuxchevaux.org>
Thu, 17 Jan 2013 21:48:15 +0000 (22:48 +0100)
committerAxel Beckert <abe@deuxchevaux.org>
Thu, 17 Jan 2013 21:48:15 +0000 (22:48 +0100)
Uses File::Which, (build-) dependency on libfile-which-perl added

TODO.markdown
bin/xen-create-image
debian/changelog
debian/control

index ff746952cdc437540f13d2167b44ebbf95c19e97..e807f9792a8deda2add8e835c2d1da2c6cb0234e 100644 (file)
@@ -181,11 +181,6 @@ Bugs to fix and features to add for 5.0
 
 * Use `Perl::Critic`
 
-* Make mirror choosing code more flexible so that it can depend on the
-  architecture. Obvious use case: Installing Sarge amd64 just works if
-  the mirror (archive of amd64.debian.net on archive.debian.org or a
-  mirror thereof) is given manually.
-
 Stuff from Steve's TODO list / Generic TODOs
 --------------------------------------------
 
index 3643ae4cb904990285d668b3e6caf198d585b95f..c1e1b68a754929faffe6764329839f4fb198e2f2 100755 (executable)
@@ -789,6 +789,7 @@ use Env;
 use File::Path qw/ mkpath /;
 use File::Temp qw/ tempdir /;
 use File::Copy qw/ mv cp /;
+use File::Which;
 use Getopt::Long;
 use Pod::Usage;
 use Data::Dumper;
@@ -1325,7 +1326,7 @@ sub setupDefaultOptions
         $CONFIG{ 'mirror_'.$debdist } = $CONFIG{ 'mirror' }
     }
     foreach my $debdist (qw(sarge etch lenny)) {
-        $CONFIG{ 'mirror_'.$debdist } = 'http://archive.debian.org/debian';
+        $CONFIG{ 'mirror_'.$debdist } = 'http://archive.debian.org/debian-archive/debian';
     }
     # Initialize per distribution mirror defaults: Ubuntu
     foreach my $ubuntudist (qw(hardy lucid oneiric precise quantal raring)) {
@@ -1335,7 +1336,8 @@ sub setupDefaultOptions
         $CONFIG{ 'mirror_'.$ubuntudist } = 'http://old-releases.ubuntu.com/ubuntu';
     }
     $CONFIG{ 'apt_proxy' }     = '';
-    $CONFIG{ 'arch' }          = '';
+    $CONFIG{ 'arch' }          =
+        which('dpkg') ? `dpkg --print-architecture` : '';
     $CONFIG{ 'fs' }            = 'ext3';
     $CONFIG{ 'force' }         = 0;
     $CONFIG{ 'no_xen_ok' }     = 0;
@@ -1825,9 +1827,10 @@ sub checkArguments
     #
     if ( $CONFIG{ 'dist' } =~ /sarge/ and
          $CONFIG{ 'arch' } =~ /amd64/ and
-         $CONFIG{ 'mirror_sarge' } eq 'http://archive.debian.org/debian' )
+         $CONFIG{ 'mirror_sarge' } =~ m(/debian-archive/debian/?$))
     {
-        $CONFIG{ 'mirror_sarge' } = 'http://archive.debian.org/debian-amd64';
+        $CONFIG{ 'mirror_sarge' } =~
+            s(/debian-archive/debian/?)(/debian-archive/debian-amd64);
     }
 
     #
index c5fd0c09d182f626530798b5bd51895f94ffb228..3500bb00a8befaddbc89311765ed5652c6ae884f 100644 (file)
@@ -14,12 +14,14 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low
       + now understands the --extension option.
       + also outputs the file name of the config file
     - Fixes "--extension=" with empty parameter.
+    - Sarge amd64 case handle properly
     - Remove CVS revisions from --version output
     - Preliminary support for Debian Jessie and Ubuntu Raring
     - Preliminary support for xl toolstack
     - xen-create-image: Consistently use runCommand() instead of system()
     - Makefile accepts DESTDIR=…
     - Move examples from debian/examples to examples.
+    - Uses File::Which, added (build-) dependency on libfile-which-perl
   * Add debian/gbp.conf to be able to to build xen-tools with
     git-buildpackage.
   * Clean up debian/rules:
index d7a52a8169198ecdf6cef91db16395d9e95d7295..7c2f1ce81a74226e99eceef35a7c2a3e19408b0e 100644 (file)
@@ -6,6 +6,7 @@ Build-Depends: debhelper (>= 7.0.0),
                devscripts,
                git,
                libfile-slurp-perl,
+               libfile-which-perl,
                libmoose-perl,
                libtest-pod-coverage-perl,
                libtest-pod-perl,
@@ -20,6 +21,7 @@ Architecture: all
 Depends: debootstrap | cdebootstrap,
          libconfig-inifiles-perl,
          libfile-slurp-perl,
+         libfile-which-perl,
          libtext-template-perl,
          openssh-client,
          perl-modules,