Control: tags -1 + patch
El dom, 15 mar 2026 a las 11:53, Agustin Martin
(<[email protected]>) escribió:
>
> El dom, 15 mar 2026 a las 0:26, Thomas Dickey
> (<[email protected]>) escribió:
> >
> > On Sat, Mar 14, 2026 at 08:07:52PM +0100, Agustin Martin wrote:
> > > On Thu, 12 Mar 2026 10:04:45 -0400 Thomas Dickey
> > > <[email protected]> wrote:
> > > > Revisiting #1122181, I see that its proposed patch fixes the issue which
> > > > I reported in #1130447.
> > >
> > I realized that Uwe's patch was an improvement
> > (which is why I said I'd close #1130447 -- actually on
> > that, I saw the progress on #1122181 made it too late for
> > me to suggest merging).
Hi,
I have been putting some print STDERR here and there and seems I
finally understood the problem and why Uwe's patch makes
testWatch4NonNativeDlUversion_uversionmangle fail. I also prepared a
possible workaround (attached).
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.
Hope this helps,
--
Agustin
From 6df9f9bd28f8d9bff0b1452adceebe73492c22cc 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.
$version and $mangled_version are initially set to unmangled version.
$mangled_version is processed afterwards to be mangled.
With --download-current-version $self->shared->{download_version}
is set to mangled version, but with --download-version=s it is set
to the upstream unmangled version.
This makes --download-current-version fail with original unmangled
version and test testWatch4NonNativeDlUversion_uversionmangle fail
if mangled version is used (it tests --download-version with a
non-mangled upstream version).
This change uses mangled version for --download-current-version.
Closes: #1122181
---
lib/Devscripts/Uscan/Modes/Http.pm | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/Devscripts/Uscan/Modes/Http.pm b/lib/Devscripts/Uscan/Modes/Http.pm
index 517c195a..67ed1494 100644
--- a/lib/Devscripts/Uscan/Modes/Http.pm
+++ b/lib/Devscripts/Uscan/Modes/Http.pm
@@ -430,7 +430,7 @@ sub parse_href {
my ($self, $href, $_pattern, $match, $mangle) = @_;
$mangle //= 'uversionmangle';
- my ($mangled_version, $version);
+ my ($mangled_version, $version, $cmp_version);
if ($self->watch_version == 2) {
# watch_version 2 only recognised one group; the code
@@ -452,7 +452,8 @@ sub parse_href {
map { $_ if defined($_) }
ref $match eq 'ARRAY' ? @$match : $href =~ m&^$_pattern$&);
}
- $version = $mangled_version;
+ $version = $mangled_version;
+ $cmp_version = $version;
if (
mangle(
@@ -464,8 +465,12 @@ sub parse_href {
}
}
$match = '';
+ # $self->shared->{download_version} is set to mangled version with
+ # --download-current-version, but --download-version uses unmangled.
+ $cmp_version = $mangled_version
+ if ($self->config->download_current_version);
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