You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: buildstuff/sed-substitute
+16-7Lines changed: 16 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -45,22 +45,31 @@ case "$outname" in
45
45
;;
46
46
esac
47
47
48
-
tmpname="$outname.tmp.$$"
49
-
48
+
tmqname="$outname.tmq.$$"
50
49
51
-
${SED-sed} -e "s|^\(.*\)[@]configure_input[@]|\1$outname. Generated from $inname by configure.ac.\n\1!!!!!!! DO NOT MODIFY THIS FILE !!!!!!!!\n\1EDIT $inname INSTEAD AND RE-RUN autoreconf.|g""$@"<"$inname">"$tmpname"|| {
50
+
${SED-sed} -e "s|^\(.*\)[@]configure_input[@]|\1$outname. Generated from $inname by configure.ac.\n\1!!!!!!! DO NOT MODIFY THIS FILE !!!!!!!!\n\1EDIT $inname INSTEAD AND RE-RUN autoreconf.|g""$@"<"$inname">"$tmqname"|| {
52
51
s="$?"
53
-
echo"$prog: Error running sed, exit code $s."
54
-
rm -f "$tmpname"
52
+
echo"$prog: Error running sed, exit code $s.">&2
53
+
rm -f "$tmqname"
55
54
exit 2
56
55
}
57
56
58
-
if grep '[@][A-Za-z0-9_-]\{1,\}@'"$tmpname">&2;then
57
+
if grep '[@][A-Za-z0-9_-]\{1,\}@'"$tmqname">&2;then
59
58
echo"$prog: Unsubstituted values found while substituting $inname">&2
60
-
rm -f "$tmpname"
59
+
rm -f "$tmqname"
61
60
exit 2
62
61
fi
63
62
63
+
tmpname="$outname.tmp.$$"
64
+
65
+
${TR-tr} -d '\015'<"$tmqname">"$tmpname"|| {
66
+
s="$?"
67
+
echo"$prog: Error running tr, exit code $s">&2
68
+
rm -f "$tmqname"
69
+
exit 2
70
+
}
71
+
rm -f "$tmqname"
72
+
64
73
iftest -f "$outname";then
65
74
if${CMP-cmp}"$outname""$tmpname"> /dev/null;then
66
75
# echo "$prog: source file up to date: $outname" >&2
0 commit comments