[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#783548: marked as done (choose-mirror: lists releases that don't include this arch)



Your message dated Mon, 11 May 2015 06:49:22 +0000
with message-id <E1YrhWk-0005yv-Nw@franck.debian.org>
and subject line Bug#783548: fixed in choose-mirror 2.63
has caused the Debian Bug report #783548,
regarding choose-mirror: lists releases that don't include this arch
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
783548: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=783548
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: choose-mirror
Version: 2.62
Severity: wishlist
Tags: patch
User: debian-bsd@lists.debian.org
Usertags: jessie kfreebsd

Hi,

When installing kfreebsd or hurd in Expert mode, choose-mirror offers to
install "jessie - stable" and "stretch - testing" even though the
architecture being installed isn't part of those releases.

I've attached a patch that adds support for the Architectures: header,
to not mention a release if it doesn't include the current arch.

Thanks.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'oldstable')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-2-amd64-xenhvm-ipsec
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/choose-mirror.c b/choose-mirror.c
index 65885f6..b7d4019 100644
--- a/choose-mirror.c
+++ b/choose-mirror.c
@@ -300,9 +300,9 @@ static int get_release(struct release_t *release, const char *name) {
 	char *command;
 	FILE *f = NULL;
 	char *wget_options, *hostname, *directory;
-	char line[80];
+	char line[BUFFER_LENGTH];
 	char *p;
-	char buf[SUITE_LENGTH];
+	char buf[BUFFER_LENGTH];
 
 	hostname = add_protocol("hostname");
 	debconf_get(debconf, hostname);
@@ -321,7 +321,7 @@ static int get_release(struct release_t *release, const char *name) {
 	}
 
 	wget_options = get_wget_options();
-	command = xasprintf("wget %s %s://%s%s/dists/%s/Release -O - | grep -E '^(Suite|Codename):'",
+	command = xasprintf("wget %s %s://%s%s/dists/%s/Release -O - | grep -E '^(Suite|Codename|Architectures):'",
 			    wget_options, protocol, hostname, directory, name);
 	di_log(DI_LOG_LEVEL_DEBUG, "command: %s", command);
 	f = popen(command, "r");
@@ -337,12 +337,14 @@ static int get_release(struct release_t *release, const char *name) {
 			if (line[strlen(line) - 1] == '\n')
 				line[strlen(line) - 1] = '\0';
 			if ((value = strstr(line, ": ")) != NULL) {
-				strncpy(buf, value + 2, SUITE_LENGTH - 1);
-				buf[SUITE_LENGTH - 1] = '\0';
+				strncpy(buf, value + 2, BUFFER_LENGTH - 1);
+				buf[BUFFER_LENGTH - 1] = '\0';
 				if (strncmp(line, "Codename:", 9) == 0)
 					release->name = strdup(buf);
 				if (strncmp(line, "Suite:", 6) == 0)
 					release->suite = strdup(buf);
+				if (strncmp(line, "Architectures:", 14) == 0)
+					release->archs = strdup(buf);
 			}
 		}
 		if (release->name != NULL && strcmp(release->name, name) == 0)
@@ -354,6 +356,14 @@ static int get_release(struct release_t *release, const char *name) {
 		    !(release->status & IS_VALID))
 			log_invalid_release(name, "Suite or Codename");
 
+		/* Does the release include this arch? */
+		if (release->archs != NULL && strstr(release->archs, ARCH_TEXT) == NULL) {
+			/* No:  disregard this release */
+			log_invalid_release(name, "Architectures");
+			release->status &= ~IS_VALID;
+			release->name = NULL;
+		}
+
 		/* Cross-validate the Release file */
 		if (release->status & IS_VALID)
 			if (! cross_validate_release(release))
diff --git a/mirrors.h b/mirrors.h
index e592b7a..f73aefb 100644
--- a/mirrors.h
+++ b/mirrors.h
@@ -17,6 +17,12 @@ struct mirror_t {
  */
 #define MANUAL_ENTRY "manual"
 
+/*
+ * Allow to read the full Architectures: line from a Release file,
+ * which is up to 123 bytes long at time of writing.
+ */
+#define BUFFER_LENGTH 256
+
 #define SUITE_LENGTH 32
 
 /* Stack of suites */
@@ -43,6 +49,7 @@ static const char suites[][SUITE_LENGTH] = {
 struct release_t {
 	char *name;
 	char *suite;
+	char *archs;
 	int status;
 };
 

--- End Message ---
--- Begin Message ---
Source: choose-mirror
Source-Version: 2.63

We believe that the bug you reported is fixed in the latest version of
choose-mirror, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 783548@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Perrier <bubulle@debian.org> (supplier of updated choose-mirror package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 11 May 2015 07:26:02 +0200
Source: choose-mirror
Binary: choose-mirror choose-mirror-bin
Architecture: source all i386
Version: 2.63
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Christian Perrier <bubulle@debian.org>
Description:
 choose-mirror - Choose mirror to install from (menu item) (udeb)
 choose-mirror-bin - Choose mirror to install from (program) (udeb)
Closes: 783548
Changes:
 choose-mirror (2.63) unstable; urgency=medium
 .
   [ Steven Chamberlain ]
   * Only list releases the current arch is included in.  For example,
     don't display a "jessie" release for kfreebsd-* or hurd.
     (Closes: #783548)
Checksums-Sha1:
 1ff62ab8f620046a812f45603c14f9bf934980b3 1840 choose-mirror_2.63.dsc
 eb82deda629fae418257c9efa489bda82cf74da6 201124 choose-mirror_2.63.tar.xz
 67be405651dcb888d5edb77089823b5b3b33b2c7 1070 choose-mirror_2.63_all.udeb
 cb03cb23cad5d0f48a8d101f8d13f52616862f45 246446 choose-mirror-bin_2.63_i386.udeb
Checksums-Sha256:
 27ba8df48257e75a1b4452eeb1929821cfdc997913a849ead48943b02cbd5ec6 1840 choose-mirror_2.63.dsc
 df46bc74d996511eac9817230dadb92f021a2688c17b6823d4bf6246e4e88978 201124 choose-mirror_2.63.tar.xz
 dfd9692fed4cf50e7ef76955b46b75c99f9127dc20711625331ca782cb9d852c 1070 choose-mirror_2.63_all.udeb
 5fe104c86f031f17d3cdadb9e798c7c269051a7f4eed829001ec3c4d4dfa8187 246446 choose-mirror-bin_2.63_i386.udeb
Files:
 1f81a63ff192f54c2bf5707b59f07220 1840 debian-installer extra choose-mirror_2.63.dsc
 f4700ba2d2f11180cd09462d277c3926 201124 debian-installer extra choose-mirror_2.63.tar.xz
 2f78766fba783933035b9ce9db32042c 1070 debian-installer extra choose-mirror_2.63_all.udeb
 043f68756fd588e6d47b3043a3667aa9 246446 debian-installer extra choose-mirror-bin_2.63_i386.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVUE3rAAoJEIcvcCxNbiWolg8P/A+Zi0g51RJondn7aCm95kE6
uJpsfPr8KQBt6yztvMhdCIvUsauOOsoriE8HZrVKfic7wucTLMnJ5rs8K8zY5MDL
fRzNp2lJxQ8hG9IjWUkHPx0pbA3WYayB9+i6ekC2XXtHklur9bEcnAsn1AtWhzQ1
DIz/N8qkXAhh/nEsraigtNwB+TjEHu+1c0hp9a/9W6gHbGmf9T+HLQJiP0L8Tyh4
T/lBnAc37/UYmz9ntHXhEKr3twGtFu7sLBvOGdDcn3dPkeRIOzuLLqZq9I38ElB4
pWN2NdlNa7VuXZ4DpBxrVgtU4++XL3kjoyOWct0h1sbf5L67Q7vwlKApeqEs5yIf
1cS9MYk6sLcgYoGyUMn1S3KiuHTNpm2AoQkmucDxZuGkeOVeTuWYVAlT0CtyixDb
FJ0TX87uapn05rMouQlxUUPlXoigauaud6JGIEWrVbIQg1dlAf9UEwfIKyGwm25K
cHZsBIKxSiUz4yvQGH1kpYdSZjnsH7/a12e3j7mkD/I/Tgu7ASgcYdO7IXLrIg7F
FG2K/H61Yo5WfK/WNGc8LTHFLa0yRXFBUBYOFnK2rkNs3xQVn1b7HmoXCnVxWePT
OR0JGyPC+Gj/usZSu+a6cOcWU5efdc6VG2KGAMY8867c3I4rSbfGrTQTtZN6+PoR
1jw080jAdPhxKDhMA5Ng
=+afY
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: