Source: grub2
Version: 2.02~beta2-28
Severity: normal
Tags: patch

override_dh_clean does not remove all necessary files to rebuild from source
using gbp. This cleanup was part of Makefile.in before the conversion to
Automake.

Example failure message:

dpkg-source: error: cannot represent change to
grub-core/lib/libgcrypt-grub/mpi/mpih-rshift.c:
dpkg-source: error:   new version is symlink to generic/mpih-rshift.c
dpkg-source: error:   old version is plain file
[...]
dpkg-source: error: unrepresentable changes to source
dpkg-buildpackage: error: dpkg-source -i -I -b grub gave error exit status 2
>From 7e71ef3ee91b17fc1be084608bb569d466a74819 Mon Sep 17 00:00:00 2001
From: Linn Crosetto <l...@hp.com>
Date: Fri, 4 Sep 2015 12:57:39 -0600
Subject: [PATCH] override_dh_clean cleanup

Remove files and soft links created during the build. The cleanup used to be
part of Makefile.in. Removed files:

grub-core/lib/libgcrypt-grub/mpi/:
	mpi-asm-defs.h
	mpih-add1.c
	mpih-sub1.c
	mpih-mul1.c
	mpih-mul2.c
	mpih-mul3.c
	mpih-lshift.c
	mpih-rshift.c

docs/:
	*.info
	stamp-vti
	version.texi
	stamp-1
	version-dev.texi

include/grub/gcrypt/g10lib.h
po/grub.pot
---
 debian/rules | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/debian/rules b/debian/rules
index cc192ce..bf1e003 100755
--- a/debian/rules
+++ b/debian/rules
@@ -495,6 +495,15 @@ override_dh_auto_clean:
 	-rm -rf debian/grub-extras-enabled debian/stamps obj
 	-rm -f contrib grub-core/contrib
 
+MPI_CLEAN_FILES = $(patsubst %,grub-core/lib/libgcrypt-grub/mpi/%, \
+			mpi-asm-defs.h mpih-add1.c mpih-sub1.c mpih-mul1.c \
+			mpih-mul2.c mpih-mul3.c mpih-lshift.c mpih-rshift.c)
+DOCS_CLEAN_FILES = $(patsubst %,docs/%, \
+			stamp-vti version.texi stamp-1 version-dev.texi) \
+		   $(shell ls docs/*.info)
+CLEAN_FILES = $(MPI_CLEAN_FILES) $(DOCS_CLEAN_FILES) \
+	      include/grub/gcrypt/g10lib.h po/grub.pot
+
 override_dh_clean:
 	dh_autoreconf_clean
 	dh_clean
@@ -506,6 +515,13 @@ override_dh_clean:
 	done
 	rm -f debian/grub-common.maintscript
 	rm -rf debian/tmp-*/
+
+	for i in $(CLEAN_FILES) ; do \
+		if [ -e "$$i" ] || [ -h "$$i" ]; then \
+			rm "$$i"; \
+		fi ; \
+	done
+
 ifneq (,$(SB_PACKAGE))
 	rm -rf debian/grub2-images
 endif
-- 
2.1.4

Reply via email to