Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/builder-flatpak-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ flatpak_path_match_prefix (const char *pattern,
return string;
return NULL;

case '/':
if (*pattern == 0)
{
/* treat as directory boundary, don't consume match */
if (*string == '/' || *string == 0)
return string;
return NULL;
}
if (*string == '/')
string++;
else
return NULL;
break;

case '?':
if (*string == '/' || *string == 0)
return NULL;
Expand Down
19 changes: 13 additions & 6 deletions src/builder-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1691,22 +1691,28 @@ builder_module_install_licenses (BuilderModule *self,
const char *id,
GFile *source_dir,
GFile *app_dir,
BuilderContext *context,
GError **error)
{
g_autoptr(GPtrArray) license_files = NULL;
g_autoptr(GFile) license_dir = NULL;
g_autoptr(GFile) dest_dir = NULL;

if (!find_license_files (self, source_dir, &license_files, error))
return FALSE;

if (license_files->len == 0)
return TRUE;

license_dir = g_file_new_build_filename (g_file_get_path (app_dir),
"files/share/licenses",
id,
self->name,
NULL);
dest_dir = builder_context_get_build_runtime (context)
? g_file_get_child (app_dir, "usr")
: g_file_get_child (app_dir, "files");

license_dir = g_file_resolve_relative_path (dest_dir,
g_build_filename ("share/licenses",
id,
self->name,
NULL));
if (!flatpak_mkdir_p (license_dir, NULL, error))
return FALSE;

Expand Down Expand Up @@ -2178,7 +2184,7 @@ builder_module_build_helper (BuilderModule *self,
return FALSE;
}

if (!builder_module_install_licenses (self, id, source_dir, app_dir, error))
if (!builder_module_install_licenses (self, id, source_dir, app_dir, context, error))
return FALSE;

/* Post installation scripts */
Expand Down Expand Up @@ -2381,6 +2387,7 @@ builder_module_checksum (BuilderModule *self,
builder_cache_checksum_str (cache, self->buildsystem);
builder_cache_checksum_str (cache, self->install_rule);
builder_cache_checksum_compat_boolean (cache, self->run_tests);
builder_cache_checksum_compat_strv (cache, self->license_files);

if (self->build_options)
builder_options_checksum (self->build_options, cache, context);
Expand Down
15 changes: 13 additions & 2 deletions src/builder-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,8 +1134,19 @@ builder_download_uri_buffer (GUri *uri,

if (retcode != CURLE_OK)
{
g_set_error_literal (error, BUILDER_CURL_ERROR, retcode,
*error_buffer ? error_buffer : curl_easy_strerror (retcode));
const char *curl_msg =
*error_buffer ? error_buffer : curl_easy_strerror (retcode);

if (retcode == CURLE_BAD_CONTENT_ENCODING)
{
g_set_error (error, BUILDER_CURL_ERROR, retcode,
"Failed to download %s: %s "
"Try adding \"disable-http-decompression\": true to this source.",
url, curl_msg);
}
else
g_set_error_literal (error, BUILDER_CURL_ERROR, retcode, curl_msg);

return FALSE;
}

Expand Down
1 change: 1 addition & 0 deletions tests/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ dist_test_scripts = \
tests/test-builder.sh \
tests/test-builder-deprecated.sh \
tests/test-builder-python.sh \
tests/test-builder-cleanup.sh \
$(NULL)

@VALGRIND_CHECK_RULES@
Expand Down
1 change: 1 addition & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test_names = [
'test-builder',
'test-builder-deprecated',
'test-builder-python',
'test-builder-cleanup',
]

tap_test = find_program(
Expand Down
Loading
Loading