diff options
author | Marek Szuba <marecki@gentoo.org> | 2020-12-24 22:24:57 +0000 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2020-12-24 22:27:30 +0000 |
commit | e78d413e73feb79c9336cd5f9a3ba13129719883 (patch) | |
tree | 233d4f099e2ade39a8d96b2ac70a6117f6d212e4 /app-eselect | |
parent | dev-util/boost-build: Remove old (diff) | |
download | gentoo-e78d413e73feb79c9336cd5f9a3ba13129719883.tar.gz gentoo-e78d413e73feb79c9336cd5f9a3ba13129719883.tar.bz2 gentoo-e78d413e73feb79c9336cd5f9a3ba13129719883.zip |
app-eselect/eselect-lua: delete symlinks created by older versions
In theory, all the versions of eselect-lua which created those extra
symlinks were always masked - but it doesn't really cost one much to try
to clean these up and it might make some edge cases easier.
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'app-eselect')
-rw-r--r-- | app-eselect/eselect-lua/eselect-lua-4-r1.ebuild (renamed from app-eselect/eselect-lua/eselect-lua-4.ebuild) | 0 | ||||
-rw-r--r-- | app-eselect/eselect-lua/files/lua.eselect-4 | 23 |
2 files changed, 21 insertions, 2 deletions
diff --git a/app-eselect/eselect-lua/eselect-lua-4.ebuild b/app-eselect/eselect-lua/eselect-lua-4-r1.ebuild index 3529ad194141..3529ad194141 100644 --- a/app-eselect/eselect-lua/eselect-lua-4.ebuild +++ b/app-eselect/eselect-lua/eselect-lua-4-r1.ebuild diff --git a/app-eselect/eselect-lua/files/lua.eselect-4 b/app-eselect/eselect-lua/files/lua.eselect-4 index 15364c039c87..86c19460a15f 100644 --- a/app-eselect/eselect-lua/files/lua.eselect-4 +++ b/app-eselect/eselect-lua/files/lua.eselect-4 @@ -12,6 +12,14 @@ HEADER_FILES="lauxlib.h luaconf.h lua.h lua.hpp lualib.h" remove_symlinks() { rm -f "${EROOT}"/usr/bin/{lua,luac} &>/dev/null rm -f "${EROOT}"/usr/share/man/man1/lua{,c}.1{,.*} &>/dev/null + # Possible leftovers from earlier versions + for dir in $(get_libdirs) ; do + rm -f "${EROOT}"${dir}/liblua.so &>/dev/null && \ + rm -f "${EROOT}"${dir}/pkgconfig/lua.pc &>/dev/null + done + for f in $HEADER_FILES ; do + rm -f "${EROOT}"/usr/include/${f} + done } _dup() { @@ -31,6 +39,17 @@ set_symlinks() { done } +get_libdirs() { + local dir libdirs + for dir in $(list_libdirs); do + [[ -L ${EROOT}/usr/${dir} ]] && continue + ls "${EROOT}"/usr/${dir}/liblua*.* > /dev/null 2>&1 || continue + + libdirs+=' '/usr/${dir} + done + echo ${libdirs:-/usr/lib} +} + find_targets() { local dirs local prefix="${EROOT}/usr/bin/" @@ -45,7 +64,7 @@ resolve_target() { if is_number $1; then [[ $1 -le ${#targets[@]} && $1 -gt 0 ]] && echo "${targets[ $(( $1 - 1 )) ]}" elif has $1 ${targets[@]}; then - echo $1 + echo $1 fi } @@ -80,7 +99,7 @@ do_set() { local target=$(resolve_target $1) if [[ -z "${target}" ]]; then - die -q "You need to specify a version" + die -q "You need to specify a version" fi remove_symlinks set_symlinks $target |