From 1efcfed63f80a9318f7a1de16ec120a2a1acdcd8 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 20 Nov 2024 16:41:34 +0000 Subject: [PATCH] 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. --- devlib/target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 44e7fc6..05d03be 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -899,7 +899,7 @@ class Target(object): for sources, dest in mapping.items(): for source in sources: async with self._xfer_cache_path(source) as device_tempfile: - await self.execute.asyn("cp -r -- {} {}".format(quote(source), quote(device_tempfile)), as_root=as_root) + await self.execute.asyn("cp -rL -- {} {}".format(quote(source), quote(device_tempfile)), as_root=as_root) await self.execute.asyn("{} chmod 0644 -- {}".format(self.busybox, quote(device_tempfile)), as_root=as_root) do_pull([device_tempfile], dest) else: