tools/git-buildpackage.git
4 years agoupstreamsource: Add __repr__
Guido Günther [Tue, 30 Jun 2020 07:46:15 +0000 (09:46 +0200)]
upstreamsource: Add __repr__

This eases debugging

4 years agoRevert "import-orig: Print name of signature file we failed to import"
Guido Günther [Mon, 29 Jun 2020 14:58:10 +0000 (16:58 +0200)]
Revert "import-orig: Print name of signature file we failed to import"

It will always be none (see check above that).

This reverts commit 3dc0bf3a8acfccdafa82b91bcc89ca2c82b46a1f.

4 years agoimport-orig: Print name of signature file we failed to import
Guido Günther [Mon, 29 Jun 2020 12:36:57 +0000 (14:36 +0200)]
import-orig: Print name of signature file we failed to import

4 years agoimport-orig: Print name of signature file we failed to import
Guido Günther [Mon, 29 Jun 2020 12:36:05 +0000 (14:36 +0200)]
import-orig: Print name of signature file we failed to import

5 years agodocs: import-ref: Fix wrong --upstream-tree default
Guido Günther [Tue, 16 Jun 2020 06:52:59 +0000 (08:52 +0200)]
docs: import-ref: Fix wrong --upstream-tree default

Closes: #962916
5 years agopristine-tar: Escape '+' in match regexp
Guido Günther [Fri, 17 Apr 2020 09:10:23 +0000 (11:10 +0200)]
pristine-tar: Escape '+' in match regexp

When looking for matching file name we need to exscape the valid '+' but
need to do it late since it must not be escaped for git-grep.

Closes: #956103
5 years agodeb: git: Escape '.' on pristine-tar matches
Guido Günther [Fri, 17 Apr 2020 08:54:06 +0000 (10:54 +0200)]
deb: git: Escape '.' on pristine-tar matches

'.' is valid in source package names and version numbers so we
want to match exactly that and not an arbitrary character.

5 years agodoctest: Ignore exception detail
Guido Günther [Fri, 17 Apr 2020 09:29:19 +0000 (11:29 +0200)]
doctest: Ignore exception detail

We used the tests to check whether the right exception was returned but
python 3.8 breaks this again:

File "/var/scratch/src/git-buildpackage/git-buildpackage/tests/doctests/test_GitVfs.py", line 56, in test_read
Failed example:
    gf = vfs.open('doesnotexist') # doctest:+ELLIPSIS
Expected:
    Traceback (most recent call last):
    ...
    OSError: can't get HEAD:doesnotexist: fatal: Path 'doesnotexist' does not exist in 'HEAD'
