sysupdate: display all component documentation URLs in table output

Component definitions may contain multiple Documentation= URLs, but the
components command previously displayed only the first URL in text output.

Use TABLE_STRV_WRAPPED to display all component documentation URLs in the
table, making the full documentation list visible to users.
Add integration test coverage for multiple Documentation= assignments.
This commit is contained in:
dongshengyuan
2026-09-08 16:05:39 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent a6f7ded859
commit e1ae3a43d3
2 changed files with 13 additions and 6 deletions
+9
View File
@@ -699,6 +699,11 @@ done
# that a ‘default’ component is only listed by sysupdate if it’s fully configured
mv "$CONFIGDIR" "$CONFIGDIR.backup"
mkdir -p /run/sysupdate.some-component.d
cat >/run/sysupdate.some-component.component <<EOF
[Component]
Documentation=https://example.com/some-component
Documentation=https://example.com/some-component-more
EOF
tee /run/sysupdate.some-component.d/portable.transfer << EOF
[Transfer]
ChangeLog=https://example.com/changelog/@v
@@ -716,6 +721,9 @@ MatchPattern=some-component_@v
CurrentSymlink=some-component
EOF
"$SYSUPDATE" --json=short components | grep -F '{"default":false,"components":["some-component"]}' >/dev/null
component_output="$("$SYSUPDATE" components)"
grep -F "https://example.com/some-component" <<<"$component_output" >/dev/null
grep -F "https://example.com/some-component-more" <<<"$component_output" >/dev/null
varlinkctl call "$VARLINK_SOCKET" io.systemd.SysUpdate.ListTargets | jq -e '.targets | all(.id.class != "host")' >/dev/null
mkdir /run/sysupdate.d
"$SYSUPDATE" --json=short components | grep -F '{"default":false,"components":["some-component"]}' >/dev/null
@@ -734,6 +742,7 @@ varlinkctl call "$VARLINK_SOCKET" io.systemd.SysUpdate.ListTargets | jq -e '.tar
# Clean up regression test
rmdir /run/sysupdate.d
rm -rf /run/sysupdate.some-component.d
rm -f /run/sysupdate.some-component.component
mv "$CONFIGDIR.backup" "$CONFIGDIR"
# Make sure the processing of compressed streams still handles uncompressed streams shorter than