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

Marek Vasut marex at denx.de
Fri Nov 18 17:26:07 CET 2016


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


More information about the U-Boot mailing list