Got:
    Traceback (most recent call last):
      File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/git/vfs.py", line 74, in open
        return GitVfs._File(self._repo.show(
      File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/git/repository.py", line 1645, in show
        raise GitRepositoryError("can't get %s: %s" % (id, stderr.decode().rstrip()))
    gbp.git.repository.GitRepositoryError: can't get HEAD:doesnotexist: fatal: path 'doesnotexist' does not exist in 'HEAD'
    <BLANKLINE>
    During handling of the above exception, another exception occurred:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/usr/lib/python3.8/doctest.py", line 1329, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest test_read[12]>", line 1, in <module>
        gf = vfs.open('doesnotexist') # doctest:+ELLIPSIS
      File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/git/vfs.py", line 78, in open
        raise OSError(e)
    OSError: can't get HEAD:doesnotexist: fatal: path 'doesnotexist' does not exist in 'HEAD'

Doctest were a nice feature but keeping up with the subtle breackage is
too cumbersome.

5 years agoDocument changes and release 0.9.19
Guido Günther [Fri, 28 Feb 2020 08:49:26 +0000 (09:49 +0100)]
Document changes and release 0.9.19

5 years agoAdd salsa-ci
Guido Günther [Fri, 28 Feb 2020 08:27:58 +0000 (09:27 +0100)]
Add salsa-ci

5 years agoBuild-Depend on pydoctor
Guido Günther [Fri, 28 Feb 2020 07:50:13 +0000 (08:50 +0100)]
Build-Depend on pydoctor

since this uses python3

Closes: #943107
Thanks: Boyuan Yang for the hints

5 years agod/tests/control: Drop python-rpm
Guido Günther [Fri, 28 Feb 2020 07:47:18 +0000 (08:47 +0100)]
d/tests/control: Drop python-rpm

It's not needed.

5 years agoDocument changes and release 0.9.18
Guido Günther [Mon, 17 Feb 2020 14:12:36 +0000 (15:12 +0100)]
Document changes and release 0.9.18

5 years agoconfig: Be less picky about comments after boolean values
Guido Günther [Sun, 2 Feb 2020 17:38:48 +0000 (18:38 +0100)]
config: Be less picky about comments after boolean values

This makes 'patch-numbers = False # comment' work.

Thanks: Mechtilde Stehmann for the report

5 years agod/tests/control: Add xsltproc to the autopkg test dependencies
Matthias Klose [Thu, 30 Jan 2020 11:26:59 +0000 (12:26 +0100)]
d/tests/control: Add xsltproc to the autopkg test dependencies

Closes: #950216
5 years agoadd option to export tarballs with upstream signature
Christian Göttsche [Mon, 16 Dec 2019 23:10:01 +0000 (00:10 +0100)]
add option to export tarballs with upstream signature

Add option `--upstream-signatures=[on|auto|off]` to export-orig.
Add option `--git-upstream-signatures=[on|auto|off]` to buildpackage.

Closes: 872864
5 years agodch: Always print where we pick up
Guido Günther [Fri, 17 Jan 2020 10:14:56 +0000 (11:14 +0100)]
dch: Always print where we pick up

5 years agoimport-orig: Recommend python3-requests
Guido Günther [Sun, 22 Dec 2019 14:58:16 +0000 (15:58 +0100)]
import-orig: Recommend python3-requests

The python2 version won't do

5 years agoDocument changes and release 0.9.17
Guido Günther [Thu, 31 Oct 2019 18:16:27 +0000 (19:16 +0100)]
Document changes and release 0.9.17

5 years agotravis-ci: Switch to bionic
Guido Günther [Mon, 28 Oct 2019 16:05:43 +0000 (17:05 +0100)]
travis-ci: Switch to bionic

Need to drop python 3.4 for that since it's not available on bionic.

5 years agoRecommend and build depend on pristine-tar 1.41
Guido Günther [Mon, 28 Oct 2019 16:01:02 +0000 (17:01 +0100)]
Recommend and build depend on pristine-tar 1.41

since only this version has signature support.

5 years agodownload_orig: Fix invocation
Guido Günther [Tue, 29 Oct 2019 08:08:34 +0000 (09:08 +0100)]
download_orig: Fix invocation

5 years agotest_import_dsc.py: Test signature import
Guido Günther [Sun, 27 Oct 2019 10:16:26 +0000 (11:16 +0100)]
test_import_dsc.py: Test signature import

5 years agoimport-dsc: Import signature if present in dsc
Guido Günther [Sat, 26 Oct 2019 22:07:30 +0000 (00:07 +0200)]
import-dsc: Import signature if present in dsc

5 years agodocs: import-orig: Document --upstream-signtures
Guido Günther [Sat, 26 Oct 2019 19:46:08 +0000 (21:46 +0200)]
docs: import-orig: Document --upstream-signtures

5 years agoimport_orig: Test prepare_pristine_tar()
Guido Günther [Sat, 26 Oct 2019 18:49:25 +0000 (20:49 +0200)]
import_orig: Test prepare_pristine_tar()

5 years agoimport_orig: Symlink signature as well if needed
Guido Günther [Sat, 26 Oct 2019 18:16:37 +0000 (20:16 +0200)]
import_orig: Symlink signature as well if needed

5 years agotest_import_orig: Test upstream signature import with pristine-tar
Guido Günther [Sun, 27 Oct 2019 10:20:45 +0000 (11:20 +0100)]
test_import_orig: Test upstream signature import with pristine-tar

5 years agoimport-orig: Handle tarball signature when using pristine-tar
Guido Günther [Sat, 26 Oct 2019 11:26:53 +0000 (13:26 +0200)]
import-orig: Handle tarball signature when using pristine-tar

5 years agoUpdate submodule
Guido Günther [Sat, 26 Oct 2019 15:01:14 +0000 (17:01 +0200)]
Update submodule

This gives us signature data

5 years agofind_upstream: Add signature file if found
Guido Günther [Sat, 26 Oct 2019 15:02:00 +0000 (17:02 +0200)]
find_upstream: Add signature file if found

5 years agoimport_orig: Add signature file if found
Guido Günther [Sat, 26 Oct 2019 15:02:00 +0000 (17:02 +0200)]
import_orig: Add signature file if found

5 years agoUpstreamSource: expose signature
Guido Günther [Sat, 26 Oct 2019 13:47:25 +0000 (15:47 +0200)]
UpstreamSource: expose signature

5 years agoUse UpstreamSource for additional tarballs as well
Guido Günther [Sun, 27 Aug 2017 12:35:31 +0000 (14:35 +0200)]
Use UpstreamSource for additional tarballs as well

This will help on upstream tarball signatures as well as
improving additional tarball handling.

5 years agoexport_orig: Don't fail without a repository
Guido Günther [Sat, 26 Oct 2019 10:02:30 +0000 (12:02 +0200)]
export_orig: Don't fail without a repository

This is a valid use case in overlay mode
Thanks: Thomas Koch for the report

5 years agoDocument changes and release 0.9.16
Guido Günther [Tue, 22 Oct 2019 15:37:10 +0000 (17:37 +0200)]
Document changes and release 0.9.16

5 years agod/control: Bump standards version
Guido Günther [Mon, 7 Oct 2019 11:54:43 +0000 (13:54 +0200)]
d/control: Bump standards version

no changes needed

5 years agodocs: Fix typos
Guido Günther [Mon, 7 Oct 2019 11:54:02 +0000 (13:54 +0200)]
docs: Fix typos

Thanks: lintian

5 years agoexport-orig: Check 'origin/pristine-tar' as well for compression type
Guido Günther [Mon, 7 Oct 2019 09:23:13 +0000 (11:23 +0200)]
export-orig: Check 'origin/pristine-tar' as well for compression type

Closes: #941894
5 years agodocs: Fix wrong argument order of branch rename
Guido Günther [Tue, 24 Sep 2019 21:40:32 +0000 (23:40 +0200)]
docs: Fix wrong argument order of branch rename

Closes: #941110
Thanks: Jens Reyer

5 years agopq: Don't bubble up FileNotFoundException
Guido Günther [Wed, 11 Sep 2019 18:00:18 +0000 (11:00 -0700)]
pq: Don't bubble up FileNotFoundException

Closes: #940043
5 years agoDocument changes and release 0.9.15
Guido Günther [Sat, 7 Sep 2019 18:05:52 +0000 (11:05 -0700)]
Document changes and release 0.9.15

5 years agogbp-clone: Support salsa: pseudo urls
Guido Günther [Tue, 13 Aug 2019 17:57:49 +0000 (19:57 +0200)]
gbp-clone: Support salsa: pseudo urls

5 years agoFix over intended lines
Guido Günther [Sun, 21 Jul 2019 11:22:44 +0000 (13:22 +0200)]
Fix over intended lines

(rightfully tripping up newer flake8)

Gbp-Dch: Ignore

5 years agoimport-orig/merge_replace Avoid calling force_head
Maximiliano Curia [Sun, 21 Jul 2019 00:59:10 +0000 (21:59 -0300)]
import-orig/merge_replace Avoid calling force_head

The debian_merge_by_replace function ends up calling force_head, but up
to this point the current branch could be anything, and thus when called from a
feature branch the latest commits get lost.

6 years agogbp.conf: Set default compresson to xz
Hideki Yamane [Sat, 18 May 2019 00:20:54 +0000 (09:20 +0900)]
gbp.conf: Set default compresson to xz

The value is commented out so does not have any effect but it's
better to recommend the right value.

6 years agodocs: import-dsc: Document --upstream-vcs-tag
Guido Günther [Fri, 26 Apr 2019 11:58:39 +0000 (13:58 +0200)]
docs: import-dsc: Document --upstream-vcs-tag

6 years agoimport_dsc: Support upstream-vcs-tag
Guido Günther [Fri, 26 Apr 2019 11:44:27 +0000 (13:44 +0200)]
import_dsc: Support upstream-vcs-tag

Closes: #782886
6 years agoimport_orig: Move upstream-vcs-tag's help to config
Guido Günther [Fri, 26 Apr 2019 11:44:08 +0000 (13:44 +0200)]
import_orig: Move upstream-vcs-tag's help to config

This way it can be shared.

6 years agodocs: Document gbp import-orig --postunpack
Guido Günther [Thu, 25 Apr 2019 15:30:53 +0000 (17:30 +0200)]
docs: Document gbp import-orig --postunpack

6 years agoimport-orig: Allow to run a post unpack hook
Guido Günther [Thu, 25 Apr 2019 15:15:21 +0000 (17:15 +0200)]
import-orig: Allow to run a post unpack hook

The working directory of the hook is the top temporary directory the
tarballs are being unpacked into.

6 years agoDocument changes and release 0.9.14
Guido Günther [Thu, 21 Mar 2019 09:34:06 +0000 (10:34 +0100)]
Document changes and release 0.9.14

6 years agotests: Drop mime headers from test case
Guido Günther [Thu, 21 Mar 2019 09:15:28 +0000 (10:15 +0100)]
tests: Drop mime headers from test case

As a result of 74669f0925b7c3d08a735d4e302b656b766d15cf we don't parse
these out anymore (but don't need them either)

Gbp-Dch: Ignore

6 years agoDep3Patch: Ignore MIME headers
Simon McVittie [Wed, 13 Mar 2019 10:21:10 +0000 (10:21 +0000)]
Dep3Patch: Ignore MIME headers

Otherwise, if we import a patch containing non-ASCII characters exported
by `gbp pq export` or `git format-patch` using DEP-3 syntax, we'd
misinterpret these fields as semantically significant and copy them into
pseudo-headers, causing them to be duplicated in the commit's long
description.

Closes: #924478
Signed-off-by: Simon McVittie <smcv@debian.org>
6 years agosetup.py: Move version parser into setup.py
Guido Günther [Tue, 19 Mar 2019 14:32:12 +0000 (15:32 +0100)]
setup.py: Move version parser into setup.py

This makes sure it ends up in the sdist tarball.

6 years agoDisable PGP signatures when retrieving list of commits
Gabriel Filion [Sun, 24 Feb 2019 01:03:41 +0000 (20:03 -0500)]
Disable PGP signatures when retrieving list of commits

gbp dch errors out with the following output if the "log.showSignature"
git config is enabled:

$ gbp dch --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', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/master']
gbp:debug: ['git', 'tag', '-l', 'debian/2.7.3-2']
gbp:debug: ['git', 'tag', '-l', 'debian/2.7.3-2']
gbp:debug: ['git', 'log', '--pretty=format:%H', '-1', '--', 'debian/changelog']
gbp:info: Changelog last touched at 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST'
gbp:debug: ['git', 'log', '--pretty=format:%H', 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD', '--no-merges', '--']
fatal: bad revision 'gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD'
gbp:error: Error getting commits gpg: Signature made Fri 01 Feb 2019 03:56:19 PM EST..HEAD

This is caused by gbp dch receiving unexpected output for the PGP
signatures and trying to use this unexpected output.

To avoid any surprises, let's disable signatures being output when we
list commits.

Also, when collecting a shortlog-like output from commit objects, the
same unexpected PGP signature output is sprayed all over the changelog.
We'll avoid this by also disable showing signatures when showing each
commit's first line.

Closes: #923087
6 years agodocs: Fix typo
Roberto C. Sánchez [Mon, 28 May 2018 18:45:27 +0000 (14:45 -0400)]
docs: Fix typo

6 years agoMerge 414292838ac45665e36455a57ff034fddf5a3b7a into db9ce9fc5b5cf29c3c7df18d84540dd40...
Michael Prokop [Fri, 18 Jan 2019 14:30:49 +0000 (14:30 +0000)]
Merge 414292838ac45665e36455a57ff034fddf5a3b7a into db9ce9fc5b5cf29c3c7df18d84540dd400d4bc6e

6 years agodocs: update examples for pristine-tar usage, requiring commit action
Michael Prokop [Fri, 18 Jan 2019 14:28:00 +0000 (15:28 +0100)]
docs: update examples for pristine-tar usage, requiring commit action

Closes: #919677
6 years agoDocument changes and release 0.9.13
Guido Günther [Sat, 29 Dec 2018 17:49:56 +0000 (18:49 +0100)]
Document changes and release 0.9.13

6 years agorpm_ch: Escape \S in regex replacement
Guido Günther [Sat, 29 Dec 2018 17:07:00 +0000 (18:07 +0100)]
rpm_ch: Escape \S in regex replacement

Replace the \S in the substitution. Otherwise we fail on Python3.7 like

  ======================================================================
  ERROR: Test determining the author name/email
  ----------------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib/python3.7/sre_parse.py", line 1021, in parse_template
      this = chr(ESCAPES[this][1])
  KeyError: '\\S'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/var/scratch/src/git-buildpackage/git-buildpackage/tests/component/rpm/test_rpm_ch.py", line 182, in test_author
      eq_(mock_ch([]), 0)
    File "/var/scratch/src/git-buildpackage/git-buildpackage/tests/component/rpm/test_rpm_ch.py", line 37, in mock_ch
      '--spawn-editor=never'] + args)
    File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/scripts/rpm_ch.py", line 422, in main
      since = get_start_commit(ch_file.changelog, repo, options)
    File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/scripts/rpm_ch.py", line 230, in get_start_commit
      since = guess_commit(changelog.sections[0], repo, options)
    File "/var/scratch/src/git-buildpackage/git-buildpackage/gbp/scripts/rpm_ch.py", line 180, in guess_commit
      options.changelog_revision)
    File "/usr/lib/python3.7/re.py", line 192, in sub
      return _compile(pattern, flags).sub(repl, string, count)
    File "/usr/lib/python3.7/re.py", line 309, in _subx
      template = _compile_repl(template, pattern)
    File "/usr/lib/python3.7/re.py", line 300, in _compile_repl
      return sre_parse.parse_template(repl, pattern)
    File "/usr/lib/python3.7/sre_parse.py", line 1024, in parse_template
      raise s.error('bad escape %s' % this, len(this))
  re.error: bad escape \S at position 7

