Source: blt
Version: 2.5.3+dfsg-1
Tags: patch
User: [email protected]
Usertags: rebootstrap

I tried building blt from the same working tree twice. The first time
succeeds. The second time fails during dh_auto_clean by resource
exhaustion:

| dpkg-buildpackage: source package blt
| dpkg-buildpackage: source version 2.5.3+dfsg-1
| dpkg-buildpackage: source distribution unstable
| dpkg-buildpackage: source changed by Sergei Golovan <[email protected]>
| dpkg-buildpackage: host architecture amd64
|  dpkg-source --before-build blt-2.5.3+dfsg
|  debian/rules clean
| dh clean
|    dh_testdir
|    dh_auto_clean

At this point, the build hangs. Depending on your resource limits, the
build is either killed by something or dh_auto_clean eventually
determines that since make -s distclean failed there is no distclean
target and continues.

Now the reason is "cd src; $(MAKE) distclean" which is (due to lack of
error checking) an infinite recursion in the absence of a src folder.

I am attaching a patch that addresses the issue.

Helmut
diff -Nru blt-2.5.3+dfsg/debian/changelog blt-2.5.3+dfsg/debian/changelog
--- blt-2.5.3+dfsg/debian/changelog     2014-11-21 15:11:22.000000000 +0100
+++ blt-2.5.3+dfsg/debian/changelog     2015-07-06 18:52:48.000000000 +0200
@@ -1,3 +1,11 @@
+blt (2.5.3+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTBFS when built twice in a row: distclean goes to an endless
+    recursion (closes: #-1).
+
+ -- Helmut Grohne <[email protected]>  Mon, 06 Jul 2015 18:52:25 +0200
+
 blt (2.5.3+dfsg-1) unstable; urgency=medium
 
   * Removed non-distributable files library/dd_protocols/* from the source
diff -Nru blt-2.5.3+dfsg/debian/patches/fixdistclean.patch 
blt-2.5.3+dfsg/debian/patches/fixdistclean.patch
--- blt-2.5.3+dfsg/debian/patches/fixdistclean.patch    1970-01-01 
01:00:00.000000000 +0100
+++ blt-2.5.3+dfsg/debian/patches/fixdistclean.patch    2015-07-06 
18:52:21.000000000 +0200
@@ -0,0 +1,21 @@
+Description: fix make distclean
+Author: Helmut Grohne <[email protected]>
+Last-Update: 2015-07-06
+
+There is no src folder. Thus the "cd src" part errors out, but does not stop
+the shell script. A recursive call for make distclean on the same directory
+ensues. The infinite recursion is stopped by resource exhaustion. make
+distclean is invoked from dh_auto_clean.
+
+Index: blt-2.5.3+dfsg/Makefile.in
+===================================================================
+--- blt-2.5.3+dfsg.orig/Makefile.in    2015-07-06 18:47:50.000000000 +0200
++++ blt-2.5.3+dfsg/Makefile.in 2015-07-06 18:49:03.000000000 +0200
+@@ -72,7 +72,6 @@
+       config.status config.cache config.log Makefile 
+ 
+ distclean: clean
+-      (cd src; $(MAKE) distclean)
+       (cd library; $(MAKE) distclean)
+       (cd man; $(MAKE) distclean)
+       (cd demos; $(MAKE) distclean)
diff -Nru blt-2.5.3+dfsg/debian/patches/series 
blt-2.5.3+dfsg/debian/patches/series
--- blt-2.5.3+dfsg/debian/patches/series        2014-07-09 17:27:15.000000000 
+0200
+++ blt-2.5.3+dfsg/debian/patches/series        2015-07-06 18:48:49.000000000 
+0200
@@ -18,3 +18,4 @@
 uninitialized.patch
 unused.patch
 pointertoint.patch
+fixdistclean.patch

Reply via email to