diff --git a/debian/changelog b/debian/changelog index 35878ef43..f53a089a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ linux (4.19~rc7-1~exp2) UNRELEASED; urgency=medium * udeb: Define mtd-core-modules package to contain MTD core if not built-in * udeb: Move MTD core from nic-modules to mtd-core-modules * debian/changelog: Move older entries to changelog.old + * debian/rules: Checksum only the source name and version from + debian/changelog [ Karsten Merker ] * [riscv64] Build a kernel image and udebs for riscv64 (Closes: #908161) diff --git a/debian/rules b/debian/rules index 1ddbb45ad..954e45ba1 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,7 @@ SOURCE := $(shell dpkg-parsechangelog -SSource) VERSION := $(shell dpkg-parsechangelog -SVersion) VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,') VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -rne 's,.*\+b([0-9]+)$$,\1,p') +VERSION_SOURCE := $(patsubst %+b$(VERSION_BINNMU),%,$(VERSION)) include /usr/share/dpkg/architecture.mk @@ -91,17 +92,23 @@ clean: debian/control rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/lib/python/debian_linux/__pycache__ $$(find debian -maxdepth 1 -type d -name 'linux-*') debian/*-modules-*-di* debian/kernel-image-*-di* debian/xen-linux-system-* debian/*-tmp dh_clean -CONTROL_FILES = debian/changelog $(wildcard debian/templates/*.in) +CONTROL_FILES = $(BUILD_DIR)/version-info $(wildcard debian/templates/*.in) CONTROL_FILES += debian/config/defines $(wildcard debian/config/*/defines) $(wildcard debian/config/*/*/defines) CONTROL_FILES += debian/installer/kernel-versions debian/installer/package-list + +# debian/bin/gencontrol.py uses debian/changelog as input, but the +# output only depends on the source name and version. To avoid +# frequent changes to debian/control.md5sum, include only those fields +# in the checksum. +$(BUILD_DIR)/version-info: debian/changelog + mkdir -p $(@D) + printf >$@ 'Source: %s\nVersion: %s\n' $(SOURCE) $(VERSION_SOURCE) + debian/control debian/rules.gen: debian/bin/gencontrol.py $(CONTROL_FILES) ifeq ($(wildcard debian/control.md5sum),) $(MAKE) -f debian/rules debian/control-real -else ifeq ($(VERSION_BINNMU),) - md5sum --check debian/control.md5sum --status || \ - $(MAKE) -f debian/rules debian/control-real else - grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \ + md5sum --check debian/control.md5sum --status || \ $(MAKE) -f debian/rules debian/control-real endif