From ed66a50ca2d6407c7b82e4bd3369938ce3a96a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Thu, 24 Apr 2025 09:47:20 +0200 Subject: [PATCH 1/6] Backport "Fix redirect regression" from upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a bug that I hit frequently: https://gitlab.com/gnuwget/wget2/-/issues/689 Signed-off-by: Ondrej Mosnáček --- 0004-Fix-redirect-regression.patch | 37 ++++++++++++++++++++++++++++++ wget2.spec | 5 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0004-Fix-redirect-regression.patch diff --git a/0004-Fix-redirect-regression.patch b/0004-Fix-redirect-regression.patch new file mode 100644 index 0000000..96a8fc3 --- /dev/null +++ b/0004-Fix-redirect-regression.patch @@ -0,0 +1,37 @@ +From 400713caebb51e17046c7d884e08729a27cfa505 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tim=20R=C3=BChsen?= +Date: Sun, 2 Feb 2025 19:42:40 +0100 +Subject: [PATCH] Fix redirect regression + +* src/wget.c (process_response_header): Follow location header. + +Fixes https://gitlab.com/gnuwget/wget2/-/issues/689 +Reported-by: https://gitlab.com/omos +--- + src/wget.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/src/wget.c b/src/wget.c +index a2358fed6..3713db6eb 100644 +--- a/src/wget.c ++++ b/src/wget.c +@@ -1907,6 +1907,16 @@ static int process_response_header(wget_http_response *resp) + + wget_cookie_normalize_cookies(job->iri, resp->cookies); + wget_cookie_store_cookies(config.cookie_db, resp->cookies); ++ ++ wget_buffer uri_buf; ++ char uri_sbuf[1024]; ++ wget_buffer_init(&uri_buf, uri_sbuf, sizeof(uri_sbuf)); ++ ++ wget_iri_relative_to_abs(iri, resp->location, (size_t) -1, &uri_buf); ++ if (uri_buf.length) ++ queue_url_from_remote(job, "utf-8", uri_buf.data, URL_FLG_REDIRECTION, NULL); ++ ++ wget_buffer_deinit(&uri_buf); + } + + return 0; +-- +GitLab + diff --git a/wget2.spec b/wget2.spec index b75c69a..4866444 100644 --- a/wget2.spec +++ b/wget2.spec @@ -8,7 +8,7 @@ Name: wget2 Version: 2.2.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -28,6 +28,9 @@ Patch0002: 0002-dont-truncate-no-clobber.patch # Add --show-progress as alias for --force-progress for wget1 compat # rhbz#2348997 Patch0003: 0003-Add-show-progress.patch +# Fix redirect regression +# https://gitlab.com/gnuwget/wget2/-/issues/689 +Patch0004: %{url}/-/commit/400713caebb51e17046c7d884e08729a27cfa505.patch#/0004-Fix-redirect-regression.patch # Buildsystem build requirements BuildRequires: autoconf From ee6ffdc19099596c08cc14517e46038b753060e9 Mon Sep 17 00:00:00 2001 From: Michal Ruprich Date: Wed, 14 May 2025 15:46:22 +0200 Subject: [PATCH 2/6] Removing Obsoletes so that wget2 can be replaced by wget1 --- wget2.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wget2.spec b/wget2.spec index 4866444..34b1820 100644 --- a/wget2.spec +++ b/wget2.spec @@ -8,7 +8,7 @@ Name: wget2 Version: 2.2.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -114,9 +114,8 @@ use functionality from GNU Wget2. %package wget Summary: %{name} shim to provide wget Requires: wget2%{?_isa} = %{version}-%{release} -# Replace wget +# Replace wget1 Conflicts: wget < 2 -Obsoletes: wget < 2 Provides: wget = %{version}-%{release} Provides: wget%{?_isa} = %{version}-%{release} # From original wget package @@ -193,6 +192,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 %changelog +* Wed May 14 2025 Michal Ruprich - 2.2.0-5 +- Removing Obsoletes so that wget2 can be replaced by wget1 + * Fri Feb 28 2025 Neal Gompa - 2.2.0-3 - Backport support for --show-progress flag Resolves: rhbz#2348997 From 197a68b3f65e0ff7c0a778d22811b64e2adb30ef Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 20:23:26 +0000 Subject: [PATCH 3/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- wget2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wget2.spec b/wget2.spec index 34b1820..77a09de 100644 --- a/wget2.spec +++ b/wget2.spec @@ -8,7 +8,7 @@ Name: wget2 Version: 2.2.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -192,6 +192,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 2.2.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Wed May 14 2025 Michal Ruprich - 2.2.0-5 - Removing Obsoletes so that wget2 can be replaced by wget1 From bea1c56115378036e0fecfce66c8e19e8dfd15e9 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Thu, 1 Jan 2026 17:33:55 +0100 Subject: [PATCH 4/6] New version 2.2.1 --- .gitignore | 2 ++ 0001-use-signed-char-ascii.patch | 24 ------------------- 0002-dont-truncate-no-clobber.patch | 23 ------------------ 0003-Add-show-progress.patch | 32 ------------------------- 0004-Fix-redirect-regression.patch | 37 ----------------------------- sources | 4 ++-- wget2.spec | 22 +++++------------ 7 files changed, 10 insertions(+), 134 deletions(-) delete mode 100644 0001-use-signed-char-ascii.patch delete mode 100644 0002-dont-truncate-no-clobber.patch delete mode 100644 0003-Add-show-progress.patch delete mode 100644 0004-Fix-redirect-regression.patch diff --git a/.gitignore b/.gitignore index 70ccca6..e3bb629 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /wget2-2.1.0.tar.gz.sig /wget2-2.2.0.tar.gz /wget2-2.2.0.tar.gz.sig +/wget2-2.2.1.tar.gz +/wget2-2.2.1.tar.gz.sig diff --git a/0001-use-signed-char-ascii.patch b/0001-use-signed-char-ascii.patch deleted file mode 100644 index 5f49f3e..0000000 --- a/0001-use-signed-char-ascii.patch +++ /dev/null @@ -1,24 +0,0 @@ -From e4a04807d77d4eb1dfe63442ef1ad2ba749e86cc Mon Sep 17 00:00:00 2001 -From: Michal Ruprich -Date: Sat, 30 Nov 2024 19:52:23 +0100 -Subject: [PATCH] * src/utils.c (wget_restrict_file_name): Explicitly use - signed char - -Fix test--restrict-ascii failures on aarch64, s390x and ppc64le. ---- - src/utils.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/utils.c b/src/utils.c -index fa2104f60..54a03f76c 100644 ---- a/src/utils.c -+++ b/src/utils.c -@@ -151,7 +151,7 @@ char *wget_restrict_file_name(const char *fname, char *esc, int mode) - bool ascii = mode & WGET_RESTRICT_NAMES_ASCII; - - for (dst = esc, s = fname; *s; s++) { -- char c = *s; -+ signed char c = *s; - - if (lowercase && c >= 'A' && c <= 'Z') { // isupper() also returns true for chars > 0x7f, the test is not EBCDIC compatible ;-) - c |= 0x20; diff --git a/0002-dont-truncate-no-clobber.patch b/0002-dont-truncate-no-clobber.patch deleted file mode 100644 index ee13135..0000000 --- a/0002-dont-truncate-no-clobber.patch +++ /dev/null @@ -1,23 +0,0 @@ -From ad80bf39ce6b2bc39a9b286d3f3fc6b67142e7e7 Mon Sep 17 00:00:00 2001 -From: Michal Ruprich -Date: Tue, 26 Nov 2024 13:26:06 +0100 -Subject: [PATCH] Prevent file truncation with --no-clobber - -* src/options.c (init): Check config.clobber. ---- - src/options.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/options.c b/src/options.c -index 36cd3bb4..2132bfd1 100644 ---- a/src/options.c -+++ b/src/options.c -@@ -3492,7 +3492,7 @@ int init(int argc, const char **argv) - if (config.output_document && strcmp(config.output_document, "-") && !config.dont_write) { - if (config.unlink) { - unlink(config.output_document); -- } else if (!config.continue_download) { -+ } else if (!config.continue_download && config.clobber) { - int fd = open(config.output_document, O_WRONLY | O_TRUNC | O_BINARY); - - if (fd != -1) diff --git a/0003-Add-show-progress.patch b/0003-Add-show-progress.patch deleted file mode 100644 index 25701a7..0000000 --- a/0003-Add-show-progress.patch +++ /dev/null @@ -1,32 +0,0 @@ -From bc77fe1c8a3ebefa07eff7ec1088fb58876a03d3 Mon Sep 17 00:00:00 2001 -From: CaitCatDev -Date: Mon, 27 Jan 2025 23:38:32 +0000 -Subject: [PATCH] Add --show-progress - -* src/options.c (struct optionw options): Add show-progress item. - -Copyright-paperwork-exempt: Yes ---- - src/options.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/options.c b/src/options.c -index 2132bfd1..83fab8f7 100644 ---- a/src/options.c -+++ b/src/options.c -@@ -2265,6 +2265,12 @@ static const struct optionw options[] = { - { "Print the server response headers. (default: off)\n" - } - }, -+ { "show-progress", &config.force_progress, parse_bool, -1, 0, -+ SECTION_DOWNLOAD, -+ { "Show Progress Bar (Deprecated alias for --force-progress)\n", -+ "(default: off)\n" -+ } -+ }, - #ifdef WITH_GPGME - { "signature-extensions", &config.sig_ext, parse_stringlist, 1, 0, - SECTION_GPG, --- -2.48.1 - diff --git a/0004-Fix-redirect-regression.patch b/0004-Fix-redirect-regression.patch deleted file mode 100644 index 96a8fc3..0000000 --- a/0004-Fix-redirect-regression.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 400713caebb51e17046c7d884e08729a27cfa505 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Tim=20R=C3=BChsen?= -Date: Sun, 2 Feb 2025 19:42:40 +0100 -Subject: [PATCH] Fix redirect regression - -* src/wget.c (process_response_header): Follow location header. - -Fixes https://gitlab.com/gnuwget/wget2/-/issues/689 -Reported-by: https://gitlab.com/omos ---- - src/wget.c | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/src/wget.c b/src/wget.c -index a2358fed6..3713db6eb 100644 ---- a/src/wget.c -+++ b/src/wget.c -@@ -1907,6 +1907,16 @@ static int process_response_header(wget_http_response *resp) - - wget_cookie_normalize_cookies(job->iri, resp->cookies); - wget_cookie_store_cookies(config.cookie_db, resp->cookies); -+ -+ wget_buffer uri_buf; -+ char uri_sbuf[1024]; -+ wget_buffer_init(&uri_buf, uri_sbuf, sizeof(uri_sbuf)); -+ -+ wget_iri_relative_to_abs(iri, resp->location, (size_t) -1, &uri_buf); -+ if (uri_buf.length) -+ queue_url_from_remote(job, "utf-8", uri_buf.data, URL_FLG_REDIRECTION, NULL); -+ -+ wget_buffer_deinit(&uri_buf); - } - - return 0; --- -GitLab - diff --git a/sources b/sources index ce583cb..6b0b36d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (wget2-2.2.0.tar.gz) = b39fb6f65b3be39c0f8f33a337c0417c8b31bf993cddbab1ef5e3dba66c6651ff8ec25d3a01ab5aa632072b14adab06adc4941bdb8e9cbf3b60bdd6f3f059cf1 -SHA512 (wget2-2.2.0.tar.gz.sig) = 217060bd7b6064c020f7d18ee1cf15b8e644de7da6d86c973c215f2a49bc0fbba16cab98db9f9f7058fb20bfa6561fba84f3c4ec230be07614f65de9a8e905e1 +SHA512 (wget2-2.2.1.tar.gz) = ce458c31eda12b12120dd39d43751d7ac3c9b46ea994ae383cc5a68be2ee776840126e5251a9479b8e3b350f093c6b3dc1dc8fca48a159e4117a73b328a91021 +SHA512 (wget2-2.2.1.tar.gz.sig) = ae79112fad4eaf7d12d8d6da86a735851b63433ed2c48300937f2e70ed52fe552a49e64e9c597580c91009cda7e2c5e129d6f9978e8312f8430438c723cbc16b diff --git a/wget2.spec b/wget2.spec index 77a09de..7612d00 100644 --- a/wget2.spec +++ b/wget2.spec @@ -4,11 +4,11 @@ %bcond as_wget 1 %endif -%global somajor 3 +%global somajor 4 Name: wget2 -Version: 2.2.0 -Release: 6%{?dist} +Version: 2.2.1 +Release: 1%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -19,19 +19,6 @@ Source1: https://ftp.gnu.org/gnu/wget/%{name}-%{version}.tar.gz.sig # key 08302DB6A2670428 Source2: tim.ruehsen-keyring.asc -# Backports from upstream -# Patch0001 needed for proper build on other than x86 arches -Patch0001: 0001-use-signed-char-ascii.patch -# -O and -nc together truncate existing file and cause data loss -# rhbz#2298879 -Patch0002: 0002-dont-truncate-no-clobber.patch -# Add --show-progress as alias for --force-progress for wget1 compat -# rhbz#2348997 -Patch0003: 0003-Add-show-progress.patch -# Fix redirect regression -# https://gitlab.com/gnuwget/wget2/-/issues/689 -Patch0004: %{url}/-/commit/400713caebb51e17046c7d884e08729a27cfa505.patch#/0004-Fix-redirect-regression.patch - # Buildsystem build requirements BuildRequires: autoconf BuildRequires: automake @@ -192,6 +179,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 %changelog +* Thu Jan 01 2026 LuK1337 - 2.2.1-1 +- New version 2.2.1 + * Fri Jul 25 2025 Fedora Release Engineering - 2.2.0-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From f0fa5dc35268ddeeaf4597dc75b4809a2ff4ca73 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 20:12:30 +0000 Subject: [PATCH 5/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- wget2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wget2.spec b/wget2.spec index 7612d00..79279c1 100644 --- a/wget2.spec +++ b/wget2.spec @@ -8,7 +8,7 @@ Name: wget2 Version: 2.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -179,6 +179,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 2.2.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Thu Jan 01 2026 LuK1337 - 2.2.1-1 - New version 2.2.1 From 1d74f6b4548be71ae14ec993dd367856b571332b Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:46:52 +0000 Subject: [PATCH 6/6] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- wget2.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wget2.spec b/wget2.spec index 79279c1..a1f6380 100644 --- a/wget2.spec +++ b/wget2.spec @@ -8,7 +8,7 @@ Name: wget2 Version: 2.2.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: An advanced file and recursive website downloader # Documentation is GFDL @@ -179,6 +179,9 @@ echo ".so man1/%{name}.1" > %{buildroot}%{_mandir}/man1/wget.1 %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 2.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jan 17 2026 Fedora Release Engineering - 2.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild