From patchwork Wed May 25 23:53:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [V2] oe-setup-builddir: remove unreachable code, update comments Date: Wed, 25 May 2011 23:53:21 -0000 From: Darren Hart X-Patchwork-Id: 4791 Message-Id: <221f6e6c12374764f75f4aae16086bfe25d9a477.1306367601.git.darren@dvhart.com> To: openembedded-core@lists.openembedded.org Cc: Darren Hart From: Darren Hart The script forces TEMPLATECONF to be non-empty with: TEMPLATECONF=${TEMPLATECONF:-meta/conf} This ensures that OELOCALCONF and OELAYERSCONF will be non-empty as well. Remove all the empty checks for these variables. While this patch doesn't change behavior, all this code was unreachable, it does bring up a point of intent. It appears as though OE*CONF was intended to be configurable by the user via the environment, the code only allows for the user to set TEMPLATECONF. This means that in order to use something other than the sample default configs, the user must specify both a local.conf.sample and a bblayers.conf.sample in their TEMPLATECONF directory. Update the comments to correctly identify the required files as local.conf.sample and bblayers.conf.sample. Signed-off-by: Darren Hart --- scripts/oe-setup-builddir | 32 +++++++++++++------------------- 1 files changed, 13 insertions(+), 19 deletions(-) diff --git a/scripts/oe-setup-builddir b/scripts/oe-setup-builddir index 87e7710..4298a1c 100755 --- a/scripts/oe-setup-builddir +++ b/scripts/oe-setup-builddir @@ -37,29 +37,26 @@ fi cd "$BUILDDIR" -TEMPLATECONF=${TEMPLATECONF:-meta/conf} # -# $TEMPLATECONF can point to a directory for the template local.conf & bblayers.conf +# $TEMPLATECONF can point to a directory for the template local.conf & +# bblayers.conf. If the user hasn't specified a path, default to +# meta/conf. # -if [ "x" != "x$TEMPLATECONF" ]; then +TEMPLATECONF=${TEMPLATECONF:-meta/conf} +if ! (test -d "$TEMPLATECONF"); then + # Allow TEMPLATECONF=meta-xyz/conf as a shortcut + if [ -d "$OEROOT/$TEMPLATECONF" ]; then + TEMPLATECONF="$OEROOT/$TEMPLATECONF" + fi if ! (test -d "$TEMPLATECONF"); then - # Allow TEMPLATECONF=meta-xyz/conf as a shortcut - if [ -d "$OEROOT/$TEMPLATECONF" ]; then - TEMPLATECONF="$OEROOT/$TEMPLATECONF" - fi - if ! (test -d "$TEMPLATECONF"); then - echo >&2 "Error: '$TEMPLATECONF' must be a directory containing local.conf & bblayers.conf" - return - fi + echo >&2 "Error: '$TEMPLATECONF' must be a directory containing local.conf.sample & bblayers.conf.sample" + return fi - OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample" - OECORELOCALCONF="$TEMPLATECONF/local.conf.sample" fi +OECORELAYERCONF="$TEMPLATECONF/bblayers.conf.sample" +OECORELOCALCONF="$TEMPLATECONF/local.conf.sample" -if [ "x" = "x$OECORELOCALCONF" ]; then - OECORELOCALCONF="$OEROOT/meta/conf/local.conf.sample" -fi if ! (test -r "$BUILDDIR/conf/local.conf"); then cat <