me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Keep the signed image repository readable by the vpac downloader

diviocity committed 5 days ago · fa26ff765d4c92538bf0a0a58e8cb52f2074191c View patch
Unverified signature 1 files changed +11 -3
tools/stage-image.py +11 -3

@@ -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")