[Pkg-nginx-maintainers] Bug#844506: nginx: Fails to build twice in same sourcedir

Sven-Haegar Koch haegar at sdinet.de
Wed Nov 16 11:19:13 UTC 2016


Source: nginx
Version: 1.10.2-2
Severity: minor
Tags: patch

Found while creating a personal jessie backport:

The package fails to build twice in the same source directory, because the
quilt patches for the modules are not removed in the clean target, and
then trying to apply them again fails.

The following patch fixes this, but perhaps not in the nicest way.

(I needed to use ||true because quilt exits with status code 2 when there
are no patches applied yet)

Greetings
Haegar


diff -urN 1/debian/rules 2/debian/rules
--- 1/debian/rules	2016-11-12 08:18:12.000000000 +0100
+++ 2/debian/rules	2016-11-16 12:07:27.000000000 +0100
@@ -145,7 +145,7 @@
 override_dh_auto_configure: config_patch_modules $(foreach flavour,$(FLAVOURS),config.arch.$(flavour))
 override_dh_auto_build:     $(foreach flavour,$(FLAVOURS),build.arch.$(flavour))
 override_dh_strip:          $(foreach flavour,$(FLAVOURS),strip.arch.$(flavour)) $(foreach mod,$(DYN_MODS),strip.mods.$(mod))
-override_dh_clean:          $(foreach flavour,$(FLAVOURS),clean.$(flavour))
+override_dh_clean:          clean_patch_modules $(foreach flavour,$(FLAVOURS),clean.$(flavour))
 	dh_clean
 
 override_dh_install:
@@ -174,6 +174,10 @@
 config.patch.%:
 	cd $(MODULESDIR)/$* && QUILT_PATCHES=$(MODULESPATCHDIR)/$* quilt push -a
 
+clean_patch_modules: $(foreach mod,$(modules_with_patches),clean.patch.$(mod))
+clean.patch.%:
+	cd $(MODULESDIR)/$* && QUILT_PATCHES=$(MODULESPATCHDIR)/$* quilt pop -a -f || true
+
 config.arch.%:
 	dh_testdir
 	mkdir -p $(BUILDDIR_$*)
@@ -188,4 +192,4 @@
 clean.%:
 	rm -rf $(BUILDDIR_$*)
 
-.PHONY: config_patch_modules
+.PHONY: config_patch_modules clean_patch_modules


-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'squeeze-lts'), (500, 'oldstable-updates'), (500, 'oldoldstable'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)



More information about the Pkg-nginx-maintainers mailing list