public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-ftp/linksys-tftp/files/, net-ftp/linksys-tftp/
@ 2021-01-06 20:58 Stephan Hartmann
  0 siblings, 0 replies; only message in thread
From: Stephan Hartmann @ 2021-01-06 20:58 UTC (permalink / raw
  To: gentoo-commits

commit:     1bbce1aa65668a27a99be58a006ada7694ecea59
Author:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
AuthorDate: Tue Jan  5 15:09:55 2021 +0000
Commit:     Stephan Hartmann <sultan <AT> gentoo <DOT> org>
CommitDate: Wed Jan  6 20:58:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bbce1aa

net-ftp/linksys-tftp: fix -fno-common and clang build, EAPI 7

Closes: https://bugs.gentoo.org/707040
Closes: https://bugs.gentoo.org/731218
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org>

 .../files/linksys-tftp-1.2.1-r1-clang.patch        | 196 +++++++++++++++++++++
 .../files/linksys-tftp-1.2.1-r1-fno-common.patch   |  11 ++
 net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild  |  21 +--
 3 files changed, 218 insertions(+), 10 deletions(-)

diff --git a/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-clang.patch b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-clang.patch
new file mode 100644
index 00000000000..94ccee0c9ee
--- /dev/null
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-clang.patch
@@ -0,0 +1,196 @@
+--- a/main.c
++++ b/main.c
+@@ -159,7 +159,7 @@ setpeer(argc, argv)
+ 
+ 	if (!argv[1]) {
+ 		printf("usage: %s host-name [port] (Default port is 69/udp)\n", argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	host = gethostbyname(argv[1]);
+ 	if (host) {
+@@ -172,7 +172,7 @@ setpeer(argc, argv)
+ 		if (sin.sin_addr.s_addr == -1) {
+ 			connected = 0;
+ 			printf("%s: unknown host\n", argv[1]);
+-			return;
++			return 0;
+ 		}
+ 		strcpy(hostname, argv[1]);
+ 	}
+@@ -182,7 +182,7 @@ setpeer(argc, argv)
+ 		if (port < 0) {
+ 			printf("%s: bad port number\n", argv[2]);
+ 			connected = 0;
+-			return;
++			return 0;
+ 		}
+ 		port = htons(port);
+ 	}
+@@ -209,7 +209,7 @@ modecmd(argc, argv)
+ 
+ 	if (argc < 2) {
+ 		printf("Using %s mode to transfer files.\n", mode);
+-		return;
++		return 0;
+ 	}
+ 	if (argc == 2) {
+ 		for (p = modes; p->m_name; p++)
+@@ -217,7 +217,7 @@ modecmd(argc, argv)
+ 				break;
+ 		if (p->m_name) {
+ 			setmode(p->m_mode);
+-			return;
++			return 0;
+ 		}
+ 		printf("%s: unknown mode\n", argv[1]);
+ 		/* drop through and print usage message */
+@@ -231,7 +231,7 @@ modecmd(argc, argv)
+ 			sep = " | ";
+ 	}
+ 	printf(" ]\n");
+-	return;
++	return 0;
+ }
+ 
+ setbinary(argc, argv)
+@@ -265,31 +265,32 @@ put(argc, argv)
+ 
+ 	if (argc < 3) {
+ 		putusage(argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	linkpass = argv[2];
+ 	if (!connected) {
+ 		fprintf(stderr,"No target machine specified.\n");
+-		return;
++		return 0;
+ 	}
+ 		cp = argv[1];
+ 		fd = open(cp, O_RDONLY);
+ 		if (fd < 0) {
+ 			fprintf(stderr, "tftp: "); perror(cp);
+-			return;
++			return 0;
+ 		}
+ 		if (verbose)
+ 			printf("putting %s to %s:%s [%s] AUTH %s\n",
+ 				cp, hostname, cp, mode, linkpass);
+ 		sin.sin_port = port;
+ 		sendfile(fd, cp, mode, linkpass);
+-		return;
++		return 0;
+ }
+ 
+ putusage(s)
+ 	char *s;
+ {
+ 	printf("usage: %s file [linksys pass] (you must be connected)\n", s);
++	return 0;
+ }
+ 
+ /*
+@@ -304,18 +305,18 @@ get(argc, argv)
+ 
+ 	if (argc < 3) {
+ 		getusage(argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	linkpass = argv[2];
+ 	if (!connected) {
+ 		fprintf(stderr,"No target machine specified.\n");
+-		return;
++		return 0;
+ 	}
+ 		cp = argv[1];
+ 		fd = creat(cp, 0644);
+ 		if (fd < 0) {
+ 			fprintf(stderr, "tftp: "); perror(cp);
+-			return;
++			return 0;
+ 		}
+ 		if (verbose)
+ 			printf("getting from %s:%s to %s [%s] AUTH %s\n",
+@@ -323,7 +324,7 @@ get(argc, argv)
+ 		sin.sin_port = port;
+ 		recvfile(fd, cp, mode, linkpass);
+ 		
+-		return;
++		return 0;
+ }
+ 
+ getusage(s)
+@@ -349,7 +350,7 @@ setrexmt(argc, argv)
+ 	}
+ 	if (argc != 2) {
+ 		printf("usage: %s value\n", argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	t = atoi(argv[1]);
+ 	if (t < 0)
+@@ -375,7 +376,7 @@ settimeout(argc, argv)
+ 	}
+ 	if (argc != 2) {
+ 		printf("usage: %s value\n", argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	t = atoi(argv[1]);
+ 	if (t < 0)
+@@ -450,7 +451,7 @@ getcmd(name)
+ 	longest = 0;
+ 	nmatches = 0;
+ 	found = 0;
+-	if(!name) return;
++	if(!name) return 0;
+ 	for (c = cmdtab; p = c->name; c++) {
+ 		for (q = name; *q == *p++; q++)
+ 			if (*q == 0)		/* exact match? */
+@@ -513,7 +514,7 @@ help(argc, argv)
+ 		printf("Commands may be abbreviated.  Commands are:\n\n");
+ 		for (c = cmdtab; c->name; c++)
+ 			printf("%-*s\t%s\n", HELPINDENT, c->name, c->help);
+-		return;
++		return 0;
+ 	}
+ 	while (--argc > 0) {
+ 		register char *arg;
+@@ -557,7 +558,7 @@ setblocksize(argc, argv)
+ 	}
+ 	if (argc != 2) {
+ 		printf("usage: %s value\n", argv[0]);
+-		return;
++		return 0;
+ 	}
+ 	t = atoi(argv[1]);
+ 	if (t < 8 || t > 1432)
+@@ -570,5 +571,5 @@ banner() {
+ 	printf("Mike Lynn\tabaddon [at] 802.11ninja.net\n");
+ 	printf("Linksys TFTP Client for *BSD/Linux\tThe Firmware gets sexier\n");
+ 	printf("Modified Berkeley TFTP client Release: %s\n\n",svers);
+-	return;
++	return 0;
+ }
+--- a/tftpsubs.c
++++ b/tftpsubs.c
+@@ -116,7 +116,7 @@ read_ahead(file, convert)
+ 
+ 	b = &bfs[nextone];              /* look at "next" buffer */
+ 	if (b->counter != BF_FREE)      /* nop if not free */
+-		return;
++		return 0;
+ 	nextone = !nextone;             /* "incr" next buffer ptr */
+ 
+ 	dp = (struct tftphdr *)b->buf;
+@@ -131,7 +131,7 @@ read_ahead(file, convert)
+ 				b->counter += i;
+ 		} while (i != 0 && !(i < 0 && errno != EINTR) &&
+ 			 b->counter < segsize);
+-		return;
++		return 0;
+ 	}
+ 
+ 	p = dp->th_data;

