All of lore.kernel.org
 help / color / mirror / Atom feed
* [Fuego] [PATCH] functions: add is_abs_path
@ 2018-10-31  1:42 Daniel Sangorrin
  2018-10-31  5:08 ` Tim.Bird
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Sangorrin @ 2018-10-31  1:42 UTC (permalink / raw)
  To: fuego

this function checks if a path is absolute or relative

Signed-off-by: Daniel Sangorrin <daniel.sangorrin@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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Fuego] [PATCH] functions: add is_abs_path
  2018-10-31  1:42 [Fuego] [PATCH] functions: add is_abs_path Daniel Sangorrin
@ 2018-10-31  5:08 ` Tim.Bird
  2018-10-31  7:23   ` Daniel Sangorrin
  0 siblings, 1 reply; 3+ messages in thread
From: Tim.Bird @ 2018-10-31  5:08 UTC (permalink / raw)
  To: daniel.sangorrin, fuego

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@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@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/fuego

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Fuego] [PATCH] functions: add is_abs_path
  2018-10-31  5:08 ` Tim.Bird
@ 2018-10-31  7:23   ` Daniel Sangorrin
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Sangorrin @ 2018-10-31  7:23 UTC (permalink / raw)
  To: Tim.Bird, fuego

OK, Done.

> -----Original Message-----
> From: Tim.Bird@sony.com <Tim.Bird@sony.com>
> Sent: Wednesday, October 31, 2018 2:09 PM
> To: daniel.sangorrin@toshiba.co.jp; fuego@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@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@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/fuego


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-31  7:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31  1:42 [Fuego] [PATCH] functions: add is_abs_path Daniel Sangorrin
2018-10-31  5:08 ` Tim.Bird
2018-10-31  7:23   ` Daniel Sangorrin

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.