All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] populate_sdk_base: add auto-completion in setup
@ 2014-06-12 15:47 Meier, Dennis
  0 siblings, 0 replies; 10+ messages in thread
From: Meier, Dennis @ 2014-06-12 15:47 UTC (permalink / raw)
  To: yocto; +Cc: Bach, Pascal, Meier, Roger

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hello Yocto-Community,

It's really easy to add auto completion in the SDK setup scripts
with BASH's "read -e -p". I attached a short patch that does this.
Makes life very comfortable ;-).

I already asked Paul Eggleton on IRC about the change, and our only concern
is that it could break the script in other shells than BASH. However, since
the script already starts with #!/bin/bash hopefully isn't a real problem.

Any thoughts? I would love to see this in an upcoming release.

Regards,
Dennis





[-- Attachment #2: 0001-populate_sdk_base-add-auto-completion-in-setup.patch --]
[-- Type: application/octet-stream, Size: 1372 bytes --]

From 4eca8b152606594500a1dee4455e5f01aae49d95 Mon Sep 17 00:00:00 2001
From: Dennis Meier <meier.dennis@siemens.com>
Date: Thu, 12 Jun 2014 16:47:23 +0200
Subject: [PATCH] populate_sdk_base: add auto-completion in setup

It's really easy to add auto completion in the SDK setup scripts
with BASH's read -e -p. Makes life very comfortable ;-).

I already asked Paul Eggleton on IRC about the change, and our only concern
is that it could break the script in other shells than BASH. However, since
the script already starts with #!/bin/bash this shouldn't be a problem.
 
Any thoughts? I would love to see this in an upcoming release.

Regards,
Dennis

---
 meta/classes/populate_sdk_base.bbclass |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 10d04ed..a8ef60b 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -173,9 +173,8 @@ if [ $verbose = 1 ] ; then
 	set -x
 fi
 
-printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
 if [ "$target_sdk_dir" = "" ]; then
-	read target_sdk_dir
+	read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
 	[ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
 else
 	echo "$target_sdk_dir"
-- 
1.7.10.4


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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-17 14:03 ` Laurentiu Palcu
@ 2014-06-29  8:01   ` Richard Purdie
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Purdie @ 2014-06-29  8:01 UTC (permalink / raw)
  To: Laurentiu Palcu; +Cc: openembedded-core

On Tue, 2014-06-17 at 17:03 +0300, Laurentiu Palcu wrote:
> On Tue, Jun 17, 2014 at 03:16:53PM +0200, Dennis Meier wrote:
> > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
> > ---
> >  meta/classes/populate_sdk_base.bbclass |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> > index 35d837d..1182425 100644
> > --- a/meta/classes/populate_sdk_base.bbclass
> > +++ b/meta/classes/populate_sdk_base.bbclass
> > @@ -173,9 +173,8 @@ if [ $verbose = 1 ] ; then
> >  	set -x
> >  fi
> >  
> > -printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
> >  if [ "$target_sdk_dir" = "" ]; then
> > -	read target_sdk_dir
> > +	read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
> >  	[ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
> >  else
> >  	echo "$target_sdk_dir"
> Moving the above printf in the 'if' branch will make this 'echo' look
> strange when the target directory is provided with the -d option... I
> believe you can remove this 'echo' completely though. There is another
> message, later, informing the user where the SDK gets installed.

I've applied a second patch to tweak this, thanks for the review.

Richard



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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-25 16:26     ` Paul Eggleton
@ 2014-06-25 16:58       ` Otavio Salvador
  0 siblings, 0 replies; 10+ messages in thread
From: Otavio Salvador @ 2014-06-25 16:58 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: Patches and discussions about the oe-core layer

On Wed, Jun 25, 2014 at 1:26 PM, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> On Tuesday 24 June 2014 10:01:36 Meier, Dennis wrote:
>> > -----Original Message-----
>> > From: otavio.salvador@gmail.com [mailto:otavio.salvador@gmail.com] On
>> > Behalf Of Otavio Salvador
>> > Sent: Dienstag, 17. Juni 2014 16:40
>> > To: Meier, Dennis
>> > Cc: Patches and discussions about the oe-core layer
>> > Subject: Re: [OE-core] [PATCH] populate_sdk_base: add auto-completion
>> > in setup
>> >
>> > On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier
>> >
>> > <meier.dennis@siemens.com> wrote:
>> > > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
>> >
>> > I do like the idea but how portable is it?
>> >
>> > For example in my envinronment it does not work as I use zsh.
>>
>> Yeah that's what I was afraid of. We figured that the script might still be
>> invoked by bash because it starts with "#!/bin/bash" and thus it might
>> work, but if you tested it and it didn't work for you I think it doesn't
>> make sense to apply this patch.
>
> Well, it depends - Otavio, when you say "it does not work" did you test it?
> #!/bin/bash should ensure bash is actually used.

Having the shebang should be fine. I tried it byhand to check if it
was compatible.

So I am fine with the patch.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-24 10:01   ` Meier, Dennis
@ 2014-06-25 16:26     ` Paul Eggleton
  2014-06-25 16:58       ` Otavio Salvador
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Eggleton @ 2014-06-25 16:26 UTC (permalink / raw)
  To: Meier, Dennis, Otavio Salvador; +Cc: openembedded-core

On Tuesday 24 June 2014 10:01:36 Meier, Dennis wrote:
> > -----Original Message-----
> > From: otavio.salvador@gmail.com [mailto:otavio.salvador@gmail.com] On
> > Behalf Of Otavio Salvador
> > Sent: Dienstag, 17. Juni 2014 16:40
> > To: Meier, Dennis
> > Cc: Patches and discussions about the oe-core layer
> > Subject: Re: [OE-core] [PATCH] populate_sdk_base: add auto-completion
> > in setup
> > 
> > On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier
> > 
> > <meier.dennis@siemens.com> wrote:
> > > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
> > 
> > I do like the idea but how portable is it?
> > 
> > For example in my envinronment it does not work as I use zsh.
> 
> Yeah that's what I was afraid of. We figured that the script might still be
> invoked by bash because it starts with "#!/bin/bash" and thus it might
> work, but if you tested it and it didn't work for you I think it doesn't
> make sense to apply this patch.

Well, it depends - Otavio, when you say "it does not work" did you test it? 
#!/bin/bash should ensure bash is actually used.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-17 14:39 ` Otavio Salvador
  2014-06-18 10:15   ` Richard Purdie
@ 2014-06-24 10:01   ` Meier, Dennis
  2014-06-25 16:26     ` Paul Eggleton
  1 sibling, 1 reply; 10+ messages in thread
From: Meier, Dennis @ 2014-06-24 10:01 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer

> -----Original Message-----
> From: otavio.salvador@gmail.com [mailto:otavio.salvador@gmail.com] On
> Behalf Of Otavio Salvador
> Sent: Dienstag, 17. Juni 2014 16:40
> To: Meier, Dennis
> Cc: Patches and discussions about the oe-core layer
> Subject: Re: [OE-core] [PATCH] populate_sdk_base: add auto-completion
> in setup
> 
> On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier
> <meier.dennis@siemens.com> wrote:
> > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
> 
> I do like the idea but how portable is it?
> 
> For example in my envinronment it does not work as I use zsh.

Yeah that's what I was afraid of. We figured that the script might still be invoked by bash because it starts with "#!/bin/bash" and thus it might work, but if you tested it and it didn't work for you I think it doesn't make sense to apply this patch.

Regards,
Dennis

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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-18 10:15   ` Richard Purdie
@ 2014-06-18 11:29     ` Otavio Salvador
  0 siblings, 0 replies; 10+ messages in thread
From: Otavio Salvador @ 2014-06-18 11:29 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Wed, Jun 18, 2014 at 7:15 AM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Tue, 2014-06-17 at 11:39 -0300, Otavio Salvador wrote:
>> On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier <meier.dennis@siemens.com> wrote:
>> > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
>>
>> I do like the idea but how portable is it?
>>
>> For example in my envinronment it does not work as I use zsh.
>
> The script in question has "/bin/bash" at the top so this shouldn't be
> an issue?

In this case I second it :-)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-17 14:39 ` Otavio Salvador
@ 2014-06-18 10:15   ` Richard Purdie
  2014-06-18 11:29     ` Otavio Salvador
  2014-06-24 10:01   ` Meier, Dennis
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2014-06-18 10:15 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer

On Tue, 2014-06-17 at 11:39 -0300, Otavio Salvador wrote:
> On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier <meier.dennis@siemens.com> wrote:
> > Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
> 
> I do like the idea but how portable is it?
> 
> For example in my envinronment it does not work as I use zsh.

The script in question has "/bin/bash" at the top so this shouldn't be
an issue?

Cheers,

Richard



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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-17 13:16 Dennis Meier
  2014-06-17 14:03 ` Laurentiu Palcu
@ 2014-06-17 14:39 ` Otavio Salvador
  2014-06-18 10:15   ` Richard Purdie
  2014-06-24 10:01   ` Meier, Dennis
  1 sibling, 2 replies; 10+ messages in thread
From: Otavio Salvador @ 2014-06-17 14:39 UTC (permalink / raw)
  To: Dennis Meier; +Cc: Patches and discussions about the oe-core layer

On Tue, Jun 17, 2014 at 10:16 AM, Dennis Meier <meier.dennis@siemens.com> wrote:
> Signed-off-by: Dennis Meier <meier.dennis@siemens.com>

I do like the idea but how portable is it?

For example in my envinronment it does not work as I use zsh.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCH] populate_sdk_base: add auto-completion in setup
  2014-06-17 13:16 Dennis Meier
@ 2014-06-17 14:03 ` Laurentiu Palcu
  2014-06-29  8:01   ` Richard Purdie
  2014-06-17 14:39 ` Otavio Salvador
  1 sibling, 1 reply; 10+ messages in thread
From: Laurentiu Palcu @ 2014-06-17 14:03 UTC (permalink / raw)
  To: Dennis Meier; +Cc: openembedded-core

On Tue, Jun 17, 2014 at 03:16:53PM +0200, Dennis Meier wrote:
> Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
> ---
>  meta/classes/populate_sdk_base.bbclass |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index 35d837d..1182425 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -173,9 +173,8 @@ if [ $verbose = 1 ] ; then
>  	set -x
>  fi
>  
> -printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
>  if [ "$target_sdk_dir" = "" ]; then
> -	read target_sdk_dir
> +	read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
>  	[ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
>  else
>  	echo "$target_sdk_dir"
Moving the above printf in the 'if' branch will make this 'echo' look
strange when the target directory is provided with the -d option... I
believe you can remove this 'echo' completely though. There is another
message, later, informing the user where the SDK gets installed.

laurentiu

> -- 
> 1.7.10.4
> 
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* [PATCH] populate_sdk_base: add auto-completion in setup
@ 2014-06-17 13:16 Dennis Meier
  2014-06-17 14:03 ` Laurentiu Palcu
  2014-06-17 14:39 ` Otavio Salvador
  0 siblings, 2 replies; 10+ messages in thread
From: Dennis Meier @ 2014-06-17 13:16 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Dennis Meier <meier.dennis@siemens.com>
---
 meta/classes/populate_sdk_base.bbclass |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 35d837d..1182425 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -173,9 +173,8 @@ if [ $verbose = 1 ] ; then
 	set -x
 fi
 
-printf "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): "
 if [ "$target_sdk_dir" = "" ]; then
-	read target_sdk_dir
+	read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
 	[ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
 else
 	echo "$target_sdk_dir"
-- 
1.7.10.4



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

end of thread, other threads:[~2014-06-29  8:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-12 15:47 [PATCH] populate_sdk_base: add auto-completion in setup Meier, Dennis
2014-06-17 13:16 Dennis Meier
2014-06-17 14:03 ` Laurentiu Palcu
2014-06-29  8:01   ` Richard Purdie
2014-06-17 14:39 ` Otavio Salvador
2014-06-18 10:15   ` Richard Purdie
2014-06-18 11:29     ` Otavio Salvador
2014-06-24 10:01   ` Meier, Dennis
2014-06-25 16:26     ` Paul Eggleton
2014-06-25 16:58       ` Otavio Salvador

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.