diff --git a/CHANGES/v2.3.md b/CHANGES/v2.3.md index c92fea35335240d8bd7cddedd5a8151a8f79d814..6aa9d2b73665ac986b85e66688d5baf494aa0ea0 100644 --- a/CHANGES/v2.3.md +++ b/CHANGES/v2.3.md @@ -235,4 +235,7 @@ For users: For developers: - Fixed small issue in debug options of \ref driver (see \issue{245}). +- `plumed patch -e` now accepts a name closely matching the patch name (e.g. `plumed patch -e gromacs2016.5` will try to patch + even if the stored patch is for `gromacs-2016.4`). This simplifies managing Portfiles. Nothing changes when picking the patch + from the interactive menu. diff --git a/patches/patch.sh b/patches/patch.sh index c5da859a2209c9074270b6e83f2eb929e03a05e1..44b42a74a758a451b18e4b0e56f61ef835cc0a05 100755 --- a/patches/patch.sh +++ b/patches/patch.sh @@ -176,6 +176,25 @@ then done fi +if [[ "$action" == patch || "$action" == revert ]] +then + found=no + for engine_try in $mdlist ; do + if [[ "$engine" == "$engine_try" ]] ; then + found=yes + fi + done + if [[ "$found" == no ]] ; then + echo "WARNING: engine $engine not found, I will search for a close match" + for engine_try in $mdlist ; do + if [[ "${engine%.*}" == "${engine_try%.*}" ]] ; then + echo "WARNING: found $engine_try" + engine="$engine_try" + fi + done + fi +fi + if [ -z "$diff" ] then diff="$PLUMED_ROOT/patches/${engine}.diff"