ceph-backport.sh: run on macOS as well as Linux
The script relies on GNU bash >= 4 (associative arrays, ${var,,}) and GNU
getopt (--long options). macOS ships bash 3.2 and BSD getopt, so the script
died with a cryptic "declare: -A: invalid option" before it could explain
itself.
Add a small portability guard near the top that:
* re-execs the script under a bash >= 4 when the running interpreter is
too old, searching $BASH_OVERRIDE, the common Homebrew locations, and
$PATH; and
* resolves getopt through a $GETOPT override (default: getopt) and confirms
it is GNU/enhanced getopt via "getopt --test".
When the required tools are absent the script now prints an actionable hint
("brew install bash gnu-getopt") instead of a bash error. The Linux path is
unchanged: bash there is already >= 4 and getopt is GNU, so neither the
re-exec nor any override triggers.
Also add a PendingReleaseNotes entry.
Assisted-by: Claude Opus 4.8
Signed-off-by: Anthony D'Atri <anthonyeleven@users.noreply.github.com> A
Anthony D'Atri committed
8f6c14b4b0554c6600f9241342af3d3428b242d8
Parent: b7dec94