diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-01-05 13:29:53 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-01-05 13:29:53 (EST) |
commit | 7d9cbae8d6125cc0da458773da173ba308debe0f (patch) | |
tree | ba47ae26c2811d04ec318e291170dbac35e0d51e | |
parent | a343bb1d182ec1141fb45f26dfe1858623428db2 (diff) |
_OB_LF: Define and use newline constant
-rw-r--r-- | lib/changelog.sh | 9 | ||||
-rw-r--r-- | lib/common.sh | 3 | ||||
-rw-r--r-- | lib/control.sh | 3 |
3 files changed, 7 insertions, 8 deletions
diff --git a/lib/changelog.sh b/lib/changelog.sh index 6e72550..a679db0 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -117,8 +117,7 @@ ob_parse_changelog() line_nr=$(($line_nr + 1)) if [ -z "${line}" ]; then if [ "${expect}" = 'start_changes' ]; then - OB_CHANGELOG_CHANGES="${OB_CHANGELOG_CHANGES} -${line}" + OB_CHANGELOG_CHANGES="${OB_CHANGELOG_CHANGES}${_OB_LF}${line}" elif [ "${expect}" = 'next_or_eof' ]; then : elif [ "${expect}" != 'changes_or_trailer' ]; then @@ -126,8 +125,7 @@ ${line}" 'changelog_found_blank_line' \ "$(_ob_get_changelog_expect_str "${expect}")" else - blank_lines="${blank_lines} -${line}" + blank_lines="${blank_lines}${_OB_LF}${line}" fi elif [ "${line# }" = "${line}" ]; then if [ "${expect}" != 'first_heading' -a \ @@ -203,8 +201,7 @@ ${line}" 'changelog_found_change' \ "$(_ob_get_changelog_expect_str "${expect}")" fi - OB_CHANGELOG_CHANGES="${OB_CHANGELOG_CHANGES} -${blank_lines}${line}" + OB_CHANGELOG_CHANGES="${OB_CHANGELOG_CHANGES}${_OB_LF}${blank_lines}${line}" expect='changes_or_trailer' blank_lines= else diff --git a/lib/common.sh b/lib/common.sh index 7693b18..c265e3c 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -17,6 +17,9 @@ # You should have received a copy of the GNU General Public License # along with opkbuild. If not, see <http://www.gnu.org/licenses/>. +_OB_LF=' +' + _ob_validate_var_name() { case "${1}" in diff --git a/lib/control.sh b/lib/control.sh index 524c504..30c6b9c 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -162,8 +162,7 @@ ob_parse_control() 'control_found_continuation' continue fi - value="${value} -${line# }" + value="${value}${_OB_LF}${line# }" ;; esac done <<-EOF |