Package: git-buildpackage
Version: 0.9.32
Severity: normal

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
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'for-each-ref', '--format=%(refname:short)', 'refs/heads/']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream']
gbp:debug: ['git', 'status', '--porcelain']
gbp:info: Launching uscan...
Newest version of adios2 on remote site is 2.8.1, specified download version is 
2.8.1
Successfully repacked ../adios2-2.8.1.tar.gz as 
../adios2_2.8.1+dfsg1.orig.tar.xz, deleting 517 files from itgbp:info: Using 
uscan downloaded tarball ../adios2_2.8.1+dfsg1.orig.tar.xz
gbp:debug: ['git', 'tag', '-l', 'upstream/2.8.1']
gbp:debug: tar ['-C', '../tmp1zd0cmte', '-a', '-xf', 
'../adios2_2.8.1+dfsg1.orig.tar.xz'] []
gbp:debug: Unpacked '../adios2_2.8.1+dfsg1.orig.tar.xz' to 
'../tmp1zd0cmte/ADIOS2-2.8.1'
gbp:info: <DebianUpstreamSource path='../adios2_2.8.1+dfsg1.orig.tar.xz' 
signaturefile=None>
gbp:info: Importing '../adios2_2.8.1+dfsg1.orig.tar.xz' to branch 'upstream'...
gbp:info: Source package is adios2
gbp:info: Upstream version is 2.8.1
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'upstream']
gbp:debug: ['git', 'add', '-f', '.']
gbp:debug: ['git', 'write-tree']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'upstream']
gbp:debug: ['git', 'commit-tree', 'b6bd2fec8ddd4682bb7b16f87e57286f93ac0984', 
'-p', '0d8247511446cb41740f2cbb74ee40943e549e82']
gbp:debug: ['git', 'update-ref', '-m', 'gbp: New upstream version 2.8.1', 
'refs/heads/upstream', '687fef9491c76d31f551408e1dfc5fa200405fc3', 
'0d8247511446cb41740f2cbb74ee40943e549e82']
gbp:debug: ['git', 'tag', '-m', 'Upstream version 2.8.1', '--no-sign', 
'upstream/2.8.1', '687fef9491c76d31f551408e1dfc5fa200405fc3']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/master']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'master']
gbp:debug: ['git', 'show', '--pretty=medium', 'master:debian/source/format']
gbp:debug: 3.0 (quilt) package, replacing debian/ dir
gbp:info: Replacing upstream source on 'master'
gbp:debug: ['git', 'ls-tree', '-z', 'upstream/2.8.1^{tree}', '--']
gbp:debug: ['git', 'ls-tree', '-z', 'master^{tree}', '--']
gbp:debug: Using 98a2d1eddd69b16b3b68b040a0132f9c80ebef39 as debian/ tree
gbp:debug: ['git', 'mktree', '-z']
gbp:debug: ['git', 'commit-tree', '11b6cfd34d89eea0c9c12ac8f1a1f04346f1da5b', 
'-p', 'master^{commit}', '-p', 'upstream/2.8.1^{commit}']
gbp:debug: ['git', 'update-ref', '-m', 'gbp: Updating master after import of 
upstream/2.8.1', 'refs/heads/master', 
'f687f080be196b7a37375aa561f561d4bd104678']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: ['git', 'reset', '--quiet', '--hard', 
'f687f080be196b7a37375aa561f561d4bd104678', '--']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: rm ['-rf', '../tmp1zd0cmte'] []
gbp:info: Successfully imported version 2.8.1 of 
../adios2_2.8.1+dfsg1.orig.tar.xz
drew@sandy:~/projects/mathlibs/build/adios2$ git tag
upstream/2.5.0+g2020.05.13
upstream/2.5.0+g2020.05.13.1
upstream/2.5.0+g2020.05.13.1+dfsg1
upstream/2.5.0+g2020.05.21+dfsg1
upstream/2.8.1


So the tag is given as upstream/2.8.1 without the +dfsg1 suffix
(but the suffix is used in the orig tarball name)


If I then try to import the latest release (v2.9.1), I get:

$ gbp import-orig --uscan  --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'for-each-ref', '--format=%(refname:short)', 'refs/heads/']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream']
gbp:debug: ['git', 'status', '--porcelain']
gbp:info: Launching uscan...
Newest version of adios2 on remote site is 2.9.1, local version is 
2.5.0+g2020.05.21
       (mangled local version is 2.5.0+g2020.05.21)
 => Newer package available from:
        => https://github.com/ornladios/ADIOS2/archive/refs/tags/v2.9.1.tar.gz
Successfully repacked ../adios2-2.9.1.tar.gz as 
../adios2_2.9.1+dfsg1.orig.tar.xz, deleting 517 files from itgbp:info: Using 
uscan downloaded tarball ../adios2_2.9.1+dfsg1.orig.tar.xz
What is the upstream version? [2.9.1+dfsg1] 
gbp:debug: ['git', 'tag', '-l', 'upstream/2.9.1+dfsg1']
gbp:debug: tar ['-C', '../tmps3ajtsuc', '-a', '-xf', 
'../adios2_2.9.1+dfsg1.orig.tar.xz'] []
gbp:debug: Unpacked '../adios2_2.9.1+dfsg1.orig.tar.xz' to 
'../tmps3ajtsuc/ADIOS2-2.9.1'
gbp:info: <DebianUpstreamSource path='../adios2_2.9.1+dfsg1.orig.tar.xz' 
signaturefile=None>
gbp:info: Importing '../adios2_2.9.1+dfsg1.orig.tar.xz' to branch 'upstream'...
gbp:info: Source package is adios2
gbp:info: Upstream version is 2.9.1+dfsg1
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/upstream']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'upstream']
gbp:debug: ['git', 'add', '-f', '.']
gbp:debug: ['git', 'write-tree']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'upstream']
gbp:debug: ['git', 'commit-tree', 'c997f98b7703842f7a5b042a6f9e2cf94fb0a0d4', 
'-p', '687fef9491c76d31f551408e1dfc5fa200405fc3']
gbp:debug: ['git', 'update-ref', '-m', 'gbp: New upstream version 2.9.1+dfsg1', 
'refs/heads/upstream', '9de477fc47a2a0f9f02445ba5be1fa9dee1148b4', 
'687fef9491c76d31f551408e1dfc5fa200405fc3']
gbp:debug: ['git', 'tag', '-m', 'Upstream version 2.9.1+dfsg1', '--no-sign', 
'upstream/2.9.1+dfsg1', '9de477fc47a2a0f9f02445ba5be1fa9dee1148b4']
gbp:debug: ['git', 'show-ref', '--verify', 'refs/heads/master']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'master']
gbp:debug: ['git', 'show', '--pretty=medium', 'master:debian/source/format']
gbp:debug: 3.0 (quilt) package, replacing debian/ dir
gbp:info: Replacing upstream source on 'master'
gbp:debug: ['git', 'ls-tree', '-z', 'upstream/2.9.1+dfsg1^{tree}', '--']
gbp:debug: ['git', 'ls-tree', '-z', 'master^{tree}', '--']
gbp:debug: Using 98a2d1eddd69b16b3b68b040a0132f9c80ebef39 as debian/ tree
gbp:debug: ['git', 'mktree', '-z']
gbp:debug: ['git', 'commit-tree', '5722b62676df8747541f571e5c8801dd918cdd57', 
'-p', 'master^{commit}', '-p', 'upstream/2.9.1+dfsg1^{commit}']
gbp:debug: ['git', 'update-ref', '-m', 'gbp: Updating master after import of 
upstream/2.9.1+dfsg1', 'refs/heads/master', 
'fbfc1ee48288886b5143c4271b22301f5da32448']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: ['git', 'reset', '--quiet', '--hard', 
'fbfc1ee48288886b5143c4271b22301f5da32448', '--']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: rm ['-rf', '../tmps3ajtsuc'] []
gbp:info: Successfully imported version 2.9.1+dfsg1 of 
../adios2_2.9.1+dfsg1.orig.tar.xz
drew@sandy:~/projects/mathlibs/build/adios2$ git tag
upstream/2.5.0+g2020.05.13
upstream/2.5.0+g2020.05.13.1
upstream/2.5.0+g2020.05.13.1+dfsg1
upstream/2.5.0+g2020.05.21+dfsg1
upstream/2.8.1
upstream/2.9.1+dfsg1


So using the same debian/watch file, "gbp import-orig --uscan -u2.8.1"
drops the +dfsg1 suffix in the upstream tag,
while "gbp import-orig --uscan" includes the +dfsg1 suffix in the tag.
The behaviour of gbp import-orig is not consistent.


-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.4.0-1-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages git-buildpackage depends on:
ii  devscripts             2.23.5
ii  git                    1:2.40.1-1
ii  man-db                 2.11.2-3
ii  python3                3.11.4-5+b1
ii  python3-dateutil       2.8.2-3
ii  python3-pkg-resources  68.0.0-2
ii  python3-yaml           6.0.1-1
ii  sensible-utils         0.0.20

Versions of packages git-buildpackage recommends:
ii  cowbuilder        0.89
ii  pbuilder          0.231
ii  pristine-tar      1.50
ii  python3-requests  2.31.0+dfsg-1
ii  sbuild            0.85.2

Versions of packages git-buildpackage suggests:
pn  python3-notify2  <none>
ii  sudo             1.9.14p2-1
ii  unzip            6.0-28

-- no debconf information

Reply via email to