* [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/
@ 2016-05-03 9:14 Alexis Ballier
0 siblings, 0 replies; 3+ messages in thread
From: Alexis Ballier @ 2016-05-03 9:14 UTC (permalink / raw
To: gentoo-commits
commit: 1ddc06bf06bc144de45139545ff4eb6f660b443c
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Sun May 1 16:01:08 2016 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Tue May 3 09:13:52 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ddc06bf
net-p2p/mldonkey: fix build with ocaml 4.03
Package-Manager: portage-2.2.28
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>
net-p2p/mldonkey/files/ocaml-4.03.patch | 145 ++++++++++++++++++++++++++++++++
net-p2p/mldonkey/mldonkey-3.1.5.ebuild | 1 +
2 files changed, 146 insertions(+)
diff --git a/net-p2p/mldonkey/files/ocaml-4.03.patch b/net-p2p/mldonkey/files/ocaml-4.03.patch
new file mode 100644
index 0000000..fce94c8
--- /dev/null
+++ b/net-p2p/mldonkey/files/ocaml-4.03.patch
@@ -0,0 +1,145 @@
+Index: mldonkey-3.1.5/src/config/unix/os_stubs_c.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/config/unix/os_stubs_c.c
++++ mldonkey-3.1.5/src/config/unix/os_stubs_c.c
+@@ -66,7 +66,7 @@ ssize_t os_read(OS_FD fd, char *buf, siz
+
+ void os_ftruncate(OS_FD fd, OFF_T len, /* bool */ int sparse)
+ {
+- int64 cursize;
++ int64_t cursize;
+ if(!fd) failwith("ftruncate32: file is closed");
+
+ cursize = os_getfdsize(fd);
+@@ -109,7 +109,7 @@ int os_getdtablesize()
+
+ *******************************************************************/
+
+-int64 os_getfdsize(OS_FD fd)
++int64_t os_getfdsize(OS_FD fd)
+ {
+ struct stat buf;
+
+@@ -127,7 +127,7 @@ int64 os_getfdsize(OS_FD fd)
+
+ *******************************************************************/
+
+-int64 os_getfilesize(char *path)
++int64_t os_getfilesize(char *path)
+ {
+ struct stat buf;
+
+Index: mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/networks/donkey/donkeyGlobals.ml
++++ mldonkey-3.1.5/src/networks/donkey/donkeyGlobals.ml
+@@ -781,7 +781,6 @@ let set_client_name c name md4 =
+ c.client_md4 <- md4;
+ end
+
+-exception ClientFound of client
+ let find_client_by_name name =
+ try
+ H.iter (fun c ->
+Index: mldonkey-3.1.5/src/utils/cdk/zip.ml
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/cdk/zip.ml
++++ mldonkey-3.1.5/src/utils/cdk/zip.ml
+@@ -72,8 +72,6 @@ type out_file =
+ mutable of_entries: entry list;
+ of_comment: string }
+
+-exception Error of string * string * string
+-
+ (* Return the position of the last occurrence of s1 in s2, or -1 if not
+ found. *)
+
+Index: mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/cdk/zlibstubs.c
++++ mldonkey-3.1.5/src/utils/cdk/zlibstubs.c
+@@ -191,7 +191,7 @@ value camlzip_inflateEnd(value vzs)
+
+ value camlzip_update_crc32(value crc, value buf, value pos, value len)
+ {
+- return copy_int32(crc32((uint32) Int32_val(crc),
++ return copy_int32(crc32((uint32_t) Int32_val(crc),
+ &Byte_u(buf, Long_val(pos)),
+ Long_val(len)));
+ }
+Index: mldonkey-3.1.5/src/utils/lib/fst_hash.c
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/fst_hash.c
++++ mldonkey-3.1.5/src/utils/lib/fst_hash.c
+@@ -197,7 +197,7 @@ unsigned short fst_hash_checksum (unsign
+ /*****************************************************************************/
+
+ // hash file
+-int fst_hash_file (unsigned char *fth, char *file, int64 filesize)
++int fst_hash_file (unsigned char *fth, char *file, int64_t filesize)
+ {
+ FILE *fp;
+ unsigned char *buf;
+@@ -271,7 +271,7 @@ int fst_hash_file (unsigned char *fth, c
+ }
+
+
+-void fst_hash_string (unsigned char *fth, unsigned char *file, int64 filesize)
++void fst_hash_string (unsigned char *fth, unsigned char *file, int64_t filesize)
+ {
+ unsigned char * buf = file;
+ size_t len = filesize;
+Index: mldonkey-3.1.5/src/utils/lib/options.ml4
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/options.ml4
++++ mldonkey-3.1.5/src/utils/lib/options.ml4
+@@ -332,7 +332,6 @@ let exit_exn = Exit
+
+
+ let unsafe_get = String.unsafe_get
+-external is_printable : char -> bool = "caml_is_printable"
+ let unsafe_set = String.unsafe_set
+
+ let escaped s =
+@@ -343,7 +342,7 @@ let escaped s =
+ (match unsafe_get s i with
+ '"' | '\\' -> 2
+ | '\n' | '\t' -> 1
+- | c -> if is_printable c then 1 else 4)
++ | c -> 1)
+ done;
+ if !n = String.length s then s
+ else
+@@ -354,16 +353,7 @@ let escaped s =
+ '"' | '\\' as c -> unsafe_set s' !n '\\'; incr n; unsafe_set s' !n c
+ | '\n' | '\t' as c -> unsafe_set s' !n c
+ | c ->
+- if is_printable c then unsafe_set s' !n c
+- else
+- let a = int_of_char c in
+- unsafe_set s' !n '\\';
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a / 100));
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a / 10 mod 10));
+- incr n;
+- unsafe_set s' !n (char_of_int (48 + a mod 10))
++ unsafe_set s' !n c
+ end;
+ incr n
+ done;
+Index: mldonkey-3.1.5/src/utils/lib/os_stubs.h
+===================================================================
+--- mldonkey-3.1.5.orig/src/utils/lib/os_stubs.h
++++ mldonkey-3.1.5/src/utils/lib/os_stubs.h
+@@ -155,8 +155,8 @@ extern OFF_T os_lseek(OS_FD fd, OFF_T po
+ extern void os_ftruncate(OS_FD fd, OFF_T len, int sparse);
+ extern ssize_t os_read(OS_FD fd, char *buf, size_t len);
+ extern int os_getdtablesize();
+-extern int64 os_getfdsize(OS_FD fd);
+-extern int64 os_getfilesize(char *path);
++extern int64_t os_getfdsize(OS_FD fd);
++extern int64_t os_getfilesize(char *path);
+ extern void os_set_nonblock(OS_SOCKET fd);
+ extern void os_uname(char buf[]);
+ extern int os_os_supported();
diff --git a/net-p2p/mldonkey/mldonkey-3.1.5.ebuild b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
index 84b99e1..b0eeb03 100644
--- a/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
+++ b/net-p2p/mldonkey/mldonkey-3.1.5.ebuild
@@ -59,6 +59,7 @@ src_prepare() {
cd "${S}"
use ocamlopt || sed -i -e "s/ocamlopt/idontwantocamlopt/g" "${S}/config/configure" || die "failed to disable ocamlopt"
epatch "${FILESDIR}/ocaml4.patch"
+ has_version '>=dev-lang/ocaml-4.03' && epatch "${FILESDIR}/ocaml-4.03.patch"
}
src_configure() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/
@ 2021-02-18 8:25 Joonas Niilola
0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2021-02-18 8:25 UTC (permalink / raw
To: gentoo-commits
commit: 30cf999cd2ab9c4d29751305c986d4e692721d2c
Author: Jesus P Rey (Chuso) <gentoo <AT> chuso <DOT> net>
AuthorDate: Sat Jan 30 19:18:29 2021 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Feb 18 08:24:51 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30cf999c
net-p2p/mldonkey: revision bump to 3.1.7-r1
Adds support to send init.d commands via telnet in addition to http.
Signed-off-by: Jesus P Rey <gentoo <AT> chuso.net>
Closes: https://bugs.gentoo.org/338017
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
.../files/{mldonkey.confd-2.8 => mldonkey.confd} | 3 +
net-p2p/mldonkey/files/mldonkey.initd | 70 ++++++++++++++--------
...onkey-3.1.7.ebuild => mldonkey-3.1.7-r1.ebuild} | 3 +-
3 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/net-p2p/mldonkey/files/mldonkey.confd-2.8 b/net-p2p/mldonkey/files/mldonkey.confd
similarity index 93%
rename from net-p2p/mldonkey/files/mldonkey.confd-2.8
rename to net-p2p/mldonkey/files/mldonkey.confd
index 1d1f282234f..7cdb2b7134e 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 12dd599de7b..b7e56137239 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
similarity index 98%
rename from net-p2p/mldonkey/mldonkey-3.1.7.ebuild
rename to net-p2p/mldonkey/mldonkey-3.1.7-r1.ebuild
index 07ce1065498..0eaeac9e746 100644
--- a/net-p2p/mldonkey/mldonkey-3.1.7.ebuild
+++ b/net-p2p/mldonkey/mldonkey-3.1.7-r1.ebuild
@@ -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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/
@ 2021-07-16 1:34 Sam James
0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2021-07-16 1:34 UTC (permalink / raw
To: gentoo-commits
commit: 207859482e3cca4d24bbb1d96e7a0f3511725d38
Author: Jesus P Rey (Chuso) <gentoo <AT> chuso <DOT> net>
AuthorDate: Thu Jul 15 18:56:30 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 16 01:33:18 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20785948
net-p2p/mldonkey: Patch for C++17 support.
Signed-off-by: Jesus P Rey <gentoo <AT> chuso.net>
Closes: https://bugs.gentoo.org/790134
Closes: https://github.com/gentoo/gentoo/pull/21663
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-p2p/mldonkey/files/cpp17-byte-namespace.patch | 63 +++++++++++++++++++++++
net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild | 2 +
2 files changed, 65 insertions(+)
diff --git a/net-p2p/mldonkey/files/cpp17-byte-namespace.patch b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
new file mode 100644
index 00000000000..0b1ca44e8ee
--- /dev/null
+++ b/net-p2p/mldonkey/files/cpp17-byte-namespace.patch
@@ -0,0 +1,63 @@
+diff -ur a/src/utils/lib/CryptoPP.cc b/src/utils/lib/CryptoPP.cc
+--- a/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:46.675183781 +0200
++++ b/src/utils/lib/CryptoPP.cc 2021-07-06 22:20:51.025182789 +0200
+@@ -9482,7 +9482,7 @@
+ #define PRIVKEYSIZE 384
+
+ static Signer* s_signer = NULL;
+-static byte m_publicKey[MAXPUBKEYSIZE+1];
++static CryptoPP::byte m_publicKey[MAXPUBKEYSIZE+1];
+ static unsigned long m_publicKeyLen = 0;
+
+ void cc_lprintf_nl(const char * msg, bool verb);
+@@ -9555,7 +9555,7 @@
+
+
+ // return signatureSize (buf)
+-int createSignature(byte *buf, int maxLen, byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
++int createSignature(CryptoPP::byte *buf, int maxLen, CryptoPP::byte *key, int keyLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
+
+ int result = 0;
+
+@@ -9570,7 +9570,7 @@
+ CryptoPP::SecByteBlock sBB(s_signer->SignatureLength());
+ CryptoPP::AutoSeededRandomPool rng;
+
+- byte bArray[MAXPUBKEYSIZE+9];
++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
+
+ memcpy(bArray,key,keyLen);
+ PokeUInt32(bArray+keyLen,cInt);
+@@ -9597,7 +9597,7 @@
+
+ }
+
+-int verifySignature(byte *key, int keyLen, byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
++int verifySignature(CryptoPP::byte *key, int keyLen, CryptoPP::byte *sig, int sigLen, uint32_t cInt, uint8_t ipType, uint32_t ip) {
+ using namespace CryptoPP;
+
+ bool result = false;
+@@ -9607,7 +9607,7 @@
+ StringSource ss_Pubkey(key, keyLen,true,0);
+ Verifier pubKey(ss_Pubkey);
+
+- byte bArray[MAXPUBKEYSIZE+9];
++ CryptoPP::byte bArray[MAXPUBKEYSIZE+9];
+
+ memcpy(bArray,m_publicKey,m_publicKeyLen);
+ PokeUInt32(bArray+m_publicKeyLen,cInt);
+diff -ur a/src/utils/lib/CryptoPP.h b/src/utils/lib/CryptoPP.h
+--- a/src/utils/lib/CryptoPP.h 2021-07-06 22:20:46.675183781 +0200
++++ b/src/utils/lib/CryptoPP.h 2021-07-06 22:20:56.271848200 +0200
+@@ -181,10 +181,9 @@
+ # define __USE_W32_SOCKETS
+ #endif
+
+-typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
+-
+ NAMESPACE_BEGIN(CryptoPP)
+
++typedef unsigned char byte; // put in global namespace to avoid ambiguity with other byte typedefs
+ typedef unsigned short word16;
+ typedef unsigned int word32;
+
diff --git a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
index 8557ea1a285..c1bb19df5b6 100644
--- a/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
+++ b/net-p2p/mldonkey/mldonkey-3.1.7-r2.ebuild
@@ -51,6 +51,8 @@ DEPEND="${COMMON_DEPEND}
RESTRICT="!ocamlopt? ( strip )"
+PATCHES=( "${FILESDIR}/cpp17-byte-namespace.patch" )
+
S="${WORKDIR}/${P}-2"
pkg_setup() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-16 1:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-16 1:34 [gentoo-commits] repo/gentoo:master commit in: net-p2p/mldonkey/, net-p2p/mldonkey/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2021-02-18 8:25 Joonas Niilola
2016-05-03 9:14 Alexis Ballier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox