Skip to content

Fix building the silo when shared-mime-info is installed#327

Open
hughsie wants to merge 1 commit into
mainfrom
hughsie/app-xml-subclass
Open

Fix building the silo when shared-mime-info is installed#327
hughsie wants to merge 1 commit into
mainfrom
hughsie/app-xml-subclass

Conversation

@hughsie

@hughsie hughsie commented Jul 15, 2026

Copy link
Copy Markdown
Owner

shared-mime-info 2.5.1 added a application/x-freedesktop-appstream-component that is a subclass of application/xml -- which breaks the explicit content type checks in the source builder. Abort the loop for any XML subclass instead to cover both cases.

Fixes: #325

Summary by CodeRabbit

  • Bug Fixes
    • Improved XML content detection so files identified as application/xml are handled correctly.
    • Preserved support for text/xml and compressed XML processing.

shared-mime-info 2.5.1 added a `application/x-freedesktop-appstream-component`
that is a subclass of `application/xml` -- which breaks the explicit content
type checks in the source builder. Abort the loop for any XML subclass instead
to cover both cases.

Fixes: #325
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b55238a9-bb95-4eec-b760-c6d1f551ea57

📥 Commits

Reviewing files that changed from the base of the PR and between 16bc869 and 2647034.

📒 Files selected for processing (1)
  • src/xb-builder-source.c

📝 Walkthrough

Walkthrough

The builder source now recognises XML-derived content types, including AppStream MIME types, when determining whether a stream is ready for XML parsing.

Changes

XML content detection

Layer / File(s) Summary
Accept XML subtypes
src/xb-builder-source.c
The stream adapter loop replaces the exact application/xml comparison with g_content_type_is_a, while retaining existing alias handling and adapter behaviour.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: fixing XML subclass handling for AppStream builds with shared-mime-info.
Linked Issues check ✅ Passed The code change implements the requested fix by accepting XML subclasses, so AppStream .metainfo, .appdata and .releases files are processed.
Out of Scope Changes check ✅ Passed The patch is narrowly scoped to the MIME-type check and adds no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libxmlb can no longer load AppStream files

1 participant