diff --git a/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-fno-common.patch b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-fno-common.patch
new file mode 100644
index 00000000000..a6397761984
--- /dev/null
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-fno-common.patch
@@ -0,0 +1,11 @@
+--- a/tftp.c
++++ b/tftp.c
+@@ -50,7 +50,7 @@ extern	int	segsize;
+ #define PKTSIZE    (1432+4) /* SEGSIZE+4 */
+ char    ackbuf[PKTSIZE];
+ int	timeout;
+-jmp_buf	toplevel;
++extern jmp_buf	toplevel;
+ jmp_buf	timeoutbuf;
+ 
+ #ifndef OACK

diff --git a/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild b/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
index b265bc6ee05..ba390c75867 100644
--- a/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
+++ b/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild
@@ -1,23 +1,24 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=7
 
-inherit eutils toolchain-funcs
+inherit toolchain-funcs
 
 DESCRIPTION="TFTP client suitable for uploading to the Linksys WRT54G Wireless Router"
-HOMEPAGE="https://www.redsand.net/solutions/linksys_tftp.html"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
 SRC_URI="https://www.redsand.net/solutions/${P}.tar.bz2"
 
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="amd64 ~ppc x86"
-IUSE=""
 
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-r1-header.patch
-	epatch "${FILESDIR}"/${P}-r1-Makefile.patch
-}
+PATCHES=(
+	"${FILESDIR}/${P}-r1-header.patch"
+	"${FILESDIR}/${P}-r1-Makefile.patch"
+	"${FILESDIR}/${P}-r1-fno-common.patch"
+	"${FILESDIR}/${P}-r1-clang.patch"
+)
 
 src_compile() {
 	emake CC="$(tc-getCC)"
@@ -25,5 +26,5 @@ src_compile() {
 
 src_install() {
 	dobin linksys-tftp
-	dodoc README
+	einstalldocs
 }


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-06 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-06 20:58 [gentoo-commits] repo/gentoo:master commit in: net-ftp/linksys-tftp/files/, net-ftp/linksys-tftp/ Stephan Hartmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox