
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@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}'