[Fuego] [PATCH 04/19] unpack: remove nostrip option
Bird, Timothy
Tim.Bird at sony.com
Fri May 12 22:57:45 UTC 2017
Good simplification!
-- Tim
> -----Original Message-----
> From: fuego-bounces at lists.linuxfoundation.org [mailto:fuego-
> bounces at lists.linuxfoundation.org] On Behalf Of Daniel Sangorrin
> Sent: Friday, May 12, 2017 1:20 AM
> To: fuego at lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 04/19] unpack: remove nostrip option
>
> unpack used to have a "nostrip" option so that the tarball
> would be extracted to its own folder. This was used in the past
> by ft2demos which was calling build directly.
>
> The problem is that tests are not supposed to call build directly
> and therefore we would need to add yet another environment variable
> for main.sh to pass it to build. Since most tests are fine with the
> current default options, I think that tests like ft2demos should
> unpack their own tarballs during test_build instead.
>
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> ---
> engine/scripts/functions.sh | 14 +++++---------
> 1 file changed, 5 insertions(+), 9 deletions(-)
>
> diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
> index ac19e8e..d9e0b18 100755
> --- a/engine/scripts/functions.sh
> +++ b/engine/scripts/functions.sh
> @@ -37,11 +37,7 @@ trap signal_handler SIGTERM SIGHUP SIGALRM SIGINT
> EXIT
> set -o errtrace
>
> # Unpacks $tarball_path/$tarball into current directory.
> -# $1 - optional flag; if set to "nostrip",
> -# the leading path components won't be stripped
> function unpack {
> - [ "$1" = "nostrip" ] && strip_opt= || strip_opt="--strip-components=1"
> -
> if [ ! -z ${tarball+x} ]; then
> case ${tarball/*./} in
> gz|tgz) key=z ;;
> @@ -49,14 +45,15 @@ function unpack {
> tar) key= ;;
> *) echo "Unknown $tarball file format. Not unpacking."; return;;
> esac
> - tar ${key}xf $TEST_HOME/$tarball $strip_opt
> + tar ${key}xf $TEST_HOME/$tarball --strip-components=1
> fi
>
> if [ ! -z ${gitrepo+x} ]; then
> if [ -z ${gitbranch+x} ]; then
> gitbranch="master"
> fi
> - # FIXTHIS: support commit ids (log and checkout)
> + # FIXTHIS: support commit ids (log and checkout)
> + # FIXTHIS: strip components like tarballs
> git clone --depth=1 --branch=$gitbranch $gitrepo
> fi
> }
> @@ -171,7 +168,6 @@ function build_error () {
> # process Rebuild flag, and unpack test sources if necessary.
> # Returns 0 if actual build needs to be performed; 1 - otherwise.
> # Build scripts must call this function in the beginning.
> -# $1 is passed directly to unpack().
> function pre_build {
> cd ${WORKSPACE}
> upName=`echo "${JOB_NAME^^}"| tr '.' '_'`
> @@ -193,7 +189,7 @@ function pre_build {
> fi
>
> if [ ! -e test_suite_ready ]; then
> - unpack $1
> + unpack
> return 0
> fi
> fi
> @@ -201,7 +197,7 @@ function pre_build {
> }
>
> function build {
> - pre_build $1
> + pre_build
> build_start_time=$(date +"%s.%N")
> test_build || return 1
> build_end_time=$(date +"%s.%N")
> --
> 2.7.4
>
>
> _______________________________________________
> Fuego mailing list
> Fuego at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego
More information about the Fuego
mailing list