6 years agogbp-pull: Invoke gbp pq correctly for --redo-pq option
Simon McVittie [Sat, 29 Dec 2018 16:09:28 +0000 (16:09 +0000)]
gbp-pull: Invoke gbp pq correctly for --redo-pq option

`gbp pull --redo-pq` assumed that `gbp-pq` exists in PATH, which isn't
normally true since 0.6.24 (2015).

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #917637
6 years agozsh completion: Fix typo in redirection to _gbp-import-dsc
Simon McVittie [Sat, 29 Dec 2018 16:05:01 +0000 (16:05 +0000)]
zsh completion: Fix typo in redirection to _gbp-import-dsc

Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #917636
6 years agoFix typo
Chris Lamb [Sat, 29 Dec 2018 16:31:46 +0000 (17:31 +0100)]
Fix typo

Closes: #914280
6 years agopush: Push Debian branch first
Guido Günther [Mon, 17 Dec 2018 16:27:56 +0000 (17:27 +0100)]
push: Push Debian branch first

This makes sure in new repos this is the correct default branch.

Closes: #916651
6 years agoPatchSeries: Don't fail if there's only a patch end marker
Guido Günther [Sun, 16 Dec 2018 12:21:29 +0000 (13:21 +0100)]
PatchSeries: Don't fail if there's only a patch end marker

If the patch only has '---' we pass empty data to git-mail-info
otherwise.

Thanks: James Cowgill for the detailed report
Closes: #916545
6 years agoDocument changes and release 0.9.12
Guido Günther [Tue, 11 Dec 2018 17:23:33 +0000 (18:23 +0100)]
Document changes and release 0.9.12

6 years agoimport_ref: Fix warning
Guido Günther [Tue, 11 Dec 2018 17:03:08 +0000 (18:03 +0100)]
import_ref: Fix warning

6 years agoDocument changes and release 0.9.11
Guido Günther [Tue, 11 Dec 2018 09:43:56 +0000 (10:43 +0100)]
Document changes and release 0.9.11

6 years agogbp-import-ref: Add warning
Guido Günther [Tue, 11 Dec 2018 09:18:58 +0000 (10:18 +0100)]
gbp-import-ref: Add warning

This is still experimental but let's ship it since it's useful in
some cases already.

Gbp-Dch: Ignore

6 years agogbp.deb: Correct "otherwise" spelling in comment
Ken Dreyer [Tue, 27 Nov 2018 22:07:33 +0000 (15:07 -0700)]
gbp.deb: Correct "otherwise" spelling in comment

6 years agoFix "was build" typos
Chris Lamb [Sun, 9 Dec 2018 16:52:22 +0000 (17:52 +0100)]
Fix "was build" typos

