commit:     a20941347bf2d9ff15f182b50f093880361fe6e2
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 14 08:21:43 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Apr 14 08:25:09 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2094134

app-emulation/lxd: fix file collision with vendor deps (bug 615444)

Bug: https://bugs.gentoo.org/show_bug.cgi?id=615444
Package-Manager: Portage-2.3.5, Repoman-2.3.2

 app-emulation/lxd/Manifest        |  1 +
 app-emulation/lxd/lxd-2.11.ebuild | 22 +++++++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/app-emulation/lxd/Manifest b/app-emulation/lxd/Manifest
index dba7edb0899..67814337f99 100644
--- a/app-emulation/lxd/Manifest
+++ b/app-emulation/lxd/Manifest
@@ -1,2 +1,3 @@
+DIST go-flags-460c7bb0abd6e927f2767cadc91aa6ef776a98b4.tar.gz 54792 SHA256 
382dbeca4e436aa1717c9a413fc53197eb3f94fbbb0b2ba3b0d1a405c9262504 SHA512 
d8c748a2617d0997ad69d64530289dc53a310381ba101b942d3e7df04ef9fd79e1d26879c485cb6e8e5c710f42411dbe5b4b157cfd36a511a19c88d336f34fea
 WHIRLPOOL 
fb23a71928c1d3d1cdbb1fecaadfed843b986d2f76a9ca57b171d80051f81a886ec7d8b292b0e054d69ed9e2fd55c1f544767332334655cd01a6c83633d6e711
 DIST lxd-2.11.tar.bz2 2407968 SHA256 
829643811a711c8e3c118274d517091b4fbd4701b760e46d7f53fcc4d356455d SHA512 
8269a20e0c0c0f3a3a247af15fcda3aa764cd2353d8a7aa9183646dbf19a080ce09bf31ff91a9faca3eda494460a788deabdb145a59c2aa1861f2df89c43294b
 WHIRLPOOL 
ba12b4c41969e17b5f9beaa7908ca7be18d3ce35ae27c762a556fe6d59f48962cf0ccaecc512887d40338e6e26ccdc2cdf6c89d87fd1b2028fb5e04f3a74b639
 DIST lxd-2.8.tar.bz2 2317466 SHA256 
57f08bd3c26ea4f32453aa163b502301ae0a80716d6de56b069eeebb35850011 SHA512 
fdf906add25ab0b79ea7669ad569873a256f0cfc220ed816b0dc2c9b1e525a19e2606678d90d50c4f548b4322a2896d4c12069337f9571a9a4f6646fb6f673a5
 WHIRLPOOL 
049f3664e60e8f6fd98c8403db31db6e1dd5f6efed2e74b9007f9f99a4b337e9f58852253d226fc294c4bc964dd6d5d732a8a386606f206a74d83a32470dc1d3

diff --git a/app-emulation/lxd/lxd-2.11.ebuild 
b/app-emulation/lxd/lxd-2.11.ebuild
index b211ffbcaf0..16dace1d2ba 100644
--- a/app-emulation/lxd/lxd-2.11.ebuild
+++ b/app-emulation/lxd/lxd-2.11.ebuild
@@ -7,6 +7,7 @@ DESCRIPTION="Fast, dense and secure container management"
 HOMEPAGE="https://linuxcontainers.org/lxd/introduction/";
 EGO_PN_PARENT="github.com/lxc"
 EGO_PN="${EGO_PN_PARENT}/lxd"
+GO_FLAGS_COMMIT="460c7bb0abd6e927f2767cadc91aa6ef776a98b4"
 
 # The source is repackaged using a script at:
 #   https://dev.gentoo.org/~stasibear/lxd_repackage.py
@@ -16,7 +17,9 @@ EGO_PN="${EGO_PN_PARENT}/lxd"
 # and anyway portage requires that fetching is only done from SRC_URI.
 # The only sane alternative I've seen is in the consul ebuild, which
 # is more transparent but raises other questions.
-SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2";
+SRC_URI="https://dev.gentoo.org/~stasibear/distfiles/${P}.tar.bz2
+       https://github.com/jessevdk/go-flags/archive/${GO_FLAGS_COMMIT}.tar.gz 
->
+       go-flags-${GO_FLAGS_COMMIT}.tar.gz"
 
 LICENSE="Apache-2.0"
 SLOT="0"
@@ -106,6 +109,23 @@ src_prepare() {
 
        # Warn on unhandled locale changes
        l10n_find_plocales_changes po "" .po
+
+       mkdir -p "${S}/src/${EGO_PN}/vendor/github.com/jessevdk"
+       mv "${WORKDIR}/go-flags-${GO_FLAGS_COMMIT}" \
+               "${S}/src/${EGO_PN}/vendor/github.com/jessevdk/go-flags" || \
+               die "Failed to move go-flags"
+
+       # gopkg.in/lxc/go-lxc.v2/examples/clone.go:17: too many errors
+       rm -rf "${S}/src/gopkg.in/lxc/go-lxc.v2/examples" || die
+
+       while read -r -d ''; do
+               [[ -d ${REPLY} ]] || continue # parent moved already
+               [[ ${REPLY} =~ ^${S}/src/${EGO_PN%/*}(/|$) ]] && continue
+               mkdir -p "$(dirname 
"${S}/src/${EGO_PN}/vendor/${REPLY#${S}/src}")"
+               mv "${REPLY}" "${S}/src/${EGO_PN}/vendor/${REPLY#${S}/src}" || \
+                       die "Failed to move ${REPLY##*/}"
+       done < <(find "${S}/src" -mindepth 2 -maxdepth 3 -type d -print0)
+       find "${S}/src" -maxdepth 3 -type d -empty -delete
 }
 
 src_compile() {

Reply via email to