From b5ffa328d5fb8719a31464665d333bbd41705c6a Mon Sep 17 00:00:00 2001 From: Aleksander Mistewicz Date: Wed, 13 Jan 2016 17:19:12 +0100 Subject: [PATCH] Add gen_list() to tct/build/build.sh Change-Id: Ied16c8acd61af35689fa66f3fc1b2818ce43dd83 Signed-off-by: Aleksander Mistewicz --- tct/build/build.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 tct/build/build.sh diff --git a/tct/build/build.sh b/tct/build/build.sh new file mode 100755 index 0000000..295eec3 --- /dev/null +++ b/tct/build/build.sh @@ -0,0 +1,41 @@ +# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This script generates list of all TCT available in specified repository. +# +# Syntax is: +# gen_list $NATIVE_TCT_REPO $NATIVE_TCT_LIST_PATH +# +# Author: Aleksander Mistewicz + +gen_list() { + NATIVE_TCT_REPO="$1" + NATIVE_TCT_LIST_PATH="$2" + + test -n "${NATIVE_TCT_REPO}" || die "Missing argument: native_tct_repo" + + cd "${NATIVE_TCT_REPO}/src" + + test -n "${NATIVE_TCT_LIST_PATH}" || die "Missing argument: native_tct_list_path" + rm "${NATIVE_TCT_LIST_PATH}" + for DIR in $(find . -maxdepth 2 -type d); + do + echo $(dirname "${DIR}") $(basename "${DIR}") >> "${NATIVE_TCT_LIST_PATH}" + done + + #in-place removal of current directory from paths + sed -e '/^\. /d' -e 's/\.\///' -i "${NATIVE_TCT_LIST_PATH}" + + cd "${OLDPWD}" +} -- 2.7.4