Merge pull request #5737 from mpg/clean-compat-sh-2.28

[backport 2.28] clean up compat.sh