Bug#814856: debhelper: dh_install -X option is broken

2017-09-19 Thread James Cowgill
Hi,

On 19/09/17 10:24, Niels Thykier wrote:
> On Tue, 16 Feb 2016 01:29:09 + James Cowgill
>  wrote:
>> Source: debhelper
>> Version: 9.20160115
>> Severity: important
>> X-Debbugs-CC: Dmitry Shachnev 
>> Control: affects -1 src:codelite
>>
>> Hi,
>>
>> It seems the -X option of dh_install is either broken or its
>> behaviour has changed recently. With newer versions of debhelper
>> codelite fails to build with this error:
>>
>>>    debian/rules override_dh_install
>>> make[1]: Entering directory '/«BUILDDIR»/codelite-9.1+dfsg'
>>> dh_install  -Xcodelite-lldb -XLLDBDebugger.so
>>> dh_install: codelite-plugins missing files: usr/bin/codelite-lldb
>>> dh_install: codelite-plugins missing files: usr/lib/codelite/LLDBDebugger.so
[...]

> Sorry for the late reply to this bug.
> 
> Could you please test if this is still a problem in debhelper 10.8?  I
> recently rewrote most of the relevant parts of dh_install, so Dmitry's
> patch is no longer applicable.  At the same time, the current code looks
> like it should handle this case as you expect (i.e. expand glob; assert
> something matches and then filter out excluded paths)

I think it's still broken. This is with debhelper 10.8:
>debian/rules override_dh_install
> make[1]: Entering directory '/<>/codelite-10.0+dfsg'
> dh_install  -Xcodelite-lldb -XLLDBDebugger.so
> dh_install: Cannot find (any matches for) "usr/bin/codelite-lldb" (tried in 
> ., debian/tmp)
> 
> dh_install: codelite-plugins missing files: usr/bin/codelite-lldb
> dh_install: Cannot find (any matches for) "usr/lib/codelite/LLDBDebugger.so" 
> (tried in ., debian/tmp)
> 
> dh_install: codelite-plugins missing files: usr/lib/codelite/LLDBDebugger.so
> dh_install: missing files, aborting
> debian/rules:40: recipe for target 'override_dh_install' failed

However, looking at this bug again, I might have misunderstood the -X
option here. As you said, at the moment it will filter out excluded
files after checking that the glob matches something. I think I was
trying to exclude entire globs from being considered (ignoring missing
files in a specific case) as opposed to excluding files which would have
otherwise been installed.

With that, I think you can close the bug. After originally filing this
bug, I changed the codelite packaging to something which worked properly
and I'm fine with keeping that.

Thanks,
James



signature.asc
Description: OpenPGP digital signature


Bug#814856: debhelper: dh_install -X option is broken

2017-09-19 Thread Niels Thykier
On Tue, 16 Feb 2016 01:29:09 + James Cowgill
 wrote:
> Source: debhelper
> Version: 9.20160115
> Severity: important
> X-Debbugs-CC: Dmitry Shachnev 
> Control: affects -1 src:codelite
> 
> Hi,
> 
> It seems the -X option of dh_install is either broken or its
> behaviour has changed recently. With newer versions of debhelper
> codelite fails to build with this error:
> 
> >    debian/rules override_dh_install
> > make[1]: Entering directory '/«BUILDDIR»/codelite-9.1+dfsg'
> > dh_install  -Xcodelite-lldb -XLLDBDebugger.so
> > dh_install: codelite-plugins missing files: usr/bin/codelite-lldb
> > dh_install: codelite-plugins missing files: usr/lib/codelite/LLDBDebugger.so
> > dh_install: missing files, aborting
> > debian/rules:40: recipe for target 'override_dh_install' failed
> > make[1]: *** [override_dh_install] Error 2
> 
> Bisected to this commit:
> 8a9b2f22871f1cd612f4a5660a943dd2ca5d4f24 is the first bad commit
> commit 8a9b2f22871f1cd612f4a5660a943dd2ca5d4f24
> Author: Dmitry Shachnev 
> Date:   Tue Jan 5 16:57:16 2016 +0300
> 
> dh_install: Fail late when there were non-existing files
> 
> Print warnings for each glob that did not match anything, and fail
> after processing all packages if there were any missing files.
> 
> Closes: #488346
> 
> Signed-off-by: Niels Thykier 
> 
> Unless I've misread the documentation, it seems that what I'm doing
> should work here.
> 
> Thanks,
> James
Hi James,

Sorry for the late reply to this bug.

Could you please test if this is still a problem in debhelper 10.8?  I
recently rewrote most of the relevant parts of dh_install, so Dmitry's
patch is no longer applicable.  At the same time, the current code looks
like it should handle this case as you expect (i.e. expand glob; assert
something matches and then filter out excluded paths)

