The following patch to choose-mirror.c removes the need for the hard coded PREFERRED_DISTRIBUTION variable by allowing it to be overridden with a pre-seeded value (good for non-Debian Debian's (Ubuntu)).
-- Jerry Haltom <[EMAIL PROTECTED]>
Index: choose-mirror.c =================================================================== --- choose-mirror.c (revision 24517) +++ choose-mirror.c (working copy) @@ -303,14 +303,16 @@ } if (ret == 0) { - /* Download and parse the Release file for the preferred + /* Download and parse the Release file for the selected * distribution, to make sure that the mirror works, and to * work out which suite it is currently in. Note that this * assumes that mirrors w/o the preferred distribution are - * broken. */ + * broken or the value has been preseeded. */ char *command; FILE *f = NULL; char *hostname, *directory; + char suite[32]; + char path[38]; debconf_progress_start(debconf, 0, 1, DEBCONF_BASE "checking_title"); debconf_progress_info(debconf, DEBCONF_BASE "checking_download"); @@ -319,13 +321,26 @@ hostname = strdup(debconf->value); debconf_get(debconf, dir); directory = strdup(debconf->value); - + + debconf_get(debconf, DEBCONF_BASE "suite"); + if (strlen(debconf->value) == 0) { + strcpy(suite, PREFERRED_DISTRIBUTION); + di_log(DI_LOG_LEVEL_DEBUG, "using default suite: %s", suite); + } else { + strcpy(suite, debconf->value); + di_log(DI_LOG_LEVEL_DEBUG, "suite preseeded: %s", suite); + } + if (proxy) setenv(proxy_var, proxy, 1); - + + /* the path in the archive will be dists/suite */ + strcpy(path, "dists/"); + strncat(path, suite, 32); + asprintf(&command, "wget -q %s://%s%s/%s/Release -O - | grep ^Suite: | cut -d' ' -f 2", protocol, hostname, directory, - "dists/" PREFERRED_DISTRIBUTION); + path); di_log(DI_LOG_LEVEL_DEBUG, "command: %s", command); free(hostname); @@ -333,7 +348,6 @@ f = popen(command, "r"); if (f != NULL) { - char suite[32]; if (fgets(suite, 31, f)) { if (suite[strlen(suite) - 1] == '\n') suite[strlen(suite) - 1] = '\0';