From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 11C6F71978 for ; Thu, 17 Nov 2016 06:19:38 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id uAH6Jer7021292 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL) for ; Wed, 16 Nov 2016 22:19:40 -0800 (PST) Received: from ala-blade47.wrs.com (147.11.105.67) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server id 14.3.294.0; Wed, 16 Nov 2016 22:19:39 -0800 From: Robert Yang To: Date: Wed, 16 Nov 2016 22:19:32 -0800 Message-ID: X-Mailer: git-send-email 2.10.2 In-Reply-To: References: MIME-Version: 1.0 Subject: [PATCH 3/8] oe-publish-sdk: make cmd easier to read X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 06:19:39 -0000 Content-Type: text/plain The command was too long to read and maintain. Signed-off-by: Robert Yang --- scripts/oe-publish-sdk | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk index 4fe8974..d95c623 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') -- 2.10.2