Closes: #916044
6 years agoimport-orig: rename sourcepackage to name
Guido Günther [Sat, 21 Oct 2017 06:35:56 +0000 (08:35 +0200)]
import-orig: rename sourcepackage to name

since it's the source package's name

6 years agoPristineTar: Don't fail if pristine-tar does't support signatures
Guido Günther [Sat, 24 Nov 2018 18:22:34 +0000 (19:22 +0100)]
PristineTar: Don't fail if pristine-tar does't support signatures

6 years agoPristienTar: Properly detect signature feature
Guido Günther [Sat, 24 Nov 2018 18:22:14 +0000 (19:22 +0100)]
PristienTar: Properly detect signature feature

6 years agoDebianSource: Drop unused variable
Guido Günther [Sat, 24 Nov 2018 17:04:22 +0000 (18:04 +0100)]
DebianSource: Drop unused variable

6 years agoMake it simple to print exception details
Guido Günther [Sat, 24 Nov 2018 16:17:10 +0000 (17:17 +0100)]
Make it simple to print exception details

6 years agopristine-tar: support checking in/out upstream signatures
Guido Günther [Sat, 24 Nov 2018 16:17:10 +0000 (17:17 +0100)]
pristine-tar: support checking in/out upstream signatures

6 years agopristine-tar: detect signature verification support
Guido Günther [Sat, 24 Nov 2018 16:17:10 +0000 (17:17 +0100)]
pristine-tar: detect signature verification support

