[oe-commits] [openembedded-core] 50/122: sshcontrol.py: in copy_to() always use scp

git at git.openembedded.org git at git.openembedded.org
Mon Dec 4 17:25:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch rocko
in repository openembedded-core.

commit a9d446d9c42a67109ae87a156ae43dcbb0f56e1e
Author: Erik Botö <erik.boto at pelagicore.com>
AuthorDate: Mon Nov 6 10:13:06 2017 -0800

    sshcontrol.py: in copy_to() always use scp
    
    The current implementation is broken when the localpath is a link.
    Then only a symlink would be created on the target, instead of copying
    the actual file.
    
    [YOCTO #11524]
    
    Signed-off-by: Erik Botö <erik.boto at pelagicore.com>
    Signed-off-by: Stephano Cetola <stephano.cetola at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
    Signed-off-by: Armin Kuster <akuster at mvista.com>
---
 meta/lib/oeqa/utils/sshcontrol.py | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
index 05d6502..d292893 100644
--- a/meta/lib/oeqa/utils/sshcontrol.py
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -150,12 +150,9 @@ class SSHControl(object):
 
     def copy_to(self, localpath, remotepath):
         if os.path.islink(localpath):
-            link = os.readlink(localpath)
-            dst_dir, dst_base = os.path.split(remotepath)
-            return self.run("cd %s; ln -s %s %s" % (dst_dir, link, dst_base))
-        else:
-            command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
-            return self._internal_run(command, ignore_status=False)
+            localpath = os.path.dirname(localpath) + "/" + os.readlink(localpath)
+        command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
+        return self._internal_run(command, ignore_status=False)
 
     def copy_from(self, remotepath, localpath):
         command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list