From 7beb71e521eb482903779e3aa830e20dd820bb8e Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Thu, 28 Nov 2024 00:27:34 +0100 Subject: [PATCH 1/2] buildpackage: Allow both DEP-14 and DEP14 as values for `dist` --- gbp/scripts/buildpackage.py | 2 +- tests/22_test_gbp_buildpackage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index bcb6fa7a..79469a03 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -202,7 +202,7 @@ def get_pbuilder_dist(options, repo, native=False): Determine the dist to build for with pbuilder/cowbuilder """ dist = None - if options.pbuilder_dist == 'DEP14': + if options.pbuilder_dist == 'DEP-14' or options.pbuilder_dist == 'DEP14': vendor = du.get_vendor().lower() branch = repo.branch if not branch: diff --git a/tests/22_test_gbp_buildpackage.py b/tests/22_test_gbp_buildpackage.py index 581e70e9..1c1bf51b 100644 --- a/tests/22_test_gbp_buildpackage.py +++ b/tests/22_test_gbp_buildpackage.py @@ -17,7 +17,7 @@ class TestGbpBuildpackageDep14(DebianGitTestRepo): DebianGitTestRepo.setUp(self) self.add_file('doesnotmatter') self.options = self.Options() - self.options.pbuilder_dist = 'DEP14' + self.options.pbuilder_dist = 'DEP-14' @patch('gbp.deb.get_vendor', return_value='Debian') def test_get_pbuilder_dist_no_dep14(self, patch): -- GitLab From 67baaae6cc43d95e8f7f069074535a375893f951 Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Thu, 28 Nov 2024 00:27:34 +0100 Subject: [PATCH 2/2] Consistently use DEP-X in documentation and error messages The consensus on debian-devel is that "DEP-X" should be preferred to "DEPX" and "DEP X". See: https://lists.debian.org/debian-devel/2024/11/msg00141.html --- docs/chapters/patches.xml | 4 ++-- docs/manpages/gbp-buildpackage.xml | 2 +- gbp/deb/git.py | 6 ++---- gbp/patch_series.py | 2 +- gbp/scripts/buildpackage.py | 2 +- tests/22_test_gbp_buildpackage.py | 2 +- tests/component/deb/test_pq.py | 8 ++++---- 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/docs/chapters/patches.xml b/docs/chapters/patches.xml index dcbe116a..3f7b0621 100644 --- a/docs/chapters/patches.xml +++ b/docs/chapters/patches.xml @@ -54,11 +54,11 @@ Also, beware that &gbp-pq; currently has incomplete support for - DEP3 headers. + DEP-3 headers. Initially, parsing with git-mailinfo(1) is attempted, which supports only the From and Subject fields. If neither of these are - present, &gbp-pq; will attempt to convert the patch from DEP3 format into + present, &gbp-pq; will attempt to convert the patch from DEP-3 format into a git-mailinfo(1) compatible format. This involves first loading From using the Author field and diff --git a/docs/manpages/gbp-buildpackage.xml b/docs/manpages/gbp-buildpackage.xml index 48392666..6dcfae14 100644 --- a/docs/manpages/gbp-buildpackage.xml +++ b/docs/manpages/gbp-buildpackage.xml @@ -388,7 +388,7 @@ via , or the corresponding configuration file options). If unset build for the unstable distribution. The special - value DEP14 will set the distribution to + value DEP-14 will set the distribution to build for from the branch name. I.e. if you're starting the build from a branch named debian/wheezy-backports the diff --git a/gbp/deb/git.py b/gbp/deb/git.py index 021f098c..60a8f723 100644 --- a/gbp/deb/git.py +++ b/gbp/deb/git.py @@ -269,8 +269,7 @@ class DebianGitRepository(PkgGitRepository): @staticmethod def _sanitize_version(version): """sanitize a version so git accepts it as a tag - - as described in DEP14 + as described in DEP-14 >>> DebianGitRepository._sanitize_version("0.0.0") '0.0.0' @@ -291,8 +290,7 @@ class DebianGitRepository(PkgGitRepository): @staticmethod def _unsanitize_version(tag): """Reverse _sanitize_version - - as described in DEP14 + as described in DEP-14 >>> DebianGitRepository._unsanitize_version("1%0_bpo3") '1:0~bpo3' diff --git a/gbp/patch_series.py b/gbp/patch_series.py index 04e495f4..2d63afef 100644 --- a/gbp/patch_series.py +++ b/gbp/patch_series.py @@ -275,7 +275,7 @@ class Dep3Patch(Patch): def _check_dep3(self): """ - Read DEP3 patch information into a structured form + Read DEP-3 patch information into a structured form """ if not os.path.exists(self.path): return diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 79469a03..b5fd1713 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -227,7 +227,7 @@ def get_pbuilder_dist(options, repo, native=False): dist = branch if dist is None: - raise GbpError("DEP14 DIST: Current branch '%s' does not match vendor/suite" % branch) + raise GbpError("DEP-14 DIST: Current branch '%s' does not match vendor/suite" % branch) else: dist = options.pbuilder_dist return dist diff --git a/tests/22_test_gbp_buildpackage.py b/tests/22_test_gbp_buildpackage.py index 1c1bf51b..0fba4c60 100644 --- a/tests/22_test_gbp_buildpackage.py +++ b/tests/22_test_gbp_buildpackage.py @@ -105,7 +105,7 @@ class TestGbpBuildpackageDep14(DebianGitTestRepo): self.repo.create_branch(branch) self.repo.set_branch(branch) with self.assertRaisesRegex(GbpError, - "DEP14 DIST: Current branch 'too/many/slashes' does not match vendor/suite"): + "DEP-14 DIST: Current branch 'too/many/slashes' does not match vendor/suite"): get_pbuilder_dist(self.options, self.repo) diff --git a/tests/component/deb/test_pq.py b/tests/component/deb/test_pq.py index 7fc7680c..11a4914f 100644 --- a/tests/component/deb/test_pq.py +++ b/tests/component/deb/test_pq.py @@ -117,8 +117,8 @@ class TestPq(ComponentTestBase): self._append_patch(repo, 'foo', '''\ Author: Mr. T. St -Description: Short DEP3 description - Long DEP3 description +Description: Short DEP-3 description + Long DEP-3 description . Continued --- /dev/null @@ -129,12 +129,12 @@ Description: Short DEP3 description self._test_pq(repo, 'import', ['--force']) author, subject = repo.get_head_author_subject() - assert subject == "Short DEP3 description" + assert subject == "Short DEP-3 description" assert author == '"Mr. T. St" ' @RepoFixtures.quilt30() def test_import_poor_dep3_behaviour(self, repo): - """Demonstrate the issues with the current DEP3 support""" + """Demonstrate the issues with the current DEP-3 support""" pkg = "hello-debhelper" dsc = self._dsc_name(pkg, "2.6-2", "dsc-3.0") -- GitLab