commit:     cd03bb12fa2799c76987346f6834b78fda9285a7
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Tue May 29 16:33:42 2018 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Tue May 29 16:33:42 2018 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=cd03bb12

New get_libdir function.

* libs/multilib.bash.in (get_libdir): New function.
* doc/developer-guide.txt: Describe it.
* libs/Makefile.am (dosed): Substitute @libdir@.
* misc/eselect-mode.el (eselect-mode-keywords-multilib):
Add get_libdir.

 ChangeLog               | 8 ++++++++
 doc/developer-guide.txt | 6 ++++++
 libs/Makefile.am        | 3 ++-
 libs/multilib.bash.in   | 7 +++++++
 misc/eselect-mode.el    | 2 +-
 5 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d94fe63..4f6510e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-05-29  Ulrich Müller  <u...@gentoo.org>
+
+       * libs/multilib.bash.in (get_libdir): New function.
+       * doc/developer-guide.txt: Describe it.
+       * libs/Makefile.am (dosed): Substitute @libdir@.
+       * misc/eselect-mode.el (eselect-mode-keywords-multilib):
+       Add get_libdir.
+
 2018-01-24  Ulrich Müller  <u...@gentoo.org>
 
        * configure.ac: Update version to 1.4.12.

diff --git a/doc/developer-guide.txt b/doc/developer-guide.txt
index ddef9f7..408b2a7 100644
--- a/doc/developer-guide.txt
+++ b/doc/developer-guide.txt
@@ -473,6 +473,12 @@ used architecture. By default it uses /etc/ld.so.conf to 
obtain all
 valid libdirs. If this fails due to a missing or broken file, this
 function uses ``uname`` to determine the architecture.
 
+The ``get_libdir`` function
+,,,,,,,,,,,,,,,,,,,,,,,,,,,
+
+The ``get_libdir`` function prints the basename of the libdir path that
+was passed to eselect's configure.
+
 Package-manager functions
 -------------------------
 

diff --git a/libs/Makefile.am b/libs/Makefile.am
index 027ef73..6ebd08e 100644
--- a/libs/Makefile.am
+++ b/libs/Makefile.am
@@ -30,7 +30,8 @@ dosed = @SED@ \
        -e 's%\@SED\@%@SED@%g' \
        -e 's%\@PORTAGEQ\@%@PORTAGEQ@%g' \
        -e 's%\@ENV_UPDATE\@%@ENV_UPDATE@%g' \
-       -e 's%\@CANONICALISE\@%@CANONICALISE@%g'
+       -e 's%\@CANONICALISE\@%@CANONICALISE@%g' \
+       -e 's%\@libdir\@%@libdir@%g'
 
 %.bash : %.bash.in
        @$(dosed) $< > $@

diff --git a/libs/multilib.bash.in b/libs/multilib.bash.in
index 4225adb..e84670e 100644
--- a/libs/multilib.bash.in
+++ b/libs/multilib.bash.in
@@ -28,3 +28,10 @@ list_libdirs() {
        done
        echo "${libdirs[@]}"
 }
+
+# get_libdir
+# Print the basename of the libdir path
+get_libdir() {
+       local libdir="@libdir@"
+       echo "${libdir##*/}"
+}

diff --git a/misc/eselect-mode.el b/misc/eselect-mode.el
index b51b60b..762137a 100644
--- a/misc/eselect-mode.el
+++ b/misc/eselect-mode.el
@@ -61,7 +61,7 @@
     font-lock-type-face))
 
 (defvar eselect-mode-keywords-multilib
-  '(("list_libdirs")
+  '(("list_libdirs" "get_libdir")
     font-lock-type-face))
 
 (defvar eselect-mode-keywords-package-manager

Reply via email to