[Fuego] [PATCH] functions: add is_abs_path

Daniel Sangorrin daniel.sangorrin at toshiba.co.jp
Wed Oct 31 07:23:11 UTC 2018


OK, Done.

> -----Original Message-----
> From: Tim.Bird at sony.com <Tim.Bird at sony.com>
> Sent: Wednesday, October 31, 2018 2:09 PM
> To: daniel.sangorrin at toshiba.co.jp; fuego at lists.linuxfoundation.org
> Subject: RE: [Fuego] [PATCH] functions: add is_abs_path
> 
> Applied.  Can you please add the page:
> function_is_abs_path to the fuegotest wiki?
> 
> Also, please add a link to the new page, on
> http://fuegotest.org/wiki/Test_Script_APIs
> 
> See that page for examples of the formatting used
> for the API function definitions.
> 
> Thanks,
>  -- Tim
> 
> 
> > -----Original Message-----
> > From: Daniel Sangorrin on Tuesday, October 30, 2018 6:42 PM
> >
> > this function checks if a path is absolute or relative
> >
> > Signed-off-by: Daniel Sangorrin <daniel.sangorrin at toshiba.co.jp>
> > ---
> >  engine/scripts/functions.sh | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/engine/scripts/functions.sh b/engine/scripts/functions.sh
> > index a2df8fc..241ba0d 100755
> > --- a/engine/scripts/functions.sh
> > +++ b/engine/scripts/functions.sh
> > @@ -1003,3 +1003,14 @@ function assert_has_program {
> >     is_on_target_path $1 ${progVar}
> >     assert_define ${progVar} "Missing '$1' program on target board"
> >  }
> > +
> > +# check if the path is an absolute path or a relative path
> > +# $1 - the path to check
> > +function is_abs_path {
> > +    if [ ${1:0:1} == "/" ]; then
> > +        # absolute path because it starts with "/"
> > +        return 0
> > +    else
> > +        return 1
> > +    fi
> > +}
> > --
> > 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