Skip to content

Commit

Permalink
Update src/rez/cli/pkg-cache.py
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Enriquez <alenrqz21@gmail.com>

Co-authored-by: Jean-Christophe Morin <38703886+JeanChristopheMorinPerso@users.noreply.github.com>
Signed-off-by: Jose Enriquez <1145623+Pixel-Minions@users.noreply.github.com>
  • Loading branch information
Pixel-Minions and JeanChristopheMorinPerso authored Oct 15, 2024
1 parent b49ef51 commit 8184494
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/rez/cli/pkg-cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ def add_variant(pkgcache, uri, opts):
print("No such variant: %s" % uri, file=sys.stderr)
sys.exit(1)

if opts.pkg_cache_mode is not None:
cache_mode = True if opts.pkg_cache_mode == "sync" else False
destpath, status = pkgcache.add_variant(
variant, force=opts.force,
wait_for_copying=cache_mode
)
# If no mode is specified, use the default behavior.
if opts.pkg_cache_mode == "async":
cache_mode = True
elif opts.pkg_cache_mode == "sync":
cache_mode = False
else:
destpath, status = pkgcache.add_variant(variant, force=opts.force)
cache_mode = not config.package_cache_async

destpath, status = pkgcache.add_variant(
variant, force=opts.force,
wait_for_copying=cache_mode
)

if status == PackageCache.VARIANT_FOUND:
print_info("Already exists: %s", destpath)
Expand Down

0 comments on commit 8184494

Please sign in to comment.