--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: choose-mirror: lists releases that don't include this arch
- From: Steven Chamberlain <steven@pyro.eu.org>
- Date: Mon, 27 Apr 2015 22:37:53 +0100
- Message-id: <20150427213753.33265.68788.reportbug@sid.kfreebsd-amd64.pyro.eu.org>
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.62+kbsd8u1
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.
Steven Chamberlain <steven@pyro.eu.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, 27 Apr 2015 11:28:22 +0000
Source: choose-mirror
Binary: choose-mirror choose-mirror-bin
Architecture: source all kfreebsd-amd64
Version: 2.62+kbsd8u1
Distribution: jessie-kfreebsd
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Steven Chamberlain <steven@pyro.eu.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.62+kbsd8u1) jessie-kfreebsd; urgency=medium
.
* 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:
c7476edb131965d042816fda2c4a607c20206da0 1872 choose-mirror_2.62+kbsd8u1.dsc
3254a00478b836be762684b1557aa90d6d631483 200600 choose-mirror_2.62+kbsd8u1.tar.xz
927e67e7f0d96ac3969f5b6c8fd334a203e1841e 1064 choose-mirror_2.62+kbsd8u1_all.udeb
04da48cd8ffe589c886bd96ff12b4b50f68ea2d1 239992 choose-mirror-bin_2.62+kbsd8u1_kfreebsd-amd64.udeb
Checksums-Sha256:
9fb3c8ced9d51c0f3090397ab886dec60aa8b85cf5d7c720367caf0ccf0c6770 1872 choose-mirror_2.62+kbsd8u1.dsc
43acd2d006479f2bfc9cb99349c10cbb13fda6e68990104e90e3fa2380eec4bd 200600 choose-mirror_2.62+kbsd8u1.tar.xz
9d7fed5f2efbd2d6857ae4a8998b97c382b761ac0a2a6be1335cefb895a722e4 1064 choose-mirror_2.62+kbsd8u1_all.udeb
2563ab230d1f494bc58cd10fc1f3f1c03f113850ef19bba2454b59b031e758f8 239992 choose-mirror-bin_2.62+kbsd8u1_kfreebsd-amd64.udeb
Files:
d481bac942016dd75f84a06a7c084643 1872 debian-installer extra choose-mirror_2.62+kbsd8u1.dsc
a8dc8b7b09ec0341ca960c191d021093 200600 debian-installer extra choose-mirror_2.62+kbsd8u1.tar.xz
61551d542c96712662311ef3f01a3552 1064 debian-installer extra choose-mirror_2.62+kbsd8u1_all.udeb
16137928dae96ef356928aff5976e169 239992 debian-installer extra choose-mirror-bin_2.62+kbsd8u1_kfreebsd-amd64.udeb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJVX20sAAoJEKv/7bJACMb5sCMP+gNVIbQ7YC0ggr9c+Otv41Kv
9Q80arV0mLvQDewJ82KBLD6WnVZ6j4O5P6TUxpNQ/PzC8E9ak+kIWp0vJ7eCyIYU
A6oq94XBDLND8YS2JBXkV5YY6eUPsELiiptK1pMda3jHlA7yFaytBIFfoy2ETt+J
vrBCZzMBDmZy6mQ5K7rn+MCcivufAEG59e0EeStLHYEdElm7oAIWJSiaNAi7VY4B
GJz8mendirEO8+AE8ZmIAdPvp7/4nTBjPWpZX45R3W4elKT/W5AsATshorblKR+W
wPgqM6p7HmAUaHtrw8MV2zs+zyGNEXulMvvq6DC+K8OmIlJrNWmxelnGgQT/d2jw
pegVWx4yvj4VII8LOdEyzdx9irfF8j48tNfnq+6zidG4j+XAt8HJoznWxHZ6SNKr
RkTRsK9Pwi13vMfO23Zv/v8FSDyVJOhV1ycsKarKkR7SSx8bHXeD8QPeOiEsL5ae
EHKixiQl6B/dm/NHwK4EcL8WtS4CFzU+TjWC7Lbv5gvBbb/Biwp7gKn+bKomJnPZ
9LCnqIRjJivTBGjyNlTfWXmeAkXDBHqKrkEaIWQHkfaNw9UytgEZs7D+ZUCtDByc
Hen9zhu0LzWgV1kdEvz5kD7KDVhbQ4AxXwRBtcoKkKYCxwRXdTSwbjeO4ZTkD3JU
I7imS5yQbGcz8a8BgLXj
=JjSy
-----END PGP SIGNATURE-----
--- End Message ---