Patchwork [1/8] fix 'no such file' error from make_device_config.sh

login
register
mail settings
Submitter Markus Armbruster
Date Jan. 13, 2011, 1:43 p.m.
Message ID <m3ipxshqb1.fsf@blackfin.pond.sub.org>
Download mbox | patch
Permalink /patch/78759/
State New
Headers show

Comments

Markus Armbruster - Jan. 13, 2011, 1:43 p.m.
David Ahern <daahern@cisco.com> writes:

> make_device_config currently emits an error:
>
> make config-all-devices.mak
>   GEN   x86_64-softmmu/config-devices.mak
> /home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qemu.git/default-configs/pci.mak : No such file or directory
>
> /bin/sh does not like the file redirection for tr so change it to cat.
>
> Signed-off-by: David Ahern <daahern@cisco.com>
> ---
>  make_device_config.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/make_device_config.sh b/make_device_config.sh
> index 596fc5b..1ce4088 100644
> --- a/make_device_config.sh
> +++ b/make_device_config.sh
> @@ -18,7 +18,7 @@ process_includes () {
>  
>  f=$src
>  while [ -n "$f" ] ; do
> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
> +  f=`cat $f | tr -d '\r' | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>    [ $? = 0 ] || exit 1
>    all_includes="$all_includes $f"
>  done

This sweeps the real error under the carpet: $f has a trailing space.

What about:
David S. Ahern - Jan. 13, 2011, 2:40 p.m.
On 01/13/11 06:43, Markus Armbruster wrote:
> David Ahern <daahern@cisco.com> writes:
> 
>> make_device_config currently emits an error:
>>
>> make config-all-devices.mak
>>   GEN   x86_64-softmmu/config-devices.mak
>> /home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qemu.git/default-configs/pci.mak : No such file or directory
>>
>> /bin/sh does not like the file redirection for tr so change it to cat.
>>
>> Signed-off-by: David Ahern <daahern@cisco.com>
>> ---
>>  make_device_config.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/make_device_config.sh b/make_device_config.sh
>> index 596fc5b..1ce4088 100644
>> --- a/make_device_config.sh
>> +++ b/make_device_config.sh
>> @@ -18,7 +18,7 @@ process_includes () {
>>  
>>  f=$src
>>  while [ -n "$f" ] ; do
>> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>> +  f=`cat $f | tr -d '\r' | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>>    [ $? = 0 ] || exit 1
>>    all_includes="$all_includes $f"
>>  done
> 
> This sweeps the real error under the carpet: $f has a trailing space.
> 
> What about:
> 
> diff --git a/make_device_config.sh b/make_device_config.sh
> index 596fc5b..711829c 100644
> --- a/make_device_config.sh
> +++ b/make_device_config.sh
> @@ -18,7 +18,7 @@ process_includes () {
>  
>  f=$src
>  while [ -n "$f" ] ; do
> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
> +  f=`tr -d '\r' <"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
>    [ $? = 0 ] || exit 1
>    all_includes="$all_includes $f"
>  done

That works too.

Any idea why the '%/config-devices.mak' rule does not work for a build
directory != src directory?

e.g., src=/my/qemu.git, build=/tmp/build-qemu

x86_64-softmmu/config-devices.mak is not created, so
config-all-devices.mak is empty and the build blows up.

David
Markus Armbruster - Jan. 14, 2011, 10:34 a.m.
David Ahern <daahern@cisco.com> writes:

> On 01/13/11 06:43, Markus Armbruster wrote:
>> David Ahern <daahern@cisco.com> writes:
>> 
>>> make_device_config currently emits an error:
>>>
>>> make config-all-devices.mak
>>>   GEN   x86_64-softmmu/config-devices.mak
>>> /home/dsa/kvm/releases/qemu.git/make_device_config.sh: line 21: /home/dsa/kvm/releases/qemu.git/default-configs/pci.mak : No such file or directory
>>>
>>> /bin/sh does not like the file redirection for tr so change it to cat.
>>>
>>> Signed-off-by: David Ahern <daahern@cisco.com>
>>> ---
>>>  make_device_config.sh |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/make_device_config.sh b/make_device_config.sh
>>> index 596fc5b..1ce4088 100644
>>> --- a/make_device_config.sh
>>> +++ b/make_device_config.sh
>>> @@ -18,7 +18,7 @@ process_includes () {
>>>  
>>>  f=$src
>>>  while [ -n "$f" ] ; do
>>> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>>> +  f=`cat $f | tr -d '\r' | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>>>    [ $? = 0 ] || exit 1
>>>    all_includes="$all_includes $f"
>>>  done
>> 
>> This sweeps the real error under the carpet: $f has a trailing space.
>> 
>> What about:
>> 
>> diff --git a/make_device_config.sh b/make_device_config.sh
>> index 596fc5b..711829c 100644
>> --- a/make_device_config.sh
>> +++ b/make_device_config.sh
>> @@ -18,7 +18,7 @@ process_includes () {
>>  
>>  f=$src
>>  while [ -n "$f" ] ; do
>> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>> +  f=`tr -d '\r' <"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
>>    [ $? = 0 ] || exit 1
>>    all_includes="$all_includes $f"
>>  done
>
> That works too.

Care to respin your patch?

> Any idea why the '%/config-devices.mak' rule does not work for a build
> directory != src directory?
>
> e.g., src=/my/qemu.git, build=/tmp/build-qemu
>
> x86_64-softmmu/config-devices.mak is not created, so
> config-all-devices.mak is empty and the build blows up.

Should be debuggable :)

"mkdir bld && cd bld && ./configure --disable-werror && make" works for
me.  config-all-devices.mak has some 80 entries.
David S. Ahern - Jan. 14, 2011, 3:13 p.m.
On 01/14/11 03:34, Markus Armbruster wrote:

>>> What about:
>>>
>>> diff --git a/make_device_config.sh b/make_device_config.sh
>>> index 596fc5b..711829c 100644
>>> --- a/make_device_config.sh
>>> +++ b/make_device_config.sh
>>> @@ -18,7 +18,7 @@ process_includes () {
>>>  
>>>  f=$src
>>>  while [ -n "$f" ] ; do
>>> -  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
>>> +  f=`tr -d '\r' <"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
>>>    [ $? = 0 ] || exit 1
>>>    all_includes="$all_includes $f"
>>>  done
>>
>> That works too.
> 
> Care to respin your patch?

done.

> 
>> Any idea why the '%/config-devices.mak' rule does not work for a build
>> directory != src directory?
>>
>> e.g., src=/my/qemu.git, build=/tmp/build-qemu
>>
>> x86_64-softmmu/config-devices.mak is not created, so
>> config-all-devices.mak is empty and the build blows up.
> 
> Should be debuggable :)
> 
> "mkdir bld && cd bld && ./configure --disable-werror && make" works for
> me.  config-all-devices.mak has some 80 entries.

And it works for me too. Must have been an 11pm phenomenon.

David

Patch

diff --git a/make_device_config.sh b/make_device_config.sh
index 596fc5b..711829c 100644
--- a/make_device_config.sh
+++ b/make_device_config.sh
@@ -18,7 +18,7 @@  process_includes () {
 
 f=$src
 while [ -n "$f" ] ; do
-  f=`tr -d '\r' < $f | awk '/^include / {ORS=" "; print "'$src_dir'/" $2}'`
+  f=`tr -d '\r' <"$f" | awk '/^include / {print "'$src_dir'/" $2}'`
   [ $? = 0 ] || exit 1
   all_includes="$all_includes $f"
 done