updatectl: fix feature JSON parsing (#43617)
## Summary `updatectl features` failed because it expected the old feature JSON fields, while `systemd-sysupdate` now returns `id`, `isEnabled`, and `documentation` as an array. This change: - Aligns `updatectl` with the current feature JSON schema. - Unifies JSON output between `systemd-sysupdate`, D-Bus, and Varlink. - Adds support for multiple `Documentation=` entries for Features and Components. - Exposes and parses `appstream` and `suggested` metadata. - Propagates condition-evaluation errors through `condition_test_list()` and `feature_is_suggested()`. - Reports suggestion-evaluation failures instead of silently treating them as `false`. - Improves JSON dump error handling. - Expands `TEST-72-SYSUPDATE` coverage and fixes its unknown-field assertion. - Documents the `DescribeFeature()` JSON field transition in `NEWS`. - Keeps the existing Component name list for `sysupdated` compatibility. The `name`/`enabled` to `id`/`isEnabled` transition is intentional and documented as a v262 payload change. Fixes #43603
This commit is contained in:
@@ -322,8 +322,8 @@ node /org/freedesktop/sysupdate1/target/host {
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>name</literal></term>
|
||||
<listitem><para>A string containing the feature's name.</para></listitem>
|
||||
<term><literal>id</literal></term>
|
||||
<listitem><para>A string containing the feature's ID.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
@@ -333,18 +333,24 @@ node /org/freedesktop/sysupdate1/target/host {
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>enabled</literal></term>
|
||||
<term><literal>isEnabled</literal></term>
|
||||
<listitem><para>A boolean indicating whether this feature is enabled.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>documentationUrl</literal></term>
|
||||
<listitem><para>An optional string that contains a user-presentable HTTP/HTTPS URL to documentation
|
||||
<term><literal>suggested</literal></term>
|
||||
<listitem><para>An optional boolean indicating whether this feature is suggested for enablement. If
|
||||
omitted, it could not be determined whether the feature is suggested.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>documentation</literal></term>
|
||||
<listitem><para>An optional array of strings containing user-presentable HTTP/HTTPS URLs to documentation
|
||||
about this feature.</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><literal>appstreamUrl</literal></term>
|
||||
<term><literal>appstream</literal></term>
|
||||
<listitem><para>An optional string that contains an HTTP/HTTPS URL to an
|
||||
<ulink url="https://wwww.freedesktop.org/software/appstream/docs/chap-CatalogData.html">appstream
|
||||
catalog</ulink> XML file containing metadata about this feature.</para></listitem>
|
||||
|
||||
@@ -98,8 +98,9 @@
|
||||
<varlistentry>
|
||||
<term><varname>Documentation=</varname></term>
|
||||
|
||||
<listitem><para>A user-presentable URL to documentation about this component.
|
||||
This setting supports specifier expansion; see below for details on supported specifiers.</para>
|
||||
<listitem><para>One or more user-presentable URLs to documentation about this component. This setting may be
|
||||
specified more than once. If the empty string is assigned to this option, the list is reset, and all prior
|
||||
assignments have no effect. It supports specifier expansion; see below for details on supported specifiers.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v262"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -81,8 +81,11 @@
|
||||
<varlistentry>
|
||||
<term><varname>Documentation=</varname></term>
|
||||
|
||||
<listitem><para>A user-presentable URL to documentation about this feature.
|
||||
This setting supports specifier expansion; see below for details on supported specifiers.</para>
|
||||
<listitem><para>One or more user-presentable URLs to documentation about this feature. This setting may be
|
||||
specified more than once. If the empty string is assigned to this option, the list is reset, and all prior
|
||||
assignments have no effect. It supports specifier expansion; see below for details on supported specifiers.</para>
|
||||
|
||||
<para>Support for specifying this setting more than once was added in version 262.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v257"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
Reference in New Issue
Block a user