)
-def have_cache(config: Config, check_uid: bool = True) -> bool:
+def have_cache(config: Config) -> bool:
if not config.incremental or config.base_trees or config.overlay:
return False
logging.debug(f"{final} does not exist, not reusing cached images")
return False
- if check_uid and (uid := final.stat().st_uid) != os.getuid():
+ if config.image != "tools" and (uid := final.stat().st_uid) != os.getuid():
logging.debug(
f"{final} uid ({uid}) does not match user uid ({os.getuid()}), not reusing cached images"
)
tools
and (
not (tools.output_dir_or_cwd() / tools.output).exists()
- or (tools.incremental and not have_cache(tools, check_uid=False))
+ or (tools.incremental and not have_cache(tools))
)
and (args.verb != Verb.build or last.output_format == OutputFormat.none)
and not args.force
# If we're doing an incremental build and the cache is not out of date, don't clean up the
# tools tree so that we can reuse the previous one.
if tools and (
- not tools.incremental
- or ((args.verb == Verb.build or args.force > 0) and not have_cache(tools, check_uid=False))
+ not tools.incremental or ((args.verb == Verb.build or args.force > 0) and not have_cache(tools))
):
if tools.incremental == Incremental.strict:
die(