From 9f7e58acdf28043bce2dfaf24ba27bb878418658 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 15 Mar 2017 13:33:09 +0100 Subject: Use internerr() or BUG() instead of assert() The problem with assert() is that it does not print the contents of the variables. It also can be disabled on NDEBUG. But we always want these consistency checks no matter what, and they are not performance sensitive anyway. Enable -Wno-nonnull-compare so that we can keep doing run-time non-NULL checks in functions, instead of just compile-time checks. --- debian/rules | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index 27a2499ef..d5e13c67f 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,12 @@ # Copyright © 2004 Scott James Remnant # Copyright © 2006-2012 Guillem Jover -WFLAGS := -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers +WFLAGS := \ + -Wall -Wextra \ + -Wno-missing-field-initializers \ + -Wno-nonnull-compare \ + -Wno-unused-parameter \ + $(nil) # Use the in-tree dpkg-buildflags dpkg_buildflags = \ -- cgit v1.2.3 From c72f539b979a0c8647d2a6c62ee45565cd243b3d Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 26 Apr 2018 03:36:36 +0200 Subject: build: Add an autogen script This conforms to general expectations, and makes having to infer what is needed to prepare the source tree more easily discoverable. --- README | 2 +- autogen | 5 +++++ debian/changelog | 1 + debian/rules | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100755 autogen (limited to 'debian/rules') diff --git a/README b/README index 348f8e700..d255efb32 100644 --- a/README +++ b/README @@ -49,7 +49,7 @@ some required software needs to be installed: After installing the needed software, and running the following command on the git tree: - $ autoreconf -f -i + $ ./autogen the source should be roughly equivalent to the distributed tar source. diff --git a/autogen b/autogen new file mode 100755 index 000000000..99ca3fe41 --- /dev/null +++ b/autogen @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +autoreconf -f -i diff --git a/debian/changelog b/debian/changelog index 372dcdcde..88907cf8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -91,6 +91,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Enable clang -Wdocumentation warning if available. - Enable gcc-7 -Wregister warning if available. - Add CPAN distribution machinery for the perl modules. Closes: #821177 + - Add an autogen script to help people bootstrap the project. * Packaging: - Install update-alternatives policykit-1 file. - Add Breaks to libdpkg-perl against pkg-kde-tools (<< 0.15.28~), as diff --git a/debian/rules b/debian/rules index d5e13c67f..6099c5c10 100755 --- a/debian/rules +++ b/debian/rules @@ -50,7 +50,7 @@ D := $(CURDIR)/debian/tmp configure: dh_testdir - autoreconf -v -i + ./autogen # Configure the build tree build-tree/config.status: configure -- cgit v1.2.3 From e50f4c72b02a88a0124d0f2b671185504fea90cd Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 8 Aug 2018 11:07:41 +0200 Subject: debian: Do not pass VERBOSE to test suite The VERBOSE variable is only honored when using the automake test drivers, which we are not using, not even the custom ones. Remove the variable usage which is confusing as it is not doing anything. --- .gitlab-ci.yml | 4 ++-- debian/changelog | 2 ++ debian/rules | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'debian/rules') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f36669fd1..4dea92ec4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ unit-tests: libtest-pod-perl libtest-pod-coverage-perl libtest-spelling-perl libtest-synopsis-perl - ./configure - - make check VERBOSE=1 TESTSUITEFLAGS=--verbose TEST_PARALLEL=$(nproc) + - make check TESTSUITEFLAGS=--verbose TEST_PARALLEL=$(nproc) AUTHOR_TESTING=1 # Test whether the unit tests pass on a VPATH build. @@ -37,7 +37,7 @@ vpath-tests: - mkdir -p build-tree - cd build-tree - ../configure - - make check VERBOSE=1 TESTSUITEFLAGS=--verbose TEST_PARALLEL=$(nproc) + - make check TESTSUITEFLAGS=--verbose TEST_PARALLEL=$(nproc) # Test whether the external functional tests pass. func-tests: diff --git a/debian/changelog b/debian/changelog index 6e5cf8bc4..cbf5b364c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -196,6 +196,8 @@ dpkg (1.19.1) UNRELEASED; urgency=medium suite, but shadowed by dpkg-dev from the build system pulling those in. - Add versioned libncurses-dev as the first Build-Depends alternative. Thanks to Sven Joachim . + - Do not pass VERBOSE to test suite, as we are not using any automake + test driver, so it does not get honored. * Test suite: - Skip Dpkg::OpenPGP test if gpg is not present. - Check POD in all perl scripts. diff --git a/debian/rules b/debian/rules index 6099c5c10..22052b892 100755 --- a/debian/rules +++ b/debian/rules @@ -83,7 +83,7 @@ check: build dh_testdir ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - cd build-tree && $(MAKE) VERBOSE=1 TESTSUITEFLAGS=--verbose \ + cd build-tree && $(MAKE) TESTSUITEFLAGS=--verbose \ TEST_PARALLEL=$(NUMJOBS) check endif -- cgit v1.2.3 From 108f8a9e0a9f7e992c4d61e202e26bb6eef6c7c6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 8 Aug 2018 11:10:20 +0200 Subject: debian: Rename maintainer-build DEB_BUILD_OPTIONS to terse Use the now official name for non-verbose builds. Ref: Debian policy 4.2.0 --- debian/changelog | 1 + debian/rules | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'debian/rules') diff --git a/debian/changelog b/debian/changelog index cbf5b364c..a925929d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -198,6 +198,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium Thanks to Sven Joachim . - Do not pass VERBOSE to test suite, as we are not using any automake test driver, so it does not get honored. + - Rename maintainer-build DEB_BUILD_OPTIONS to new standardized terse. * Test suite: - Skip Dpkg::OpenPGP test if gpg is not present. - Check POD in all perl scripts. diff --git a/debian/rules b/debian/rules index 22052b892..49812fdd2 100755 --- a/debian/rules +++ b/debian/rules @@ -33,7 +33,7 @@ endif ifeq ($(DEB_HOST_ARCH_OS),linux) confflags += --with-libselinux endif -ifeq (,$(filter maintainer-build,$(DEB_BUILD_OPTIONS))) +ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS))) confflags += --disable-silent-rules endif -- cgit v1.2.3 From c3f8bca7e6cf4d75ca94dc4b92c9d7f63d23775f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 8 Aug 2018 11:11:44 +0200 Subject: debian: Enable verbose test suite only in non-terse builds --- debian/changelog | 1 + debian/rules | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'debian/rules') diff --git a/debian/changelog b/debian/changelog index a925929d5..b129c07a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -199,6 +199,7 @@ dpkg (1.19.1) UNRELEASED; urgency=medium - Do not pass VERBOSE to test suite, as we are not using any automake test driver, so it does not get honored. - Rename maintainer-build DEB_BUILD_OPTIONS to new standardized terse. + - Enable verbose test suite only in non-terse builds. * Test suite: - Skip Dpkg::OpenPGP test if gpg is not present. - Check POD in all perl scripts. diff --git a/debian/rules b/debian/rules index 49812fdd2..09dc6e65e 100755 --- a/debian/rules +++ b/debian/rules @@ -35,6 +35,7 @@ ifeq ($(DEB_HOST_ARCH_OS),linux) endif ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS))) confflags += --disable-silent-rules + testflags += TESTSUITEFLAGS=--verbose endif # Enable parallel test suite @@ -83,8 +84,7 @@ check: build dh_testdir ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - cd build-tree && $(MAKE) TESTSUITEFLAGS=--verbose \ - TEST_PARALLEL=$(NUMJOBS) check + cd build-tree && $(MAKE) $(testflags) TEST_PARALLEL=$(NUMJOBS) check endif # Install the package underneath debian/tmp -- cgit v1.2.3 From db3872abfb48ff4a5393f3c2fe343a63d90395f6 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 19 Feb 2019 05:53:04 +0100 Subject: debian: Include a bug-script to report on tainted merged-usr-via-symlinks Systems deployed with that method bypass the package manager and its understanding of the filesystem, create aliasing problems, and break all kinds of expectations for any program that uses pathnames as key into their database, such as u-a. --- Makefile.am | 1 + debian/bug-script | 10 ++++++++++ debian/changelog | 1 + debian/rules | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 debian/bug-script (limited to 'debian/rules') diff --git a/Makefile.am b/Makefile.am index d77292da7..f9bfee9ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,6 +45,7 @@ EXTRA_DIST = \ doc/lcov-inject.pl \ doc/rootless-builds.txt \ doc/triggers.txt \ + debian/bug-script \ debian/changelog \ debian/compat \ debian/control \ diff --git a/debian/bug-script b/debian/bug-script new file mode 100644 index 000000000..56d654818 --- /dev/null +++ b/debian/bug-script @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +for d in /bin /sbin /lib /lib32 /libo32 /libx32 /lib64; do + if [ "$(readlink $d)" = "usr$d" ]; then + echo "System tainted due to merged-usr-via-symlinks." >&3 + break + fi +done diff --git a/debian/changelog b/debian/changelog index 0ceef6a69..6d95110ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,7 @@ dpkg (1.19.5) UNRELEASED; urgency=medium - Remove now unused assert usertag description. - Remove trailing whitespace from changelog. - Remove Origin and Bugs fields from control file. + - Include a bug-script to report on tainted merged-usr-via-symlinks. [ Updated programs translations ] * German (Sven Joachim). diff --git a/debian/rules b/debian/rules index 09dc6e65e..65e6006d1 100755 --- a/debian/rules +++ b/debian/rules @@ -117,6 +117,7 @@ binary-arch: install $(call dpkg-installmanl10n,dselect) dh_installman -a dh_link -a + dh_bugfiles -a -A dh_lintian -a dh_strip -a dh_compress -a @@ -138,6 +139,7 @@ binary-indep: install $(call dpkg-installmanl10n,dpkg-dev) dh_installman -i dh_link -i + dh_bugfiles -i -A dh_lintian -i # The perl modules should not depend on a specific interpreter. dh_perl -i -Nlibdpkg-perl -- cgit v1.2.3 From 7658b575d978b9c6655854cd6dc1c2de031fdca5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 20 Mar 2019 06:26:45 +0100 Subject: debian: Add a lintian dpkg profile to supress Debian specific tags This makes it possible to disable tags that are Debian specific, such as the controversial tag emitted for vendor-specific patch series files. --- Makefile.am | 1 + debian/changelog | 3 +++ debian/dpkg.install | 1 + debian/dpkg.lintian-profile | 7 +++++++ debian/rules | 5 +++++ man/dpkg-source.man | 5 +++++ 6 files changed, 22 insertions(+) create mode 100644 debian/dpkg.lintian-profile (limited to 'debian/rules') diff --git a/Makefile.am b/Makefile.am index f9bfee9ba..231ab999d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,6 +63,7 @@ EXTRA_DIST = \ debian/dpkg.postrm \ debian/dpkg.logrotate \ debian/dpkg.lintian-overrides \ + debian/dpkg.lintian-profile \ debian/dselect.cfg \ debian/dselect.docs \ debian/dselect.install \ diff --git a/debian/changelog b/debian/changelog index a5aee75bc..7d7b1e800 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ dpkg (1.19.6) UNRELEASED; urgency=medium [ Guillem Jover ] * Packaging: - Update usertags. + - Install a lintian profile for dpkg based on the debian profile, so that + we can supress Debian-specific tags, such as the controversial one on + vendor-specific patch series files. [ Updated scripts translations ] * German (Helge Kreutzmann). diff --git a/debian/dpkg.install b/debian/dpkg.install index 3f51aaaa7..108ca54ef 100644 --- a/debian/dpkg.install +++ b/debian/dpkg.install @@ -13,6 +13,7 @@ usr/bin/dpkg-statoverride usr/bin/dpkg-trigger usr/bin/update-alternatives usr/share/dpkg/*table +usr/share/lintian/profiles usr/share/locale/*/LC_MESSAGES/dpkg.mo usr/share/polkit-1/actions var/lib/dpkg/alternatives diff --git a/debian/dpkg.lintian-profile b/debian/dpkg.lintian-profile new file mode 100644 index 000000000..44f2614c0 --- /dev/null +++ b/debian/dpkg.lintian-profile @@ -0,0 +1,7 @@ +# This is the dpkg pseudo-vendor profile. +Profile: dpkg/main +# It has all the checks and settings from the "debian" profile. +Extends: debian/main +# Except the ones that are bogus for the non-Debian distributions. +Disable-Tags: + package-uses-vendor-specific-patch-series, diff --git a/debian/rules b/debian/rules index 65e6006d1..a542193fc 100755 --- a/debian/rules +++ b/debian/rules @@ -96,6 +96,11 @@ install: check cd build-tree && $(MAKE) DESTDIR=$(D) install + # Special-case the lintian profile, as dh cannot rename on install. + mkdir -p $(D)/usr/share/lintian/profiles/dpkg + cp debian/dpkg.lintian-profile \ + $(D)/usr/share/lintian/profiles/dpkg/main.profile + define dpkg-installmanl10n for f in `sed -e 's:\*:*/*:' debian/$(1).manpages`; do \ test -e $$f && \ diff --git a/man/dpkg-source.man b/man/dpkg-source.man index 49a162914..502c67311 100644 --- a/man/dpkg-source.man +++ b/man/dpkg-source.man @@ -506,6 +506,11 @@ options and always expect patches that can be applied with the \fB\-p1\fP option of \fBpatch\fP. It will thus emit a warning when it encounters such options, and the build is likely to fail. .PP +Note that \fBlintian\fP(1) will emit unconditional warnings when using +vendor series due to a controversial Debian specific ruling, which should +not affect any external usage; to silence these, the dpkg lintian profile +can be used by passing «\fB--profile dpkg\fP» to \fBlintian\fP(1). +.PP The timestamp of all patched files is reset to the extraction time of the source package (this avoids timestamp skews leading to problems when autogenerated files are patched). -- cgit v1.2.3 From 9b68d769f7280452402ea38ebfaf358ed44be20a Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Sun, 3 Nov 2019 00:27:00 +0100 Subject: debian: Replace custom rule for 'configure' with call to dh_autoreconf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having this custom rule to create the «configure» file means that it might end up not being rebuilt if the timestamps of some other files are off compared to the debian/changelog date. Using dh_autoreconf guarantees that even if these timestamps got updated incorrectly, the file will always be rebuilt as expected. The historic rationale for not doing this before, even though this has been considered a best packaging practice, was that because dpkg needs explicit support for new architectures, which is the main reason to get autotools updated to pull in new config.* files, we would get reports so that we could add such support and release a new upstream version. But this has never happened, and it's causing other problems. Closes: #939516 Signed-off-by: Guillem Jover --- debian/changelog | 2 ++ debian/rules | 10 +++------- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'debian/rules') diff --git a/debian/changelog b/debian/changelog index 23a21e719..30aac0626 100644 --- a/debian/changelog +++ b/debian/changelog @@ -68,6 +68,8 @@ dpkg (1.20.0) UNRELEASED; urgency=medium cross-build for musl-based systems. * Packaging: - Remove obsolete Breaks satisfied since oldstable. + - Replace custom rule for 'configure' with call to dh_autoreconf. + Thanks to Dan Streetman . Closes: #939516 * Test suite: - Remove perlcritic Documentation::RequirePodLinksIncludeText suppression. - Clarify cppcheck va_list_usedBeforeStarted suppression. diff --git a/debian/rules b/debian/rules index a542193fc..006d069ce 100755 --- a/debian/rules +++ b/debian/rules @@ -47,15 +47,10 @@ endif D := $(CURDIR)/debian/tmp -# Create configure script if necessary, automake handles rebuilding it. -configure: - dh_testdir - - ./autogen - # Configure the build tree -build-tree/config.status: configure +build-tree/config.status: dh_testdir + dh_autoreconf install -d build-tree cd build-tree && ../configure $(confflags) \ @@ -164,6 +159,7 @@ clean: [ ! -f Makefile ] || $(MAKE) distclean rm -rf build-tree + dh_autoreconf_clean dh_clean -- cgit v1.2.3