From d66fc073423b01f578b3ffdd8acb4c74b139321d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Sun, 28 Aug 2016 15:42:31 +0100 Subject: [PATCH] debian/rules.real: Avoid error message when usbip's config.h doesn't exist usbip has its own version number which we combine with the source package version, which is assigned to VERSION for the install-usbip target (only). We find the version number by processing the config.h file created by autoconf. The file always exists before the install-usbip rule is invoked, but the target-specific definition of VERSION is still evaluated whenever debian/rules.real is used, resulting in confusing (though harmless) error messages about a missing file. We could change VERSION to be a recursively-expanded variable, but then it would still be evaulated multiple times. Instead, move the definition of VERSION into the target's commands. --- debian/changelog | 1 + debian/rules.real | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 255f53867..083176e37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,6 +46,7 @@ linux (4.7.2-1) UNRELEASED; urgency=medium * aacraid: Check size values after double-fetch from user (CVE-2016-6480) * liblockdep: Move dummy definition of prandom_u32() to fix missing declaration + * debian/rules.real: Avoid error message when usbip's config.h doesn't exist [ Martin Michlmayr ] * [armhf] Enable MMC_SDHCI_IPROC and HW_RANDOM_BCM2835 for BCM2835. diff --git a/debian/rules.real b/debian/rules.real index 2175cb48f..895d52b53 100644 --- a/debian/rules.real +++ b/debian/rules.real @@ -580,7 +580,6 @@ endif install-usbip: DH_OPTIONS = -plibusbip-dev -pusbip install-usbip: DIR = $(CURDIR)/debian/usbip-tmp -install-usbip: override VERSION := $(shell sed -ne 's,^#define PACKAGE_VERSION "\(.*\)"$$,\1,p' $(BUILD_DIR)/build-tools/tools/usb/usbip/config.h) install-usbip: $(STAMPS_DIR)/build-tools dh_testdir dh_testroot @@ -598,8 +597,9 @@ endif dh_fixperms dh_installdeb dh_shlibdeps - test -n "$(VERSION)" -a -n "$(DEB_VERSION)" - dh_gencontrol -- -v$(VERSION)+$(DEB_VERSION) + VERSION=$$(sed -ne 's,^#define PACKAGE_VERSION "\(.*\)"$$,\1,p' $(BUILD_DIR)/build-tools/tools/usb/usbip/config.h) && \ + test -n "$$VERSION" -a -n "$(DEB_VERSION)" && \ + dh_gencontrol -- -v$$VERSION+$(DEB_VERSION) dh_md5sums dh_builddeb