diff options
author | Stephan Hartmann <sultan@gentoo.org> | 2021-01-05 16:09:55 +0100 |
---|---|---|
committer | Stephan Hartmann <sultan@gentoo.org> | 2021-01-06 21:58:13 +0100 |
commit | 1bbce1aa65668a27a99be58a006ada7694ecea59 (patch) | |
tree | eded19f948b450d279324aec665bb8d0e884c147 /net-ftp | |
parent | app-shells/pdmenu: version bump, comaintain (diff) | |
download | gentoo-1bbce1aa65668a27a99be58a006ada7694ecea59.tar.gz gentoo-1bbce1aa65668a27a99be58a006ada7694ecea59.tar.bz2 gentoo-1bbce1aa65668a27a99be58a006ada7694ecea59.zip |
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@gentoo.org>
Diffstat (limited to 'net-ftp')
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 000000000000..94ccee0c9eef --- /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 000000000000..a63977619845 --- /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 b265bc6ee05c..ba390c758671 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 } |