commit:     e67308394f12801aae8b004f2753a55c26f59635
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 30 21:49:01 2019 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Aug 30 21:49:01 2019 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=e6730839

Fix version comparison for Emacs 26.1 and later.

* emacs-updater (action_rebuild): Drop the last component,
i.e., the build number, from Emacs versions below 26 only.

Bug: https://bugs.gentoo.org/693140
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog     | 6 ++++++
 emacs-updater | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 45a594e..25f549d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-30  Ulrich Müller  <[email protected]>
+
+       * emacs-updater (action_rebuild): Drop the last component,
+       i.e., the build number, from Emacs versions below 26 only.
+       Fixes bug 693140.
+
 2016-06-08  Ulrich Müller  <[email protected]>
 
        * emacs-updater: Update URLs to use https.

diff --git a/emacs-updater b/emacs-updater
index 3133316..0bca953 100755
--- a/emacs-updater
+++ b/emacs-updater
@@ -237,6 +237,8 @@ action_rebuild() {
     ret=$?
     [[ ${ret} -eq 0 ]] || { failure "Error running Emacs"; exit ${ret}; }
     [[ ${active} ]] || { failure "Cannot determine Emacs version"; exit 1; }
+    # Drop last component (build number) from versions below 26
+    [[ ${active%%.*} -lt 26 ]] && active=${active%.*}
     message "Currently selected GNU Emacs version: ${active}"
 
     for elc in $(find "${ROOT}${SITELISP}" -name "*.elc")
@@ -245,8 +247,9 @@ action_rebuild() {
        ret=$?
        [[ ${ret} -eq 0 ]] || { failure "Error running sed"; exit ${ret}; }
        version=${version:-unknown}
+       [[ ${version%%.*} -lt 26 ]] && version=${version%.*}
 
-       if [[ -z ${MAJOR} && ${version%.*} != "${active%.*}" ]] \
+       if [[ -z ${MAJOR} && ${version} != "${active}" ]] \
            || [[ ${version%%.*} != "${active%%.*}" ]] \
            || [[ $1 = all ]]
        then

Reply via email to