Skip to content

Commit 1efcfed

Browse files
douglas-raillard-armmarcbonnici
authored andcommitted
target: Copy symlinks as files when pulling
When pulling a file from the target, copy all paths as files and follow symlinks if necessary. That fixes issues related to chmod not working on symlinks and generally allows getting any path. If we want to one day preserve symlinks in some capacities, we can always add an option to Target.pull() to do so.
1 parent df1b5ef commit 1efcfed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

devlib/target.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ def do_pull(sources, dest):
899899
for sources, dest in mapping.items():
900900
for source in sources:
901901
async with self._xfer_cache_path(source) as device_tempfile:
902-
await self.execute.asyn("cp -r -- {} {}".format(quote(source), quote(device_tempfile)), as_root=as_root)
902+
await self.execute.asyn("cp -rL -- {} {}".format(quote(source), quote(device_tempfile)), as_root=as_root)
903903
await self.execute.asyn("{} chmod 0644 -- {}".format(self.busybox, quote(device_tempfile)), as_root=as_root)
904904
do_pull([device_tempfile], dest)
905905
else:

0 commit comments

Comments
 (0)