else:
return
- mkdirp_chown_current_user(args.output_dir, skip_chown=args.no_chown)
-
def find_builddir(args: argparse.Namespace) -> None:
subdir = f"{args.distribution}~{args.release}"
else:
return
- mkdirp_chown_current_user(args.build_dir, skip_chown=args.no_chown)
-
def find_cache(args: argparse.Namespace) -> None:
subdir = f"{args.distribution}~{args.release}"
else:
return
- mkdirp_chown_current_user(args.cache_path, skip_chown=args.no_chown)
-
def require_private_file(name: str, description: str) -> None:
mode = os.stat(name).st_mode & 0o777
mkdirp_chown_current_user(config.build_dir, skip_chown=config.no_chown, mode=0o755)
+def make_cache_dir(config: MkosiConfig) -> None:
+ """Create the output directory if set and not existing yet"""
+ # TODO: mypy complains that having the same structure as above, makes the
+ # return on None unreachable code. I can't see right now, why it *should* be
+ # unreachable, so invert the structure here to be on the safe side.
+ if config.cache_path is not None:
+ mkdirp_chown_current_user(config.cache_path, skip_chown=config.no_chown, mode=0o755)
+
+
def configure_ssh(state: MkosiState, cached: bool) -> Optional[TextIO]:
if state.do_run_build_script or not state.config.ssh:
return None
def build_stuff(config: MkosiConfig) -> Manifest:
make_output_dir(config)
+ make_cache_dir(config)
workspace = setup_workspace(config)
cache = setup_package_cache(config, Path(workspace.name))