[pkg-go] RFC: Enhancements to dh-golang

Michael Hudson-Doyle michael.hudson at canonical.com
Wed May 11 02:57:22 UTC 2016


On 9 May 2016 at 13:23, Martín Ferrari <tincho at tincho.org> wrote:
> On 09/05/16 02:12, Michael Hudson-Doyle wrote:
>
>> (parenthetically, as I think I said on IRC, dh-golang should just copy
>> testdata by default)
>
> I agree, but so far I don't know how to detect that programatically.

This seems to do the trick for me:

diff --git a/lib/Debian/Debhelper/Buildsystem/golang.pm
b/lib/Debian/Debhelper/Buildsystem/golang.pm
index 4d73d99..4fbf1d7 100644
--- a/lib/Debian/Debhelper/Buildsystem/golang.pm
+++ b/lib/Debian/Debhelper/Buildsystem/golang.pm
@@ -103,6 +103,8 @@ sub configure {
             my $name = substr($File::Find::name, 2);
             if ($install_all) {
                 # All files will be installed
+            } elsif ($File::Find::name =~ m%/testdata/%) {
+                # testdata directories are always copied
             } else {
                 my $dot = rindex($name, ".");
                 return if $dot == -1;

(only lightly tested, but tested)

>>> override_dh_auto_install:
>>>         dh_auto_install -O--buildsystem=golang -- --no-source
>>
>> Like Dmitry, I guess I'm only +0 on this.
>
> I see the point... I don't think it adds clutter, but I'd remove it if
> people are not too happy about it.

Certainly the implementation seems simple enough. Don't much care either way!

>> Hmmm. Can see the point, but it would be a loooot of output in some
>> cases. DH_VERBOSE doesn't really support levels of verbosity does it?
>
> It is a lot of output, but currently, you have no way to see what is
> actually being included in the build, which I think is a problem. I
> thought of this when adding the first feature, because I had no way to
> easily see what was going on!
>
> About verbosity levels, not really. You have: normal, verbose, and quiet
> mode.
>
> Personally, I think this is valuable output, and one can just use
> DH_VERBOSE=0

I think I agree the information is worth the log spam. So +1 on this
for me -- we can always find some other way to moderate it later if we
feel the need...

Cheers,
mwh



More information about the Pkg-go-maintainers mailing list