aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2016-11-15 21:54:47 -0800
committerRobert Yang <liezhi.yang@windriver.com>2016-12-21 06:18:56 +0000
commit60659ebc25824ef806750aea16c822c3995974eb (patch)
treecc8456a5ce2030da9c7a9593b30397f62a4211ca
parent4ca9366fb9e8313ea9bb22257a860064afd68cf8 (diff)
downloadopenembedded-core-contrib-60659ebc25824ef806750aea16c822c3995974eb.tar.gz
openembedded-core-contrib-60659ebc25824ef806750aea16c822c3995974eb.tar.bz2
openembedded-core-contrib-60659ebc25824ef806750aea16c822c3995974eb.zip
oe-publish-sdk: make cmd easier to read
The command was too long to read and maintain. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
-rwxr-xr-xscripts/oe-publish-sdk19
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk
index 4fe8974dee1..d95c623b2c9 100755
--- a/scripts/oe-publish-sdk
+++ b/scripts/oe-publish-sdk
@@ -113,10 +113,25 @@ def publish(args):
return ret
# Setting up the git repo
+ cmd_common = "if [ ! -e .git ]; then"
+ cmd_common += " git init .;"
+ cmd_common += " mv .git/hooks/post-update.sample .git/hooks/post-update;"
+ cmd_common += " echo '*.pyc\n*.pyo' > .gitignore;"
+ cmd_common += "fi;"
+ cmd_common += "git add -A .;"
+ cmd_common += "git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m 'init repo' || true;"
if not is_remote:
- cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo "*.pyc\n*.pyo" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true; git update-server-info' % (destination, destination)
+ cmd = "set -e;"
+ cmd += "mkdir -p %s/layers;" % destination
+ cmd += "cd %s/layers;" % destination
+ cmd += cmd_common
+ cmd += "git update-server-info"
else:
- cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update; echo '*.pyc\n*.pyo' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true; git update-server-info'" % (host, destdir, destdir)
+ cmd = "ssh %s 'set -e;" % host
+ cmd += "mkdir -p %s/layers;" % destdir
+ cmd += "cd %s/layers;" % destdir
+ cmd += cmd_common
+ cmd += "git update-server-info'"
ret = subprocess.call(cmd, shell=True)
if ret == 0:
logger.info('SDK published successfully')