All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Cc: patrick.ohly@gmx.de, saul.wold@intel.com
Subject: [PATCH 2/2] scripts: Add yocto-compat-layer-wrapper
Date: Wed, 29 Mar 2017 15:44:10 -0600	[thread overview]
Message-ID: <1490823850-20782-2-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1490823850-20782-1-git-send-email-anibal.limon@linux.intel.com>

This script will be used to create it's own environment to make
runs of yocto-compat-layer.py againts layers isolated.

It clones the oe-core and bitbake repository in a temporary folder
and then calls yocto-compat-layer.py with specified LAYERS_DIRs to
test.

Example:

$ ./scripts/yocto-compat-layer-wrapper LAYER_DIR LAYER_DIR_N

[YOCTO #11164]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 scripts/yocto-compat-layer-wrapper | 68 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100755 scripts/yocto-compat-layer-wrapper

diff --git a/scripts/yocto-compat-layer-wrapper b/scripts/yocto-compat-layer-wrapper
new file mode 100755
index 0000000..6776f64
--- /dev/null
+++ b/scripts/yocto-compat-layer-wrapper
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+# Yocto Project compatibility layer tool wrapper
+#
+# Copyright (C) 2017 Intel Corporation
+# Released under the MIT license (see COPYING.MIT)
+
+oe_core_repo="git://git.openembedded.org/openembedded-core"
+bitbake_repo="git://git.openembedded.org/bitbake"
+
+show_help() {
+	printf "Usage: %s [-o output_log] [-h] LAYER_DIR ...\n" $0
+}
+
+output_log=''
+layer_dirs=""
+while getopts o:h arg
+do
+	case $arg in
+	o)
+		output_log=$(realpath "$OPTARG");;
+	h)
+		show_help
+		exit 0;;
+	?)
+		show_help
+		exit 2;;
+	esac
+done
+shift $(($OPTIND - 1))
+if [[ -z $* ]]; then
+	show_help
+	exit 1
+else
+	for layer_dir in $(realpath $*); do
+		layer_dirs="$layer_dirs $layer_dir"
+	done
+fi
+
+env_dir=$(mktemp -d -t yocto-compat-XXXX)
+echo "The environment will be setup at $env_dir"
+echo ""
+
+echo "Cloning oe-core..."
+git clone $oe_core_repo $env_dir
+if [ $? -ne 0 ]; then
+	echo "Failed to clone oe-core repository"
+	exit 1
+fi
+
+echo "Cloning bitbake..."
+git clone $bitbake_repo $env_dir/bitbake
+if [ $? -ne 0 ]; then
+	echo "Failed to clone bitbake repository"
+	exit 1
+fi
+
+echo ""
+echo "Changing directory to $env_dir"
+cd $env_dir
+source oe-init-build-env
+if [[ -z $output_log ]]; then
+	echo "Running yocto-compat-layer.py $layer_dirs"
+	yocto-compat-layer.py $layer_dirs
+else
+	echo "Running yocto-compat-layer.py -o $output_log $layer_dirs"
+	yocto-compat-layer.py -o $output_log $layer_dirs
+fi
-- 
2.1.4



  reply	other threads:[~2017-03-29 21:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-29 21:44 [PATCH 1/2] scripts/lib/compatlayer: detect_layers always use realpath's Aníbal Limón
2017-03-29 21:44 ` Aníbal Limón [this message]
     [not found]   ` <1490853745.6396.439.camel@gmx.de>
     [not found]     ` <58DD2C5B.8010704@linux.intel.com>
2017-03-30 16:05       ` [PATCH 2/2] scripts: Add yocto-compat-layer-wrapper Aníbal Limón
2017-03-30 16:13       ` Patrick Ohly
2017-03-30 16:43         ` Aníbal Limón
2017-03-30 16:58           ` Joshua Lock
2017-03-30 17:07             ` Aníbal Limón

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490823850-20782-2-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=patrick.ohly@gmx.de \
    --cc=saul.wold@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.