1 |
commit: e78d413e73feb79c9336cd5f9a3ba13129719883 |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 24 22:24:57 2020 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 24 22:27:30 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e78d413e |
7 |
|
8 |
app-eselect/eselect-lua: delete symlinks created by older versions |
9 |
|
10 |
In theory, all the versions of eselect-lua which created those extra |
11 |
symlinks were always masked - but it doesn't really cost one much to try |
12 |
to clean these up and it might make some edge cases easier. |
13 |
|
14 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
15 |
|
16 |
...select-lua-4.ebuild => eselect-lua-4-r1.ebuild} | 0 |
17 |
app-eselect/eselect-lua/files/lua.eselect-4 | 23 ++++++++++++++++++++-- |
18 |
2 files changed, 21 insertions(+), 2 deletions(-) |
19 |
|
20 |
diff --git a/app-eselect/eselect-lua/eselect-lua-4.ebuild b/app-eselect/eselect-lua/eselect-lua-4-r1.ebuild |
21 |
similarity index 100% |
22 |
rename from app-eselect/eselect-lua/eselect-lua-4.ebuild |
23 |
rename to app-eselect/eselect-lua/eselect-lua-4-r1.ebuild |
24 |
|
25 |
diff --git a/app-eselect/eselect-lua/files/lua.eselect-4 b/app-eselect/eselect-lua/files/lua.eselect-4 |
26 |
index 15364c039c8..86c19460a15 100644 |
27 |
--- a/app-eselect/eselect-lua/files/lua.eselect-4 |
28 |
+++ b/app-eselect/eselect-lua/files/lua.eselect-4 |
29 |
@@ -12,6 +12,14 @@ HEADER_FILES="lauxlib.h luaconf.h lua.h lua.hpp lualib.h" |
30 |
remove_symlinks() { |
31 |
rm -f "${EROOT}"/usr/bin/{lua,luac} &>/dev/null |
32 |
rm -f "${EROOT}"/usr/share/man/man1/lua{,c}.1{,.*} &>/dev/null |
33 |
+ # Possible leftovers from earlier versions |
34 |
+ for dir in $(get_libdirs) ; do |
35 |
+ rm -f "${EROOT}"${dir}/liblua.so &>/dev/null && \ |
36 |
+ rm -f "${EROOT}"${dir}/pkgconfig/lua.pc &>/dev/null |
37 |
+ done |
38 |
+ for f in $HEADER_FILES ; do |
39 |
+ rm -f "${EROOT}"/usr/include/${f} |
40 |
+ done |
41 |
} |
42 |
|
43 |
_dup() { |
44 |
@@ -31,6 +39,17 @@ set_symlinks() { |
45 |
done |
46 |
} |
47 |
|
48 |
+get_libdirs() { |
49 |
+ local dir libdirs |
50 |
+ for dir in $(list_libdirs); do |
51 |
+ [[ -L ${EROOT}/usr/${dir} ]] && continue |
52 |
+ ls "${EROOT}"/usr/${dir}/liblua*.* > /dev/null 2>&1 || continue |
53 |
+ |
54 |
+ libdirs+=' '/usr/${dir} |
55 |
+ done |
56 |
+ echo ${libdirs:-/usr/lib} |
57 |
+} |
58 |
+ |
59 |
find_targets() { |
60 |
local dirs |
61 |
local prefix="${EROOT}/usr/bin/" |
62 |
@@ -45,7 +64,7 @@ resolve_target() { |
63 |
if is_number $1; then |
64 |
[[ $1 -le ${#targets[@]} && $1 -gt 0 ]] && echo "${targets[ $(( $1 - 1 )) ]}" |
65 |
elif has $1 ${targets[@]}; then |
66 |
- echo $1 |
67 |
+ echo $1 |
68 |
fi |
69 |
} |
70 |
|
71 |
@@ -80,7 +99,7 @@ do_set() { |
72 |
|
73 |
local target=$(resolve_target $1) |
74 |
if [[ -z "${target}" ]]; then |
75 |
- die -q "You need to specify a version" |
76 |
+ die -q "You need to specify a version" |
77 |
fi |
78 |
remove_symlinks |
79 |
set_symlinks $target |