UnitFileChange *c;
unsigned i;
- assert(type >= 0);
- assert(type < _UNIT_FILE_CHANGE_TYPE_MAX);
assert(path);
assert(!changes == !n_changes);
const char *path,
bool allow_symlink) {
- const ConfigItem items[] = {
- { "Alias", config_parse_strv, 0, &info->aliases, "Install" },
- { "WantedBy", config_parse_strv, 0, &info->wanted_by, "Install" },
- { "Also", config_parse_also, 0, c, "Install" },
- { NULL, NULL, 0, NULL, NULL }
+ const ConfigTableItem items[] = {
+ { "Install", "Alias", config_parse_strv, 0, &info->aliases },
+ { "Install", "WantedBy", config_parse_strv, 0, &info->wanted_by },
+ { "Install", "Also", config_parse_also, 0, c },
+ { NULL, NULL, NULL, 0, NULL }
};
int fd;
return -ENOMEM;
}
- r = config_parse(path, f, NULL, items, true, info);
+ r = config_parse(path, f, NULL, config_item_table_lookup, (void*) items, true, info);
fclose(f);
if (r < 0)
return r;
goto finish;
}
+ /* This will return the number of symlink rules that were
+ supposed to be created, not the ones actually created. This is
+ useful to determine whether the passed files hat any
+ installation data at all. */
r = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes);
finish:
r = remove_marked_symlinks(remove_symlinks_to, config_path, changes, n_changes);
+ /* Returns number of symlinks that where supposed to be installed. */
q = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes);
if (r == 0)
r = q;
if (r == 0)
r = q;
+ /* Returns number of symlinks that where supposed to be installed. */
q = install_context_apply(&plus, &paths, config_path, root_dir, force, changes, n_changes);
if (r == 0)
r = q;