Merge pull request #1261 from flatcar-linux/krnowak/gcs-python3

Update net-misc/google-cloud-sdk to 355.0.0
This commit is contained in:
Krzesimir Nowak 2021-09-27 14:49:40 +02:00 committed by GitHub
commit 4391488894
7 changed files with 146 additions and 70 deletions

View File

@ -1,2 +1 @@
DIST google-cloud-sdk-138.0.0-linux-x86_64.tar.gz 9105906 SHA256 dc370f43b0296c5e53ca53201b526f8de2d5fbeafc9fecdc55391bb9535fc4f8 SHA512 929e45cb53f7a2e3077f6b7e21c38189cfb4de5076cbcdd56fde76dffa4c770ffa4d78ff90d0da65fa477b1cbb30e50859538bf41a188fd3cbdd02cd89d8042a WHIRLPOOL d157b559363f498dba9a8545d72cdc24bfa55bfab5a5238442c1d61750944ef8b79c73a43402910d009c6df9e2bd085a1d3a634e0b4a44457c5772b28ed40555 DIST google-cloud-sdk-355.0.0-linux-x86_64.tar.gz 87476312 BLAKE2B faa28734678b9e91c17dd27d3e4b7f53feab2462d640be3c237d9798f23750fcde916a087d8a60b9b5e06eb9c70f108d3ad45a19b5889121ead635cb63f653cb SHA512 dbfc2c98fd769d27be1dd58f4a4a0490a28b4119b3c2fc7b91b5e71c76488009f3ce57c8a3a2b91480ddddaf6c4ed78c05dd5e735a245be086c7c0ab9379b023
DIST google-cloud-sdk-188.0.1-linux-x86_64.tar.gz 18563397 SHA256 2966e8c21b4176037cc7f1916a170f2b6c7fcdb563cde25e26063986d2bdc047 SHA512 5106cbff6ceb195c968f08126a0a63ac16e23d28e4072770674182e9b466d1d8bf66c1b675ff38f58cf2317e87544b76de982c911c765d9cfbae9b5d3361ce66 WHIRLPOOL 0ec82dfc892a68875a4a154583d043bdc9de53a0b51be117f9b6553d142cfbc57272f900f5b8f3fb61c20ad9e07e07bb3767c5c090fb3a6314aaaa2a7900c4ed

View File

@ -0,0 +1,31 @@
Some notes about the google-cloud-sdk package:
- It is only a part of our SDK image, as we are using it for uploading
built artifacts to our google storage. So this is not a user-facing
package. Maybe at some point it can be dropped if we decide to
always pull a docker image that contains the google-cloud-sdk - we
already do it in some places. The GCE OEM image has bash aliases
that also download the docker image and run gcloud/gsutil from it.
- Since it's only for "internal" use, we don't install all the
tools. We only keep gcloud and gsutil. Not sure if we even use the
former, maybe could be dropped later. But this is the reason why we
remove some of the code in src_prepare - we don't need bq, for
example.
- The scripts in the "files" directory are really cut-down versions of
"gsutil" and "gcloud" scripts coming from google-could-sdk
tarball. The scripts in tarball are doing a bunch of discoveries to
set up some environment variables - we cut the chase and set them to
a good known values.
- We have a runtime dependency on crcmod, because we want to make sure
that gsutil will use a compiled version of crc computing routines
instead of python ones - the latter are super-slow and gsutil
disables some features if they are used. Not sure if we use those
features, though (uploading composite objects).
- We used to have a runtime dependency on pyopenssl, which is used by
`gsutil signurl` command. We dropped it again, because the only uses
of the signurl command are with gsutil coming from docker images
instead of this package.

View File

