diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-03-03 10:28:17 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-03-03 10:28:17 +0000 |
commit | d99093fb4bb5652015c06274d64083daa2439e4f (patch) | |
tree | cf61513204d97974179580065e85df5c8009087c /net-p2p/mldonkey | |
parent | 463397cf1e064185110fe57c568d73f99a06f5d1 (diff) |
gentoo resync : 03.03.2021
Diffstat (limited to 'net-p2p/mldonkey')
-rw-r--r-- | net-p2p/mldonkey/Manifest | 6 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey.confd (renamed from net-p2p/mldonkey/files/mldonkey.confd-2.8) | 3 | ||||
-rw-r--r-- | net-p2p/mldonkey/files/mldonkey.initd | 70 | ||||
-rw-r--r-- | net-p2p/mldonkey/mldonkey-3.1.7-r1.ebuild (renamed from net-p2p/mldonkey/mldonkey-3.1.7.ebuild) | 7 |
4 files changed, 55 insertions, 31 deletions
diff --git a/net-p2p/mldonkey/Manifest b/net-p2p/mldonkey/Manifest index e0ccb7ab4b07..91f97a60a0f5 100644 --- a/net-p2p/mldonkey/Manifest +++ b/net-p2p/mldonkey/Manifest @@ -1,5 +1,5 @@ -AUX mldonkey.confd-2.8 887 BLAKE2B 43cc5c149ceefc7ec3631d280e0a17266bed0d690b19d34932e7a47131e6c7e2bc0e836821f5b3e1bb4adb1438b1fa7a5b8f7e2f827d0bebfab85025bdea0b3d SHA512 0ec0fe4fcf87222e31852e7e254e5e054bc31b713d5e4679b2a794c6df8cf0347f9a1d3d345bb48144b13d3e8dcb38168d0be32c766b7d678a8055fc066beb4d -AUX mldonkey.initd 3158 BLAKE2B 7cacc7c72de3e80c3d4f79f3e15b4b583169e6391c5cf9350910e683ba296139b899d86a715f588d5c488edc2651ae61db7ed7048c751d6d26c0ba09084adc6c SHA512 33530e71032be0771296fde58a46dc02859a82de5173ff71bbbcdebf879e6d7d6b597b4104db0ab2f319d3f5848db41d17cadbdd781c6f97dd23387b7f823054 +AUX mldonkey.confd 949 BLAKE2B 05e1ceaa111249a979931c14eb599201e525f50af2370318c4bd0b6025694b55167e400c784774719dc084e326de378365e6a53badaf48cc1681003ef5b55ceb SHA512 d45f8ca35aacbd4f05a936c591866b7cb4b19e6c69139f728160c8dc09b3d4c1f689d28fa7287692f8382c291b50ff91b3ea594fe781f861efa991f2927e882c +AUX mldonkey.initd 3509 BLAKE2B d3098a027f044f3bfc7559fa1869f7080844de1cec93fe26424322aafd482c7f010fef96854115e42e4b2a37f31b1d0f6caf94abf0c97c52d794db4767f5c0c1 SHA512 0c423feb9abbe7b08d77a3221a3638a0a93526bbf68c5e60e944413f4fd13ac44813609179b981c31d19e1e8fe11333f16dc8388a144208694cb84c008dbbed3 DIST mldonkey-3.1.7-2.tar.bz2 2801815 BLAKE2B f914648b4e2a358e51518f3b58dc0df803cdb28d7706783504644266690514c17c2cae0688011073391db221eb8f38c7cbaf1e913220d824e41ca2e23d4c8587 SHA512 11cb0fa0db95e918c291009f4121a1b34cf485e5ac6826a72a4dc520dd78d21ced40d205fa26eb451c7d3eb31f2193cbb64e46c99c85dc932762c1bcc4da4934 -EBUILD mldonkey-3.1.7.ebuild 4511 BLAKE2B edb2721ec9dff498eaabafdf1b263c355024107e49582ac7b5a632700270e240c3057f14c6940463dcbb5679a4b0c0935080b77659c7aef8ec7b60cd8d70deba SHA512 500a7865b3ac804f82afc47ed907d554023801c0baa44a4654e68c736d6d0c92b9285a1290d76120f6d3a5e99bcbcf5f2cad54c5bf5db8a20308f7a3826c8fa5 +EBUILD mldonkey-3.1.7-r1.ebuild 4531 BLAKE2B a996af51c615fbce2d18810f4930c60daaa7833ac5c9528bcc1ba8433eb1649f3b5661977aa34ee7a6d78534adb3a4345dd19f68bcc363f0cb8dc4b6bbb530a4 SHA512 1d9c33ff5bfb0b17eb4cb8b56b9096171dc9c7468b01d85bfaf784ef83b538c369aa9d942f3189b8a4dc83916524092758d89fd75f4f3db93d755029b5e437c6 MISC metadata.xml 779 BLAKE2B d57b3c5b63c33bbb2fa699498dd7d05038fba219c8778a50b1acdfa9c4be4e5b3161af20ec29cc44f63c3a4d33fa7c93faa7835a5f269646b3a8873349702ae6 SHA512 97d2135549869254658d258e3833bf0c700edddf94fa7b40244b14b4bece855b7683191d33db5ad9ccef2884a63ee2ea6e8f9dc5ef28bd1a870266930c610c0c diff --git a/net-p2p/mldonkey/files/mldonkey.confd-2.8 b/net-p2p/mldonkey/files/mldonkey.confd index 1d1f282234f7..7cdb2b7134ed 100644 --- a/net-p2p/mldonkey/files/mldonkey.confd-2.8 +++ b/net-p2p/mldonkey/files/mldonkey.confd @@ -33,6 +33,9 @@ SERVER="localhost" # port for webinterface, usually 4080 PORT="4080" +# port for telnet interface, usually 4000 +TELNET_PORT="4000" + # to enable password restricted access, # uncomment and set BOTH following vars: #USERNAME="admin" diff --git a/net-p2p/mldonkey/files/mldonkey.initd b/net-p2p/mldonkey/files/mldonkey.initd index 12dd599de7be..b7e561372392 100644 --- a/net-p2p/mldonkey/files/mldonkey.initd +++ b/net-p2p/mldonkey/files/mldonkey.initd @@ -35,26 +35,55 @@ start() { eend $? } -setup_uri() { - BASE="http://" +send_telnet_commands() { + if [ -z "${TELNET_PORT+x}" ]; then + return 1 + fi + local cmds= if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then - BASE="${BASE}${USERNAME}:${PASSWORD}@" + cmds="auth ${USERNAME} ${PASSWORD}\n" fi - BASE="${BASE}${SERVER}:${PORT}" + cmds="$cmds\nansi false\n" + while [ $# -gt 0 ]; do + cmds="$cmds$1\n" + shift + done + printf "$cmds\nexit\n" | nc -w "${MLDONKEY_TIMEOUT}" localhost "${TELNET_PORT}" 2> /dev/null + return $? +} + +send_http_commands() { + if [ -z "${PORT+x}" ]; then + return 1 + fi + local base="http://" + if [ -n "${USERNAME}" -a -n "${PASSWORD}" ]; then + base="${base}${USERNAME}:${PASSWORD}@" + fi + base="${base}${SERVER}:${PORT}" + local retval=0 + while [ $retval -eq 0 -a $# -gt 0 ]; do + wget -q -O /dev/stdout --timeout="${MLDONKEY_TIMEOUT}" "${base}/submit?q=${1// /+}" 2> /dev/null + retval=$? + shift + done + return $retval +} + +send_commands() { + send_telnet_commands "$@" &> /dev/null || send_http_commands "$@" &> /dev/null + return $? } stop() { ebegin "Stopping ${SVCNAME} -- please wait" - setup_uri - wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=close_fds -q - wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=save -q - wget --spider --timeout="${MLDONKEY_TIMEOUT}" "${BASE}"/submit?q=kill -q + send_commands close_fds save kill # give it a chance to die: local timeout=${MLDONKEY_TIMEOUT} while [ $timeout -gt 0 ]; do - if ! start-stop-daemon --test --quiet --stop \ + if ! start-stop-daemon --test --quiet --quiet --stop \ --exec "${MLDONKEY_BINARY}" \ --pidfile /var/run/"${SVCNAME}".pid ; then eend 0 @@ -87,32 +116,23 @@ reload() { slow() { ebegin "Reducing bandwidth to ${LOW_DOWN}k/${LOW_UP}k" - setup_uri - wget --spider --timeout="${MLDONKEY_TIMEOUT}" \ - "${BASE}/submit?q=set+max_hard_download_rate+${LOW_DOWN}" -q - wget --spider --timeout=${MLDONKEY_TIMEOUT} \ - "${BASE}/submit?q=set+max_hard_upload_rate+${LOW_UP}" -q + send_commands "set max_hard_download_rate ${LOW_DOWN}" "set max_hard_upload_rate ${LOW_UP}" eend $? } fast() { ebegin "Increasing bandwidth to ${HIGH_DOWN}k/${HIGH_UP}k" - - setup_uri - wget --spider --timeout="${MLDONKEY_TIMEOUT}" \ - "${BASE}/submit?q=set+max_hard_upload_rate+${HIGH_UP}" -q - wget --spider --timeout="${MLDONKEY_TIMEOUT}" \ - "${BASE}/submit?q=set+max_hard_download_rate+${HIGH_DOWN}" -q + send_commands "set max_hard_upload_rate ${HIGH_UP}" "set max_hard_download_rate ${HIGH_DOWN}" eend $? } info() { - setup_uri - local result=$(wget --timeout="${MLDONKEY_TIMEOUT}" \ - -O - "${BASE}"/submit?q=vo 2>/dev/null | \ - grep -C1 max_hard_upload | \ - grep value=\" | cut -d\" -f2) + set -o pipefail + local result=$( + send_telnet_commands "voo max_hard_upload_rate" | grep -a 'max_hard_upload_rate.* =' | cut -d \ -f 3 || + send_http_commands "voo max_hard_upload_rate" | fgrep name=value | sed -e 's/.*value="//' -e 's/".*//' + ) if [ "${result}" = "${LOW_UP}" ]; then einfo "${SVCNAME} runs slow" else diff --git a/net-p2p/mldonkey/mldonkey-3.1.7.ebuild b/net-p2p/mldonkey/mldonkey-3.1.7-r1.ebuild index e74b093c8948..0eaeac9e7461 100644 --- a/net-p2p/mldonkey/mldonkey-3.1.7.ebuild +++ b/net-p2p/mldonkey/mldonkey-3.1.7-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI="7" @@ -11,7 +11,7 @@ SRC_URI="https://github.com/ygrek/mldonkey/releases/download/release-${PV//./-}- LICENSE="GPL-2" SLOT="0" -KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ppc ~ppc64 x86" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~x86" IUSE="bittorrent doc fasttrack gd gnutella gtk guionly magic +ocamlopt upnp" @@ -19,6 +19,7 @@ REQUIRED_USE="guionly? ( gtk )" RDEPEND="dev-lang/perl dev-ml/camlp4:= + net-analyzer/netcat gd? ( media-libs/gd[truetype] ) gtk? ( gnome-base/librsvg @@ -137,7 +138,7 @@ src_install() { done use bittorrent && newbin "make_torrent${myext}" make_torrent - newconfd "${FILESDIR}/mldonkey.confd-2.8" mldonkey + newconfd "${FILESDIR}/mldonkey.confd" mldonkey fperms 600 /etc/conf.d/mldonkey newinitd "${FILESDIR}/mldonkey.initd" mldonkey fi |