[PATCH 1327/1327] Fix fallback mirror/suite

Reto Gantenbein reto.gantenbein at linuxmonk.ch
Wed Jul 14 13:30:54 CEST 2010


Print default Debian stable suite if on non-Debian dom0
(cherry picked from commit 4f1e453d1f0d08304256b1461bbfdbe1abe69c78)
---
 bin/xt-guess-suite-and-mirror |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/bin/xt-guess-suite-and-mirror b/bin/xt-guess-suite-and-mirror
index e15032a..edf18e1 100755
--- a/bin/xt-guess-suite-and-mirror
+++ b/bin/xt-guess-suite-and-mirror
@@ -151,6 +151,7 @@ chomp($lsb_release);
 if (!$found and $lsb_release and -x $lsb_release) {
     my $vendor = `$lsb_release -s -i`;
 
+    # If we have a known dom0, use the same suite
     if ($vendor eq 'Debian' or $vendor eq 'Ubuntu') {
         $suite = `$lsb_release -s -c`;
         chomp($suite);
@@ -166,19 +167,21 @@ if (!$found and $lsb_release and -x $lsb_release) {
     }
 }
 
-if ($found) {
-    unless ($want_help || $want_version || $want_suite || $want_mirror) {
-        print "$mirror $suite\n";
-    } else {
-        if ($want_mirror) {
-            print "$mirror";
-        }
-        if ($want_suite) {
-            print "$suite";
-        }
-        print "\n";
-    }
-} else {
+# Fallback to default if dom0 does not reveal any information
+if (!$found) {
     $suite  = $fallback_suite{$fallback};
     $mirror = $fallback_mirror{$fallback};
 }
+
+unless ($want_help || $want_version || $want_suite || $want_mirror) {
+    print "$mirror $suite\n";
+} else {
+    if ($want_mirror) {
+        print "$mirror";
+    }
+    if ($want_suite) {
+        print "$suite";
+    }
+    print "\n";
+}
+
-- 
1.7.1


--=-o24Y2pqGiRfPORxeWiOg--



More information about the xen-tools-dev mailing list