@ -1,10 +1,28 @@
#!/bin/sh #!/bin/sh
CLOUDSDK_ROOT_DIR="/usr/lib/google-cloud-sdk" CLOUDSDK_ROOT_DIR='/usr/lib/google-cloud-sdk'
CLOUDSDK_PYTHON="python2.7" CLOUDSDK_PYTHON='python3'
CLOUDSDK_PYTHON_ARGS="-S" CLOUDSDK_PYTHON_ARGS=''
CLOUDSDK_GSUTIL_PYTHON="${CLOUDSDK_PYTHON}"
CLOUDSDK_BQ_PYTHON="${CLOUDSDK_PYTHON}"
CLOUDSDK_PYTHON_SITEPACKAGES='1'
unset CLOUDSDK_PYTHON_SITEPACKAGES if [ -z "${PYTHONIOENCODING}" ]; then
export CLOUDSDK_ROOT_DIR CLOUDSDK_PYTHON_ARGS CLOUDSDK_ENCODING='UTF-8'
else
CLOUDSDK_ENCODING="${PYTHONIOENCODING}"
fi
"$CLOUDSDK_PYTHON" $CLOUDSDK_PYTHON_ARGS "${CLOUDSDK_ROOT_DIR}/lib/gcloud.py" "$@" export CLOUDSDK_ROOT_DIR
export CLOUDSDK_PYTHON_ARGS
export CLOUDSDK_GSUTIL_PYTHON
export CLOUDSDK_BQ_PYTHON
export CLOUDSDK_ENCODING
export PYTHONIOENCODING="${CLOUDSDK_ENCODING}"
export CLOUDSDK_PYTHON
export CLOUDSDK_PYTHON_SITEPACKAGES
unset PYTHONHOME
exec "${CLOUDSDK_PYTHON}" $CLOUDSDK_PYTHON_ARGS "${CLOUDSDK_ROOT_DIR}/lib/gcloud.py" "$@"

View File

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

View File

@ -3,3 +3,6 @@ disable_usage_reporting = True
[component_manager] [component_manager]
disable_update_check = True disable_update_check = True
[survey]
disable_prompts = True

View File

@ -1,49 +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 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}]
dev-python/pyopenssl
!net-misc/gsutil"
src_prepare() {
# Drop unnused python3 code
rm -r lib/third_party/httplib2/python3 || die
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
newbashcomp completion.bash.inc gcloud
bashcomp_alias gcloud gsutil
}

View File

@ -0,0 +1,63 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=6
PYTHON_COMPAT=( python3_6 )
inherit bash-completion-r1 python-single-r1
DESCRIPTION="Command line tool for interacting with Google Compute Engine"
HOMEPAGE="https://cloud.google.com/sdk"
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}]"
src_prepare() {
# Drop unused python2 code
rm -r lib/third_party/httplib2/python2 || die
rm -r lib/third_party/gcloud_crcmod/python2 || die
rm -r lib/third_party/concurrent/{python2,futures} || die
rm -r platform/gsutil/third_party/httplib2/python2 || die
rm -r platform/gsutil/third_party/crcmod/python2 || die
rm -r platform/bq/third_party/httplib2/python2 || die
# Use the compiled crcmod from the system
rm -r platform/gsutil/third_party/{crcmod,crcmod_osx} || die
rm -r lib/third_party/gcloud_crcmod/python3/{_crcfunpy,crcmod,predefined}.py || die
# Drop unused stuff
rm -r platform/bq || die
# Python optimize complains about syntax errors in these
# files, so I suppose that they are unused at runtime.
rm -r platform/gsutil/gslib/vendored/boto/{docs,tests/{fps,db}} || die
rm -r platform/ext-runtime/nodejs/test
rm -f platform/gsutil/third_party/apitools/ez_setup.py
rm -r lib/third_party/yaml
rm -r lib/googlecloudsdk/third_party/appengine/api
rm -r lib/third_party/fancy_urllib
default
}
src_install() {
insinto "/usr/lib/${PN}"
doins -r lib platform "${FILESDIR}/properties"
insinto "/usr/lib/${PN}/bin"
doins -r bin/bootstrapping
python_optimize "${D}/usr/lib/${PN}"
dobin "${FILESDIR}/"{gcloud,gsutil}
dodoc LICENSE README RELEASE_NOTES
newbashcomp completion.bash.inc gcloud
bashcomp_alias gcloud gsutil
}