commit f5d230410ed12387146e129aab4e70db85ff670b from: Thomas Adam date: Fri Oct 08 22:48:33 2021 UTC regress: provide a sed wrapper In order to portably handle the difference in how 'sed -i' works between *BSD and Linux, provide a wrapper to invoke the underying system sed(1) based on which OSTYPE is in use. commit - 372960fedf033e1a18e08ae30d9d0a9096206266 commit + f5d230410ed12387146e129aab4e70db85ff670b blob - 9f27a5b3838165f5f270d7da86b7e35a5068ed48 blob + 112a00ef6c99ee9cf2fbf8df43a49b9683220c99 --- Makefile.common.in +++ Makefile.common.in @@ -5,8 +5,7 @@ AM_CFLAGS += \ -Wshadow -Wpointer-arith -Wno-sign-compare -Wundef \ -Wbad-function-cast -Winline -Wcast-align \ -Wdeclaration-after-statement -Wno-pointer-sign \ - -Wno-attributes -Wno-unused-result \ - -Wno-incompatible-pointer-types-discards-qualifiers + -Wno-attributes -Wno-unused-result AM_CPPFLAGS += \ @AM_CPPFLAGS@ \ blob - f4828b6c8a7e9c290972b5457c4a9c2f7d93597b blob + bc331784c2f2ec466c7da7156184fb494b4cf2a0 --- regress/cmdline/commit.sh +++ regress/cmdline/commit.sh @@ -1377,7 +1377,9 @@ test_commit_prepared_logmsg() { cat > $testroot/editor.sh < $testroot/stdout.expected echo -n "Updated to refs/heads/master: $head_rev" \ blob - bab97d4aacb49217ed5a5c0a3bf43ae8df1729eb blob + 2d72590bb4cccfd94b9d11567d69f4cec032c8e4 --- regress/cmdline/histedit.sh +++ regress/cmdline/histedit.sh @@ -1569,7 +1569,9 @@ test_histedit_fold_only() { cat > $testroot/editor.sh < $testroot/editor.sh < $testroot/patchscript @@ -1729,9 +1729,9 @@ test_stage_patch_twice() { return 1 fi - sed -i -e 's/^2$/a/' $testroot/wt/numbers - sed -i -e 's/^7$/b/' $testroot/wt/numbers - sed -i -e 's/^16$/c/' $testroot/wt/numbers + sed -i '' -e 's/^2$/a/' $testroot/wt/numbers + sed -i '' -e 's/^7$/b/' $testroot/wt/numbers + sed -i '' -e 's/^16$/c/' $testroot/wt/numbers # stage middle hunk printf "n\ny\nn\n" > $testroot/patchscript @@ -2167,9 +2167,9 @@ test_stage_patch_quit() { return 1 fi - sed -i -e 's/^2$/a/' $testroot/wt/numbers - sed -i -e 's/^7$/b/' $testroot/wt/numbers - sed -i -e 's/^16$/c/' $testroot/wt/numbers + sed -i '' -e 's/^2$/a/' $testroot/wt/numbers + sed -i '' -e 's/^7$/b/' $testroot/wt/numbers + sed -i '' -e 's/^16$/c/' $testroot/wt/numbers (cd $testroot/wt && got rm zzz > /dev/null) # stage first hunk and quit; and don't pass a path argument to @@ -2275,9 +2275,9 @@ test_stage_patch_incomplete_script() { return 1 fi - sed -i -e 's/^2$/a/' $testroot/wt/numbers - sed -i -e 's/^7$/b/' $testroot/wt/numbers - sed -i -e 's/^16$/c/' $testroot/wt/numbers + sed -i '' -e 's/^2$/a/' $testroot/wt/numbers + sed -i '' -e 's/^7$/b/' $testroot/wt/numbers + sed -i '' -e 's/^16$/c/' $testroot/wt/numbers # stage first hunk and then stop responding; got should error out printf "y\n" > $testroot/patchscript blob - 5cba17832df6f6116c7bcae1f7fb3c259c11c230 blob + 617773180b2eca26860783dcbc63d506914059e2 --- regress/cmdline/status.sh +++ regress/cmdline/status.sh @@ -177,11 +177,11 @@ test_status_shows_local_mods_after_update() { return 1 fi - sed -i '' 's/2/22/' $testroot/repo/numbers + sed -i '' -e 's/2/22/' $testroot/repo/numbers git_commit $testroot/repo -m "modified line 2" # modify line 7; both changes should merge cleanly - sed -i '' 's/7/77/' $testroot/wt/numbers + sed -i '' -e 's/7/77/' $testroot/wt/numbers echo "G numbers" > $testroot/stdout.expected echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected @@ -335,12 +335,12 @@ test_status_shows_no_mods_after_complete_merge() { return 1 fi - sed -i '' 's/2/22/' $testroot/repo/numbers + sed -i '' -e 's/2/22/' $testroot/repo/numbers git_commit $testroot/repo -m "modified line 2" sleep 1 # modify line 2 again; no local changes are left after merge - sed -i '' 's/2/22/' $testroot/wt/numbers + sed -i '' -e 's/2/22/' $testroot/wt/numbers echo "G numbers" > $testroot/stdout.expected echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected @@ -390,11 +390,11 @@ test_status_shows_conflict() { return 1 fi - sed -i '' 's/2/22/' $testroot/repo/numbers + sed -i '' -e 's/2/22/' $testroot/repo/numbers git_commit $testroot/repo -m "modified line 2" # modify line 2 in a conflicting way - sed -i '' 's/2/77/' $testroot/wt/numbers + sed -i '' -e 's/2/77/' $testroot/wt/numbers echo "C numbers" > $testroot/stdout.expected echo -n "Updated to refs/heads/master: " >> $testroot/stdout.expected blob - 3b3d58a2e081bceb00cc302ffc67e0ab03817dd7 blob + 0cc8e6f70c11e911af90f3bcf58b3178c39ecfe2 --- regress/cmdline/unstage.sh +++ regress/cmdline/unstage.sh @@ -198,9 +198,9 @@ test_unstage_patch() { return 1 fi - sed -i -e 's/^2$/a/' $testroot/wt/numbers - sed -i -e 's/^7$/b/' $testroot/wt/numbers - sed -i -e 's/^16$/c/' $testroot/wt/numbers + sed -i '' -e 's/^2$/a/' $testroot/wt/numbers + sed -i '' -e 's/^7$/b/' $testroot/wt/numbers + sed -i '' -e 's/^16$/c/' $testroot/wt/numbers (cd $testroot/wt && got stage > /dev/null) ret="$?" @@ -818,9 +818,9 @@ test_unstage_patch_quit() { return 1 fi - sed -i -e 's/^2$/a/' $testroot/wt/numbers - sed -i -e 's/^7$/b/' $testroot/wt/numbers - sed -i -e 's/^16$/c/' $testroot/wt/numbers + sed -i '' -e 's/^2$/a/' $testroot/wt/numbers + sed -i '' -e 's/^7$/b/' $testroot/wt/numbers + sed -i '' -e 's/^16$/c/' $testroot/wt/numbers (cd $testroot/wt && got rm zzz > /dev/null) (cd $testroot/wt && got stage > /dev/null) blob - d93ef8c508fbe9bf2bafd25578af7d0c0c1b512b blob + 2a7545564f078c5d130856c1ee10bc042b9e44f1 --- regress/cmdline/update.sh +++ regress/cmdline/update.sh @@ -660,12 +660,12 @@ test_update_merges_file_edits() { echo "modified alpha" > $testroot/repo/alpha echo "modified beta" > $testroot/repo/beta - sed -i '' 's/2/22/' $testroot/repo/numbers + sed -i '' -e 's/2/22/' $testroot/repo/numbers git_commit $testroot/repo -m "modified 3 files" echo "modified alpha, too" > $testroot/wt/alpha touch $testroot/wt/beta - sed -i '' 's/7/77/' $testroot/wt/numbers + sed -i '' -e 's/7/77/' $testroot/wt/numbers echo "C alpha" > $testroot/stdout.expected echo "U beta" >> $testroot/stdout.expected