6 years agoDeduplicate version_mangle_re
Guido Günther [Fri, 23 Nov 2018 16:37:42 +0000 (17:37 +0100)]
Deduplicate version_mangle_re

6 years agobuildpackage, export-orig: support version substitution for --git-tarball-dir
Luca Boccassi [Thu, 6 Sep 2018 16:34:13 +0000 (18:34 +0200)]
buildpackage, export-orig: support version substitution for --git-tarball-dir

Add support for passing %(version), %(hversion) and %(version%A%B) in
buildpackage --git-tarball-dir and export-orig --tarball-dir.

Closes: #909266
Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agoRefresh tests data submodule
Luca Boccassi [Fri, 2 Nov 2018 19:51:12 +0000 (19:51 +0000)]
Refresh tests data submodule

6 years agoPatchSeries: Only pass patch description and header to git-mailinfo
Guido Günther [Thu, 8 Nov 2018 10:09:10 +0000 (11:09 +0100)]
PatchSeries: Only pass patch description and header to git-mailinfo

There are patches around that use

Content-Transfer-Encoding: base64

but the actual patch after '---' is unencoded ascii resulting in garbage
after the patch description when imported into a patch queue.

Since we're discarding the patch part of git-mailinfo anyway don't pass
this on in the first place.

Closes: #912426
6 years agoGitRepository: Make git_inout available everywhere
Guido Günther [Thu, 8 Nov 2018 10:08:31 +0000 (11:08 +0100)]
GitRepository: Make git_inout available everywhere

