* [PATCH] scripts: Avoid adding duplicate entries to PATH
@ 2019-08-21 17:43 vijaikumar.kanagarajan
2019-08-21 17:49 ` Jan Kiszka
0 siblings, 1 reply; 7+ messages in thread
From: vijaikumar.kanagarajan @ 2019-08-21 17:43 UTC (permalink / raw)
To: isar-users, henning.schild, claudius.heine.ext; +Cc: jan.kiszka, Vijai Kumar K
From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
If the setup script is run multiple times in the same shell session,
PATH variable gets overpopulated with duplicate entries. Remove any
existing entries before adding.
Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
scripts/isar-buildenv-internal | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
index 2186e40..8b941a2 100755
--- a/scripts/isar-buildenv-internal
+++ b/scripts/isar-buildenv-internal
@@ -60,7 +60,14 @@ unset BDIR
export BUILDDIR
-PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
+for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
+ # Remove any existences of $newpath from $PATH
+ PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
+
+ # Add $newpath to $PATH
+ PATH="$newpath:$PATH"
+done
+
export PATH
BBPATH="${BUILDDIR}"
--
2.17.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scripts: Avoid adding duplicate entries to PATH
2019-08-21 17:43 [PATCH] scripts: Avoid adding duplicate entries to PATH vijaikumar.kanagarajan
@ 2019-08-21 17:49 ` Jan Kiszka
2019-08-21 18:44 ` vijai kumar
2019-08-21 18:48 ` [PATCH v2] " vijaikumar.kanagarajan
0 siblings, 2 replies; 7+ messages in thread
From: Jan Kiszka @ 2019-08-21 17:49 UTC (permalink / raw)
To: vijaikumar.kanagarajan, isar-users, henning.schild, claudius.heine.ext
Cc: Vijai Kumar K
On 21.08.19 19:43, vijaikumar.kanagarajan@gmail.com wrote:
> From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
>
> If the setup script is run multiple times in the same shell session,
> PATH variable gets overpopulated with duplicate entries. Remove any
> existing entries before adding.
>
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> scripts/isar-buildenv-internal | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
> index 2186e40..8b941a2 100755
> --- a/scripts/isar-buildenv-internal
> +++ b/scripts/isar-buildenv-internal
> @@ -60,7 +60,14 @@ unset BDIR
>
> export BUILDDIR
>
> -PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
> +for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
> + # Remove any existences of $newpath from $PATH
> + PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
> +
> + # Add $newpath to $PATH
> + PATH="$newpath:$PATH"
> +done
> +
> export PATH
>
> BBPATH="${BUILDDIR}"
>
That's taken from OE - makes sense. OE does "unset newpath" afterwards.
Is there more relevant stuff that we may lack?
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] scripts: Avoid adding duplicate entries to PATH
2019-08-21 17:49 ` Jan Kiszka
@ 2019-08-21 18:44 ` vijai kumar
2019-08-21 18:48 ` [PATCH v2] " vijaikumar.kanagarajan
1 sibling, 0 replies; 7+ messages in thread
From: vijai kumar @ 2019-08-21 18:44 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 1701 bytes --]
On Wednesday, August 21, 2019 at 11:19:22 PM UTC+5:30, Jan Kiszka wrote:
>
> On 21.08.19 19:43, vijaikumar...@gmail.com <javascript:> wrote:
> > From: Vijai Kumar K <Vijaikumar_...@mentor.com <javascript:>>
> >
> > If the setup script is run multiple times in the same shell session,
> > PATH variable gets overpopulated with duplicate entries. Remove any
> > existing entries before adding.
> >
> > Signed-off-by: Vijai Kumar K <Vijaikumar_...@mentor.com <javascript:>>
> > ---
> > scripts/isar-buildenv-internal | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/scripts/isar-buildenv-internal
> b/scripts/isar-buildenv-internal
> > index 2186e40..8b941a2 100755
> > --- a/scripts/isar-buildenv-internal
> > +++ b/scripts/isar-buildenv-internal
> > @@ -60,7 +60,14 @@ unset BDIR
> >
> > export BUILDDIR
> >
> > -PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
> > +for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
> > + # Remove any existences of $newpath from $PATH
> > + PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
> > +
> > + # Add $newpath to $PATH
> > + PATH="$newpath:$PATH"
> > +done
> > +
> > export PATH
> >
> > BBPATH="${BUILDDIR}"
> >
>
> That's taken from OE - makes sense. OE does "unset newpath" afterwards.
>
Yes. Right from OE. Ah, it does. Will add in v2.
>
> Is there more relevant stuff that we may lack?
For now, this is it. Just came across this issue. Found out that oe has
handled it, so brought in the same.
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
>
[-- Attachment #1.2: Type: text/html, Size: 3093 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] scripts: Avoid adding duplicate entries to PATH
2019-08-21 17:49 ` Jan Kiszka
2019-08-21 18:44 ` vijai kumar
@ 2019-08-21 18:48 ` vijaikumar.kanagarajan
2019-08-21 19:00 ` Jan Kiszka
2019-09-09 13:59 ` Baurzhan Ismagulov
1 sibling, 2 replies; 7+ messages in thread
From: vijaikumar.kanagarajan @ 2019-08-21 18:48 UTC (permalink / raw)
To: isar-users, henning.schild, claudius.heine.ext; +Cc: jan.kiszka, Vijai Kumar K
From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
If the setup script is run multiple times in the same shell session,
PATH variable gets overpopulated with duplicate entries. Remove any
existing entries before adding.
Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
---
Changes in v2:
- Unset newpath
scripts/isar-buildenv-internal | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
index 2186e40..72a91ab 100755
--- a/scripts/isar-buildenv-internal
+++ b/scripts/isar-buildenv-internal
@@ -60,7 +60,15 @@ unset BDIR
export BUILDDIR
-PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
+for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
+ # Remove any existences of $newpath from $PATH
+ PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
+
+ # Add $newpath to $PATH
+ PATH="$newpath:$PATH"
+done
+unset newpath
+
export PATH
BBPATH="${BUILDDIR}"
--
2.17.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] scripts: Avoid adding duplicate entries to PATH
2019-08-21 18:48 ` [PATCH v2] " vijaikumar.kanagarajan
@ 2019-08-21 19:00 ` Jan Kiszka
2019-09-03 7:56 ` Vijai Kumar K
2019-09-09 13:59 ` Baurzhan Ismagulov
1 sibling, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2019-08-21 19:00 UTC (permalink / raw)
To: vijaikumar.kanagarajan, isar-users, henning.schild, claudius.heine.ext
Cc: Vijai Kumar K
On 21.08.19 20:48, vijaikumar.kanagarajan@gmail.com wrote:
> From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
>
> If the setup script is run multiple times in the same shell session,
> PATH variable gets overpopulated with duplicate entries. Remove any
> existing entries before adding.
>
> Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> ---
> Changes in v2:
> - Unset newpath
>
> scripts/isar-buildenv-internal | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
> index 2186e40..72a91ab 100755
> --- a/scripts/isar-buildenv-internal
> +++ b/scripts/isar-buildenv-internal
> @@ -60,7 +60,15 @@ unset BDIR
>
> export BUILDDIR
>
> -PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
> +for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
> + # Remove any existences of $newpath from $PATH
> + PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
> +
> + # Add $newpath to $PATH
> + PATH="$newpath:$PATH"
> +done
> +unset newpath
> +
> export PATH
>
> BBPATH="${BUILDDIR}"
>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] scripts: Avoid adding duplicate entries to PATH
2019-08-21 19:00 ` Jan Kiszka
@ 2019-09-03 7:56 ` Vijai Kumar K
0 siblings, 0 replies; 7+ messages in thread
From: Vijai Kumar K @ 2019-09-03 7:56 UTC (permalink / raw)
To: Jan Kiszka, ibr, claudius.heine.ext
Cc: vijaikumar.kanagarajan, isar-users, henning.schild
On Wed, Aug 21, 2019 at 09:00:28PM +0200, Jan Kiszka wrote:
> On 21.08.19 20:48, vijaikumar.kanagarajan@gmail.com wrote:
> > From: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> >
> > If the setup script is run multiple times in the same shell session,
> > PATH variable gets overpopulated with duplicate entries. Remove any
> > existing entries before adding.
> >
> > Signed-off-by: Vijai Kumar K <Vijaikumar_Kanagarajan@mentor.com>
> > ---
> > Changes in v2:
> > - Unset newpath
> >
> > scripts/isar-buildenv-internal | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git a/scripts/isar-buildenv-internal b/scripts/isar-buildenv-internal
> > index 2186e40..72a91ab 100755
> > --- a/scripts/isar-buildenv-internal
> > +++ b/scripts/isar-buildenv-internal
> > @@ -60,7 +60,15 @@ unset BDIR
> > export BUILDDIR
> > -PATH=$ISARROOT/bitbake/bin:$ISARROOT/scripts:$PATH
> > +for newpath in "$ISARROOT/bitbake/bin" "$ISARROOT/scripts"; do
> > + # Remove any existences of $newpath from $PATH
> > + PATH=$(echo $PATH | sed -re "s#(^|:)$newpath(:|$)#\2#g;s#^:##")
> > +
> > + # Add $newpath to $PATH
> > + PATH="$newpath:$PATH"
> > +done
> > +unset newpath
> > +
> > export PATH
> > BBPATH="${BUILDDIR}"
> >
>
> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
>
> Thanks,
> Jan
Can this be merged??
Thanks,
Vijai Kumar K
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE
> Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] scripts: Avoid adding duplicate entries to PATH
2019-08-21 18:48 ` [PATCH v2] " vijaikumar.kanagarajan
2019-08-21 19:00 ` Jan Kiszka
@ 2019-09-09 13:59 ` Baurzhan Ismagulov
1 sibling, 0 replies; 7+ messages in thread
From: Baurzhan Ismagulov @ 2019-09-09 13:59 UTC (permalink / raw)
To: isar-users
On Thu, Aug 22, 2019 at 12:18:37AM +0530, vijaikumar.kanagarajan@gmail.com wrote:
> If the setup script is run multiple times in the same shell session,
> PATH variable gets overpopulated with duplicate entries. Remove any
> existing entries before adding.
Applied to next, thanks.
With kind regards,
Baurzhan.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-09-09 13:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 17:43 [PATCH] scripts: Avoid adding duplicate entries to PATH vijaikumar.kanagarajan
2019-08-21 17:49 ` Jan Kiszka
2019-08-21 18:44 ` vijai kumar
2019-08-21 18:48 ` [PATCH v2] " vijaikumar.kanagarajan
2019-08-21 19:00 ` Jan Kiszka
2019-09-03 7:56 ` Vijai Kumar K
2019-09-09 13:59 ` Baurzhan Ismagulov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox