To this end, replace the simple numeric comparison of the first component by a call to ver_test. Signed-off-by: Ulrich Müller --- eclass/elisp-common.eclass | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 79f29ef95ad..6f79caee2f0 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -158,7 +158,8 @@ # merge and unmerge of a package. case ${EAPI:-0} in - 4|5|6|7) ;; + 4|5|6) inherit eapi7-ver ;; + 7) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -230,11 +231,16 @@ elisp-need-emacs() { have_emacs=$(elisp-emacs-version) || return 2 einfo "Emacs version: ${have_emacs}" if [[ ${have_emacs} =~ XEmacs|Lucid ]]; then - eerror "This package needs GNU Emacs." + eerror "XEmacs detected. This package needs GNU Emacs." return 1 fi - if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then - eerror "This package needs at least Emacs ${need_emacs%%.*}." + # GNU Emacs versions have only numeric components. + if ! [[ ${have_emacs} =~ ^[0-9]+(\.[0-9]+)*$ ]]; then + eerror "Malformed version string: ${have_emacs}" + return 2 + fi + if ! ver_test "${have_emacs}" -ge "${need_emacs}"; then + eerror "This package needs at least Emacs ${need_emacs}." eerror "Use \"eselect emacs\" to select the active version." return 1 fi -- 2.24.1