]> code.ossystems Code Review - openembedded-core.git/commitdiff
go.bbclass: exported function cleanup
authorMatt Madison <matt@madison.systems>
Fri, 8 Sep 2017 21:04:38 +0000 (18:04 -0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 11 Sep 2017 16:30:14 +0000 (17:30 +0100)
Since this is a class, it should follow the
class function export mechanism for its task
functions, and should set directory-related
flags for directories they need.

Signed-off-by: Matt Madison <matt@madison.systems>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/go.bbclass

index f64b07fd82b338a6c0b8c79a112916c4e446c682..6df73bf377b707accbd3427099001f7ba1077361 100644 (file)
@@ -51,14 +51,14 @@ FILES_${PN}-staticdev += "${GOPKG_FINAL}/${GO_IMPORT}*"
 
 GO_INSTALL ?= "${GO_IMPORT}/..."
 
-do_go_compile() {
+go_do_compile() {
        GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env
        if [ -n "${GO_INSTALL}" ]; then
                GOPATH=${S}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install ${GOBUILDFLAGS} ${GO_INSTALL}
        fi
 }
 
-do_go_install() {
+go_do_install() {
        rm -rf ${WORKDIR}/staging
        install -d ${WORKDIR}/staging${GOROOT_FINAL} ${D}${GOROOT_FINAL}
        tar -C ${S} -cf - . | tar -C ${WORKDIR}/staging${GOROOT_FINAL} -xpvf -
@@ -84,11 +84,7 @@ do_go_install() {
                rmdir -p "${D}${GOBIN_FINAL}" || true
        fi
 }
+do_install[dirs] =+ "${WORKDIR}/staging"
+do_install[cleandirs] += "${WORKDIR}/staging"
 
-do_compile() {
-       do_go_compile
-}
-
-do_install() {
-       do_go_install
-}
+EXPORT_FUNCTIONS do_compile do_install