diff options
author | Stefan Eßer <se@FreeBSD.org> | 2022-06-22 13:41:40 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2022-06-22 13:49:47 +0000 |
commit | 1576f66712876ee8b0fcc8b35fb062e1813b4fc0 (patch) | |
tree | 391e884128407b34182b0b9e223f26fced2a9005 | |
parent | 3f739b0595b7d6ac4bac9aaa1cae0910f11f92e2 (diff) | |
download | src-1576f66712876ee8b0fcc8b35fb062e1813b4fc0.tar.gz src-1576f66712876ee8b0fcc8b35fb062e1813b4fc0.zip |
vendor/bc: update to upstream commit ca53adf83b7a
The filter_text function in scripts/functions.sh in version 5.3.3 had
commented out a "rm" command, probably for debugging purposes. This
caused temporary files to persist in /tmp when the bc program had been
built.
This commit fixes the build process with no change of the resulting
artefacts.
-rwxr-xr-x | scripts/functions.sh | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/scripts/functions.sh b/scripts/functions.sh index 53778ad4d16b..f2c5b0b50eae 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -348,13 +348,13 @@ filter_text() { # Set up some local variables. _filter_text_status="$ALL" - _filter_text_temp="$_filter_text_out.tmp" + _filter_text_last_line="" # We need to set IFS, so we store it here for restoration later. _filter_text_ifs="$IFS" # Remove the file- that will be generated. - rm -rf "$_filter_text_out" "$_filter_text_temp" + rm -rf "$_filter_text_out" # Here is the magic. This loop reads the template line-by-line, and based on # _filter_text_status, either prints it to the markdown manual or not. @@ -371,10 +371,10 @@ filter_text() { # # Obviously, the tag itself and its end are not printed to the markdown # manual. - while IFS= read -r line; do + while IFS= read -r _filter_text_line; do # If we have found an end, reset the status. - if [ "$line" = "{{ end }}" ]; then + if [ "$_filter_text_line" = "{{ end }}" ]; then # Some error checking. This helps when editing the templates. if [ "$_filter_text_status" -eq "$ALL" ]; then @@ -384,7 +384,7 @@ filter_text() { _filter_text_status="$ALL" # We have found a tag that allows our build type to use it. - elif [ "${line#\{\{* $_filter_text_buildtype *\}\}}" != "$line" ]; then + elif [ "${_filter_text_line#\{\{* $_filter_text_buildtype *\}\}}" != "$_filter_text_line" ]; then # More error checking. We don't want tags nested. if [ "$_filter_text_status" -ne "$ALL" ]; then @@ -394,7 +394,7 @@ filter_text() { _filter_text_status="$NOSKIP" # We have found a tag that is *not* allowed for our build type. - elif [ "${line#\{\{*\}\}}" != "$line" ]; then + elif [ "${_filter_text_line#\{\{*\}\}}" != "$_filter_text_line" ]; then if [ "$_filter_text_status" -ne "$ALL" ]; then err_exit "start tag nested in start tag" 3 @@ -405,18 +405,15 @@ filter_text() { # This is for normal lines. If we are not skipping, print. else if [ "$_filter_text_status" -ne "$SKIP" ]; then - printf '%s\n' "$line" >> "$_filter_text_temp" + if [ "$_filter_text_line" != "$_filter_text_last_line" ]; then + printf '%s\n' "$_filter_text_line" >> "$_filter_text_out" + fi + _filter_text_last_line="$_filter_text_line" fi fi done < "$_filter_text_in" - # Remove multiple blank lines. - uniq "$_filter_text_temp" "$_filter_text_out" - - # Remove the temp file. - #rm -rf "$_filter_text_temp" - # Reset IFS. IFS="$_filter_text_ifs" } |