#1128260 git-buildpackage: gbp import-orig --uscan --upstream-version imports wrong version if repacking

#1128260#5
Date:
2026-02-17 08:17:48 UTC
From:
To:
Dear Maintainer,

The recent addition of retry with --download-debversion if --download-version
failed [1] to gbp import-orig is a great idea. However, there is a bug in the
implementation. When uscan --download-version=foo fails, gbp is supposed to
call uscan --download-debversion=foo, but it instead calls uscan without
specifying any version. This results in uscan downloading the latest
version of the tarball available and gbp then renames that tarball to
the specified version. This is very confusing.

I've attached a patch that ensures gbp import-orig passes the correct
version in the fallback. I would also suggest that the manpage be
updated to reflect this behaviour, as it is not currently documented.
The option is currently described as:

#1128260#10
Date:
2026-04-18 17:49:00 UTC
From:
To:
Raising severity to important.

This bug is actually critical for the case where repacking is needed
with an upstream version lower than the latest.  It makes gbp work than useless
for this use case, worse, since extra effort has to be made to fix and
clean the local repo after the wrong version has been downloaded.

Please apply Cordell's patch.