1 |
To this end, replace the simple numeric comparison of the first |
2 |
component by a call to ver_test. |
3 |
|
4 |
Signed-off-by: Ulrich Müller <ulm@g.o> |
5 |
--- |
6 |
eclass/elisp-common.eclass | 14 ++++++++++---- |
7 |
1 file changed, 10 insertions(+), 4 deletions(-) |
8 |
|
9 |
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass |
10 |
index 79f29ef95ad..6f79caee2f0 100644 |
11 |
--- a/eclass/elisp-common.eclass |
12 |
+++ b/eclass/elisp-common.eclass |
13 |
@@ -158,7 +158,8 @@ |
14 |
# merge and unmerge of a package. |
15 |
|
16 |
case ${EAPI:-0} in |
17 |
- 4|5|6|7) ;; |
18 |
+ 4|5|6) inherit eapi7-ver ;; |
19 |
+ 7) ;; |
20 |
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; |
21 |
esac |
22 |
|
23 |
@@ -230,11 +231,16 @@ elisp-need-emacs() { |
24 |
have_emacs=$(elisp-emacs-version) || return 2 |
25 |
einfo "Emacs version: ${have_emacs}" |
26 |
if [[ ${have_emacs} =~ XEmacs|Lucid ]]; then |
27 |
- eerror "This package needs GNU Emacs." |
28 |
+ eerror "XEmacs detected. This package needs GNU Emacs." |
29 |
return 1 |
30 |
fi |
31 |
- if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then |
32 |
- eerror "This package needs at least Emacs ${need_emacs%%.*}." |
33 |
+ # GNU Emacs versions have only numeric components. |
34 |
+ if ! [[ ${have_emacs} =~ ^[0-9]+(\.[0-9]+)*$ ]]; then |
35 |
+ eerror "Malformed version string: ${have_emacs}" |
36 |
+ return 2 |
37 |
+ fi |
38 |
+ if ! ver_test "${have_emacs}" -ge "${need_emacs}"; then |
39 |
+ eerror "This package needs at least Emacs ${need_emacs}." |
40 |
eerror "Use \"eselect emacs\" to select the active version." |
41 |
return 1 |
42 |
fi |
43 |
-- |
44 |
2.24.1 |