El mié, 18 mar 2026 a las 0:08, Agustin Martin (<[email protected]>) escribió:
> Now the explanations. In Http.pm,  $version and $mangled_version are
> initially set to unmangled version. $mangled_version is processed
> afterwards in mangle function call and gets mangled.
>
> With --download-current-version $self->shared->{download_version} is
> set to mangled version, but with --download-version=s it is set to the
> passed upstream unmangled version.
>
> This makes --download-current-version fail when compared with original
> unmangled version and testWatch4NonNativeDlUversion_uversionmangle
> fail when comparison uses mangled version as in Uwe's patch and in my
> previous attempt (that test uses --download-version with a non-mangled
> upstream version).
>
>  My workaround uses mangled version in comparison if
> --download-current-version is used. Should result in no other changes.
>
> Not sure if this is the best fix, but with this change package builds
> and passes tests, and things seem to work.
>
> Find attached the patch with my changes.

Please find attached a new version of the patch with more compact
changes for easier reviewing.

-- 
Agustin
From 3893e999995dd4887ff443f36fa0f5e23504a79f Mon Sep 17 00:00:00 2001
From: Agustin Martin Domingo <[email protected]>
Date: Tue, 17 Mar 2026 11:06:14 +0100
Subject: [PATCH] l/D/U/M/Http.pm: Selectively compare versions according to
 options.

In Http.pm,  $version and $mangled_version are initially set
to unmangled version. $mangled_version is processed afterwards
in mangle function call and gets mangled.

With --download-current-version $self->shared->{download_version} is
set to mangled version, but with --download-version=s it is set to the
passed upstream unmangled version.

This makes --download-current-version fail when compared with original
unmangled version and testWatch4NonNativeDlUversion_uversionmangle
fail when comparison uses mangled version (that test uses
--download-version with a non-mangled upstream version).

This change uses mangled version for --download-current-version.

Closes: #1112388, #1122181, #1112388, #1130447
---
 lib/Devscripts/Uscan/Modes/Http.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/Devscripts/Uscan/Modes/Http.pm b/lib/Devscripts/Uscan/Modes/Http.pm
index 517c195a..0aabb439 100644
--- a/lib/Devscripts/Uscan/Modes/Http.pm
+++ b/lib/Devscripts/Uscan/Modes/Http.pm
@@ -463,9 +463,17 @@ sub parse_href {
             return ();
         }
     }
+
+    # $self->shared->{download_version} is set to mangled version with
+    # --download-current-version, but --download-version uses unmangled.
+    my $cmp_version
+      = ($self->config->download_current_version)
+      ? $mangled_version
+      : $version;
+
     $match = '';
     if (defined $self->shared->{download_version}) {
-        if ($version eq $self->shared->{download_version}) {
+        if ($cmp_version eq $self->shared->{download_version}) {
             $match = "matched with the download version";
         }
     }
-- 
2.51.0

Reply via email to