On Mon, Aug 27, 2018 at 10:03:57AM +1200, Michael Hudson-Doyle wrote:
> It's available in go list as well, e.g.
> 
> $ go list -f '{{if not .Standard}}{{ .ImportPath }}{{end}}'
> github.com/snapcore/snapd/snap bytes
> github.com/snapcore/snapd/snap
> $

That's much simpler, so the second patch is attached.

-- 
Shengjing Zhu
From 389d176cfef89a41b495b4af4578780b48d01972 Mon Sep 17 00:00:00 2001
From: Shengjing Zhu <i...@zhsj.me>
Date: Mon, 27 Aug 2018 11:55:01 +0800
Subject: [PATCH] Fix index out of range when using gccgo

Signed-off-by: Shengjing Zhu <i...@zhsj.me>
---
 script/dh_golang | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/script/dh_golang b/script/dh_golang
index 73ded48..4baef7f 100755
--- a/script/dh_golang
+++ b/script/dh_golang
@@ -78,6 +78,12 @@ my @godeps = exec_single(qq{go list -f '$tmpl'}, @targets);
 
 my $gofiletmpl = '\
 {{ .Dir }}/{{ index (or .GoFiles .CgoFiles .TestGoFiles .XTestGoFiles .IgnoredGoFiles) 0 }}';
+
+# gccgo can't find standard libraries files #907263
+if (grep /gccgo/, exec_single(q{go version})) {
+    $gofiletmpl = '{{if not .Standard}}' . $gofiletmpl . '{{end}}';
+}
+
 my @gofiles = exec_chunked(qq{go list -f '$gofiletmpl'}, uniq(@godeps));
 
 my @realpath;
-- 
2.18.0

Attachment: signature.asc
Description: PGP signature

Reply via email to