google-cloud-sdk: update to current release, replace gsutil

This commit is contained in:
Michael Marineau 2016-12-14 17:46:07 -08:00
parent 16f42ed093
commit 50fde38a1c
9 changed files with 82 additions and 63 deletions

View File

@ -73,7 +73,7 @@ RDEPEND="${RDEPEND}
dev-vcs/mercurial dev-vcs/mercurial
dev-vcs/subversion[-dso] dev-vcs/subversion[-dso]
net-misc/gcutil net-misc/gcutil
net-misc/gsutil net-misc/google-cloud-sdk
sys-apps/usbutils sys-apps/usbutils
sys-apps/systemd sys-apps/systemd
!sys-apps/nih-dbus-tool !sys-apps/nih-dbus-tool

View File

@ -1 +1 @@
DIST google-cloud-sdk-108.0.0-linux-x86_64.tar.gz 7533227 SHA256 2cd451c11553e20fef4c234fc09fd2bb299786db586e9c49cf4700e1bd7c8ba3 SHA512 3db135cb26b3cd713ec8eb74205cc08bc6f5e5e6c2e76908d76d45e146fdc2489f3a01710178c43b2a568c3de78604a757441b49d440d8dfc7e5c0e9a4adce8e WHIRLPOOL 6857b2435d5062c6aa029c88f3e4692d96e051808155b09adf680b2d8d0b9806559be08aef7fa0261ed84512b5a93e4e78ad01bf9ed3669b1b16d8ce520c58fc DIST google-cloud-sdk-138.0.0-linux-x86_64.tar.gz 9105906 SHA256 dc370f43b0296c5e53ca53201b526f8de2d5fbeafc9fecdc55391bb9535fc4f8 SHA512 929e45cb53f7a2e3077f6b7e21c38189cfb4de5076cbcdd56fde76dffa4c770ffa4d78ff90d0da65fa477b1cbb30e50859538bf41a188fd3cbdd02cd89d8042a WHIRLPOOL d157b559363f498dba9a8545d72cdc24bfa55bfab5a5238442c1d61750944ef8b79c73a43402910d009c6df9e2bd085a1d3a634e0b4a44457c5772b28ed40555

View File

@ -1,25 +0,0 @@
From b75e17459bf1201c40e1ff372ec43c1c33caa57a Mon Sep 17 00:00:00 2001
From: Alex Crawford <alex.crawford@coreos.com>
Date: Wed, 18 May 2016 18:45:18 -0700
Subject: [PATCH] Hardcode the root directory
---
bin/gcloud | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/gcloud b/bin/gcloud
index e3bec46..ef62c98 100755
--- a/bin/gcloud
+++ b/bin/gcloud
@@ -58,7 +58,7 @@ _cloudsdk_root_dir() {
esac
done
}
-CLOUDSDK_ROOT_DIR=$(_cloudsdk_root_dir "$0")
+CLOUDSDK_ROOT_DIR="/usr/lib/google-cloud-sdk"
# Cloud SDK requires python 2 (2.6 or 2.7)
case $CLOUDSDK_PYTHON in
--
2.7.3

View File

@ -0,0 +1,10 @@
#!/bin/sh
CLOUDSDK_ROOT_DIR="/usr/lib/google-cloud-sdk"
CLOUDSDK_PYTHON="python2.7"
CLOUDSDK_PYTHON_ARGS="-S"
unset CLOUDSDK_PYTHON_SITEPACKAGES
export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS
"$CLOUDSDK_PYTHON" $CLOUDSDK_PYTHON_ARGS "${CLOUDSDK_ROOT_DIR}/lib/gcloud.py" "$@"

View File

@ -0,0 +1,17 @@
#!/bin/sh
CLOUDSDK_ROOT_DIR="/usr/lib/google-cloud-sdk"
CLOUDSDK_PYTHON="python2.7"
CLOUDSDK_PYTHON_SITEPACKAGES=1
export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_SITEPACKAGES
unset CLOUDSDK_PYTHON_ARGS
# Execute platform/gsutil/gsutil.py instead of the gcloud-ified wrapper
# bin/bootstrapping/gsutil.py because the gcloud version *only* uses
# gcloud provided auth tokens, ignoring older .boto provided tokens.
# This breaks all existing users of gsutil in the SDK which isn't OK.
#
# If future versions fix this and gracefully fall back to .boto oauth
# tokens then we can switch but until then stick with the old scheme.
"$CLOUDSDK_PYTHON" "${CLOUDSDK_ROOT_DIR}/platform/gsutil/gsutil.py" "$@"

View File

@ -0,0 +1,5 @@
[core]
disable_usage_reporting = True
[component_manager]
disable_update_check = True

View File

@ -1,36 +0,0 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit eutils python-r1
DESCRIPTION="Command line tool for interacting with Google Compute Engine"
HOMEPAGE="https://cloud.google.com/sdk/#linux"
SRC_URI="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${P}-linux-x86_64.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
S="${WORKDIR}/${PN}"
DEPEND="${PYTHON_DEPS}"
RDEPEND="${DEPEND}"
src_prepare() {
epatch "${FILESDIR}/0001-Hardcode-the-root-directory.patch"
default
}
src_install() {
dobin "${S}/bin/gcloud"
insinto "/usr/lib/${PN}"
doins -r "${S}/lib"
}

View File

@ -0,0 +1,48 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI=6
PYTHON_COMPAT=( python2_7 )
inherit bash-completion-r1 python-single-r1
DESCRIPTION="Command line tool for interacting with Google Compute Engine"
HOMEPAGE="https://cloud.google.com/sdk/#linux"
SRC_URI="https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/${P}-linux-x86_64.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64"
IUSE=""
S="${WORKDIR}/${PN}"
DEPEND="${PYTHON_DEPS}"
RDEPEND="${DEPEND}
dev-python/crcmod[${PYTHON_USEDEP}]
!net-misc/gsutil"
src_prepare() {
# Drop unnused python3 code
rm -r platform/gsutil/third_party/httplib2/python3 || die
# Use the compiled crcmod from the system
rm -r platform/gsutil/third_party/{crcmod,crcmod_osx} || die
default
}
src_install() {
insinto "/usr/lib/${PN}"
doins -r lib platform "${FILESDIR}/properties"
python_optimize "${D}/usr/lib/${PN}"
dobin "${FILESDIR}/"{gcloud,gsutil}
dodoc LICENSE README RELEASE_NOTES
doman help/man/man1/*.1
newbashcomp completion.bash.inc gcloud
bashcomp_alias gcloud gsutil
}