From 53d96a5ad4e017def99225a24d667544e473ba02 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 24 Nov 2021 18:51:04 +0100 Subject: [PATCH 1/2] control: Run wrap-and-sort This standardizes the format and ensures future diffs will look nicer and be easier to review. Gbp-Dch: Ignore --- debian/control | 45 +++++++++++++++++++++++--------------------- debian/tests/control | 4 +++- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/debian/control b/debian/control index 2984938..72b7b6a 100644 --- a/debian/control +++ b/debian/control @@ -2,35 +2,38 @@ Source: libvirt-dbus Section: admin Priority: optional Maintainer: Debian Libvirt Maintainers -Uploaders: Andrea Bolognani +Uploaders: + Andrea Bolognani , Homepage: https://libvirt.org/ Vcs-Git: https://salsa.debian.org/libvirt-team/libvirt-dbus.git Vcs-Browser: https://salsa.debian.org/libvirt-team/libvirt-dbus -Build-Depends: debhelper-compat (= 13), - meson, - pkg-config, - libvirt-dev (>= 3.0.0), - libglib2.0-dev (>= 2.44.0), - libvirt-glib-1.0-dev (>= 0.0.7), - dbus , - python3:any, - python3-gi , - python3-dbus , - python3-docutils, - python3-pytest , +Build-Depends: + dbus , + debhelper-compat (= 13), + libglib2.0-dev (>= 2.44.0), + libvirt-dev (>= 3.0.0), + libvirt-glib-1.0-dev (>= 0.0.7), + meson, + pkg-config, + python3-dbus , + python3-docutils, + python3-gi , + python3-pytest , + python3:any, Standards-Version: 4.6.0 Rules-Requires-Root: no Package: libvirt-dbus Architecture: any -Depends: dbus, - default-dbus-session-bus | dbus-session-bus, - policykit-1, - libvirt-daemon, - libvirt-daemon-system, - adduser, - ${shlibs:Depends}, - ${misc:Depends} +Depends: + adduser, + dbus, + default-dbus-session-bus | dbus-session-bus, + libvirt-daemon, + libvirt-daemon-system, + policykit-1, + ${misc:Depends}, + ${shlibs:Depends}, Description: libvirt D-Bus API bindings Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). The diff --git a/debian/tests/control b/debian/tests/control index b30b3c8..820aba3 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,2 +1,4 @@ Tests: smoke -Depends: libvirt-dbus, systemd +Depends: + libvirt-dbus, + systemd, -- GitLab From 9dea489ff2c570eea462f71e68510cd8538f272a Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Wed, 24 Nov 2021 18:40:30 +0100 Subject: [PATCH 2/2] rules: Add maintainer checks In the libvirt package we run the wrap-and-sort check as part of the Salsa CI pipeline, which means that the maintainer might only find out about a trivial formatting issue several minutes after opening a MR and after a lot of compute power has already been used to build the package. Running them from debian/rules before the actual build starts instead means that issues can be caught quickly while iterating locally. Gbp-Dch: Ignore --- debian/control | 2 ++ debian/rules | 14 ++++++++++++++ debian/scripts/maintainer-checks.sh | 11 +++++++++++ debian/source/options | 1 + 4 files changed, 28 insertions(+) create mode 100755 debian/scripts/maintainer-checks.sh diff --git a/debian/control b/debian/control index 72b7b6a..3edeec7 100644 --- a/debian/control +++ b/debian/control @@ -10,12 +10,14 @@ Vcs-Browser: https://salsa.debian.org/libvirt-team/libvirt-dbus Build-Depends: dbus , debhelper-compat (= 13), + devscripts , libglib2.0-dev (>= 2.44.0), libvirt-dev (>= 3.0.0), libvirt-glib-1.0-dev (>= 0.0.7), meson, pkg-config, python3-dbus , + python3-debian , python3-docutils, python3-gi , python3-pytest , diff --git a/debian/rules b/debian/rules index 6992c23..cecf773 100755 --- a/debian/rules +++ b/debian/rules @@ -10,6 +10,20 @@ DESTDIR = $(CURDIR)/debian/tmp %: dh $@ --builddir $(BUILDDIR) +# Perform maintainer checks. +# +# These checks are useful for the maintainer to ensure the package +# is always in good shape. We run them very early, both for local +# builds and as part of Salsa CI pipelines; when building from a +# prepared source package, however, the script will not be present +# and so the checks will be skipped. +ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) +execute_before_dh_auto_configure: + if test -x $(CURDIR)/debian/scripts/maintainer-checks.sh; then \ + $(CURDIR)/debian/scripts/maintainer-checks.sh; \ + fi +endif + # Run configure. # # We want to be explicit about the user the daemon will run as, even diff --git a/debian/scripts/maintainer-checks.sh b/debian/scripts/maintainer-checks.sh new file mode 100755 index 0000000..f4f0250 --- /dev/null +++ b/debian/scripts/maintainer-checks.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +out=$(wrap-and-sort -ast --dry-run) +if test "$out"; then + echo "Please run 'wrap-and-sort -ast'" >&2 + exit 1 +fi + +exit 0 diff --git a/debian/source/options b/debian/source/options index 3359f9b..6bb1e11 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,3 +1,4 @@ diff-ignore = "^.*$" tar-ignore = "debian/gbp.conf" tar-ignore = "debian/salsa-ci.yml" +tar-ignore = "debian/scripts" -- GitLab