1 |
commit: 1bbce1aa65668a27a99be58a006ada7694ecea59 |
2 |
Author: Stephan Hartmann <sultan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 5 15:09:55 2021 +0000 |
4 |
Commit: Stephan Hartmann <sultan <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 6 20:58:13 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bbce1aa |
7 |
|
8 |
net-ftp/linksys-tftp: fix -fno-common and clang build, EAPI 7 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/707040 |
11 |
Closes: https://bugs.gentoo.org/731218 |
12 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
13 |
Signed-off-by: Stephan Hartmann <sultan <AT> gentoo.org> |
14 |
|
15 |
.../files/linksys-tftp-1.2.1-r1-clang.patch | 196 +++++++++++++++++++++ |
16 |
.../files/linksys-tftp-1.2.1-r1-fno-common.patch | 11 ++ |
17 |
net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild | 21 +-- |
18 |
3 files changed, 218 insertions(+), 10 deletions(-) |
19 |
|
20 |
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 |
21 |
new file mode 100644 |
22 |
index 00000000000..94ccee0c9ee |
23 |
--- /dev/null |
24 |
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-clang.patch |
25 |
@@ -0,0 +1,196 @@ |
26 |
+--- a/main.c |
27 |
++++ b/main.c |
28 |
+@@ -159,7 +159,7 @@ setpeer(argc, argv) |
29 |
+ |
30 |
+ if (!argv[1]) { |
31 |
+ printf("usage: %s host-name [port] (Default port is 69/udp)\n", argv[0]); |
32 |
+- return; |
33 |
++ return 0; |
34 |
+ } |
35 |
+ host = gethostbyname(argv[1]); |
36 |
+ if (host) { |
37 |
+@@ -172,7 +172,7 @@ setpeer(argc, argv) |
38 |
+ if (sin.sin_addr.s_addr == -1) { |
39 |
+ connected = 0; |
40 |
+ printf("%s: unknown host\n", argv[1]); |
41 |
+- return; |
42 |
++ return 0; |
43 |
+ } |
44 |
+ strcpy(hostname, argv[1]); |
45 |
+ } |
46 |
+@@ -182,7 +182,7 @@ setpeer(argc, argv) |
47 |
+ if (port < 0) { |
48 |
+ printf("%s: bad port number\n", argv[2]); |
49 |
+ connected = 0; |
50 |
+- return; |
51 |
++ return 0; |
52 |
+ } |
53 |
+ port = htons(port); |
54 |
+ } |
55 |
+@@ -209,7 +209,7 @@ modecmd(argc, argv) |
56 |
+ |
57 |
+ if (argc < 2) { |
58 |
+ printf("Using %s mode to transfer files.\n", mode); |
59 |
+- return; |
60 |
++ return 0; |
61 |
+ } |
62 |
+ if (argc == 2) { |
63 |
+ for (p = modes; p->m_name; p++) |
64 |
+@@ -217,7 +217,7 @@ modecmd(argc, argv) |
65 |
+ break; |
66 |
+ if (p->m_name) { |
67 |
+ setmode(p->m_mode); |
68 |
+- return; |
69 |
++ return 0; |
70 |
+ } |
71 |
+ printf("%s: unknown mode\n", argv[1]); |
72 |
+ /* drop through and print usage message */ |
73 |
+@@ -231,7 +231,7 @@ modecmd(argc, argv) |
74 |
+ sep = " | "; |
75 |
+ } |
76 |
+ printf(" ]\n"); |
77 |
+- return; |
78 |
++ return 0; |
79 |
+ } |
80 |
+ |
81 |
+ setbinary(argc, argv) |
82 |
+@@ -265,31 +265,32 @@ put(argc, argv) |
83 |
+ |
84 |
+ if (argc < 3) { |
85 |
+ putusage(argv[0]); |
86 |
+- return; |
87 |
++ return 0; |
88 |
+ } |
89 |
+ linkpass = argv[2]; |
90 |
+ if (!connected) { |
91 |
+ fprintf(stderr,"No target machine specified.\n"); |
92 |
+- return; |
93 |
++ return 0; |
94 |
+ } |
95 |
+ cp = argv[1]; |
96 |
+ fd = open(cp, O_RDONLY); |
97 |
+ if (fd < 0) { |
98 |
+ fprintf(stderr, "tftp: "); perror(cp); |
99 |
+- return; |
100 |
++ return 0; |
101 |
+ } |
102 |
+ if (verbose) |
103 |
+ printf("putting %s to %s:%s [%s] AUTH %s\n", |
104 |
+ cp, hostname, cp, mode, linkpass); |
105 |
+ sin.sin_port = port; |
106 |
+ sendfile(fd, cp, mode, linkpass); |
107 |
+- return; |
108 |
++ return 0; |
109 |
+ } |
110 |
+ |
111 |
+ putusage(s) |
112 |
+ char *s; |
113 |
+ { |
114 |
+ printf("usage: %s file [linksys pass] (you must be connected)\n", s); |
115 |
++ return 0; |
116 |
+ } |
117 |
+ |
118 |
+ /* |
119 |
+@@ -304,18 +305,18 @@ get(argc, argv) |
120 |
+ |
121 |
+ if (argc < 3) { |
122 |
+ getusage(argv[0]); |
123 |
+- return; |
124 |
++ return 0; |
125 |
+ } |
126 |
+ linkpass = argv[2]; |
127 |
+ if (!connected) { |
128 |
+ fprintf(stderr,"No target machine specified.\n"); |
129 |
+- return; |
130 |
++ return 0; |
131 |
+ } |
132 |
+ cp = argv[1]; |
133 |
+ fd = creat(cp, 0644); |
134 |
+ if (fd < 0) { |
135 |
+ fprintf(stderr, "tftp: "); perror(cp); |
136 |
+- return; |
137 |
++ return 0; |
138 |
+ } |
139 |
+ if (verbose) |
140 |
+ printf("getting from %s:%s to %s [%s] AUTH %s\n", |
141 |
+@@ -323,7 +324,7 @@ get(argc, argv) |
142 |
+ sin.sin_port = port; |
143 |
+ recvfile(fd, cp, mode, linkpass); |
144 |
+ |
145 |
+- return; |
146 |
++ return 0; |
147 |
+ } |
148 |
+ |
149 |
+ getusage(s) |
150 |
+@@ -349,7 +350,7 @@ setrexmt(argc, argv) |
151 |
+ } |
152 |
+ if (argc != 2) { |
153 |
+ printf("usage: %s value\n", argv[0]); |
154 |
+- return; |
155 |
++ return 0; |
156 |
+ } |
157 |
+ t = atoi(argv[1]); |
158 |
+ if (t < 0) |
159 |
+@@ -375,7 +376,7 @@ settimeout(argc, argv) |
160 |
+ } |
161 |
+ if (argc != 2) { |
162 |
+ printf("usage: %s value\n", argv[0]); |
163 |
+- return; |
164 |
++ return 0; |
165 |
+ } |
166 |
+ t = atoi(argv[1]); |
167 |
+ if (t < 0) |
168 |
+@@ -450,7 +451,7 @@ getcmd(name) |
169 |
+ longest = 0; |
170 |
+ nmatches = 0; |
171 |
+ found = 0; |
172 |
+- if(!name) return; |
173 |
++ if(!name) return 0; |
174 |
+ for (c = cmdtab; p = c->name; c++) { |
175 |
+ for (q = name; *q == *p++; q++) |
176 |
+ if (*q == 0) /* exact match? */ |
177 |
+@@ -513,7 +514,7 @@ help(argc, argv) |
178 |
+ printf("Commands may be abbreviated. Commands are:\n\n"); |
179 |
+ for (c = cmdtab; c->name; c++) |
180 |
+ printf("%-*s\t%s\n", HELPINDENT, c->name, c->help); |
181 |
+- return; |
182 |
++ return 0; |
183 |
+ } |
184 |
+ while (--argc > 0) { |
185 |
+ register char *arg; |
186 |
+@@ -557,7 +558,7 @@ setblocksize(argc, argv) |
187 |
+ } |
188 |
+ if (argc != 2) { |
189 |
+ printf("usage: %s value\n", argv[0]); |
190 |
+- return; |
191 |
++ return 0; |
192 |
+ } |
193 |
+ t = atoi(argv[1]); |
194 |
+ if (t < 8 || t > 1432) |
195 |
+@@ -570,5 +571,5 @@ banner() { |
196 |
+ printf("Mike Lynn\tabaddon [at] 802.11ninja.net\n"); |
197 |
+ printf("Linksys TFTP Client for *BSD/Linux\tThe Firmware gets sexier\n"); |
198 |
+ printf("Modified Berkeley TFTP client Release: %s\n\n",svers); |
199 |
+- return; |
200 |
++ return 0; |
201 |
+ } |
202 |
+--- a/tftpsubs.c |
203 |
++++ b/tftpsubs.c |
204 |
+@@ -116,7 +116,7 @@ read_ahead(file, convert) |
205 |
+ |
206 |
+ b = &bfs[nextone]; /* look at "next" buffer */ |
207 |
+ if (b->counter != BF_FREE) /* nop if not free */ |
208 |
+- return; |
209 |
++ return 0; |
210 |
+ nextone = !nextone; /* "incr" next buffer ptr */ |
211 |
+ |
212 |
+ dp = (struct tftphdr *)b->buf; |
213 |
+@@ -131,7 +131,7 @@ read_ahead(file, convert) |
214 |
+ b->counter += i; |
215 |
+ } while (i != 0 && !(i < 0 && errno != EINTR) && |
216 |
+ b->counter < segsize); |
217 |
+- return; |
218 |
++ return 0; |
219 |
+ } |
220 |
+ |
221 |
+ p = dp->th_data; |
222 |
|
223 |
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 |
224 |
new file mode 100644 |
225 |
index 00000000000..a6397761984 |
226 |
--- /dev/null |
227 |
+++ b/net-ftp/linksys-tftp/files/linksys-tftp-1.2.1-r1-fno-common.patch |
228 |
@@ -0,0 +1,11 @@ |
229 |
+--- a/tftp.c |
230 |
++++ b/tftp.c |
231 |
+@@ -50,7 +50,7 @@ extern int segsize; |
232 |
+ #define PKTSIZE (1432+4) /* SEGSIZE+4 */ |
233 |
+ char ackbuf[PKTSIZE]; |
234 |
+ int timeout; |
235 |
+-jmp_buf toplevel; |
236 |
++extern jmp_buf toplevel; |
237 |
+ jmp_buf timeoutbuf; |
238 |
+ |
239 |
+ #ifndef OACK |
240 |
|
241 |
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 |
242 |
index b265bc6ee05..ba390c75867 100644 |
243 |
--- a/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild |
244 |
+++ b/net-ftp/linksys-tftp/linksys-tftp-1.2.1-r3.ebuild |
245 |
@@ -1,23 +1,24 @@ |
246 |
-# Copyright 1999-2015 Gentoo Foundation |
247 |
+# Copyright 1999-2021 Gentoo Authors |
248 |
# Distributed under the terms of the GNU General Public License v2 |
249 |
|
250 |
-EAPI=5 |
251 |
+EAPI=7 |
252 |
|
253 |
-inherit eutils toolchain-funcs |
254 |
+inherit toolchain-funcs |
255 |
|
256 |
DESCRIPTION="TFTP client suitable for uploading to the Linksys WRT54G Wireless Router" |
257 |
-HOMEPAGE="https://www.redsand.net/solutions/linksys_tftp.html" |
258 |
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage" |
259 |
SRC_URI="https://www.redsand.net/solutions/${P}.tar.bz2" |
260 |
|
261 |
LICENSE="BSD" |
262 |
SLOT="0" |
263 |
KEYWORDS="amd64 ~ppc x86" |
264 |
-IUSE="" |
265 |
|
266 |
-src_prepare() { |
267 |
- epatch "${FILESDIR}"/${P}-r1-header.patch |
268 |
- epatch "${FILESDIR}"/${P}-r1-Makefile.patch |
269 |
-} |
270 |
+PATCHES=( |
271 |
+ "${FILESDIR}/${P}-r1-header.patch" |
272 |
+ "${FILESDIR}/${P}-r1-Makefile.patch" |
273 |
+ "${FILESDIR}/${P}-r1-fno-common.patch" |
274 |
+ "${FILESDIR}/${P}-r1-clang.patch" |
275 |
+) |
276 |
|
277 |
src_compile() { |
278 |
emake CC="$(tc-getCC)" |
279 |
@@ -25,5 +26,5 @@ src_compile() { |
280 |
|
281 |
src_install() { |
282 |
dobin linksys-tftp |
283 |
- dodoc README |
284 |
+ einstalldocs |
285 |
} |