Sending this to the list as it was rejected on master due to a
temporary mail config error on master.
-------------------------------------------------------------------------
Author: fjp
Date: Thu Dec 28 19:49:24 2006
New Revision: 43617

Added:
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.base-in
 - copied, changed from r43555,
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp-in
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.sel-in
Removed:
   trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp-in
Modified:
   trunk/packages/choose-mirror/Makefile
   trunk/packages/choose-mirror/choose-mirror.c
   trunk/packages/choose-mirror/debian/changelog
   trunk/packages/choose-mirror/debian/po/POTFILES.in
Log:
Enable ftp support again, but without the option to select country/mirror
to limit the size increase of the udeb


Modified: trunk/packages/choose-mirror/Makefile
==============================================================================
--- trunk/packages/choose-mirror/Makefile       (original)
+++ trunk/packages/choose-mirror/Makefile       Thu Dec 28 19:49:24 2006
@@ -1,5 +1,6 @@
 USE_HTTP=1
 #USE_FTP=1
+USE_FTP_MANUAL=1

 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

@@ -12,7 +13,12 @@
 endif
 ifeq (1,${USE_FTP})
 CFLAGS:=$(CFLAGS) -DWITH_FTP
-templates:=$(templates) debian/choose-mirror-bin.templates.ftp-in
+templates:=$(templates) debian/choose-mirror-bin.templates.ftp.base-in
+templates:=$(templates) debian/choose-mirror-bin.templates.ftp.sel-in
+endif
+ifeq (1,${USE_FTP_MANUAL})
+CFLAGS:=$(CFLAGS) -DWITH_FTP_MANUAL
+templates:=$(templates) debian/choose-mirror-bin.templates.ftp.base-in
 endif
 templates:=$(templates) debian/choose-mirror-bin.templates.both-in


Modified: trunk/packages/choose-mirror/choose-mirror.c
==============================================================================
--- trunk/packages/choose-mirror/choose-mirror.c        (original)
+++ trunk/packages/choose-mirror/choose-mirror.c        Thu Dec 28 19:49:24 2006
@@ -11,9 +11,13 @@
 #ifdef WITH_FTP
 #include "mirrors_ftp.h"
 #endif
+
 #if ! defined (WITH_HTTP) && ! defined (WITH_FTP)
 #error Must compile with at least one of FTP or HTTP
 #endif
+#if defined (WITH_FTP) && defined (WITH_FTP_MANUAL)
+#error Only one of WITH_FTP and WITH_FTP_MANUAL can be defined
+#endif

 static struct debconfclient *debconf;
 static char *protocol = NULL;
@@ -95,7 +99,7 @@
        return ret;
 }

-/* returns true if there is a mirror in the specificed country */
+/* returns true if there is a mirror in the specified country */
 static inline int has_mirror(char *country) {
        char **mirrors;
        if (strcmp(country, MANUAL_ENTRY) == 0)
@@ -217,6 +221,12 @@
                free(country);
        country = NULL;

+#if defined (WITH_FTP_MANUAL)
+       assert(protocol != NULL);
+       if (strcasecmp(protocol,"ftp") == 0)
+               return 0;
+#endif
+
        debconf_get(debconf, DEBCONF_BASE "country");
        if (! strlen(debconf->value)) {
                /* Not set yet. Seed with a default value. */
@@ -250,6 +260,13 @@

 static int set_country(void) {
        char *countries;
+
+#if defined (WITH_FTP_MANUAL)
+       assert(protocol != NULL);
+       if (strcasecmp(protocol,"ftp") == 0)
+               return 0;
+#endif
+
        countries = add_protocol("countries");
        debconf_get(debconf, countries);
        country = strdup(debconf->value);
@@ -260,7 +277,7 @@
 }

 static int choose_protocol(void) {
-#if defined (WITH_HTTP) && defined (WITH_FTP)
+#if defined (WITH_HTTP) && (defined (WITH_FTP) || defined
 (WITH_FTP_MANUAL)) /* Both are supported, so ask. */
        debconf_subst(debconf, DEBCONF_BASE "protocol", "protocols", "http,
 ftp"); debconf_input(debconf, "medium", DEBCONF_BASE "protocol");
@@ -269,7 +286,7 @@
 }

 static int get_protocol(void) {
-#if defined (WITH_HTTP) && defined (WITH_FTP)
+#if defined (WITH_HTTP) && (defined (WITH_FTP) || defined
 (WITH_FTP_MANUAL)) debconf_get(debconf, DEBCONF_BASE "protocol");
        protocol = strdup(debconf->value);
 #else
@@ -300,7 +317,15 @@
        char *list;

        debconf_get(debconf, DEBCONF_BASE "country");
+#ifndef WITH_FTP_MANUAL
        manual_entry = ! strcmp(debconf->value, MANUAL_ENTRY);
+#else
+       if (! strcasecmp(protocol,"ftp") == 0)
+               manual_entry = ! strcmp(debconf->value, MANUAL_ENTRY);
+       else
+               manual_entry = 1;
+#endif
+
        if (! manual_entry) {
                char *mir = add_protocol("mirror");


Modified: trunk/packages/choose-mirror/debian/changelog
==============================================================================
--- trunk/packages/choose-mirror/debian/changelog       (original)
+++ trunk/packages/choose-mirror/debian/changelog       Thu Dec 28 19:49:24
 2006 @@ -1,3 +1,10 @@
+choose-mirror (2.11) UNRELEASED; urgency=low
+
+  * Enable ftp support again, but without the option to select
 country/mirror +    to limit the size increase of the udeb. Closes:
 #377032.
+
+ -- Frans Pop <[EMAIL PROTECTED]>  Thu, 28 Dec 2006 19:19:24 +0100
+
 choose-mirror (2.10) unstable; urgency=low

   * Rebuilt after discovering typos in Mirrors.masterlist

Copied:
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.base-in 
(from r43555,
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp-in)
 ==============================================================================
--- trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp-in      
(original)
+++ trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.base-in 
Thu Dec 28 19:49:24 2006 @@ -1,39 +1,5 @@
 # Templates only needed by choose-mirror if ftp support is enabled.

-Template: mirror/ftp/countries
-Type: select
-_Choices: enter information manually
-#  Translators, you should put here the ISO 3166 code of a country
-#  which you know hosts at least one Debian FTP mirror. Please check
-#  that the country really has a Debian FTP mirror before putting a
-#  random value here
-#
-#  First check that the country you mention here is listed in
-#  http://cvs.debian.org/ *checkout* 
/webwml/english/mirror/Mirrors.masterlist?rev=HEAD\&cvsroot=webwml&contnt-type=text/plain
-#  (remove the spaces between "*" and "/")
-#
-#  BE CAREFUL to use the TWO LETTER ISO-3166 CODE and not anything else
-#
-#  You do not need to translate what's between the square brackets
-#  You should even NOT put square brackets in translations:
-#  msgid "US[ Default value for ftp]"
-#  msgstr "FR"
-_Default: US[ Default value for ftp]
-_Description: Debian archive mirror country:
- The goal is to find a mirror of the Debian archive that is close to you on 
the network -- be
- aware that nearby countries, or even your own, may not be the best choice.
-
-Template: mirror/ftp/mirror
-Type: select
-Choices: ${mirrors}
-Default: ftp.debian.org
-_Description: Debian archive mirror:
- Please select a Debian archive mirror. You should use a mirror in
- your country or region if you do not know which mirror has the best
- Internet connection to you.
- .
- Usually, ftp.<your country code>.debian.org is a good choice.
-
 Template: mirror/ftp/hostname
 Type: string
 _Description: Debian archive mirror hostname:

Added:
 trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.sel-in
 ==============================================================================
--- (empty file)
+++ trunk/packages/choose-mirror/debian/choose-mirror-bin.templates.ftp.sel-in  
Thu Dec 28 19:49:24 2006 @@ -0,0 +1,36 @@
+# Templates only needed by choose-mirror if ftp support is enabled.
+# And then only if mirror selection is enabled.
+
+Template: mirror/ftp/countries
+Type: select
+_Choices: enter information manually
+#  Translators, you should put here the ISO 3166 code of a country
+#  which you know hosts at least one Debian FTP mirror. Please check
+#  that the country really has a Debian FTP mirror before putting a
+#  random value here
+#
+#  First check that the country you mention here is listed in
+#  http://cvs.debian.org/ *checkout* 
/webwml/english/mirror/Mirrors.masterlist?rev=HEAD\&cvsroot=webwml&content-type=text/plain
+#  (remove the spaces between "*" and "/")
+#
+#  BE CAREFUL to use the TWO LETTER ISO-3166 CODE and not anything else
+#
+#  You do not need to translate what's between the square brackets
+#  You should even NOT put square brackets in translations:
+#  msgid "US[ Default value for ftp]"
+#  msgstr "FR"
+_Default: US[ Default value for ftp]
+_Description: Debian archive mirror country:
+ The goal is to find a mirror of the Debian archive that is close to you on 
the network -- be
+ aware that nearby countries, or even your own, may not be the best choice.
+
+Template: mirror/ftp/mirror
+Type: select
+Choices: ${mirrors}
+Default: ftp.debian.org
+_Description: Debian archive mirror:
+ Please select a Debian archive mirror. You should use a mirror in
+ your country or region if you do not know which mirror has the best
+ Internet connection to you.
+ .
+ Usually, ftp.<your country code>.debian.org is a good choice.

Modified: trunk/packages/choose-mirror/debian/po/POTFILES.in
==============================================================================
--- trunk/packages/choose-mirror/debian/po/POTFILES.in  (original)
+++ trunk/packages/choose-mirror/debian/po/POTFILES.in  Thu Dec 28 19:49:24 
2006 @@ -1,5 +1,6 @@
 [type: gettext/rfc822deb] choose-mirror-bin.templates-in
 [type: gettext/rfc822deb] choose-mirror-bin.templates.http-in
-[type: gettext/rfc822deb] choose-mirror-bin.templates.ftp-in
+[type: gettext/rfc822deb] choose-mirror-bin.templates.ftp.base-in
+[type: gettext/rfc822deb] choose-mirror-bin.templates.ftp.sel-in
 [type: gettext/rfc822deb] choose-mirror-bin.templates.both-in

-------------------------------------------------------


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

Reply via email to