Commit 094563a5 authored by Simon McVittie's avatar Simon McVittie

Update subvolume names to match what Ribchester actually does

The precise subvolume names (app-foo.bar-1 vs. foo.bar/version-1/static)
are unimportant, and using subdirectories like this turned out to be
slightly easier to implement in a robust way.
Reviewed-by: default avatarMathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D4050
parent d88c3231
......@@ -684,28 +684,30 @@ it from version 1 to version 2. That would look something like this:
* Instruct any running processes belonging to that bundle to exit
* Wait for the processes to save their state and exit; if a timeout
is reached, kill the processes
* Unmount the `app-com.example.MyApp-1` subvolume from
* Unmount the `com.example.MyApp/version-1/static` subvolume from
`/Applications/com.example.MyApp`
* Create a snapshot of `app-com.example.MyApp-1` named
`app-com.example.MyApp-2`
* Create a new snapshot of the subvolume
`/var/Applications/com.example.MyApp`, named `var-com.example.MyApp-1`
* Unmount the `com.example.MyApp/version-1/variable` subvolume from
`/var/Applications/com.example.MyApp`
* Create a snapshot of `com.example.MyApp/version-1/static` named
`com.example.MyApp/version-2/static`
* Create a new snapshot of `com.example.MyApp/version-1/variable`,
named `com.example.MyApp/version-2/variable`
* Recursively delete the `cache` and `users/*/cache` directories from
`var-com.example.MyApp-1`
`com.example.MyApp/version-1/variable`
* If it was not already installed, instead:
* Create a new, empty subvolume `/var/Applications/com.example.MyApp`,
or create it elsewhere (named `var-com.example.MyApp-2`) and mount
it at that location
* Create a new, empty subvolume named `app-com.example.MyApp-2`
* For each existing static file in `app-com.example.MyApp-2` that was
carried over from `app-com.example.MyApp-1`:
* Create a new, empty subvolume `com.example.MyApp/version-2/variable`
to be mounted at `/var/Applications/com.example.MyApp`
* Create a new, empty subvolume `com.example.MyApp/version-2/static`
to be mounted at `/Applications/com.example.MyApp`
* For each existing static file in `com.example.MyApp/version-2/static` that
was carried over from `com.example.MyApp/version-1/static`:
* If there is no corresponding file in version 2, delete it
* If its contents do not match the corresponding file in version 2,
delete it
* If its metadata do not match the one in version 2, update the
metadata
* For each static file in version 2:
* If there is no corresponding file in `app-com.example.MyApp-2`,
* If there is no corresponding file in `com.example.MyApp/version-2/static`,
the file is either new or changed. Unpack the new version.
* *(Optional, if support for this feature is required)* Copy any files
required from `share/factory/{etc,var}` to `{etc,var}`, overwriting files
......@@ -713,7 +715,7 @@ it from version 1 to version 2. That would look something like this:
matches what is in version 1's `share/factory/{etc,var}` but does not
match version 2's `share/factory/{etc,var}`
A simpler procedure would be to create the `app-com.example.MyApp-2`
A simpler procedure would be to create the `com.example.MyApp/version-2/static`
subvolume as empty, and then unpack all of the static files from the
new version. However, that procedure would not provide de-duplication
between consecutive versions if a file has not changed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment