Hi Drew,
On Sat, 19 Aug 2023 21:18:03 +0200 Drew Parsons <[email protected]>
wrote:
> gbp import-orig creates a git tag, with default
> --upstream-tag=upstream/%(version)s
>
> When used with --uscan, the tag includes any repacking suffix (+dfsg1)
> specified in debian/watch. However that works only when the latest
> upstream release is pulled via uscan.
>
> Sometimes we need an older release, specified by --upstream-version.
> But in the case of a specified version, the +dfsg1 repacking suffix is
> dropped, it is not used in gbp's upstream tag.
>
> For instance, trying to package adios2
> (https://salsa.debian.org/science-team/adios2) and specifying v2.8.1,
> I get:
>
> $ gbp import-orig --uscan -u2.8.1 --verbose
I've found this to be quite frustrating too, but I disagree with you
slightly on the solution. Or, at the very least, I can point out some
places where the documentation is confusing. If we check the manpage for
d/watch, it describes Dversion-Mangle [1]:
> Normalize the last upstream version string found in debian/changelog
to compare it to the available upstream tarball version. Removal of the
Debian specific suffix such as s/@DEB_EXT@// is usually done here.
From this, my understanding is that the "upstream version string" is
the version string from d/changelog, though it excludes the Debian
portion of the version following the dash. The upstream version thus
includes the +dfsg suffix.
The -u option for gbp import-orig is short for --upstream-version, so
you should be using "gbp import-orig --uscan -u2.8.1+dfsg --verbose".
Or, that would be the case except the gbp import-orig manpage [2]
documents --upstream-version as forwarding the argument directly to
uscan --download-version:
> --upstream-version=version, -uversion
> The upstream version number. With --uscan, passed to uscan as
--download-version
and `uscan --download-version` is documented as [3]:
> --download-version version
> Specify the version which the upstream release must match in
order to be considered, rather than using the release with the highest
version. (a best effort feature)
which we can contrast with uscan --download-debversion, which would do
what we actually want [3]:
> --download-debversion version
> Specify the Debian package version to download the corresponding
upstream release version. The dversionmangle and uversionmangle rules
are considered. (a best effort feature)
To me, the problem really seems to be that `gbp import-orig
--upstream-version` should be calling ` uscan --download-debversion`
(and documented as such).
As of git-buildpackage 0.9.6, gbp import-orig --uscan --upstream-version
is actually supposed to already be calling `uscan --download-debversion`
if `uscan --download-version` fails. That feature would be sufficient to
fix the weirdness with gbp --uscan --upstream-version and a +dfsg
suffix, but there was a bug in the implementation of the feature [4][5],
and gbp import-orig actually ends up calling uscan without any version
arguments.
If that mistake is fixed, then "gbp import-orig --uscan -u2.8.1+dfsg"
will achieve what you're trying to do. To me, expecting the dfsg suffix
in the upstream version string seems like it would be more consistent
with other related tools. With that said, I'm not an expert on this
terminology.
Sincerely,
Cory Bloor
[1]: https://manpages.debian.org/unstable/devscripts/debian-watch.5.en.html
[2]:
https://manpages.debian.org/unstable/git-buildpackage/gbp-import-orig.1.en.html#upstream
[3]: https://manpages.debian.org/unstable/devscripts/uscan.1.en.html
[4]:
https://salsa.debian.org/agx/git-buildpackage/-/commit/7d509bf8948e66e08b8bdd505b86ac5e4c374eae.patch
[5]: The variables passed for download_debversion are incorrect in the
second and third hunks of [4].