6 years agodocs: update references from <http://dep.debian.net> to <https://dep-team.pages.debia...
Arnaud Rebillout [Tue, 5 Jun 2018 03:58:27 +0000 (10:58 +0700)]
docs: update references from <dep.debian.net> to <https://dep-team.pages.debian.net>.

6 years agosetup.py: Fix gbp problem when installed with pip
Kiss György [Thu, 18 Oct 2018 13:40:47 +0000 (15:40 +0200)]
setup.py: Fix gbp problem when installed with pip

when installed with "pip install gbp" it will be installed as version "0.0"
because the released version doesn't have a debian/changelog file, so it will
be installed with a warning:
balabit-bbos-tools 1.0.0 has requirement gbp==0.9.8, but you'll have gbp 0.0 which is incompatible.

and will cause an Exception when using gbp from a setuptools entrypoint script:

  File "/home/walkman/stew/projects/platform/source/balabit-os-tools/.venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 574, in _build_master
    ws.require(__requires__)
  File "/home/walkman/stew/projects/platform/source/balabit-os-tools/.venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 892, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/walkman/stew/projects/platform/source/balabit-os-tools/.venv/lib/python3.6/site-packages/pkg_resources/__init__.py", line 783, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (gbp 0.0 (/home/walkman/stew/projects/platform/source/balabit-os-tools/.venv/lib/python3.6/site-packages), Requirement.parse('gbp==0.9.8'), {'requiresgbp'})

This is because pkg_resources checks every dependency version and if it doesn't
match with the egg-info, it raises this Exception.

Instead, we try to parse the debian/changelog first, then load the version, or
if the debian/changelog file doesn't exists (this is the case at pip install)
we read the gbp/version.py and parse the version from it.

There is a "round trip check", which means the parsed version is written, then
it will be read back immediately to see if there is any problem.

6 years agobuilpackage-rpm: Use GBP_TMP_DIR instead f GBP_BUILD_DIR
Guido Günther [Sun, 28 Oct 2018 11:40:12 +0000 (12:40 +0100)]
builpackage-rpm: Use GBP_TMP_DIR instead f GBP_BUILD_DIR

This is consistent with --git-post-export and unbreaks

    tests/component/rpm/test_buildpackage_rpm.py:TestGbpRpm.test_hook_options

6 years agobuildpackage{,-rpm}: add preexport hook
Luca Boccassi [Mon, 25 Jun 2018 22:37:02 +0000 (23:37 +0100)]
buildpackage{,-rpm}: add preexport hook

Sometimes it is necessary to perform operations before preparing the
tarballs and exporting to the build directory.
One such case is when having to handle extremely large binary assets in
the orig tarball and at the same time complex packaging code, which
makes it desirable to separate the two into different repositories for
easier handling.
A pre-export hook allows to ensure that the tarball repository is
present and checked out at the correct branch.

