Skip to content
Snippets Groups Projects
Commit 658ed7ce authored by Simon McVittie's avatar Simon McVittie
Browse files

pv-runtime: GC all deployments if operating from an unpacked directory


If we are operating from ./scout_platform_x.y.z, self->id will be NULL.
Instead of matching on the names of directories, we can just check
whether the deployment we are going to use is the same file (device
and inode number) as the old deployment we are considering deleting.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent bf9e4393
No related branches found
No related tags found
1 merge request!295pressure-vessel: Use a mtree(5) manifest to set up the runtime
......@@ -820,17 +820,10 @@ pv_runtime_garbage_collect (PvRuntime *self,
if (g_str_has_prefix (dent->d_name, "deploy-"))
{
/* Don't GC old deployments unless we know which one is current
* and therefore should not be deleted */
if (self->id == NULL)
{
g_debug ("Ignoring %s/deploy-*: current ID not known",
self->variable_dir);
continue;
}
/* Don't GC the current deployment */
if (strcmp (dent->d_name + strlen ("deploy-"), self->id) == 0)
if (_srt_fstatat_is_same_file (self->variable_dir_fd,
dent->d_name,
AT_FDCWD,
self->deployment))
{
g_debug ("Ignoring %s/%s: is the current version",
self->variable_dir, dent->d_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment