[U-Boot] [PATCH] qts-filter.sh: strip DOS line endings and handle continuation lines

Bill Randle bill.randle at gmail.com
Fri Nov 18 17:29:35 CET 2016


On Fri, Nov 18, 2016 at 8:26 AM, Marek Vasut <marex at denx.de> wrote:
> On 11/18/2016 05:49 AM, Bill Randle wrote:
>> Some Altera Quartus generated files have long lines that are split with a '\' at
>> the end of the line. It also writes files in DOS format, which can confuse some
>> of the processing scripts in this file. This patch solves both issues.
>>
>> Signed-off-by: Bill Randle <bill.randle at gmail.com>
>> ---
>>  arch/arm/mach-socfpga/qts-filter.sh | 52 +++++++++++++++++++++++--------------
>>  1 file changed, 33 insertions(+), 19 deletions(-)
>
> Wouldn't it make more sense to define shell function which would rectify
> the file content and call it from multiple places ? ie.
>
> fix_newlines_in_macros() {
>     sed "............."
> }
>
> -       # Retrieve the pinmux config and zap the ad-hoc length encoding
> -       sed -n '/^unsigned/ !b; :next {/^unsigned/ {s/\[.*\]/[]/;s/unsigned
> long/const u8/};p;n;b next}' \
> -               ${in_bsp_dir}/generated/pinmux_config_${soc}.c
> +       # Retrieve the pinmux config and zap the ad-hoc length encoding,
> +       # converting DOS line endings and deal with lines ending in '\'
> +       fix_newlines_in_macros \
> +                   ${in_bsp_dir}/generated/pinmux_config_${soc}.c |
> +       sed -n '/^unsigned/ !b; :next {/^unsigned/ {s/\[.*\]/[]/;s/unsigned
> long/const u8/};p;n;b next}'
>
>
> --
> Best regards,
> Marek Vasut

Probably a good idea. I'll do that and submit a V2 patch.

    -Bill


More information about the U-Boot mailing list