Commit 4995e8ca authored by Bernhard Link's avatar Bernhard Link

actually ignore 'none' as documented

parent 7f585125
......@@ -444,7 +444,7 @@ static void checkifarchitectureisused(const struct strlist *architectures, const
assert( rule != NULL );
if( architectures->count == 0 )
return;
found = strlist_preparefoundlist(architectures);
found = strlist_preparefoundlist(architectures, true);
if( found == NULL )
return;
for( d = alldistributions ; d != NULL ; d = d->next ) {
......@@ -455,8 +455,6 @@ static void checkifarchitectureisused(const struct strlist *architectures, const
for( i = 0 ; i < architectures->count ; i++ ) {
if( found[i] )
continue;
if( strcmp(architectures->values[i], "none") == 0 )
continue;
fprintf(stderr,
"Warning: pull rule '%s' wants to %s architecture '%s',\n"
"but no distribution using this has such an architecture.\n"
......@@ -476,7 +474,7 @@ static void checkifcomponentisused(const struct strlist *components, const struc
assert( rule != NULL );
if( components->count == 0 )
return;
found = strlist_preparefoundlist(components);
found = strlist_preparefoundlist(components, true);
if( found == NULL )
return;
for( d = alldistributions ; d != NULL ; d = d->next ) {
......@@ -487,8 +485,6 @@ static void checkifcomponentisused(const struct strlist *components, const struc
for( i = 0 ; i < components->count ; i++ ) {
if( found[i] )
continue;
if( strcmp(components->values[i], "none") == 0 )
continue;
fprintf(stderr,
"Warning: pull rule '%s' wants to %s component '%s',\n"
"but no distribution using this has such an component.\n"
......@@ -508,7 +504,7 @@ static void checkifudebcomponentisused(const struct strlist *udebcomponents, con
assert( rule != NULL );
if( udebcomponents->count == 0 )
return;
found = strlist_preparefoundlist(udebcomponents);
found = strlist_preparefoundlist(udebcomponents, true);
if( found == NULL )
return;
for( d = alldistributions ; d != NULL ; d = d->next ) {
......@@ -519,8 +515,6 @@ static void checkifudebcomponentisused(const struct strlist *udebcomponents, con
for( i = 0 ; i < udebcomponents->count ; i++ ) {
if( found[i] )
continue;
if( strcmp(udebcomponents->values[i], "none") == 0 )
continue;
fprintf(stderr,
"Warning: pull rule '%s' wants to %s udeb component '%s',\n"
"but no distribution using this has such an udeb component.\n"
......
......@@ -269,7 +269,7 @@ bool strlist_intersects(const struct strlist *a, const struct strlist *b) {
return false;
}
bool *strlist_preparefoundlist(const struct strlist *list) {
bool *strlist_preparefoundlist(const struct strlist *list, bool ignorenone) {
bool *found;
int i, j;
......@@ -279,6 +279,10 @@ bool *strlist_preparefoundlist(const struct strlist *list) {
for( i = 0 ; i < list->count ; i++ ) {
if( found[i] )
continue;
if( ignorenone && strcmp(list->values[i], "none") == 0 ) {
found[i] = true;
continue;
}
for( j = i + 1 ; j < list->count ; j++ )
if( strcmp(list->values[i], list->values[j]) == 0 )
found[j] = true;
......
......@@ -47,7 +47,7 @@ bool strlist_intersects(const struct strlist *, const struct strlist *);
bool strlist_subset(const struct strlist *strlist, const struct strlist *subset, const char **missing);
/* a list of bool for all values, duplicates already set to true */
bool *strlist_preparefoundlist(const struct strlist *);
bool *strlist_preparefoundlist(const struct strlist *, bool ignorenone);
/* concatenate <prefix> <values separated by infix> <suffix> */
char *strlist_concat(const struct strlist *, const char *prefix, const char *infix, const char *suffix);
......
......@@ -409,7 +409,7 @@ static void checkpatternsforunused(const struct update_pattern *patterns, const
if( p->architectures_into.count == 0 )
continue;
found = strlist_preparefoundlist(&p->architectures_into);
found = strlist_preparefoundlist(&p->architectures_into, true);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
......@@ -427,7 +427,7 @@ static void checkpatternsforunused(const struct update_pattern *patterns, const
free(found);
}
if( p->components_set && p->components_into.count > 0 ) {
found = strlist_preparefoundlist(&p->components_into);
found = strlist_preparefoundlist(&p->components_into, true);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
......@@ -445,7 +445,7 @@ static void checkpatternsforunused(const struct update_pattern *patterns, const
free(found);
}
if( p->udebcomponents_set && p->udebcomponents_into.count > 0 ) {
found = strlist_preparefoundlist(&p->udebcomponents_into);
found = strlist_preparefoundlist(&p->udebcomponents_into, true);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
......
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