summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2011-02-11 16:12:53 -0600
committerWilliam Pitcock <nenolod@dereferenced.org>2011-02-11 16:13:22 -0600
commit79e019622ee7936997851e93cfd9764256ee2ae6 (patch)
tree80b9b9efc8393d217c3b16ca9e3a8976de48e539
parentb0807a54ce16b3a5987e33b9d744024663aab1a4 (diff)
downloadaports-79e019622ee7936997851e93cfd9764256ee2ae6.tar.bz2
aports-79e019622ee7936997851e93cfd9764256ee2ae6.tar.xz
main/busybox: upgrade to 1.18.3; replace wget patch with one blessed by upstream
-rw-r--r--main/busybox/APKBUILD10
-rw-r--r--main/busybox/busybox-1.18.2-wget.patch20
-rw-r--r--main/busybox/busybox-1.18.3-wget.patch128
3 files changed, 133 insertions, 25 deletions
diff --git a/main/busybox/APKBUILD b/main/busybox/APKBUILD
index 99b1f2ca4..7742c9fe1 100644
--- a/main/busybox/APKBUILD
+++ b/main/busybox/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=busybox
-pkgver=1.18.2
-pkgrel=2
+pkgver=1.18.3
+pkgrel=0
pkgdesc="Size optimized toolbox of many common UNIX utilities"
url=http://busybox.net
arch="all"
@@ -13,7 +13,7 @@ triggers="busybox.trigger:/bin /usr/bin /sbin /usr/sbin /lib/modules/*"
source="http://busybox.net/downloads/$pkgname-$pkgver.tar.bz2
$pkgname-1.11.1-bb.patch
busybox-uname-is-not-gnu.patch
- busybox-1.18.2-wget.patch
+ busybox-1.18.3-wget.patch
busyboxconfig"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -70,8 +70,8 @@ static() {
}
-md5sums="69a82091e5710b72db5ce0e14e7c0cd7 busybox-1.18.2.tar.bz2
+md5sums="660af4d44661d32b22025a66f4f78df2 busybox-1.18.3.tar.bz2
4c0f3b486eaa0674961b7ddcd0c60a9b busybox-1.11.1-bb.patch
b5375210f13fd6e1ca61a565e8fabd35 busybox-uname-is-not-gnu.patch
-d45bc3a7a8d5a903c0c3cb561c4bd1b1 busybox-1.18.2-wget.patch
+abe065069fed8458eedbdad48c115e1f busybox-1.18.3-wget.patch
181310149cad8fce22aba96220cbbd38 busyboxconfig"
diff --git a/main/busybox/busybox-1.18.2-wget.patch b/main/busybox/busybox-1.18.2-wget.patch
deleted file mode 100644
index 8c28eea65..000000000
--- a/main/busybox/busybox-1.18.2-wget.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- busybox-1.18.2/networking/wget.c
-+++ busybox-1.18.2.mod/networking/wget.c
-@@ -137,7 +137,7 @@
- ret = fread(p, 1, nmemb, stream);
- p += ret;
- nmemb -= ret;
-- } while (nmemb && ferror(stream) && errno == EINTR);
-+ } while (nmemb && ferror(stream) && (errno == EINTR || errno == EAGAIN));
-
- return p - (char*)ptr;
- }
-@@ -152,7 +152,7 @@
- clearerr(stream);
- errno = 0;
- ret = fgets(s, size, stream);
-- } while (ret == NULL && ferror(stream) && errno == EINTR);
-+ } while (ret == NULL && ferror(stream) && (errno == EINTR || errno == EAGAIN));
-
- return ret;
- }
diff --git a/main/busybox/busybox-1.18.3-wget.patch b/main/busybox/busybox-1.18.3-wget.patch
new file mode 100644
index 000000000..88cfc918c
--- /dev/null
+++ b/main/busybox/busybox-1.18.3-wget.patch
@@ -0,0 +1,128 @@
+--- busybox-1.18.3/networking/wget.c
++++ busybox-1.18.3-wget/networking/wget.c
+@@ -446,7 +446,7 @@ static FILE* prepare_ftp_session(FILE **
+
+ static void NOINLINE retrieve_file_data(FILE *dfp, int output_fd)
+ {
+- char buf[512];
++ char buf[4*1024]; /* made bigger to speed up local xfers */
+ #if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
+ # if ENABLE_FEATURE_WGET_TIMEOUT
+ unsigned second_cnt;
+@@ -455,7 +455,6 @@ static void NOINLINE retrieve_file_data(
+
+ polldata.fd = fileno(dfp);
+ polldata.events = POLLIN | POLLPRI;
+- ndelay_on(polldata.fd);
+ #endif
+ progress_meter(PROGRESS_START);
+
+@@ -464,6 +463,10 @@ static void NOINLINE retrieve_file_data(
+
+ /* Loops only if chunked */
+ while (1) {
++
++#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
++ ndelay_on(polldata.fd);
++#endif
+ while (1) {
+ int n;
+ unsigned rdsz;
+@@ -493,22 +496,46 @@ static void NOINLINE retrieve_file_data(
+ progress_meter(PROGRESS_BUMP);
+ }
+ #endif
++ /* fread internally uses read loop, which in our case
++ * is usually exited when we get EAGAIN.
++ * In this case, libc sets error marker on the stream.
++ * Need to clear it before next fread to avoid possible
++ * rare false positive ferror below. Rare because usually
++ * fread gets more than zero bytes, and we don't fall
++ * into if (n <= 0) ...
++ */
++ clearerr(dfp);
++ errno = 0;
+ n = safe_fread(buf, rdsz, dfp);
++ /* man fread:
++ * If error occurs, or EOF is reached, the return value
++ * is a short item count (or zero).
++ * fread does not distinguish between EOF and error.
++ */
+ if (n <= 0) {
+- if (ferror(dfp)) {
+- /* perror will not work: ferror doesn't set errno */
+- bb_error_msg_and_die(bb_msg_read_error);
+- }
+- break;
++#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
++ if (errno == EAGAIN) /* poll lied, there is no data? */
++ continue; /* yes */
++#endif
++ if (ferror(dfp))
++ bb_perror_msg_and_die(bb_msg_read_error);
++ break; /* EOF, not error */
+ }
++
+ xwrite(output_fd, buf, n);
+ #if ENABLE_FEATURE_WGET_STATUSBAR
+ G.transferred += n;
+ progress_meter(PROGRESS_BUMP);
+ #endif
+- if (G.got_clen)
++ if (G.got_clen) {
+ G.content_len -= n;
++ if (G.content_len == 0)
++ break;
++ }
+ }
++#if ENABLE_FEATURE_WGET_STATUSBAR || ENABLE_FEATURE_WGET_TIMEOUT
++ ndelay_off(polldata.fd);
++#endif
+
+ if (!G.chunked)
+ break;
+@@ -706,6 +733,11 @@ int wget_main(int argc UNUSED_PARAM, cha
+ fprintf(sfp, "Host: %s\r\nUser-Agent: %s\r\n",
+ target.host, user_agent);
+
++ /* Ask server to close the connection as soon as we are done
++ * (IOW: we do not intend to send more requests)
++ */
++ fprintf(sfp, "Connection: close\r\n");
++
+ #if ENABLE_FEATURE_WGET_AUTHENTICATION
+ if (target.user) {
+ fprintf(sfp, "Proxy-Authorization: Basic %s\r\n"+6,
+@@ -719,22 +751,25 @@ int wget_main(int argc UNUSED_PARAM, cha
+
+ if (G.beg_range)
+ fprintf(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range);
++
+ #if ENABLE_FEATURE_WGET_LONG_OPTIONS
+ if (extra_headers)
+ fputs(extra_headers, sfp);
+
+ if (opt & WGET_OPT_POST_DATA) {
+ char *estr = URL_escape(post_data);
+- fprintf(sfp, "Content-Type: application/x-www-form-urlencoded\r\n");
+- fprintf(sfp, "Content-Length: %u\r\n" "\r\n" "%s",
+- (int) strlen(estr), estr);
+- /*fprintf(sfp, "Connection: Keep-Alive\r\n\r\n");*/
+- /*fprintf(sfp, "%s\r\n", estr);*/
++ fprintf(sfp,
++ "Content-Type: application/x-www-form-urlencoded\r\n"
++ "Content-Length: %u\r\n"
++ "\r\n"
++ "%s",
++ (int) strlen(estr), estr
++ );
+ free(estr);
+ } else
+ #endif
+- { /* If "Connection:" is needed, document why */
+- fprintf(sfp, /* "Connection: close\r\n" */ "\r\n");
++ {
++ fprintf(sfp, "\r\n");
+ }
+
+ fflush(sfp);