Commit bf43c8c7 authored by Bernhard Link's avatar Bernhard Link

fix some outputs to properly behave with included config files

parent a5e41220
......@@ -244,8 +244,7 @@ static bool notpropersuperset(const struct atomlist *allowed, const char *allowe
"In distribution description of '%s' (line %u to %u in %s):\n"
"%s contains '%s' not found in %s!\n",
d->codename,
d->firstline, d->lastline,
config_filename(iter),
d->firstline, d->lastline, d->filename,
checkname, atoms[missing], allowedname);
return true;
}
......@@ -299,6 +298,7 @@ CFfinishparse(distribution) {
distribution_free(n);
return RET_NOTHING;
}
n->filename = config_filename(iter);
n->firstline = config_firstline(iter);
n->lastline = config_line(iter) - 1;
......@@ -307,10 +307,12 @@ CFfinishparse(distribution) {
if (strcmp(d->codename, n->codename) == 0) {
fprintf(stderr,
"Multiple distributions with the common codename: '%s'!\n"
"First was in %s line %u to %u, another in lines %u to %u\n",
n->codename, config_filename(iter),
"First was in %s line %u to %u,\n"
"now another in lines %u to %u of %s.\n",
n->codename, d->filename,
d->firstline, d->lastline,
n->firstline, n->lastline);
n->firstline, n->lastline,
n->filename);
distribution_free(n);
return RET_ERROR;
}
......
......@@ -30,6 +30,7 @@ struct distribution {
/* the primary name to access this distribution: */
char *codename;
/* for more helpfull error messages: */
const char *filename; /* only valid while parsing! */
unsigned int firstline, lastline;
/* additional information for the Release-file to be
* generated, may be NULL. only suite is sometimes used
......
......@@ -102,6 +102,7 @@ struct incoming {
bool cleanup[cuf_COUNT];
bool options[iof_COUNT];
/* only to ease parsing: */
const char *filename; /* only valid while parsing! */
size_t lineno;
};
#define BASENAME(i, ofs) (i)->files.values[ofs]
......@@ -215,11 +216,10 @@ CFfinishparse(incoming) {
}
if (d->i != NULL) {
fprintf(stderr,
"Multiple definitions of '%s' within '%s': first started at line %u, second at line %u!\n",
"Multiple definitions of '%s': first started at line %u of %s, second at line %u of %s!\n",
d->name,
config_filename(iter),
(unsigned int)d->i->lineno,
config_firstline(iter));
(unsigned int)d->i->lineno, d->i->filename,
config_firstline(iter), config_filename(iter));
incoming_free(i);
incoming_free(d->i);
d->i = NULL;
......@@ -284,6 +284,7 @@ CFfinishparse(incoming) {
}
d->i = i;
i->filename = config_filename(iter);
i->lineno = config_firstline(iter);
/* only suppreses the last unused warning: */
*last = i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment