diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2015-08-26 12:42:54 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2015-08-27 14:44:16 +0000 |
commit | 8dc5fb2c70f2ff9db3f804b0bba20edf4a512f78 (patch) | |
tree | 17a9dbf994c3281e54a7f3695f6788463d73cd03 /scripts/release | |
parent | 8137e2a320e2d835dda7d7ae8aa6996bf36819e6 (diff) |
Fix word wrapping determinism on BSD / Linux
fmt behaves totally differently depending on the version and on the
OS, use fold instead that has a consistent behaviour accross platform.
Tested with bazel test //scripts/release/... on OSX and Linux.
--
MOS_MIGRATED_REVID=101567574
Diffstat (limited to 'scripts/release')
-rwxr-xr-x | scripts/release/release_test.sh | 8 | ||||
-rwxr-xr-x | scripts/release/relnotes.sh | 14 | ||||
-rwxr-xr-x | scripts/release/relnotes_test.sh | 2 |
3 files changed, 9 insertions, 15 deletions
diff --git a/scripts/release/release_test.sh b/scripts/release/release_test.sh index 4c2606800e..3152054825 100755 --- a/scripts/release/release_test.sh +++ b/scripts/release/release_test.sh @@ -195,8 +195,8 @@ EOF local header='Release v1 ('$(date +%Y-%m-%d)') Baseline: 1170dc6 - + 0540fde: Extract version numbers that look like - "..._1.2.3_..." from BUILD_EMBED_LABEL into Info.plist. + + 0540fde: Extract version numbers that look like "..._1.2.3_..." + from BUILD_EMBED_LABEL into Info.plist. ' assert_equals "${header}Test replacement" "$(cat ${TEST_log})" @@ -208,8 +208,8 @@ Baseline: 1170dc6 header='Release v1 ('$(date +%Y-%m-%d)') Baseline: 1170dc6 - + 0540fde: Extract version numbers that look like - "..._1.2.3_..." from BUILD_EMBED_LABEL into Info.plist. + + 0540fde: Extract version numbers that look like "..._1.2.3_..." + from BUILD_EMBED_LABEL into Info.plist. + cef25c4: RELNOTES: Attribute error messages related to Android resources are easier to understand now. diff --git a/scripts/release/relnotes.sh b/scripts/release/relnotes.sh index 15abbd1cb7..7071f7186a 100755 --- a/scripts/release/relnotes.sh +++ b/scripts/release/relnotes.sh @@ -97,16 +97,10 @@ function get_release_notes() { done } -# fmt behaves a bit different on GNU/Linux than on BSDs. -if [ "$(uname -s | tr 'A-Z' 'a-z')" = "linux" ]; then - function wrap_text() { - fmt -w $1 -g $1 - } -else - function wrap_text() { - fmt -w $1 - } -fi +# fmt behaves differently on *BSD and on GNU/Linux, use fold. +function wrap_text() { + fold -s -w $1 | sed 's/ *$//' +} # Returns the list of release notes in arguments into a list of points in # a markdown list. The release notes are wrapped to 70 characters so it diff --git a/scripts/release/relnotes_test.sh b/scripts/release/relnotes_test.sh index 32d571134e..419ed109a6 100755 --- a/scripts/release/relnotes_test.sh +++ b/scripts/release/relnotes_test.sh @@ -198,7 +198,7 @@ function test_create_revision_information() { should produce additional information about aspect dependencies when --output is set to {xml, proto}.' assert_equals "$expected" \ - "$(create_revision_information 965c392 bb59d88 14d905b)" + "$(create_revision_information 965c392 bb59d88 14d905b)" } run_suite "Release notes generation tests" |