Hi,

On 31/07/15 03:59 AM, Michael Stapelberg wrote:
> Your patch still adds an extra option. Can you remove that part
> please?
>
> Also, while you’re at it, install .s files as well? :)
>

This one should work like you wanted!

-- 
Alexandre Viau
alexan...@alexandreviau.net
From 3c38a20f08306f2ee071fd79112aa1191a0d9e36 Mon Sep 17 00:00:00 2001
From: Alexandre Viau <alexan...@alexandreviau.net>
Date: Wed, 29 Jul 2015 14:51:20 -0400
Subject: [PATCH] Extend list of extensions installed by default

---
 lib/Debian/Debhelper/Buildsystem/golang.pm | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/Debian/Debhelper/Buildsystem/golang.pm b/lib/Debian/Debhelper/Buildsystem/golang.pm
index 6b33f69..8688973 100644
--- a/lib/Debian/Debhelper/Buildsystem/golang.pm
+++ b/lib/Debian/Debhelper/Buildsystem/golang.pm
@@ -51,11 +51,15 @@ sub configure {
     my $builddir = $this->get_builddir();
 
     ############################################################################
-    # Copy all .go files into the build directory $builddir/src/$go_package
+    # Copy all source files into the build directory $builddir/src/$go_package
     ############################################################################
 
     my $install_all = (exists($ENV{DH_GOLANG_INSTALL_ALL}) &&
                        $ENV{DH_GOLANG_INSTALL_ALL} == 1);
+
+    # By default, only .go, .c, .h, .proto and .s files are installed.
+    my @installed_file_extensions = ('.go', '.c', '.h', '.proto', '.s');
+
     my @sourcefiles;
     find({
         # Ignores ./debian entirely, but not e.g. foo/debian/debian.go
@@ -69,8 +73,18 @@ sub configure {
             my $name = $File::Find::name;
             if ($install_all) {
                 # All files will be installed
-            } elsif (substr($name, -3) ne '.go') {
-                return;
+            } else {
+                my $matched_extension = 0;
+                foreach (@installed_file_extensions)
+                {
+                      if (substr($name, -length($_)) eq $_){
+                          $matched_extension = 1;
+                          last;
+                      }
+                }
+                if (not $matched_extension) {
+                    return;
+                }
             }
             return unless -f $name;
             # Store regexp/utf.go instead of ./regexp/utf.go
-- 
2.4.6

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Pkg-go-maintainers mailing list
Pkg-go-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-go-maintainers

Reply via email to