lifecycle: add lif_lifecycle_count_rdepends(), which calculates reverse dependency depth

This commit is contained in:
Ariadne Conill 2020-09-09 17:39:26 -06:00
parent a5eebda391
commit 2569503afa
4 changed files with 68 additions and 0 deletions

View file

@ -290,6 +290,12 @@ ifquery_main(int argc, char *argv[])
return EXIT_FAILURE;
}
if (!lif_lifecycle_count_rdepends(&exec_opts, &collection))
{
fprintf(stderr, "%s: could not validate dependency tree\n", argv0);
return EXIT_FAILURE;
}
/* --list --state is not allowed */
if (listing && listing_stat)
generic_usage(self_applet, EXIT_FAILURE);

View file

@ -229,6 +229,12 @@ ifupdown_main(int argc, char *argv[])
return EXIT_FAILURE;
}
if (!lif_lifecycle_count_rdepends(&exec_opts, &collection))
{
fprintf(stderr, "%s: could not validate dependency tree\n", argv0);
return EXIT_FAILURE;
}
if (!lif_state_sync(&state, &collection))
{
fprintf(stderr, "%s: could not sync state\n", argv0);