[OE-core] [PATCH] go/go-runtime: use update-alternative for zdefaultcc.go

changqing.li at windriver.com changqing.li at windriver.com
Tue Aug 6 06:54:59 UTC 2019


From: Changqing Li <changqing.li at windriver.com>

fix below error:
file /usr/lib64/go/src/cmd/cgo/zdefaultcc.go conflicts between attempted installs of go-dev-1.12.6-r0.core2_64 and go-runtime-dev-1.12.6-r0.core2_64
file /usr/lib64/go/src/cmd/go/internal/cfg/zdefaultcc.go conflicts between attempted installs of go-dev-1.12.6-r0.core2_64 and go-runtime-dev-1.12.6-r0.core2_64

Signed-off-by: Changqing Li <changqing.li at windriver.com>
---
 meta/recipes-devtools/go/go-runtime_1.12.bb | 6 ++++++
 meta/recipes-devtools/go/go_1.12.bb         | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/meta/recipes-devtools/go/go-runtime_1.12.bb b/meta/recipes-devtools/go/go-runtime_1.12.bb
index 43b68b4..a509824 100644
--- a/meta/recipes-devtools/go/go-runtime_1.12.bb
+++ b/meta/recipes-devtools/go/go-runtime_1.12.bb
@@ -1,2 +1,8 @@
 require go-${PV}.inc
 require go-runtime.inc
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN}-dev = "zdefaultcc.go.1 zdefaultcc.go.2"
+ALTERNATIVE_LINK_NAME[zdefaultcc.go.1] = "${libdir}/go/src/cmd/cgo/zdefaultcc.go"
+ALTERNATIVE_LINK_NAME[zdefaultcc.go.2] = "${libdir}/go/src/cmd/go/internal/cfg/zdefaultcc.go
diff --git a/meta/recipes-devtools/go/go_1.12.bb b/meta/recipes-devtools/go/go_1.12.bb
index 42cdb04..6103832 100644
--- a/meta/recipes-devtools/go/go_1.12.bb
+++ b/meta/recipes-devtools/go/go_1.12.bb
@@ -12,3 +12,10 @@ python() {
     else:
         d.setVar('GOBUILDMODE', 'pie')
 }
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY_${PN}-dev = '20'
+ALTERNATIVE_${PN}-dev = "zdefaultcc.go.1 zdefaultcc.go.2"
+ALTERNATIVE_LINK_NAME[zdefaultcc.go.1] = "${libdir}/go/src/cmd/cgo/zdefaultcc.go"
+ALTERNATIVE_LINK_NAME[zdefaultcc.go.2] = "${libdir}/go/src/cmd/go/internal/cfg/zdefaultcc.go"
-- 
2.7.4



More information about the Openembedded-core mailing list