Re: gbp import-orig --uscan for the non-trivial cases
On 27/08/2025 19:35, Marc Haber wrote:
Exhibit A is sniproxy, a package I have recently taken over. Upstream
does proper releases, but seldomly. Last proper release was in 2023.
trixy, forky and sid have a git snapshot packaged in 2024. With the goal
of packaging a current git snapshot while preserving upstream's history
in Debian's git, I tried the following combination of the "Github" and
the "direct access to the git repository (HEAD)" recipe from debian-
watch(5):
| Version: 5
| | Template: Github
| Owner: dlundquist
| Project: sniproxy
| | Source: https://github.com/dlundquist/sniproxy.git
| Matching-Pattern: HEAD
| Mode: git
| Filename-Mangle: s/^(@PACKAGE@)-0\.0/$1-0.6.2/
| Repack: yes
| Compression: xz
With that, I hoped that gbp import-orig --scan would build an upstream
tarball from git and use that for packaging. But it doesn't.
I haven't tried v5, but in v4 syntax, without the repacking, this works:
d/watch
opts="mode=git, pgpmode=none, pretty=0.6.1+git%cd" \
https://github.com/dlundquist/sniproxy.git HEAD
$ uscan -dd
$ ls ..
sniproxy_0.6.1+git20240702.orig.tar.xz ->
sniproxy-0.6.1+git20240702.tar.xz
sniproxy-0.6.1+git20240702.tar.xz
I use '-dd' a lot when uscan doesn't do anything - probably confused by
the versions.
And perhaps you should use "pretty" in the interpretation of the git
version commit instead of Filename-Mangle.
Am I supposed to build the upstream tarball myself wit git archive?
No, uscan git-clones in a temp dir (watch ../) and creates a tarball
from it. Then gbp continues from the tarball.
Perhaps switch to v4 as there are tons more examples there - or v5 has a
bug?
The happy path should be:
$ gbp clone some-repo.git
$ cd some-repo
$ gbp import-orig --uscan
Then you should have 2 updated branches + orig tarball.
Doesn't work all the time though, especially if you're repacking
Where is the repo where you get the gbp-import-orig error? I could try that.
--
Regards,
Ahmad
Reply to: