import: optionally pull .verity + .roothash.p7s data when downloading

We already had support for downlading a .nspawn and a .roothash file,
let's make the set complete, and also download .verity + roothash.p7s if
it exists, as nspawn consumes that.

Since there are now four kinds of additional resources to acquire, let's
introduce a PullFlags flags value for this instead of separate 'bool'
variables, it's just too many to always pass those around on the
function parameter list.
This commit is contained in:
Lennart Poettering
2021-01-19 18:29:59 +01:00
parent 6792cbbcf8
commit 133b34f69a
7 changed files with 262 additions and 146 deletions
+2 -2
View File
@@ -110,7 +110,7 @@ int pull_find_old_etags(
return 0;
}
int pull_make_local_copy(const char *final, const char *image_root, const char *local, bool force_local) {
int pull_make_local_copy(const char *final, const char *image_root, const char *local, PullFlags flags) {
const char *p;
int r;
@@ -122,7 +122,7 @@ int pull_make_local_copy(const char *final, const char *image_root, const char *
p = prefix_roota(image_root, local);
if (force_local)
if (FLAGS_SET(flags, PULL_FORCE))
(void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME);
r = btrfs_subvol_snapshot(final, p,