flatpak-builtins-build-finish.c (flatpak-1.15.1.tar.xz) | : | flatpak-builtins-build-finish.c (flatpak-1.15.2.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 178 | skipping to change at line 178 | |||
if (!glnx_file_copy_at (source_iter.fd, dent->d_name, &stbuf, | if (!glnx_file_copy_at (source_iter.fd, dent->d_name, &stbuf, | |||
destination_dfd, dent->d_name, | destination_dfd, dent->d_name, | |||
GLNX_FILE_COPY_NOXATTRS, | GLNX_FILE_COPY_NOXATTRS, | |||
cancellable, | cancellable, | |||
error)) | error)) | |||
return FALSE; | return FALSE; | |||
} | } | |||
else | else | |||
{ | { | |||
source_printable = g_build_filename (source_relpath, dent->d_name, NUL L); | source_printable = g_build_filename (source_relpath, dent->d_name, NUL L); | |||
g_debug ("Not exporting non-regular file %s", source_printable); | g_info ("Not exporting non-regular file %s", source_printable); | |||
} | } | |||
} | } | |||
/* Try to remove the directory, as we don't want to export empty directories. | /* Try to remove the directory, as we don't want to export empty directories. | |||
* However, don't fail if the unlink fails due to the directory not being empt y */ | * However, don't fail if the unlink fails due to the directory not being empt y */ | |||
do | do | |||
res = unlinkat (destination_parent_fd, destination_name, AT_REMOVEDIR); | res = unlinkat (destination_parent_fd, destination_name, AT_REMOVEDIR); | |||
while (G_UNLIKELY (res == -1 && errno == EINTR)); | while (G_UNLIKELY (res == -1 && errno == EINTR)); | |||
if (res == -1) | if (res == -1) | |||
{ | { | |||
skipping to change at line 267 | skipping to change at line 267 | |||
g_auto(GStrv) allowed_prefixes = NULL; | g_auto(GStrv) allowed_prefixes = NULL; | |||
g_auto(GStrv) allowed_extensions = NULL; | g_auto(GStrv) allowed_extensions = NULL; | |||
gboolean require_exact_match = FALSE; | gboolean require_exact_match = FALSE; | |||
if (!flatpak_get_allowed_exports (path, app_id, arg_context, | if (!flatpak_get_allowed_exports (path, app_id, arg_context, | |||
&allowed_extensions, &allowed_prefixes, &require_exact_match)) | &allowed_extensions, &allowed_prefixes, &require_exact_match)) | |||
return flatpak_fail (error, "Unexpectedly not allowed to export %s", pat h); | return flatpak_fail (error, "Unexpectedly not allowed to export %s", pat h); | |||
if (g_file_query_exists (src, cancellable)) | if (g_file_query_exists (src, cancellable)) | |||
{ | { | |||
g_debug ("Exporting from %s", path); | g_info ("Exporting from %s", path); | |||
g_autoptr(GFile) dest = NULL; | g_autoptr(GFile) dest = NULL; | |||
g_autoptr(GFile) dest_parent = NULL; | g_autoptr(GFile) dest_parent = NULL; | |||
if (strcmp (path, "share/appdata") == 0) | if (strcmp (path, "share/appdata") == 0) | |||
dest = g_file_resolve_relative_path (export, "share/metainfo"); | dest = g_file_resolve_relative_path (export, "share/metainfo"); | |||
else | else | |||
dest = g_file_resolve_relative_path (export, path); | dest = g_file_resolve_relative_path (export, path); | |||
dest_parent = g_file_get_parent (dest); | dest_parent = g_file_get_parent (dest); | |||
g_debug ("Ensuring export/%s parent exists", path); | g_info ("Ensuring export/%s parent exists", path); | |||
if (!flatpak_mkdir_p (dest_parent, cancellable, error)) | if (!flatpak_mkdir_p (dest_parent, cancellable, error)) | |||
return FALSE; | return FALSE; | |||
g_debug ("Copying from files/%s", path); | g_info ("Copying from files/%s", path); | |||
if (!copy_exports (src, | if (!copy_exports (src, | |||
dest, | dest, | |||
path, | path, | |||
allowed_prefixes, | allowed_prefixes, | |||
allowed_extensions, | allowed_extensions, | |||
require_exact_match, | require_exact_match, | |||
cancellable, | cancellable, | |||
error)) | error)) | |||
return FALSE; | return FALSE; | |||
} | } | |||
skipping to change at line 403 | skipping to change at line 403 | |||
ref = flatpak_build_untyped_ref (id, branch, arch); | ref = flatpak_build_untyped_ref (id, branch, arch); | |||
g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_RUNTIME, r ef); | g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_RUNTIME, r ef); | |||
} | } | |||
} | } | |||
if (!is_runtime) | if (!is_runtime) | |||
{ | { | |||
if (g_key_file_has_key (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, NULL )) | if (g_key_file_has_key (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, NULL )) | |||
{ | { | |||
g_debug ("Command key is present"); | g_info ("Command key is present"); | |||
if (opt_command) | if (opt_command) | |||
g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, opt_command); | g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, opt_command); | |||
} | } | |||
else if (opt_command) | else if (opt_command) | |||
{ | { | |||
g_debug ("Using explicitly provided command %s", opt_command); | g_info ("Using explicitly provided command %s", opt_command); | |||
g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, o pt_command); | g_key_file_set_string (keyfile, group, FLATPAK_METADATA_KEY_COMMAND, o pt_command); | |||
} | } | |||
else | else | |||
{ | { | |||
g_autofree char *command = NULL; | g_autofree char *command = NULL; | |||
g_autoptr(GFile) bin_dir = NULL; | g_autoptr(GFile) bin_dir = NULL; | |||
g_autoptr(GFileEnumerator) bin_enum = NULL; | g_autoptr(GFileEnumerator) bin_enum = NULL; | |||
g_autoptr(GFileInfo) child_info = NULL; | g_autoptr(GFileInfo) child_info = NULL; | |||
g_debug ("Looking for executables"); | g_info ("Looking for executables"); | |||
bin_dir = g_file_resolve_relative_path (base, "files/bin"); | bin_dir = g_file_resolve_relative_path (base, "files/bin"); | |||
if (g_file_query_exists (bin_dir, cancellable)) | if (g_file_query_exists (bin_dir, cancellable)) | |||
{ | { | |||
bin_enum = g_file_enumerate_children (bin_dir, G_FILE_ATTRIBUTE_ST ANDARD_NAME, | bin_enum = g_file_enumerate_children (bin_dir, G_FILE_ATTRIBUTE_ST ANDARD_NAME, | |||
G_FILE_QUERY_INFO_NOFOLLOW_S YMLINKS, | G_FILE_QUERY_INFO_NOFOLLOW_S YMLINKS, | |||
cancellable, error); | cancellable, error); | |||
if (!bin_enum) | if (!bin_enum) | |||
goto out; | goto out; | |||
skipping to change at line 688 | skipping to change at line 688 | |||
if (id == NULL) | if (id == NULL) | |||
return flatpak_fail (error, _("No name specified in the metadata")); | return flatpak_fail (error, _("No name specified in the metadata")); | |||
is_runtime = TRUE; | is_runtime = TRUE; | |||
} | } | |||
if (g_file_query_exists (export_dir, cancellable)) | if (g_file_query_exists (export_dir, cancellable)) | |||
return flatpak_fail (error, _("Build directory %s already finalized"), direc tory); | return flatpak_fail (error, _("Build directory %s already finalized"), direc tory); | |||
if (!is_runtime) | if (!is_runtime) | |||
{ | { | |||
g_debug ("Collecting exports"); | g_info ("Collecting exports"); | |||
if (!collect_exports (base, id, arg_context, cancellable, error)) | if (!collect_exports (base, id, arg_context, cancellable, error)) | |||
return FALSE; | return FALSE; | |||
} | } | |||
g_debug ("Updating metadata"); | g_info ("Updating metadata"); | |||
if (!update_metadata (base, arg_context, is_runtime, cancellable, error)) | if (!update_metadata (base, arg_context, is_runtime, cancellable, error)) | |||
return FALSE; | return FALSE; | |||
g_print (_("Please review the exported files and the metadata\n")); | g_print (_("Please review the exported files and the metadata\n")); | |||
return TRUE; | return TRUE; | |||
} | } | |||
gboolean | gboolean | |||
flatpak_complete_build_finish (FlatpakCompletion *completion) | flatpak_complete_build_finish (FlatpakCompletion *completion) | |||
End of changes. 9 change blocks. | ||||
9 lines changed or deleted | 9 lines changed or added |