Closes: #909266
Signed-off-by: Luca Boccassi <bluca@debian.org>
6 years agoFix flake8's W605 (invalid escape sequence)
Guido Günther [Sun, 14 Oct 2018 09:17:43 +0000 (11:17 +0200)]
Fix flake8's W605 (invalid escape sequence)

See also

    https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

6 years agoIgnore flake8's 'W504 line break after binary operator'
Guido Günther [Mon, 15 Oct 2018 07:57:55 +0000 (09:57 +0200)]
Ignore flake8's 'W504 line break after binary operator'

With flake8's other warnings this doesn't make much sense since
indentation accoding to https://hg.python.org/peps/rev/3857909d7956
does not work. It triggers

- 'W503 line break before binary operator'
- 'E129 visually indented line with same indent as next logical line'

If one want to align the operators one hits
- 'E127 continuation line over-indented for visual indent'

So let's leave things as is for the moment.

6 years agorepository: Remove superfluous blank line
Guido Günther [Mon, 15 Oct 2018 08:06:30 +0000 (10:06 +0200)]
repository: Remove superfluous blank line

to make flake8 happy

Gbp-Dch: Ignore

6 years agoPkgPolicy.symlink_orig: also remove dangling symlinks
Andreas Beckmann [Wed, 19 Sep 2018 23:23:02 +0000 (01:23 +0200)]
PkgPolicy.symlink_orig: also remove dangling symlinks

6 years agohook: Fix harmless typo
Andreas Beckmann [Fri, 7 Sep 2018 17:52:38 +0000 (19:52 +0200)]
hook: Fix harmless typo

Gbp-Dch: Ignore

6 years agodebian.source: Enumerate components only once
Andreas Beckmann [Fri, 7 Sep 2018 09:54:31 +0000 (11:54 +0200)]
debian.source: Enumerate components only once

6 years agobuildpackage: Unify 'extract' messages
Andreas Beckmann [Thu, 6 Sep 2018 12:49:16 +0000 (14:49 +0200)]
buildpackage: Unify 'extract' messages

Gbp-Dch: Ignore

6 years agotests: small fix for import-orig-rpm component test
Markus Lehtonen [Tue, 18 Sep 2018 10:49:37 +0000 (13:49 +0300)]
tests: small fix for import-orig-rpm component test

Merge behaviour in newer git versions (> v2.16) is slightly different.

This broke one test with an error something like:
Traceback (most recent call last):
  File "tests/component/rpm/test_import_orig_rpm.py", line 243, in test_misc_options
    eq_(len(repo.get_commits(until='pack')), 3)
AssertionError: 2 != 3

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
6 years agotravisci: Test Python 3.7 as well
Guido Günther [Mon, 17 Sep 2018 07:51:25 +0000 (09:51 +0200)]
travisci: Test Python 3.7 as well

Use the workaround from

    https://github.com/travis-ci/travis-ci/issues/9815

since Python 3.7 is not yet supported by the default image.

6 years agogbp.git: fix doctest with recent python-dateutil.
Markus Lehtonen [Fri, 14 Sep 2018 11:00:36 +0000 (14:00 +0300)]
gbp.git: fix doctest with recent python-dateutil.

Traceback format has changed in recent python-dateutil.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
6 years agopq: Fix testcase
Guido Günther [Fri, 24 Aug 2018 06:53:59 +0000 (08:53 +0200)]
pq: Fix testcase

Pseudo headers are now moved to the top of the patch.

6 years agopq import: Always put DEP-3 headers as pseudo-headers
Ben Hutchings [Sun, 12 Aug 2018 00:42:42 +0000 (01:42 +0100)]
pq import: Always put DEP-3 headers as pseudo-headers

If there are any non-git DEP-3 header fields, put them at the top of
the body text, regardless of whether Description or Subject is used.
Also put a blank line between them and the rest of the message body.