Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package git-buildpackage [ Michael Prokop ] * [4142928] docs: update examples for pristine-tar usage, requiring commit action (Closes: #919677) [ Roberto C. Sánchez ] * [d3f67c8] docs: Fix typo [ Guido Günther ] * [3e3458f] setup.py: Move version parser into setup.py. This makes sure it ends up in the sdist tarball. [ Gabriel Filion ] * [34b9da1] Disable PGP signatures when retrieving list of commits (Closes: #923087) [ Simon McVittie ] * [74669f0] 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) The first two are doc updates to make things look better in buster while the last two fix rather important issues when processing lists of signed commits or patches with non-ascii characters. The setup.py modification helps people interacting with pypi. Cheers, -- Guido unblock git-buildpackage/0.9.14 -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386, armhf Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled
diff --git a/debian/changelog b/debian/changelog index 583ac6a7..466ff853 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +git-buildpackage (0.9.14) unstable; urgency=medium + + [ Michael Prokop ] + * [4142928] docs: update examples for pristine-tar usage, requiring commit + action + (Closes: #919677) + + [ Roberto C. Sánchez ] + * [d3f67c8] docs: Fix typo + + [ Gabriel Filion ] + * [34b9da1] Disable PGP signatures when retrieving list of commits + (Closes: #923087) + + [ Guido Günther ] + * [3e3458f] setup.py: Move version parser into setup.py. + This makes sure it ends up in the sdist tarball. + + [ Simon McVittie ] + * [74669f0] 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) + + -- Guido Günther <a...@sigxcpu.org> Thu, 21 Mar 2019 10:33:34 +0100 + git-buildpackage (0.9.13) unstable; urgency=medium [ Guido Günther ] diff --git a/docs/chapters/patches.xml b/docs/chapters/patches.xml index cb026c1b..aaf60299 100644 --- a/docs/chapters/patches.xml +++ b/docs/chapters/patches.xml @@ -9,7 +9,7 @@ </para> <para> - The basic idea is that patches are imported from you + The basic idea is that patches are imported from your &debian-branch; to a patch-queue branch with one patch file in <filename>debian/patches/</filename> becoming one commit on the the patch-queue branch. The created branch will be named after diff --git a/docs/manpages/gbp-pristine-tar.xml b/docs/manpages/gbp-pristine-tar.xml index 93a1db3d..eb74a31e 100644 --- a/docs/manpages/gbp-pristine-tar.xml +++ b/docs/manpages/gbp-pristine-tar.xml @@ -84,11 +84,11 @@ <title>EXAMPLES</title> <para>Add pristine-tar commits for an upstream tarball:</para> <screen> - &gbp-pristine-tar; ../upstream-tarball-0.1.tar.gz</screen> + &gbp-pristine-tar; commit ../upstream-tarball-0.1.tar.gz</screen> <para>Same as above with an additional tarball <filename>../upstream-tarball-foo-0.1.tar.gz:</filename></para> <screen> - &gbp-pristine-tar; --component-tarball=foo ../upstream-tarball-0.1.tar.gz</screen> + &gbp-pristine-tar; --component-tarball=foo commit ../upstream-tarball-0.1.tar.gz</screen> </refsect1> <refsect1> &man.gbp.config-files; diff --git a/gbp/git/repository.py b/gbp/git/repository.py index a44c71e1..dfc8e556 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1613,7 +1613,7 @@ class GitRepository(object): merge commit @type first_parent: C{bool} """ - args = GitArgs('--pretty=format:%H') + args = GitArgs('--pretty=format:%H', '--no-show-signature') args.add_true(num, '-%d' % num) args.add_true(first_parent, '--first-parent') if since: @@ -1694,7 +1694,7 @@ class GitRepository(object): commit_sha1 = self.rev_parse("%s^0" % commitish) args = GitArgs('--pretty=format:%an%x00%ae%x00%ad%x00%cn%x00%ce%x00%cd%x00%s%x00%f%x00%b%x00', '-z', '--date=raw', '--no-renames', '--name-status', - commit_sha1) + '--no-show-signature', commit_sha1) out, err, ret = self._git_inout('show', args.args) if ret: raise GitRepositoryError("Unable to retrieve commit info for %s" diff --git a/gbp/patch_series.py b/gbp/patch_series.py index c47f4b6e..7b561e62 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -255,6 +255,16 @@ class Dep3Patch(Patch): changes += add_date(v) elif k == 'long_desc': pass + elif k in ( + 'content-transfer-encoding', + 'content-type', + 'mime-version', + ): + # These can appear in `git format-patch` or `gbp pq export` + # output. They are not semantically significant: they're + # part of the encoding of the patch as an email, rather + # than real patch metadata. + pass else: pseudo_headers += ''.join(v) changes += 1 diff --git a/packaging/git-buildpackage.spec b/packaging/git-buildpackage.spec index 8b4e4741..1f719e67 100644 --- a/packaging/git-buildpackage.spec +++ b/packaging/git-buildpackage.spec @@ -3,7 +3,7 @@ Name: git-buildpackage Summary: Build packages from git -Version: 0.9.13 +Version: 0.9.14 Release: 0 Group: Development/Tools/Building License: GPLv2 diff --git a/setup.py b/setup.py index 150dfdde..fc99c5a9 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,46 @@ import os from setuptools import setup, find_packages -from version_parser import parse_and_fetch_version +import subprocess + +VERSION_PY_PATH = 'gbp/version.py' + + +def _parse_changelog(): + """Get version from debian changelog and write it to gbp/version.py""" + popen = subprocess.Popen('dpkg-parsechangelog', stdout=subprocess.PIPE) + out, ret = popen.communicate() + for line in out.decode('utf-8').split('\n'): + if line.startswith('Version:'): + version = line.split(' ')[1].strip() + return version + + raise ValueError('Could not parse version from debian/changelog') + + +def _save_version_py(version): + with open(VERSION_PY_PATH, 'w') as f: + f.write('"The current gbp version number"\n') + f.write('gbp_version = "%s"\n' % version) + + +def _load_version(): + with open(VERSION_PY_PATH, 'r') as f: + version_py = f.read() + version_py_globals = {} + exec(version_py, version_py_globals) + return version_py_globals['gbp_version'] + + +def parse_and_fetch_version(): + if os.path.exists('debian/changelog'): + version = _parse_changelog() + _save_version_py(version) + # we could return with the version here, but instead we check that + # the file has been properly written and it can be loaded back + + version = _load_version() + return version def readme(): diff --git a/tests/08_test_patch.py b/tests/08_test_patch.py index 9fe7f7fd..cf87b811 100644 --- a/tests/08_test_patch.py +++ b/tests/08_test_patch.py @@ -116,10 +116,6 @@ class TestBase64Patch(unittest.TestCase): self.assertEqual("Nick Leverton", p.author) self.assertEqual("n...@leverton.org", p.email) self.assertEqual("""\ -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: base64 - Sort files when using mergelib to create libnullmailer.a, to get reproducible build diff --git a/version_parser.py b/version_parser.py deleted file mode 100644 index 793d77db..00000000 --- a/version_parser.py +++ /dev/null @@ -1,42 +0,0 @@ -import os -import subprocess - - -VERSION_PY_PATH = 'gbp/version.py' - - -def _parse_changelog(): - """Get version from debian changelog and write it to gbp/version.py""" - popen = subprocess.Popen('dpkg-parsechangelog', stdout=subprocess.PIPE) - out, ret = popen.communicate() - for line in out.decode('utf-8').split('\n'): - if line.startswith('Version:'): - version = line.split(' ')[1].strip() - return version - - raise ValueError('Could not parse version from debian/changelog') - - -def _save_version_py(version): - with open(VERSION_PY_PATH, 'w') as f: - f.write('"The current gbp version number"\n') - f.write('gbp_version = "%s"\n' % version) - - -def _load_version(): - with open(VERSION_PY_PATH, 'r') as f: - version_py = f.read() - version_py_globals = {} - exec(version_py, version_py_globals) - return version_py_globals['gbp_version'] - - -def parse_and_fetch_version(): - if os.path.exists('debian/changelog'): - version = _parse_changelog() - _save_version_py(version) - # we could return with the version here, but instead we check that - # the file has been properly written and it can be loaded back - - version = _load_version() - return version