|
|
@@ -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)) |
|
|
|