MCPcopy Create free account
hub / github.com/Entware/Entware / conf_touch_deps

Function conf_touch_deps

scripts/config/confdata.c:1079–1154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1077}
1078
1079static int conf_touch_deps(void)
1080{
1081 const char *name, *tmp;
1082 struct symbol *sym;
1083 int res, i;
1084
1085 name = conf_get_autoconfig_name();
1086 tmp = strrchr(name, '/');
1087 depfile_prefix_len = tmp ? tmp - name + 1 : 0;
1088 if (depfile_prefix_len + 1 > sizeof(depfile_path))
1089 return -1;
1090
1091 strncpy(depfile_path, name, depfile_prefix_len);
1092 depfile_path[depfile_prefix_len] = 0;
1093
1094 conf_read_simple(name, S_DEF_AUTO);
1095 sym_calc_value(modules_sym);
1096
1097 for_all_symbols(i, sym) {
1098 sym_calc_value(sym);
1099 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
1100 continue;
1101 if (sym->flags & SYMBOL_WRITE) {
1102 if (sym->flags & SYMBOL_DEF_AUTO) {
1103 /*
1104 * symbol has old and new value,
1105 * so compare them...
1106 */
1107 switch (sym->type) {
1108 case S_BOOLEAN:
1109 case S_TRISTATE:
1110 if (sym_get_tristate_value(sym) ==
1111 sym->def[S_DEF_AUTO].tri)
1112 continue;
1113 break;
1114 case S_STRING:
1115 case S_HEX:
1116 case S_INT:
1117 if (!strcmp(sym_get_string_value(sym),
1118 sym->def[S_DEF_AUTO].val))
1119 continue;
1120 break;
1121 default:
1122 break;
1123 }
1124 } else {
1125 /*
1126 * If there is no old value, only 'no' (unset)
1127 * is allowed as new value.
1128 */
1129 switch (sym->type) {
1130 case S_BOOLEAN:
1131 case S_TRISTATE:
1132 if (sym_get_tristate_value(sym) == no)
1133 continue;
1134 break;
1135 default:
1136 break;

Callers 1

conf_write_autoconfFunction · 0.85

Calls 6

conf_get_autoconfig_nameFunction · 0.85
conf_read_simpleFunction · 0.85
sym_calc_valueFunction · 0.85
sym_get_tristate_valueFunction · 0.85
sym_get_string_valueFunction · 0.85
conf_touch_depFunction · 0.85

Tested by

no test coverage detected