python311Packages.moto: 4.2.6 -> 4.2.10
[NixPkgs.git] / pkgs / build-support / setup-hooks / patch-rc-path-hooks / test / test-sourcing-posix
blob6039b4dcf09752b52822f3c478cbaaefcbdc90ab
1 #!/bin/sh
3 set -eu
5 UNPATCHED_SOURCE_FILE="$1"
6 PATCHED_SOURCE_FILE="$2"
7 ORIG_PATH="$PWD/alfa:$PWD/bravo"
8 RESULT_PATH_FROM_UNPATCHED="$(
9 PATH="$ORIG_PATH"; export PATH
10 . "$UNPATCHED_SOURCE_FILE"
11 echo "$PATH"
13 RESULT_PATH_FROM_PATCHED="$(
14 PATH="$ORIG_PATH"; export PATH
15 . "$PATCHED_SOURCE_FILE"
16 echo "$PATH"
18 if [ "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" ]; then
19 echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" > /dev/stderr
20 exit 1