commit:     ddf4c60d7b580790322c8b677490dbbaead15073
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon May 25 13:13:13 2015 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon May 25 13:13:13 2015 +0000
URL:        https://gitweb.gentoo.org/proj/emacs.git/commit/?id=ddf4c60d

elisp-common.eclass: Fix filename matching in elisp-site-file-install.

* elisp-common.eclass (elisp-site-file-install): Fix filename
matching. It should use shortest match, not longest.

 eclass/ChangeLog           | 5 +++++
 eclass/elisp-common.eclass | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index cef4072..3cfdab5 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-25  Ulrich Müller  <[email protected]>
+
+       * elisp-common.eclass (elisp-site-file-install): Fix filename
+       matching. It should use shortest match, not longest.
+
 2014-06-07  Ulrich Müller  <[email protected]>
 
        * elisp.eclass (DEPEND): Increase minimum Emacs version to 23.

diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 6f93e92..36ad8ae 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -322,7 +322,8 @@ elisp-site-file-install() {
 
        [[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
                || ewarn "elisp-site-file-install: bad name of site-init file"
-       sf="${T}/${sf/%-gentoo*.el/-gentoo.el}"
+       [[ ${sf%-gentoo*.el} != "${sf}" ]] && sf="${sf%-gentoo*.el}-gentoo.el"
+       sf="${T}/${sf}"
        ebegin "Installing site initialisation file for GNU Emacs"
        [[ $1 = "${sf}" ]] || cp "$1" "${sf}"
        sed -i -e 
"1{:x;/^\$/{n;bx;};/^;.*${PN}/I!s:^:${header}\n\n:;1s:^:\n:;}" \

Reply via email to