mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-03 05:18:00 -05:00
create-usb: Detect the case of partial deploys and warn/fail
We don't want to make a usb repo with e.g. just one translation.
This commit is contained in:
@@ -120,6 +120,9 @@ add_related (GHashTable *all_refs,
|
||||
if (deploy_data == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (flatpak_deploy_data_has_subpaths (deploy_data))
|
||||
return flatpak_fail (error, _("Related ref '%s' is only partially installed"), ref);
|
||||
|
||||
commit = flatpak_deploy_data_get_commit (deploy_data);
|
||||
|
||||
deploy = flatpak_dir_load_deployed (dir, ref, commit, cancellable, error);
|
||||
@@ -154,6 +157,13 @@ add_related (GHashTable *all_refs,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flatpak_deploy_data_has_subpaths (ext_deploy_data))
|
||||
{
|
||||
g_printerr (_("Warning: Omitting related ref ‘%s’ because it is partially installed.\n"),
|
||||
ext->ref);
|
||||
continue;
|
||||
}
|
||||
|
||||
ext_remote = flatpak_deploy_data_get_origin (ext_deploy_data);
|
||||
if (ext_remote == NULL)
|
||||
return FALSE;
|
||||
@@ -628,6 +638,11 @@ flatpak_builtin_create_usb (int argc, char **argv, GCancellable *cancellable, GE
|
||||
deploy_data = flatpak_dir_get_deploy_data (dir, installed_ref, FLATPAK_DEPLOY_VERSION_ANY, cancellable, error);
|
||||
if (deploy_data == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (flatpak_deploy_data_has_subpaths (deploy_data))
|
||||
return flatpak_fail (error,
|
||||
_("Ref '%s' is only partially installed"), installed_ref);
|
||||
|
||||
commit = flatpak_deploy_data_get_commit (deploy_data);
|
||||
c_s = commit_and_subpaths_new (commit, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user