@@ -1180,13 +1180,19 @@ struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2)
}
static void
-expr_print_newline(struct expr *e,
- void (*fn)(void *, struct symbol *, const char *),
- void *data,
- int prevtoken)
+expr_print_revdep(struct expr *e,
+ void (*fn)(void *, struct symbol *, const char *),
+ void *data,
+ int prevtoken,
+ enum print_type type)
{
- fn(data, NULL, "\n - ");
- expr_print(e, fn, data, prevtoken);
+ if (type == PRINT_REVDEP_ALL ||
+ type == PRINT_REVDEP_YES && expr_calc_value(e) == yes ||
+ type == PRINT_REVDEP_MOD && expr_calc_value(e) == mod ||
+ type == PRINT_REVDEP_NO && expr_calc_value(e) == no) {
+ fn(data, NULL, "\n - ");
+ expr_print(e, fn, data, prevtoken);
+ }
}
static void
@@ -1211,21 +1217,10 @@ __expr_print(struct expr *e,
fn(data, e->left.sym, e->left.sym->name);
break;
case PRINT_REVDEP_ALL:
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_YES:
- if (expr_calc_value(e) == yes)
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_MOD:
- if (expr_calc_value(e) == mod)
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_NO:
- if (expr_calc_value(e) == no)
- expr_print_newline(e, fn, data, E_OR);
- break;
- default:
+ expr_print_revdep(e, fn, data, E_OR, type);
break;
}
else
@@ -1283,21 +1278,10 @@ __expr_print(struct expr *e,
expr_print(e->right.expr, fn, data, E_AND);
break;
case PRINT_REVDEP_ALL:
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_YES:
- if (expr_calc_value(e) == yes)
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_MOD:
- if (expr_calc_value(e) == mod)
- expr_print_newline(e, fn, data, E_OR);
- break;
case PRINT_REVDEP_NO:
- if (expr_calc_value(e) == no)
- expr_print_newline(e, fn, data, E_OR);
- break;
- default:
+ expr_print_revdep(e, fn, data, E_OR, type);
break;
}
break;
@@ -797,19 +797,19 @@ void get_revdep_by_type(struct expr *e, char *s, struct gstr *r)
if (expr_revdep_contains(e, yes)) {
str_append(r, s);
- str_append(r, _(" [y]:"));
+ str_append(r, " [y]:");
expr_gstr_print_revdep(e, r, PRINT_REVDEP_YES);
str_append(r, "\n");
}
if (expr_revdep_contains(e, mod)) {
str_append(r, s);
- str_append(r, _(" [m]:"));
+ str_append(r, " [m]:");
expr_gstr_print_revdep(e, r, PRINT_REVDEP_MOD);
str_append(r, "\n");
}
if (expr_revdep_contains(e, no)) {
str_append(r, s);
- str_append(r, _(" [n]:"));
+ str_append(r, " [n]:");
expr_gstr_print_revdep(e, r, PRINT_REVDEP_NO);
str_append(r, "\n");
}