Skip to content

Commit 9916dc3

Browse files
committed
cmd-import: use cp-reflink when copying ociarchive
This will make the copy super lightweight if it's on a filesystem that supports reflinks.
1 parent c0c9824 commit 9916dc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd-import

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def generate_oci_archive(args, tmpd):
9393

9494
if args.srcimg.startswith('oci-archive:'):
9595
print(f"Copying {args.srcimg.partition(':')[2]} to {tmpf}")
96-
shutil.copy(args.srcimg.partition(':')[2], tmpf)
96+
subprocess.check_call(['cp-reflink', args.srcimg.partition(':')[2], tmpf])
9797
else:
9898
extra_args = []
9999
# in the containers-storage case, there's no digest to preserve

0 commit comments

Comments
 (0)