From 3002c3d0893c0c0f333d60eeb6d4a41e5fcb127a Mon Sep 17 00:00:00 2001 From: Rick Farina Date: Wed, 12 Jun 2019 16:10:40 -0400 Subject: [PATCH] app-eselect/eselect-metasploit: fix lib dir get_libdir and other hacks were being used despite the ebuild installing to /usr/lib and not /usr/$(get_libdir) now. This was hidden by profile 17.0 but found by a user on 17.1 Package-Manager: Portage-2.3.67, Repoman-2.3.14 Signed-off-by: Rick Farina --- .../eselect-metasploit-0.17.ebuild | 40 ++++ .../files/metasploit.eselect-0.17 | 197 ++++++++++++++++++ 2 files changed, 237 insertions(+) create mode 100644 app-eselect/eselect-metasploit/eselect-metasploit-0.17.ebuild create mode 100644 app-eselect/eselect-metasploit/files/metasploit.eselect-0.17 diff --git a/app-eselect/eselect-metasploit/eselect-metasploit-0.17.ebuild b/app-eselect/eselect-metasploit/eselect-metasploit-0.17.ebuild new file mode 100644 index 000000000000..1d5193b54601 --- /dev/null +++ b/app-eselect/eselect-metasploit/eselect-metasploit-0.17.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multilib + +DESCRIPTION="eselect module for metasploit" +HOMEPAGE="https://www.pentoo.ch/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" + +DEPEND="app-admin/eselect + !" +} + +describe_set_options() { + echo " : Target name or number (from 'list' action)" + echo "--use-old : If an implementation is already set, use that one instead" +} + +do_set() { + local action="error" + local current=$(basename "$(canonicalise "${EROOT}${MSFPATH}")") + local available=( $(find_targets) ) + local new + local opt + + while [[ ${#@} -gt 0 ]] ; do + opt=$1 + shift + case ${opt} in + --use-old) + if [[ -n "${current}" ]] && has "${current}" "${available[@]}"; then + action="old-implementation" + fi + ;; + metasploit*) + if [[ "${action}" != "old-implementation" ]] ; then + action="set-implementation" + fi + + if has ${opt} ${available[@]}; then + new="${opt}" + else + echo "You need to emerge ${opt} before you try to eselect it" + fi + ;; + *) + if [[ "${action}" != "old-implementation" ]] ; then + action="set-implementation" + fi + + if is_number ${opt} ; then + #targets=( $(get_implementations) ) + new=${available[opt - 1]} + if [[ -z ${new} ]] ; then + die -q "Unrecognized option: ${opt}" + fi + else + die -q "Unrecognized option: ${opt}" + fi + ;; + esac + done + + case ${action} in + old-implementation) + set_symlink_safe ${current} + return $? + ;; + set-implementation) + if [[ -n ${new} ]] ; then + set_symlink_safe ${new} + return $? + else + die -q "Please specify an implementation to set" + fi + ;; + *) + die -q "Invalid usage of set action." + ;; + esac +} -- 2.26.2