sysupdate: rename isEnabled to enabled
The "isEnabled" name was changed from "enabled" post v261 by accident (becausea6f7ded859replaced json formatting via table formatter to a native json generator which was introduced for varlink, which changed the names). THis was later made official in #43603, but it should rather have changed things back to the original name, in particular as the underling .feature file field actually is called "Enabled=" and not "IsEnabled=". We really should take care to generate the same names for Varlink JSON data as for the data returned by the systemd-sysupdate cli.a6f7ded859ensured that, so that's great. But at the same time I think the varlink names should be adjusted to the old names, since varlink support for this was just added in this cycle. Given that v262 is not tagged yet, let's now revert to the old name.
This commit is contained in:
@@ -2443,7 +2443,7 @@ static int feature_to_json(Context *context, const Feature *f, sd_json_variant *
|
||||
JSON_BUILD_PAIR_STRING_NON_EMPTY("description", f->description),
|
||||
JSON_BUILD_PAIR_STRV_NON_EMPTY("documentation", f->documentation),
|
||||
JSON_BUILD_PAIR_STRING_NON_EMPTY("appstream", f->appstream),
|
||||
SD_JSON_BUILD_PAIR_BOOLEAN("isEnabled", f->enabled),
|
||||
SD_JSON_BUILD_PAIR_BOOLEAN("enabled", f->enabled),
|
||||
SD_JSON_BUILD_PAIR_CONDITION(suggested >= 0, "suggested", SD_JSON_BUILD_BOOLEAN(suggested > 0)),
|
||||
JSON_BUILD_PAIR_STRV_NON_EMPTY("transfers", transfers));
|
||||
if (r < 0)
|
||||
|
||||
@@ -1420,7 +1420,7 @@ static int describe_feature(sd_bus *bus, const char *feature, Feature *ret) {
|
||||
static const sd_json_dispatch_field dispatch_table[] = {
|
||||
{ "id", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(Feature, id), SD_JSON_MANDATORY },
|
||||
{ "description", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(Feature, description), SD_JSON_NULLABLE },
|
||||
{ "isEnabled", SD_JSON_VARIANT_BOOLEAN, sd_json_dispatch_stdbool, offsetof(Feature, enabled), SD_JSON_MANDATORY },
|
||||
{ "enabled", SD_JSON_VARIANT_BOOLEAN, sd_json_dispatch_stdbool, offsetof(Feature, enabled), SD_JSON_MANDATORY },
|
||||
{ "suggested", SD_JSON_VARIANT_BOOLEAN, sd_json_dispatch_tristate, offsetof(Feature, suggested), SD_JSON_NULLABLE },
|
||||
{ "documentation", SD_JSON_VARIANT_ARRAY, sd_json_dispatch_strv, offsetof(Feature, documentation), SD_JSON_NULLABLE },
|
||||
{ "appstream", SD_JSON_VARIANT_STRING, sd_json_dispatch_string, offsetof(Feature, appstream), SD_JSON_NULLABLE },
|
||||
|
||||
Reference in New Issue
Block a user