* [PATCH 0/2] scripts/config: bug fix and improvement
@ 2013-05-12 19:08 Clement Chauplannaz
2013-05-12 19:08 ` [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value Clement Chauplannaz
2013-05-12 19:08 ` [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options Clement Chauplannaz
0 siblings, 2 replies; 8+ messages in thread
From: Clement Chauplannaz @ 2013-05-12 19:08 UTC (permalink / raw)
To: linux-kbuild; +Cc: mmarek, andi, yann.morin.1998
Hi all,
Here are two tiny patches which deal with scripts/config.
The first sets the reported name of the script to be what it was invoked
as - this is of importance for kconfig-frontends package, where the script
is renamed.
The second fixes a bug in the assignement of parameters required by options
-E/-D/-M; those are the options allowing to position a value below another
one.
Clement Chauplannaz (2):
scripts/config: replace hard-coded script name by a dynamic value
scripts/config: fix assignment of parameters for short version of
--*-after options
scripts/config | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
--
1.8.3.rc1.44.gb387c77.dirty
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value
2013-05-12 19:08 [PATCH 0/2] scripts/config: bug fix and improvement Clement Chauplannaz
@ 2013-05-12 19:08 ` Clement Chauplannaz
2013-05-12 19:25 ` Andi Kleen
2013-05-20 15:57 ` Yann E. MORIN
2013-05-12 19:08 ` [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options Clement Chauplannaz
1 sibling, 2 replies; 8+ messages in thread
From: Clement Chauplannaz @ 2013-05-12 19:08 UTC (permalink / raw)
To: linux-kbuild; +Cc: mmarek, andi, yann.morin.1998
The script `config' prints its name in usage() function. It is currently
hard-coded to value `config'. However, the script may be reused under
a different name in contexts other than the Linux Kernel.
Replace the hard-coded value `config' by the name of the script at runtime.
Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
---
scripts/config | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/scripts/config b/scripts/config
index bb4d3de..6b3272e 100755
--- a/scripts/config
+++ b/scripts/config
@@ -1,6 +1,8 @@
#!/bin/bash
# Manipulate options in a .config file from the command line
+myname=${0##*/}
+
# If no prefix forced, use the default CONFIG_
CONFIG_="${CONFIG_-CONFIG_}"
@@ -8,7 +10,7 @@ usage() {
cat >&2 <<EOL
Manipulate options in a .config file from the command line.
Usage:
-config options command ...
+$myname options command ...
commands:
--enable|-e option Enable option
--disable|-d option Disable option
@@ -33,14 +35,14 @@ options:
--file config-file .config file to change (default .config)
--keep-case|-k Keep next symbols' case (dont' upper-case it)
-config doesn't check the validity of the .config file. This is done at next
+$myname doesn't check the validity of the .config file. This is done at next
make time.
-By default, config will upper-case the given symbol. Use --keep-case to keep
+By default, $myname will upper-case the given symbol. Use --keep-case to keep
the case of all following symbols unchanged.
-config uses 'CONFIG_' as the default symbol prefix. Set the environment
-variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" config ...
+$myname uses 'CONFIG_' as the default symbol prefix. Set the environment
+variable CONFIG_ to the prefix to use. Eg.: CONFIG_="FOO_" $myname ...
EOL
exit 1
}
--
1.8.3.rc1.44.gb387c77.dirty
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options
2013-05-12 19:08 [PATCH 0/2] scripts/config: bug fix and improvement Clement Chauplannaz
2013-05-12 19:08 ` [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value Clement Chauplannaz
@ 2013-05-12 19:08 ` Clement Chauplannaz
2013-05-20 15:55 ` Yann E. MORIN
1 sibling, 1 reply; 8+ messages in thread
From: Clement Chauplannaz @ 2013-05-12 19:08 UTC (permalink / raw)
To: linux-kbuild; +Cc: mmarek, andi, yann.morin.1998
When --*-after options are used, two parameters are parsed from the
command-line before the adequate function is called:
- the `before' option, after which the new option will be inserted,
- the name of the option to enable/disable/modularise.
With the short version of --*-after options (namely -E, -D, -M), the
parsing step is not performed which leads to processing unset variables.
Add options -E, -D, -M to the test that triggers assignment of parameters
for --*-after options.
Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
---
scripts/config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/config b/scripts/config
index 6b3272e..567120a 100755
--- a/scripts/config
+++ b/scripts/config
@@ -107,7 +107,7 @@ while [ "$1" != "" ] ; do
;;
--refresh)
;;
- --*-after)
+ --*-after|-E|-D|-M)
checkarg "$1"
A=$ARG
checkarg "$2"
--
1.8.3.rc1.44.gb387c77.dirty
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value
2013-05-12 19:08 ` [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value Clement Chauplannaz
@ 2013-05-12 19:25 ` Andi Kleen
2013-05-12 20:29 ` Yann E. MORIN
2013-05-20 15:57 ` Yann E. MORIN
1 sibling, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2013-05-12 19:25 UTC (permalink / raw)
To: Clement Chauplannaz; +Cc: linux-kbuild, mmarek, andi, yann.morin.1998
On Sun, May 12, 2013 at 09:08:51PM +0200, Clement Chauplannaz wrote:
> The script `config' prints its name in usage() function. It is currently
> hard-coded to value `config'. However, the script may be reused under
> a different name in contexts other than the Linux Kernel.
>
> Replace the hard-coded value `config' by the name of the script at runtime.
>
> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
Both patched are fine for me.
Acked-by: Andi Kleen <ak@linux.intel.com>
-Andi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value
2013-05-12 19:25 ` Andi Kleen
@ 2013-05-12 20:29 ` Yann E. MORIN
2013-05-12 20:54 ` Clément Chauplannaz
0 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2013-05-12 20:29 UTC (permalink / raw)
To: Andi Kleen; +Cc: Clement Chauplannaz, linux-kbuild, mmarek
Andy, Clément, All,
On 2013-05-12 21:25 +0200, Andi Kleen spake thusly:
> On Sun, May 12, 2013 at 09:08:51PM +0200, Clement Chauplannaz wrote:
> > The script `config' prints its name in usage() function. It is currently
> > hard-coded to value `config'. However, the script may be reused under
> > a different name in contexts other than the Linux Kernel.
> >
> > Replace the hard-coded value `config' by the name of the script at runtime.
> >
> > Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
>
> Both patched are fine for me.
> Acked-by: Andi Kleen <ak@linux.intel.com>
It's too late for 3.10 now, so I'll queue them in my tree for 3.11.
Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value
2013-05-12 20:29 ` Yann E. MORIN
@ 2013-05-12 20:54 ` Clément Chauplannaz
0 siblings, 0 replies; 8+ messages in thread
From: Clément Chauplannaz @ 2013-05-12 20:54 UTC (permalink / raw)
To: Yann E. MORIN; +Cc: Andi Kleen, linux-kbuild, mmarek
Thanks!
Clément
2013/5/12 Yann E. MORIN <yann.morin.1998@free.fr>:
> Andy, Clément, All,
>
> On 2013-05-12 21:25 +0200, Andi Kleen spake thusly:
>> On Sun, May 12, 2013 at 09:08:51PM +0200, Clement Chauplannaz wrote:
>> > The script `config' prints its name in usage() function. It is currently
>> > hard-coded to value `config'. However, the script may be reused under
>> > a different name in contexts other than the Linux Kernel.
>> >
>> > Replace the hard-coded value `config' by the name of the script at runtime.
>> >
>> > Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
>>
>> Both patched are fine for me.
>> Acked-by: Andi Kleen <ak@linux.intel.com>
>
> It's too late for 3.10 now, so I'll queue them in my tree for 3.11.
>
> Thank you!
>
> Regards,
> Yann E. MORIN.
>
> --
> .-----------------.--------------------.------------------.--------------------.
> | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
> | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
> '------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options
2013-05-12 19:08 ` [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options Clement Chauplannaz
@ 2013-05-20 15:55 ` Yann E. MORIN
0 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2013-05-20 15:55 UTC (permalink / raw)
To: Clement Chauplannaz; +Cc: linux-kbuild, mmarek, andi
Clément, All,
On 2013-05-12 21:08 +0200, Clement Chauplannaz spake thusly:
> When --*-after options are used, two parameters are parsed from the
> command-line before the adequate function is called:
> - the `before' option, after which the new option will be inserted,
> - the name of the option to enable/disable/modularise.
>
> With the short version of --*-after options (namely -E, -D, -M), the
> parsing step is not performed which leads to processing unset variables.
>
> Add options -E, -D, -M to the test that triggers assignment of parameters
> for --*-after options.
>
> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
I've applied this to my tree in the branch yem-kconfig-rc-fixes, for
which I've just sent a pull-request to Michal. Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value
2013-05-12 19:08 ` [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value Clement Chauplannaz
2013-05-12 19:25 ` Andi Kleen
@ 2013-05-20 15:57 ` Yann E. MORIN
1 sibling, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2013-05-20 15:57 UTC (permalink / raw)
To: Clement Chauplannaz; +Cc: linux-kbuild, mmarek, andi
Clément, All,
On 2013-05-12 21:08 +0200, Clement Chauplannaz spake thusly:
> The script `config' prints its name in usage() function. It is currently
> hard-coded to value `config'. However, the script may be reused under
> a different name in contexts other than the Linux Kernel.
>
> Replace the hard-coded value `config' by the name of the script at runtime.
>
> Signed-off-by: Clement Chauplannaz <chauplac@gmail.com>
I've applied this in my tree in the branch yem-kconfig-for-next, for
inclusion upstream when the 3.11 merge window opens. Thank you!
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-05-20 16:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-12 19:08 [PATCH 0/2] scripts/config: bug fix and improvement Clement Chauplannaz
2013-05-12 19:08 ` [PATCH 1/2] scripts/config: replace hard-coded script name by a dynamic value Clement Chauplannaz
2013-05-12 19:25 ` Andi Kleen
2013-05-12 20:29 ` Yann E. MORIN
2013-05-12 20:54 ` Clément Chauplannaz
2013-05-20 15:57 ` Yann E. MORIN
2013-05-12 19:08 ` [PATCH 2/2] scripts/config: fix assignment of parameters for short version of --*-after options Clement Chauplannaz
2013-05-20 15:55 ` Yann E. MORIN
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox