From: Adrian Freihofer Date: Mon, 7 Sep 2020 16:43:13 +0000 (+0200) Subject: oe-publish-sdk: fix layers init via ssh X-Git-Tag: 2020-10-gatesgarth~277 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=5cc1ae332eb6b05d83802c8d64ab2767c7079412;p=openembedded-core.git oe-publish-sdk: fix layers init via ssh Escaping does not work in my use case. It must be escaped for python, ssh and shell as well as for different versions of echo. Let's try it a little less elegant, but hopefully more reliable. Signed-off-by: Adrian Freihofer Signed-off-by: Richard Purdie --- diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk index 4b70f436b1..19a5d69864 100755 --- a/scripts/oe-publish-sdk +++ b/scripts/oe-publish-sdk @@ -106,7 +106,7 @@ def publish(args): if not is_remote: cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo "*.pyc\n*.pyo\npyshtables.py" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true' % (destination, destination) else: - cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo '*.pyc\n*.pyo\npyshtables.py' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true'" % (host, destdir, destdir) + cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo '*.pyc' > .gitignore; echo '*.pyo' >> .gitignore; echo 'pyshtables.py' >> .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true'" % (host, destdir, destdir) ret = subprocess.call(cmd, shell=True) if ret == 0: logger.info('SDK published successfully')