Keep the signed image repository readable by the vpac downloader
@@ -22,7 +22,12 @@ def write_directory(root, relative):
2222 directory = root / relative
2323 if directory.resolve() != directory:
2424 raise ValueError(f"unexpected guest symlink at {relative}")
25- directory.mkdir(parents=True, exist_ok=True)
25+ current = root
26+ for name in Path(relative).parts:
27+ current /= name
28+ if not current.is_dir():
29+ current.mkdir()
30+ current.chmod(0o755)
2631 return directory
2732
2833
@@ -41,6 +46,7 @@ def snapshot(repo, dest, ring, arch, gpg_home):
4146 if target.exists():
4247 raise ValueError(f"duplicate repository filename: {name}")
4348 shutil.copyfile(source, target)
49+ target.chmod(0o644)
4450 return target
4551
4652 for index in ("vinix.db", "vinix.files"):
@@ -97,10 +103,12 @@ def stage(args):
97103 db = write_directory(root, "var/lib/vpac")
98104 if any(db.iterdir()):
99105 raise ValueError("package database directory is already populated")
100- shutil.copytree(records, db / "local")
106+ local = db / "local"
107+ shutil.copytree(records, local)
108+ local.chmod(0o755)
101109 sync = write_directory(root, "var/lib/vpac/sync")
102110 for name in ("vinix.db", "vinix.db.sig"):
103- shutil.copyfile(package_dir / name, sync / name)
111+ shutil.copy(package_dir / name, sync / name)
104112 root.rename(output / "root")
105113 print(audit, end="")
106114 print(f"staged {len(indexed)} signed seed packages and the installed database")