lib/sysroot: Fix retrieving non-booted pending deployment
If we're booted into a deployment, then any queries for the pending merge deployment of a non-booted OS will fail due all of them being considered rollback. Fix this by filtering by `osname` *before* determining if we've crossed the booted deployment yet. Closes: #1472 Approved by: cgwalters
This commit is contained in:
parent
6db6268dfd
commit
530043fcf6
|
|
@ -1202,6 +1202,10 @@ ostree_sysroot_query_deployments_for (OstreeSysroot *self,
|
||||||
{
|
{
|
||||||
OstreeDeployment *deployment = self->deployments->pdata[i];
|
OstreeDeployment *deployment = self->deployments->pdata[i];
|
||||||
|
|
||||||
|
/* Ignore deployments not for this osname */
|
||||||
|
if (strcmp (ostree_deployment_get_osname (deployment), osname) != 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Is this deployment booted? If so, note we're past the booted */
|
/* Is this deployment booted? If so, note we're past the booted */
|
||||||
if (self->booted_deployment != NULL &&
|
if (self->booted_deployment != NULL &&
|
||||||
ostree_deployment_equal (deployment, self->booted_deployment))
|
ostree_deployment_equal (deployment, self->booted_deployment))
|
||||||
|
|
@ -1210,10 +1214,6 @@ ostree_sysroot_query_deployments_for (OstreeSysroot *self,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Ignore deployments not for this osname */
|
|
||||||
if (strcmp (ostree_deployment_get_osname (deployment), osname) != 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!found_booted && !ret_pending)
|
if (!found_booted && !ret_pending)
|
||||||
ret_pending = g_object_ref (deployment);
|
ret_pending = g_object_ref (deployment);
|
||||||
else if (found_booted && !ret_rollback)
|
else if (found_booted && !ret_rollback)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue