Skip to content

Commit fba37bf

Browse files
committed
builder-manifest: Run appstream-compose with no-partial-urls argument
When 0.16.3 is available This is an alternative to #576 We check at runtime instead of build-time and downgrade instead of erroring. Checking at build time is insufficient as there is no guarantee flatpak-builder is run with the same appstream version it was compiled with. Ideally we want to compose with `--no-partial-urls` so a warning is printed if it is not found. `--no-partial-urls` makes the mirrored URLs in appstream catalogue data the full URL. So if `--mirror-screenshot-url=https://example.org/media` and the metainfo has `<screenshot><image>https://github.com/foobar.png</image></screenshot>` After composing with `--no-partial-urls`, it will become <screenshot><image>https://example.org/media/foobar.png</image></screenshot>` instead of `/media/foobar.png`. This is needed by Flathub and generally should be a standard requirement for any software store (to have a full working URL instead of a partial whatever-that-is).
1 parent c86e6c1 commit fba37bf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/builder-manifest.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,9 +3056,16 @@ builder_manifest_cleanup (BuilderManifest *self,
30563056
g_autofree char *arg_media_dir = g_strdup_printf ("--media-dir=%s",
30573057
flatpak_file_get_path_cached (media_dir));
30583058

3059+
gboolean has_no_partial_urls = appstream_version_check (0, 16, 3);
3060+
if (!has_no_partial_urls)
3061+
{
3062+
g_warning ("Found AppStream version < 0.16.3. Failed to add '--no-partial-urls' to compose");
3063+
}
3064+
30593065
g_print ("Running appstreamcli compose\n");
30603066
g_print ("Saving screenshots in %s\n", flatpak_file_get_path_cached (media_dir));
30613067
if (!appstreamcli_compose (error,
3068+
has_no_partial_urls ? "--no-partial-urls" : NULL,
30623069
"--prefix=/",
30633070
origin,
30643071
arg_base_url,

0 commit comments

Comments
 (0)