From c0add6f460d368939558291e5579dfe28b6727fc Mon Sep 17 00:00:00 2001 From: Alexander M Pickering Date: Mon, 11 Nov 2024 12:27:03 -0600 Subject: Add colors --- libressl.patch | 49 +++++++++++++++++++++++++------------------------ meta.lua | 2 +- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/libressl.patch b/libressl.patch index ee924e6..6af3b51 100644 --- a/libressl.patch +++ b/libressl.patch @@ -135,7 +135,7 @@ index 9f1dd67ec..7e8da6df2 100644 static void tls_xwrite(tls_state_t *tls, int len) { diff --git a/networking/wget.c b/networking/wget.c -index 6a64836fb..3f1213af1 100644 +index 6a64836fb..3bd573e0a 100644 --- a/networking/wget.c +++ b/networking/wget.c @@ -169,7 +169,8 @@ @@ -158,7 +158,7 @@ index 6a64836fb..3f1213af1 100644 - bb_simple_perror_msg_and_die("error getting response"); + printf("wget fgets_trim_sanitize 2\n"); + if (fgets(G.wget_buf, sizeof(G.wget_buf), fp) == NULL){ -+ bb_simple_perror_msg_and_die("error getting response: %s",strerror(errno)); ++ bb_error_msg_and_die("error getting response: %s",strerror(errno)); + } clear_alarm(); @@ -194,7 +194,7 @@ index 6a64836fb..3f1213af1 100644 static int spawn_https_helper_openssl(const char *host, unsigned port) { char *allocated = NULL; -@@ -777,6 +788,37 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) +@@ -777,6 +788,38 @@ static int spawn_https_helper_openssl(const char *host, unsigned port) # endif return sp[0]; } @@ -226,13 +226,14 @@ index 6a64836fb..3f1213af1 100644 + tls_config_free(config); + free(allocated); + free(servername); ++ printf("Connected sp %s\n"); + return sp[0]; +} +# endif #endif #if ENABLE_FEATURE_WGET_HTTPS -@@ -1151,6 +1193,7 @@ static void download_one_url(const char *url) +@@ -1151,6 +1194,7 @@ static void download_one_url(const char *url) server.user = NULL; target.user = NULL; @@ -240,7 +241,7 @@ index 6a64836fb..3f1213af1 100644 parse_url(url, &target); /* Use the proxy if necessary */ -@@ -1172,6 +1215,7 @@ static void download_one_url(const char *url) +@@ -1172,6 +1216,7 @@ static void download_one_url(const char *url) server.host = target.host; } } @@ -248,7 +249,7 @@ index 6a64836fb..3f1213af1 100644 if (ENABLE_FEATURE_IPV6) strip_ipv6_scope_id(target.host); -@@ -1191,6 +1235,7 @@ static void download_one_url(const char *url) +@@ -1191,6 +1236,7 @@ static void download_one_url(const char *url) G.fname_out = fname_out_alloc = xstrdup(G.fname_out); } } @@ -256,7 +257,7 @@ index 6a64836fb..3f1213af1 100644 #if ENABLE_FEATURE_WGET_STATUSBAR G.curfile = bb_get_last_path_component_nostrip(G.fname_out); #endif -@@ -1206,15 +1251,19 @@ static void download_one_url(const char *url) +@@ -1206,15 +1252,19 @@ static void download_one_url(const char *url) * We are not sure it exists on remote side */ } @@ -276,7 +277,7 @@ index 6a64836fb..3f1213af1 100644 /*G.content_len = 0; - redundant, got_clen = 0 is enough */ G.got_clen = 0; G.chunked = 0; -@@ -1229,37 +1278,49 @@ static void download_one_url(const char *url) +@@ -1229,37 +1279,49 @@ static void download_one_url(const char *url) /* Open socket to http(s) server */ #if ENABLE_FEATURE_WGET_OPENSSL @@ -328,7 +329,7 @@ index 6a64836fb..3f1213af1 100644 /* Send HTTP request */ if (use_proxy) { SENDFMT(sfp, "GET %s://%s/%s HTTP/1.1\r\n", -@@ -1270,6 +1331,7 @@ static void download_one_url(const char *url) +@@ -1270,6 +1332,7 @@ static void download_one_url(const char *url) (option_mask32 & WGET_OPT_POST) ? "POST" : "GET", target.path); } @@ -336,7 +337,7 @@ index 6a64836fb..3f1213af1 100644 if (!USR_HEADER_HOST) SENDFMT(sfp, "Host: %s\r\n", target.host); if (!USR_HEADER_USER_AGENT) -@@ -1280,6 +1342,7 @@ static void download_one_url(const char *url) +@@ -1280,6 +1343,7 @@ static void download_one_url(const char *url) */ SENDFMT(sfp, "Connection: close\r\n"); @@ -344,7 +345,7 @@ index 6a64836fb..3f1213af1 100644 #if ENABLE_FEATURE_WGET_AUTHENTICATION if (target.user && !USR_HEADER_AUTH) { SENDFMT(sfp, "Proxy-Authorization: Basic %s\r\n"+6, -@@ -1291,6 +1354,7 @@ static void download_one_url(const char *url) +@@ -1291,6 +1355,7 @@ static void download_one_url(const char *url) } #endif @@ -352,7 +353,7 @@ index 6a64836fb..3f1213af1 100644 if (G.beg_range != 0 && !USR_HEADER_RANGE) SENDFMT(sfp, "Range: bytes=%"OFF_FMT"u-\r\n", G.beg_range); -@@ -1300,6 +1364,7 @@ static void download_one_url(const char *url) +@@ -1300,6 +1365,7 @@ static void download_one_url(const char *url) fputs(G.extra_headers, sfp); } @@ -360,7 +361,7 @@ index 6a64836fb..3f1213af1 100644 if (option_mask32 & WGET_OPT_POST_FILE) { int fd = xopen_stdin(G.post_file); G.post_data = xmalloc_read(fd, NULL); -@@ -1314,15 +1379,18 @@ static void download_one_url(const char *url) +@@ -1314,15 +1380,18 @@ static void download_one_url(const char *url) ); } # if ENABLE_PLATFORM_MINGW32 @@ -379,7 +380,7 @@ index 6a64836fb..3f1213af1 100644 } else # else SENDFMT(sfp, -@@ -1338,6 +1406,7 @@ static void download_one_url(const char *url) +@@ -1338,6 +1407,7 @@ static void download_one_url(const char *url) SENDFMT(sfp, "\r\n"); } @@ -387,7 +388,7 @@ index 6a64836fb..3f1213af1 100644 fflush(sfp); /* Tried doing this unconditionally. -@@ -1358,14 +1427,21 @@ static void download_one_url(const char *url) +@@ -1358,14 +1428,21 @@ static void download_one_url(const char *url) * Retrieve HTTP response line and check for "200" status code. */ read_response: @@ -409,7 +410,7 @@ index 6a64836fb..3f1213af1 100644 switch (status) { case 0: case 100: -@@ -1441,6 +1517,7 @@ However, in real world it was observed that some web servers +@@ -1441,6 +1518,7 @@ However, in real world it was observed that some web servers /* * Retrieve HTTP headers. */ @@ -417,7 +418,7 @@ index 6a64836fb..3f1213af1 100644 while ((str = get_sanitized_hdr(sfp)) != NULL) { static const char keywords[] ALIGN1 = "content-length\0""transfer-encoding\0""location\0"; -@@ -1497,6 +1574,7 @@ However, in real world it was observed that some web servers +@@ -1497,6 +1575,7 @@ However, in real world it was observed that some web servers goto establish_session; } } @@ -425,7 +426,7 @@ index 6a64836fb..3f1213af1 100644 // if (status >= 300) // bb_error_msg_and_die("bad redirection (no Location: header from server)"); -@@ -1514,6 +1592,7 @@ However, in real world it was observed that some web servers +@@ -1514,6 +1593,7 @@ However, in real world it was observed that some web servers free(lsa); @@ -433,7 +434,7 @@ index 6a64836fb..3f1213af1 100644 if (!(option_mask32 & WGET_OPT_SPIDER)) { if (G.output_fd < 0) G.output_fd = xopen(G.fname_out, G.o_flags); -@@ -1536,6 +1615,7 @@ However, in real world it was observed that some web servers +@@ -1536,6 +1616,7 @@ However, in real world it was observed that some web servers /* ftpcmd("QUIT", NULL, sfp); - why bother? */ } #endif @@ -441,7 +442,7 @@ index 6a64836fb..3f1213af1 100644 fclose(sfp); free(server.allocated); -@@ -1544,11 +1624,13 @@ However, in real world it was observed that some web servers +@@ -1544,11 +1625,13 @@ However, in real world it was observed that some web servers free(target.user); free(fname_out_alloc); free(redirected_path); @@ -455,7 +456,7 @@ index 6a64836fb..3f1213af1 100644 #if ENABLE_FEATURE_WGET_LONG_OPTIONS static const char wget_longopts[] ALIGN1 = /* name, has_arg, val */ -@@ -1590,6 +1672,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1590,6 +1673,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") #endif INIT_G(); @@ -463,7 +464,7 @@ index 6a64836fb..3f1213af1 100644 #if ENABLE_FEATURE_WGET_TIMEOUT G.timeout_seconds = 900; -@@ -1626,6 +1709,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1626,6 +1710,8 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_data) IF_FEATURE_WGET_LONG_OPTIONS(, &G.post_file) ); @@ -472,7 +473,7 @@ index 6a64836fb..3f1213af1 100644 #if 0 /* option bits debug */ if (option_mask32 & WGET_OPT_RETRIES) bb_error_msg("-t NUM"); if (option_mask32 & WGET_OPT_nsomething) bb_error_msg("-nsomething"); -@@ -1670,6 +1755,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1670,6 +1756,7 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } #endif @@ -480,7 +481,7 @@ index 6a64836fb..3f1213af1 100644 G.output_fd = -1; G.o_flags = O_WRONLY | O_CREAT | O_TRUNC | O_EXCL; if (G.fname_out) { /* -O FILE ? */ -@@ -1691,8 +1777,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") +@@ -1691,8 +1778,11 @@ IF_DESKTOP( "no-parent\0" No_argument "\xf0") } } diff --git a/meta.lua b/meta.lua index 6e217a1..6d5a0b7 100644 --- a/meta.lua +++ b/meta.lua @@ -28,7 +28,7 @@ for opti_k, opti_v, rel_k, rel_v, _, comp_v in cartesian(optimizations, debug, c ["busybox.exe"] = true }, env = { - CFLAGS = opti_v .. " " .. rel_v, + CFLAGS = opti_v .. " " .. rel_v .. " -fdiagnostics-color=always", } } if opti_k == "zero" then -- cgit v1.2.3-55-g6feb