Patch upstream's custom script for dependency-generation

to avoid using overly-long sed commands. This is achieved
by separating one large command (-e "cmd1;cmd2;...") into
multiple ones (-e "cmd1" -e "cmd2" ...).

The long command was hitting our sed's limit of 2048...

PR:		177018
Approved by:	maintainer (makc)
Sponsored by:	United Wallabies
This commit is contained in:
Mikhail Teterin 2014-12-13 00:20:07 +00:00
parent 5ef9131741
commit f462e27bb3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=374612

78
devel/xsd/files/patch-dep Normal file
View file

@ -0,0 +1,78 @@
--- build-0.3/c/gnu/dep 2010-04-27 14:22:22.000000000 -0400
+++ build-0.3/c/gnu/dep 2014-12-12 16:10:56.000000000 -0500
@@ -1,3 +1,3 @@
-#! /usr/bin/env bash
+#!/bin/sh
# file : build/c/gnu/dep
@@ -21,5 +21,5 @@
script=
-function gen_script ()
+gen_script ()
{
while [ "$1" ]; do
@@ -34,10 +34,10 @@
#
script="$script"\
-"s \\ $prefix \\ $path$prefix g;"\
-"s \\ /usr/include/$prefix \\ $path$prefix g;"\
-"s \\ /usr/local/include/$prefix \\ $path$prefix g;"\
-"s ^$prefix $path$prefix ;"\
-"s ^/usr/include/$prefix $path$prefix ;"\
-"s ^/usr/local/include/$prefix $path$prefix ;"
+" -e 's| $prefix| $path$prefix|g'"\
+" -e 's| /usr/include/$prefix| $path$prefix|g'"\
+" -e 's| /usr/local/include/$prefix| $path$prefix|g'"\
+" -e 's|^$prefix|$path$prefix|'"\
+" -e 's|^/usr/include/$prefix|$path$prefix|'"\
+" -e 's|^/usr/local/include/$prefix|$path$prefix|'"
done
}
@@ -54,5 +54,4 @@
# some other place (e.g., /usr/include).
#
-epilogue="s% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%"
-
-exec sed -e "$script$epilogue"
+script="${script} -e 's% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%'"
+eval exec sed $script
--- build-0.3/c/intel/dep 2010-04-27 14:22:22.000000000 -0400
+++ build-0.3/c/intel/dep 2014-12-12 16:10:56.000000000 -0500
@@ -1,3 +1,3 @@
-#! /usr/bin/env bash
+#!/bin/sh
# file : build/c/intel/dep
@@ -21,5 +21,5 @@
script=
-function gen_script ()
+gen_script ()
{
while [ "$1" ]; do
@@ -34,10 +34,10 @@
#
script="$script"\
-"s \\ $prefix \\ $path$prefix g;"\
-"s \\ /usr/include/$prefix \\ $path$prefix g;"\
-"s \\ /usr/local/include/$prefix \\ $path$prefix g;"\
-"s ^$prefix $path$prefix ;"\
-"s ^/usr/include/$prefix $path$prefix ;"\
-"s ^/usr/local/include/$prefix $path$prefix ;"
+" -e 's| $prefix| $path$prefix|g'"\
+" -e 's| /usr/include/$prefix| $path$prefix|g'"\
+" -e 's| /usr/local/include/$prefix| $path$prefix|g'"\
+" -e 's|^$prefix|$path$prefix|'"\
+" -e 's|^/usr/include/$prefix|$path$prefix|'"\
+" -e 's|^/usr/local/include/$prefix|$path$prefix|'"
done
}
@@ -54,5 +54,4 @@
# some other place (e.g., /usr/include).
#
-epilogue="s% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%"
-
-exec sed -e "$script$epilogue"
+script="${script} -e 's% \([^/. \\\\]\)% $out_base/\1%g;s%^\([^/. ].*:\)%$out_base/\1%'"
+eval exec sed $script