diff mbox

[2/4] fix scripts/make_device_config.sh

Message ID 1359720044-8140-3-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Feb. 1, 2013, noon UTC
Make it handle multiple include statements in a file.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 scripts/make_device_config.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Färber Feb. 1, 2013, 1:38 p.m. UTC | #1
Am 01.02.2013 13:00, schrieb Gerd Hoffmann:
> Make it handle multiple include statements in a file.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  scripts/make_device_config.sh |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh
> index 0778fe2..81fe942 100644
> --- a/scripts/make_device_config.sh
> +++ b/scripts/make_device_config.sh
> @@ -18,7 +18,7 @@ process_includes () {
>  
>  f=$src
>  while [ -n "$f" ] ; do
> -  f=`tr -d '\r' < $f | awk '/^include / {printf "'$src_dir'/%s", $2}'`
> +  f=`cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}'`
>    [ $? = 0 ] || exit 1
>    all_includes="$all_includes $f"
>  done

The actual fix is appending a space? Or how does cat make a difference?

Cheers,
Andreas
Gerd Hoffmann Feb. 1, 2013, 3:18 p.m. UTC | #2
On 02/01/13 14:38, Andreas Färber wrote:
> Am 01.02.2013 13:00, schrieb Gerd Hoffmann:
>> Make it handle multiple include statements in a file.
>>
>> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>> ---
>>  scripts/make_device_config.sh |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh
>> index 0778fe2..81fe942 100644
>> --- a/scripts/make_device_config.sh
>> +++ b/scripts/make_device_config.sh
>> @@ -18,7 +18,7 @@ process_includes () {
>>  
>>  f=$src
>>  while [ -n "$f" ] ; do
>> -  f=`tr -d '\r' < $f | awk '/^include / {printf "'$src_dir'/%s", $2}'`
>> +  f=`cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}'`
>>    [ $? = 0 ] || exit 1
>>    all_includes="$all_includes $f"
>>  done
> 
> The actual fix is appending a space? Or how does cat make a difference?

Both changes are needed.

Without the space you get "pci.makusb.mak" instead of "pci.mak usb.mak"
in $f (and $all_includes).

The cat makes sure it still works with two files in $f.

cheers,
  Gerd
diff mbox

Patch

diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh
index 0778fe2..81fe942 100644
--- a/scripts/make_device_config.sh
+++ b/scripts/make_device_config.sh
@@ -18,7 +18,7 @@  process_includes () {
 
 f=$src
 while [ -n "$f" ] ; do
-  f=`tr -d '\r' < $f | awk '/^include / {printf "'$src_dir'/%s", $2}'`
+  f=`cat $f | tr -d '\r' | awk '/^include / {printf "'$src_dir'/%s ", $2}'`
   [ $? = 0 ] || exit 1
   all_includes="$all_includes $f"
 done