Thanks,
~Niels



Bug#814856: debhelper: dh_install -X option is broken

2016-02-15 Thread Dmitry Shachnev
Hi James (and thanks for X-Debbugs-Ccing me),

On Tue, Feb 16, 2016 at 01:29:09AM +, James Cowgill wrote:
> It seems the -X option of dh_install is either broken or its
> behaviour has changed recently. With newer versions of debhelper
> codelite fails to build with this error:
> 
> >    debian/rules override_dh_install
> > make[1]: Entering directory '/«BUILDDIR»/codelite-9.1+dfsg'
> > dh_install  -Xcodelite-lldb -XLLDBDebugger.so
> > dh_install: codelite-plugins missing files: usr/bin/codelite-lldb
> > dh_install: codelite-plugins missing files: usr/lib/codelite/LLDBDebugger.so
> > dh_install: missing files, aborting
> > debian/rules:40: recipe for target 'override_dh_install' failed
> > make[1]: *** [override_dh_install] Error 2

It is broken for a (in my opinion) quite rare case: when you list a file
in an install file *and* tell dh_install to exclude it.

A patch to fix this bug is attached.

--
Dmitry Shachnev
From cc89fa572415d7b5db2c1b0580b18c05b43f82aa Mon Sep 17 00:00:00 2001
From: Dmitry Shachnev 
Date: Tue, 16 Feb 2016 10:20:03 +0300
Subject: [PATCH] dh_install: Ignore lines where all globs have been
 --exclude'd.

Closes: #814856.
---
 debian/changelog | 5 +
 dh_install   | 6 ++
 2 files changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1b98f4a..1c047aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,14 @@
 debhelper (9.20160116) UNRELEASED; urgency=medium
 
+  [ Niels Thykier ]
   * Remove dh_suidregister and related autoscripts.  No package
 (that can be built in unstable) invokes this tool.
   * dh: Do not create stamp files when running with --no-act.
 
+  [ Dmitry Shachnev ]
+  * dh_install: Ignore lines in install files where all globs have been
+--exclude'd.  (Closes: #814856)
+
  -- Niels Thykier   Sat, 16 Jan 2016 13:23:00 +
 
 debhelper (9.20160115) unstable; urgency=medium
diff --git a/dh_install b/dh_install
index 9288e86..9c75fea 100755
--- a/dh_install
+++ b/dh_install
@@ -173,7 +173,10 @@ foreach my $package (getpackages()) {
 		}
 
 		my @filelist;
+		my $non_excluded_globs = 0;
 		foreach my $glob (@$set) {
+			next if excludefile($glob);
+			++$non_excluded_globs;
 			my @found = glob "$srcdir/$glob";
 			if (! compat(6)) {
 # Fall back to looking in debian/tmp.
@@ -187,6 +190,9 @@ foreach my $package (getpackages()) {
 			}
 		}
 
+		# If all globs were excluded, do nothing.
+		next unless $non_excluded_globs;
+
 		if (! compat(4)) { # check added in v5
 			if (! @filelist && ! $skip_install) {
 warning("$package missing files: @$set");
-- 
2.7.0



signature.asc
Description: PGP signature


Bug#814856: debhelper: dh_install -X option is broken

2016-02-15 Thread James Cowgill
Source: debhelper
Version: 9.20160115
Severity: important
X-Debbugs-CC: Dmitry Shachnev 
Control: affects -1 src:codelite

Hi,

It seems the -X option of dh_install is either broken or its
behaviour has changed recently. With newer versions of debhelper
codelite fails to build with this error:

>    debian/rules override_dh_install
> make[1]: Entering directory '/«BUILDDIR»/codelite-9.1+dfsg'
> dh_install  -Xcodelite-lldb -XLLDBDebugger.so
> dh_install: codelite-plugins missing files: usr/bin/codelite-lldb
> dh_install: codelite-plugins missing files: usr/lib/codelite/LLDBDebugger.so
> dh_install: missing files, aborting
> debian/rules:40: recipe for target 'override_dh_install' failed
> make[1]: *** [override_dh_install] Error 2

Bisected to this commit:
8a9b2f22871f1cd612f4a5660a943dd2ca5d4f24 is the first bad commit
commit 8a9b2f22871f1cd612f4a5660a943dd2ca5d4f24
Author: Dmitry Shachnev 
Date:   Tue Jan 5 16:57:16 2016 +0300

dh_install: Fail late when there were non-existing files

Print warnings for each glob that did not match anything, and fail
after processing all packages if there were any missing files.

Closes: #488346

Signed-off-by: Niels Thykier 

Unless I've misread the documentation, it seems that what I'm doing
should work here.

Thanks,
James

signature.asc
Description: This is a digitally signed message part