Changeset aa0faeca in mainline for uspace/srv/sysman/repo.c


Ignore:
Timestamp:
2020-03-08T16:47:18Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
a73aaec1
Parents:
13b4504
git-author:
Matthieu Riolo <matthieu.riolo@…> (2020-03-06 18:10:45)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-03-08 16:47:18)
Message:

Adding "ConditionArchitecture" to sysman's unit

the services s3c24xx_uart and s3c24xx_ts are specific for
arm32. This newly flag allows sysman to ignore those units
when they are asked to be loaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/repo.c

    r13b4504 raa0faeca  
    278278}
    279279
     280static bool repo_clean_up_unit(ht_link_t *ht_link, void *arg)
     281{
     282        unit_t *unit = hash_table_get_inst(ht_link, unit_t, units_by_name);
     283
     284        if (unit->conditions != UNIT_CONDITION_NONE) {
     285                unit_log_condition(unit);
     286
     287                list_foreach_safe(unit->edges_in, current_link, iter) {
     288                        unit_edge_t *e = list_get_instance(current_link, unit_edge_t, edges_in);
     289                        edge_remove(&e);
     290                }
     291
     292                list_foreach_safe(unit->edges_out, current_link, iter) {
     293                        unit_edge_t *e = list_get_instance(current_link, unit_edge_t, edges_out);
     294                        edge_remove(&e);
     295                }
     296        }
     297
     298        return true;
     299}
     300
    280301/** Resolve unresolved dependencies between any pair of units_by_name
    281302 *
     
    289310        bool has_error = false;
    290311        hash_table_apply(&units_by_name, &repo_resolve_unit, &has_error);
     312
     313        if (!has_error) {
     314                //once all references have been built test if there are
     315                //units which dont meet the conditions. If yes, remove the edges
     316                hash_table_apply(&units_by_name, &repo_clean_up_unit, &has_error);
     317        }
    291318
    292319        return has_error ? ENOENT : EOK;
Note: See TracChangeset for help on using the changeset viewer.