[PATCH modular] Per-component configure options
Trevor Woerner
twoerner at gmail.com
Thu Jan 19 06:21:26 PST 2012
Hi Gaetan,
Thanks for reviewing my patch!
On Wed, Jan 18, 2012 at 7:49 PM, Gaetan Nadon <memsize at videotron.ca> wrote:
> On 12-01-16 06:22 PM, Trevor Woerner wrote:
>> @@ -1009,9 +1017,15 @@ process_module_file() {
>> continue
>> fi
>>
>> - module=`echo $line | cut -d'/' -f1`
>> - component=`echo $line | cut -d'/' -f2`
>> - build $module $component
>> + module=`echo $line | cut -d' ' -f1 | cut -d'/' -f1`
>> + component=`echo $line | cut -d' ' -f1 | cut -d'/' -f2`
>> + confopts_check=`echo $line | cut -d' ' -f2-`
> What is the role of the dash following f2? There were none before.
Each line of the <modfile> is assumed to contain a
<module>/<component> group, then an optional space, then an optional
space separated list of zero or more configure arguments.
<module>/<component>[ <arg1>[ <arg2>[ <arg3>...]]]
The first 2 "cut" lines grab the first item on the line (given a ' '
(space) separator) and further filter out the <module> and <component>
(given a '/' separator). The third "cut" line starts after the
<module>/<component> (optional space) and grabs everything else on the
line. Although my example (in a previous email) only demonstrates
giving one configure argument to mesa/drm, I tested this patch by
providing a range of different numbers of configuration arguments
(including zero) to various modules.
This cutting scheme revolves around the assumption the <module> and
<component> are always separated by a forward slash, even in the 2
cases where there is no <component> (i.e. pixman/ and xserver/. But
this is already the case. The existing build.sh already does this when
it provides the "-L" list. The use is just expected to maintain this
convention.
The reason there was no dash before is that there was only one "cut"
operation before (for the <mod>/<comp>) and now there are two. The
second "cut" takes "everything after and including the second
space-separated group", thus the dash is required.
>> + if [ "$module/$component" = "$confopts_check" ]; then
>> + confopts=""
>> + else
>> + confopts="$confopts_check"
>> + fi
>> + build $module "$component" "$confopts"
>> done <"$MODFILE"
> Are all the new quotes around "$component" required? There can be no
> spaces in the lines, e.g. app/xclock. The seperator is a space and a
> '/'. Many double quotes have been added throughout the script.
Yes, the double quotes are required and were added as a result of
testing. They're needed in the 2 cases where there is no <component>
(i.e. pixman/ and xserver/) otherwise the $confopts becomes the 2nd
argument to the "build" (etc) routine. The blank second argument needs
to be preserved and is done so by the use of the quotes.
More information about the xorg-devel
mailing list