Skip to content

Commit 974a77f

Browse files
committed
move cache copy op to repository
Signed-off-by: george.ridal <george.ridal@findesign.com.au>
1 parent 9afb325 commit 974a77f

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

src/rez/package_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def _while_copying():
405405
th.start()
406406

407407
try:
408-
shutil.copytree(variant_root, rootpath)
408+
variant.repository.cache_variant(variant, rootpath)
409409
finally:
410410
still_copying = False
411411

src/rez/package_repository.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import threading
1212
import os.path
1313
import time
14+
import shutil
1415

1516

1617
def get_package_repository_types():
@@ -510,6 +511,12 @@ def _uid(self):
510511
"""
511512
return (self.name(), self.location)
512513

514+
def cache_variant(self, variant, location):
515+
"""
516+
Copy a variant from repository to cache location
517+
"""
518+
shutil.copytree(variant.root, location)
519+
513520

514521
class PackageRepositoryManager(object):
515522
"""Package repository manager.

0 commit comments

Comments
 (0)