Package: debhelper
Version: 7.4.13
Severity: normal
Tags: patch

Hello,

I have a little problem when building rt-tests[1]:

        uklei...@cassiopeia:~/gsrc/rt-tests-0.66$ ls *.d*
        ls: cannot access *.d*: No such file or directory
        uklei...@cassiopeia:~/gsrc/rt-tests-0.66$ dh_auto_clean
        for F in cyclictest signaltest pi_stress rt-migrate-test ptsematest
        sigwaittest svsematest sendme pip *.o .depend *.*~ *.orig *.rej
        rt-tests.spec *.d ; do find -type f -name $F | xargs rm -f; done
        rm -f hwlatdetect
        rm -f tags
        rm -rf BUILD RPMS SRPMS releases *.tar.gz rt-tests.spec
        uklei...@cassiopeia:~/gsrc/rt-tests-0.66$ ls *.d*
        cyclictest.d.25488  ptsematest.d.25468       signaltest.d.25483
        pip.d.25448         rt-migrate-test.d.25473  sigwaittest.d.25463
        pi_stress.d.25478   sendme.d.25453           svsematest.d.25458

when creating a package that results in:

        ...
        dpkg-source: info: local changes stored in 
rt-tests-0.66/debian/patches/debian-changes-0.66-1, the modified files are:
         rt-tests-0.66/cyclictest.d.25488
         rt-tests-0.66/pi_stress.d.25478
         rt-tests-0.66/pip.d.25448
         rt-tests-0.66/ptsematest.d.25468
         rt-tests-0.66/rt-migrate-test.d.25473
         rt-tests-0.66/sendme.d.25453
         rt-tests-0.66/signaltest.d.25483
         rt-tests-0.66/sigwaittest.d.25463
         rt-tests-0.66/svsematest.d.25458
        ...

which isn't nice.

rt-tests' Makefile contains:

        ...
        # Pattern rule to generate dependency files from .c files
        %.d: %.c
                @set -e; rm -f $@; \
                $(CC) -MM $(CFLAGS) $< > $...@.$$$$; \
                sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $...@.$$$$ > $@; \
                rm -f $...@.$$$$
        ...
        -include $(sources:.c=.d)
        ...

So the *.d files are generated when debhelper tries to determine if
there is a distclean target by running

        make -s -n --no-print-directory distclean

.  That is OK so far.  The problem now is that debhelper closes stderr
for the above command which makes sed fail[2] above and so

        rm -f $...@.$$$$

isn't executed which leaves the files above.

Best regards
Uwe

[1] see git://git.pengutronix.de/git/ukl/rt-tests.git
[2] I'm not sure if this is sound behaviour, too.


-- System Information:
Debian Release: squeeze/sid
  APT prefers proposed-updates
  APT policy: (900, 'proposed-updates'), (900, 'stable'), (600, 
'testing-proposed-updates'), (600, 'testing'), (500, 
'oldstable-proposed-updates'), (500, 'oldstable'), (200, 'unstable'), (2, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages debhelper depends on:
ii  binutils                      2.20-6     The GNU assembler, linker and bina
ii  dpkg-dev                      1.15.5.6   Debian package development tools
ii  file                          4.26-1     Determines file type using "magic"
ii  html2text                     1.3.2a-5   advanced HTML to text converter
ii  man-db                        2.5.2-4    on-line manual pager
ii  perl                          5.10.1-9   Larry Wall's Practical Extraction 
ii  perl-base                     5.10.1-9   minimal Perl system
ii  po-debconf                    1.0.15     manage translated Debconf template

debhelper recommends no packages.

Versions of packages debhelper suggests:
pn  dh-make                       <none>     (no description available)

-- no debconf information
>From 1747dd4e5dfcbd65cd3441960d9d6475c79b46e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <[email protected]>
Date: Thu, 18 Feb 2010 22:02:57 +0100
Subject: [PATCH] provide /dev/null on stderr for make in exists_make_target

The Makefile might include commands that are executed even though -n is
given (e.g. to generate included files).  Be nice to them and provide a
valid stderr.

This was noticed when building rt-tests which calls sed to generate some
files tracking dependencies.  sed tries to close stderr at the end and
exits with return value 4 if that fails.
---
 Debian/Debhelper/Buildsystem/makefile.pm |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Debian/Debhelper/Buildsystem/makefile.pm 
b/Debian/Debhelper/Buildsystem/makefile.pm
index 2c14c15..c9fe314 100644
--- a/Debian/Debhelper/Buildsystem/makefile.pm
+++ b/Debian/Debhelper/Buildsystem/makefile.pm
@@ -20,6 +20,7 @@ sub exists_make_target {
        unshift @opts, "-C", $buildpath if $buildpath ne ".";
        open(SAVEDERR, ">&STDERR");
        close STDERR;
+       open(STDERR, '>/dev/null');
        open(MAKE, "-|", $this->{makecmd}, @opts, $target);
        my $output=<MAKE>;
        close MAKE;
-- 
1.7.0

Reply via email to