Update of /cvs/debian-boot/debian-installer/retriever/choose-mirror
In directory gluck:/tmp/cvs-serv982

Modified Files:
        Makefile choose-mirror.c 
Log Message:
   - Fix code that tried to parse the debconf string return code from
     INPUT commands, a string that is not in the debconf spec and could
     change at any time. Instead, use the well-defined numeric part of
     the return code.
   - Don't crash if debian-installer/country is unavailable.
   - Try to update the Mirrors.masterlist every build (using a null "force"
     target), to ensure that it is always up-to-date on new uploads of the
     package. 
   - Remove the empty Mirrors.masterlist.new if retreival fails.


Index: choose-mirror.c
===================================================================
RCS file: /cvs/debian-boot/debian-installer/retriever/choose-mirror/choose-mirror.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- choose-mirror.c     9 Nov 2003 22:33:46 -0000       1.16
+++ choose-mirror.c     8 Dec 2003 21:50:27 -0000       1.17
@@ -124,19 +124,14 @@
 }
 
 int choose_country(void) {
-
-
        if (country)
                free(country);
        country = NULL;
 
        /* Pick a default country from elsewhere, eg languagechooser,*/
-       debconf_get(debconf, DEBCONF_BASE "country");
-
-       if (strcmp(debconf->value, "question will be asked") == 0) {
+       if (debconf_get(debconf, DEBCONF_BASE "country") == 0) {
                // Not set yet. Seed with a default value
                if ((debconf_get(debconf, "debian-installer/country") == 0) &&
-                   (strcmp(debconf->value, "question will be asked") != 0) &&
                    (debconf->value != NULL) ) {
                                country = strdup (debconf->value);
                                debconf_set (debconf, DEBCONF_BASE "country", country);
@@ -145,7 +140,7 @@
                country = debconf->value;
 
        // Ensure 'country' set to something
-       if (strlen(country) == 0)
+       if (country && strlen(country) == 0)
                country = NULL;
        if (country == NULL)
                country = "US";

Index: Makefile
===================================================================
RCS file: /cvs/debian-boot/debian-installer/retriever/choose-mirror/Makefile,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Makefile    9 Nov 2003 20:50:49 -0000       1.14
+++ Makefile    8 Dec 2003 21:50:27 -0000       1.15
@@ -2,6 +2,7 @@
 OBJS=$(subst .c,.o,$(wildcard *.c))
 BIN=choose-mirror
 LIBS=-ldebconfclient
+MIRRORLISTURL=http://cvs.debian.org/*checkout*/webwml/english/mirror/Mirrors.masterlist?rev=HEAD&cvsroot=webwml&content-type=text/plain
 
 ifdef DEBUG
 CFLAGS:=$(CFLAGS) -DDODEBUG
@@ -9,12 +10,15 @@
 
 all: $(BIN) debian/choose-mirror.templates
 
-Mirrors.masterlist:
-       if wget -nv 
'http://cvs.debian.org/*checkout*/webwml/english/mirror/Mirrors.masterlist?rev=HEAD&cvsroot=webwml&content-type=text/plain'
 -O - > [EMAIL PROTECTED]; then \
-           if test -s [EMAIL PROTECTED]; then \
-              mv [EMAIL PROTECTED] $@; \
-           fi; \
-        fi
+# Freshen Mirrors.masterlist file, but allow failure.
+Mirrors.masterlist: force-try-update
+       if wget -nv '$(MIRRORLISTURL)' -O - > [EMAIL PROTECTED] && \
+          test -s [EMAIL PROTECTED]; then \
+               mv [EMAIL PROTECTED] $@; \
+       else \
+               rm -f [EMAIL PROTECTED]; \
+       fi
+force-try-update: ;
 
 debian/choose-mirror.templates:  Mirrors.masterlist
        ./makeheader.pl template


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to