From f05a0cef9f403da8b1a7acd94cc462af1810acc7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Sep 2026 12:15:38 +0200 Subject: [PATCH] sysupdate: rename isEnabled to enabled The "isEnabled" name was changed from "enabled" post v261 by accident (because a6f7ded859b9a30d73f3a578c2b2b15080d64b03 replaced 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. a6f7ded859b9a30d73f3a578c2b2b15080d64b03 ensured 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. --- NEWS | 8 ++++---- man/org.freedesktop.sysupdate1.xml | 2 +- src/shared/varlink-io.systemd.SysUpdate.c | 2 +- src/sysupdate/sysupdate.c | 2 +- src/sysupdate/updatectl.c | 2 +- test/units/TEST-72-SYSUPDATE.sh | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index c5af1e89e6..21b15dcfef 100644 --- a/NEWS +++ b/NEWS @@ -144,10 +144,10 @@ CHANGES WITH 262 in spe: hierarchy that is not merged is now shown as "-" instead of "none". * The JSON payload returned by systemd-sysupdated's DescribeFeature() - method changed the "name" and "enabled" keys to "id" and - "isEnabled", respectively. The "appStream" key is now "appstream", - and the "documentation" key is now an array of strings. Consumers - of this interface must update their JSON parsing accordingly. + method changed the "name" keys to "id". The "appStream" key is now + "appstream", and the "documentation" key is now an array of strings. + Consumers of this interface must update their JSON parsing + accordingly. * The PrivateUsersOwnership= setting in .nspawn files now defaults to "auto" when PrivateUsers= is "pick" or "managed", matching the diff --git a/man/org.freedesktop.sysupdate1.xml b/man/org.freedesktop.sysupdate1.xml index 09d55c3c6b..27ec86926d 100644 --- a/man/org.freedesktop.sysupdate1.xml +++ b/man/org.freedesktop.sysupdate1.xml @@ -333,7 +333,7 @@ node /org/freedesktop/sysupdate1/target/host { - isEnabled + enabled A boolean indicating whether this feature is enabled. diff --git a/src/shared/varlink-io.systemd.SysUpdate.c b/src/shared/varlink-io.systemd.SysUpdate.c index 68aa337a0e..f5fa7a6e69 100644 --- a/src/shared/varlink-io.systemd.SysUpdate.c +++ b/src/shared/varlink-io.systemd.SysUpdate.c @@ -41,7 +41,7 @@ static SD_VARLINK_DEFINE_STRUCT_TYPE( SD_VARLINK_FIELD_COMMENT("A URL to an AppStream catalog XML file describing the feature."), SD_VARLINK_DEFINE_FIELD(appstream, SD_VARLINK_STRING, SD_VARLINK_NULLABLE), SD_VARLINK_FIELD_COMMENT("Whether the feature is enabled."), - SD_VARLINK_DEFINE_FIELD(isEnabled, SD_VARLINK_BOOL, 0), + SD_VARLINK_DEFINE_FIELD(enabled, SD_VARLINK_BOOL, 0), SD_VARLINK_FIELD_COMMENT("Whether the feature is suggested for enablement."), SD_VARLINK_DEFINE_FIELD(suggested, SD_VARLINK_BOOL, SD_VARLINK_NULLABLE), SD_VARLINK_FIELD_COMMENT("Array of IDs of the transfers (including currently disabled ones) which are controlled by this feature."), diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 4f55ccdafb..7b68bdde1e 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -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) diff --git a/src/sysupdate/updatectl.c b/src/sysupdate/updatectl.c index d9ecf69818..194ab0a9cd 100644 --- a/src/sysupdate/updatectl.c +++ b/src/sysupdate/updatectl.c @@ -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 }, diff --git a/test/units/TEST-72-SYSUPDATE.sh b/test/units/TEST-72-SYSUPDATE.sh index 0de5ecd370..77d711f087 100755 --- a/test/units/TEST-72-SYSUPDATE.sh +++ b/test/units/TEST-72-SYSUPDATE.sh @@ -507,7 +507,7 @@ EOF "https://example.com/optional-more" ] ' <<<"$feature_json" >/dev/null - jq -e '.isEnabled == false' <<<"$feature_json" >/dev/null + jq -e '.enabled == false' <<<"$feature_json" >/dev/null jq -e '.suggested == false' <<<"$feature_json" >/dev/null jq -e '.appstream == "https://example.com/optional.appstream.xml"' <<<"$feature_json" >/dev/null