From 47b3dd10388e8688f6646d0d780bcc6e3e20586d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 12 Aug 2013 18:38:33 -0400 Subject: [PATCH 1/3] bump(net-misc/gsutil): Update to 3.34 ebuilds originally created and tested in my "misc-overlay" https://github.com/marineam/misc-overlay --- .../coreos-overlay/net-misc/gsutil/Manifest | 1 + .../net-misc/gsutil/files/dummy.boto | 2 + ...Fix-test-using-glob-with-ObjectToURI.patch | 30 +++++++++++++ ...tests-that-fail-for-package-installs.patch | 45 +++++++++++++++++++ ...util-3.34-use-friendy-version-checks.patch | 22 +++++++++ .../net-misc/gsutil/gsutil-3.34.ebuild | 42 +++++++++++++++++ .../default/linux/package.accept_keywords | 5 +-- 7 files changed, 144 insertions(+), 3 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-test-using-glob-with-ObjectToURI.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-update-tests-that-fail-for-package-installs.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-use-friendy-version-checks.patch create mode 100644 sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/gsutil-3.34.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/Manifest b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/Manifest index 345cc5206a..e5328ee206 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/Manifest @@ -1 +1,2 @@ DIST gsutil_3.31.tar.gz 1533732 SHA256 fc429054777caa6dfa49776b28c0511f0d63dc45351f9e0ba31e9fee036694f9 SHA512 acb210147d618c1a5e82259ab0183ef4349b491889d862f4619d6b10384f30a719dd1239e87d2b65260ba1f6865447b9c4989cf35959c15149d124b345d65da6 WHIRLPOOL 4279cfbdb5d452a062e6a8cc23dd49bb7bff3e264903c1da46861bc5ef39dfb73a62e22b49175652b5003e658017921873f2c6dbfdc6c114ad80cf1b71e7d004 +DIST gsutil_3.34.tar.gz 1572225 SHA256 f01195a58358836d665c1760e248044fb19b85ab33565e60f0f96f915f41e7e7 SHA512 a413570c881bd222a49169da5a4e899ccb889bcbe889f3e7cb888562884b759af18253b942dfb6d0fbdede3d6b8dd8eee4bb45af3d9adfe630f96f163bf7773d WHIRLPOOL 5afc1680f402181a1d1f53fa72f9fa98ec417684cc21c7c794ed2e779ff6516fd27b35d8e48ac90e427868c6311c3450b1c373dd133290e7b5d4a1be8f753620 diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/dummy.boto b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/dummy.boto index 71653fef44..0abc21056d 100644 --- a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/dummy.boto +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/dummy.boto @@ -2,3 +2,5 @@ [Credentials] gs_oauth2_refresh_token = 1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + +[GSUtil] diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-test-using-glob-with-ObjectToURI.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-test-using-glob-with-ObjectToURI.patch new file mode 100644 index 0000000000..6ef41cc45c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-test-using-glob-with-ObjectToURI.patch @@ -0,0 +1,30 @@ +From 1b2eccc8a3c8c70855973d9dcff46bb0c4f79345 Mon Sep 17 00:00:00 2001 +From: Michael Marineau +Date: Mon, 12 Aug 2013 17:42:39 -0400 +Subject: [PATCH] Fix test using ? glob with ObjectToURI + +Passing a ? wildcard through ObjectToURI does not work because passing +the constructed URI through urlparse.urlparse() interprets ? as a query +and strips it off since there is no query string following it. The * +glob which is actually used in the very next call doesn't have that +problem so just use that instead. +--- + gslib/tests/test_naming.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gslib/tests/test_naming.py b/gslib/tests/test_naming.py +index b4d0ccd..8208238 100755 +--- a/gslib/tests/test_naming.py ++++ b/gslib/tests/test_naming.py +@@ -840,7 +840,7 @@ class GsutilNamingTests(testcase.GsUtilUnitTestCase): + for i, final_dst_char in enumerate(('', '/')): + # Copy some files into place in dst bucket. + self.RunCommand( +- 'cp', [suri(src_bucket_uri, 'f%df?' % i), ++ 'cp', [suri(src_bucket_uri, 'f%df*' % i), + suri(dst_bucket_uri, 'dst_subdir%d' % i) + final_dst_char]) + # Now do the move test. + self.RunCommand( +-- +1.8.1.5 + diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-update-tests-that-fail-for-package-installs.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-update-tests-that-fail-for-package-installs.patch new file mode 100644 index 0000000000..6307353bb7 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-Fix-update-tests-that-fail-for-package-installs.patch @@ -0,0 +1,45 @@ +From a978811458f3d0c5379101bdda4396c62b8b0d6b Mon Sep 17 00:00:00 2001 +From: Michael Marineau +Date: Mon, 12 Aug 2013 16:46:25 -0400 +Subject: [PATCH] Fix update tests that fail for package installs. + +Software updates are checked for but never offered in package installs. +Perhaps _MaybeCheckForAndOfferSoftwareUpdate should be split into two +functions so the "check for" and "offer" parts can be tested +independently but this fixes the tests as-is. +--- + gslib/tests/test_command_runner.py | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/gslib/tests/test_command_runner.py b/gslib/tests/test_command_runner.py +index 01b5312..0a9eb01 100644 +--- a/gslib/tests/test_command_runner.py ++++ b/gslib/tests/test_command_runner.py +@@ -105,8 +105,10 @@ class TestSoftwareUpdateCheckUnitTests( + self._SetBotoConfig('GSUtil', 'software_update_check_period', '1') + with open(self.timestamp_file, 'w') as f: + f.write(str(int(time.time() - 2 * SECONDS_PER_DAY))) ++ # Update will not trigger for package installs. ++ expect = not gslib.IS_PACKAGE_INSTALL + self.assertEqual( +- True, ++ expect, + self.command_runner._MaybeCheckForAndOfferSoftwareUpdate('ls', 0)) + + def test_not_time_for_update_yet(self): +@@ -134,9 +136,10 @@ class TestSoftwareUpdateCheckUnitTests( + with open(self.timestamp_file, 'w') as f: + f.write(str(int(time.time() - 2 * SECONDS_PER_DAY))) + +- # With regular loglevel, should return True. ++ # With regular loglevel, should return True except for package installs. ++ expect = not gslib.IS_PACKAGE_INSTALL + self.assertEqual( +- True, ++ expect, + self.command_runner._MaybeCheckForAndOfferSoftwareUpdate('ls', 0)) + + prev_loglevel = logging.getLogger().getEffectiveLevel() +-- +1.8.1.5 + diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-use-friendy-version-checks.patch b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-use-friendy-version-checks.patch new file mode 100644 index 0000000000..a807b13199 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/files/gsutil-3.34-use-friendy-version-checks.patch @@ -0,0 +1,22 @@ +diff --git a/setup.py b/setup.py +index 1478628..c25b6e7 100755 +--- a/setup.py ++++ b/setup.py +@@ -33,15 +33,13 @@ management tasks, including: + """ + + requires = [ +- 'boto==2.9.7', ++ 'boto>=2.9.7', + 'httplib2>=0.8', + 'python-gflags>=2.0', + 'google-api-python-client>=1.1', + 'pyOpenSSL>=0.13', + 'crcmod>=1.7', +- # Not using 1.02 because of: +- # https://code.google.com/p/socksipy-branch/issues/detail?id=3 +- 'SocksiPy-branch==1.01', ++ 'SocksiPy-branch>=1.01', + ] + + dependency_links = [ diff --git a/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/gsutil-3.34.ebuild b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/gsutil-3.34.ebuild new file mode 100644 index 0000000000..d505af43d1 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/net-misc/gsutil/gsutil-3.34.ebuild @@ -0,0 +1,42 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="5" +PYTHON_COMPAT=( python{2_6,2_7} ) + +inherit distutils-r1 + +DESCRIPTION="command line tool for interacting with cloud storage services" +HOMEPAGE="https://github.com/GoogleCloudPlatform/gsutil" +SRC_URI="http://commondatastorage.googleapis.com/pub/${PN}_${PV}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="amd64" +IUSE="" + +DEPEND="${PYTHON_DEPS}" +RDEPEND="${DEPEND} + >=dev-python/boto-2.9.7[${PYTHON_USEDEP}] + >=dev-python/crcmod-1.7 + >=dev-python/httplib2-0.8[${PYTHON_USEDEP}] + >=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}] + dev-python/google-api-python-client[${PYTHON_USEDEP}] + dev-python/python-gflags[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + dev-python/socksipy-branch[${PYTHON_USEDEP}] + " + +S=${WORKDIR}/${PN} +DOCS=( README.md CHANGES.md ) +PATCHES=( + ${FILESDIR}/${P}-use-friendy-version-checks.patch + ${FILESDIR}/${P}-Fix-update-tests-that-fail-for-package-installs.patch + ${FILESDIR}/${P}-Fix-test-using-glob-with-ObjectToURI.patch +) + +python_test() { + export BOTO_CONFIG=${FILESDIR}/dummy.boto + ${PYTHON} gslib/__main__.py test -u || die "tests failed" +} diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/default/linux/package.accept_keywords b/sdk_container/src/third_party/coreos-overlay/profiles/default/linux/package.accept_keywords index 029f9571c0..4174a2be1a 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/default/linux/package.accept_keywords +++ b/sdk_container/src/third_party/coreos-overlay/profiles/default/linux/package.accept_keywords @@ -59,7 +59,6 @@ =sys-devel/clang-3.2 ~amd64 =dev-util/shflags-1.0.3 ~amd64 =dev-util/perf-3.4 ~amd64 -=dev-python/boto-2.7.0 ~amd64 =sys-libs/libnih-1.0.3 ~amd64 =sys-devel/llvm-3.2 ~amd64 =dev-python/pyusb-1.0.0_alpha3 ~amd64 @@ -93,10 +92,10 @@ # Needed for docker =sys-fs/aufs-util-3.7.6 ~amd64 -# Needed by gsutil-3.31 +# Needed by gsutil-3.34 =dev-python/httplib2-0.8 ~amd64 =dev-python/crcmod-1.7-r1 ~amd64 -=dev-python/boto-2.9.6 ~amd64 +=dev-python/boto-2.9.8 ~amd64 # Fixes XML validation failure and python eclass usage =dev-lang/yasm-1.2.0-r1 From 14454b0cec294c935d575c8df764793de1504e29 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 12 Aug 2013 19:05:00 -0400 Subject: [PATCH 2/3] fix(coreos-base/oem-vagrant): No need for run.sh for copying ssh key. Copying authorized_keys is now built in to coreos-init. --- .../files/{vagrant.pub => authorized_keys} | 0 .../coreos-base/oem-vagrant/files/run.sh | 17 ----------------- .../oem-vagrant/oem-vagrant-0.0.1-r1.ebuild | 1 + .../oem-vagrant/oem-vagrant-0.0.1.ebuild | 5 +---- 4 files changed, 2 insertions(+), 21 deletions(-) rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/{vagrant.pub => authorized_keys} (100%) delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/run.sh create mode 120000 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1-r1.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/vagrant.pub b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/authorized_keys similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/vagrant.pub rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/authorized_keys diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/run.sh b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/run.sh deleted file mode 100644 index 981e0e8849..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/files/run.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -set -e - -USER_DIR="/home/core" - -if [ -e "${USER_DIR}/.ssh/authorized_keys" ]; then - exit 0 -fi - -if [ ! -d "${USER_DIR}/.ssh" ]; then - mkdir -p ${USER_DIR}/.ssh - chmod 700 ${USER_DIR}/.ssh -fi - -cp /usr/share/oem/vagrant.pub "${USER_DIR}/.ssh/authorized_keys" -chown -R core: "${USER_DIR}/.ssh" diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1-r1.ebuild new file mode 120000 index 0000000000..4aa0c75f40 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1-r1.ebuild @@ -0,0 +1 @@ +oem-vagrant-0.0.1.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1.ebuild index 657cce3a92..4932abe20b 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-vagrant/oem-vagrant-0.0.1.ebuild @@ -17,8 +17,5 @@ S="${WORKDIR}" src_install() { insinto "/" - doins "${FILESDIR}/vagrant.pub" - - exeinto "/" - doexe ${FILESDIR}/run.sh + doins "${FILESDIR}/authorized_keys" } From 42dc93dc92cac8477bfc1d5a5d173bbfe09cafa8 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 12 Aug 2013 19:13:40 -0400 Subject: [PATCH 3/3] fix(coreos-base/oem-ami): Simplify ssh key install Use the new update-ssh-keys script to make the script a lot simpler. :) --- .../oem-ami/files/install-ec2-key.sh | 21 ------------------- .../coreos-base/oem-ami/files/run | 8 +++++++ .../coreos-base/oem-ami/files/run.sh | 3 --- ....0.1-r8.ebuild => oem-ami-0.0.1-r9.ebuild} | 0 .../coreos-base/oem-ami/oem-ami-0.0.1.ebuild | 4 +--- 5 files changed, 9 insertions(+), 27 deletions(-) delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh create mode 100755 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh rename sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/{oem-ami-0.0.1-r8.ebuild => oem-ami-0.0.1-r9.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh deleted file mode 100755 index 6144e1b120..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/install-ec2-key.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -/usr/bin/block-until-url http://169.254.169.254/ - -USER_DIR="/home/core" - -if [ ! -d ${USER_DIR}/.ssh ] ; then - mkdir -p ${USER_DIR}/.ssh - chmod 700 ${USER_DIR}/.ssh -fi -curl -s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key > /tmp/my-key -if [ $? -eq 0 ] ; then - cat /tmp/my-key >> ${USER_DIR}/.ssh/authorized_keys - chmod 700 ${USER_DIR}/.ssh/authorized_keys - rm /tmp/my-key -else - echo unable to download key - rm /tmp/my-key - exit 1 -fi -chown -R core: $USER_DIR/.ssh diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run new file mode 100755 index 0000000000..f46ae9d631 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +KEY_URL="http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key" + +block-until-url "$KEY_URL" +curl --fail -s "$KEY_URL" | update-ssh-keys -a ec2 diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh deleted file mode 100755 index 69c0f1858a..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/files/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -/usr/share/oem/usr/bin/install-ec2-key.sh diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r8.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r9.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r8.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1-r9.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild index 8db3190479..567f5321b4 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ami/oem-ami-0.0.1.ebuild @@ -16,10 +16,8 @@ IUSE="" S="${WORKDIR}" src_install() { - dobin "${FILESDIR}"/install-ec2-key.sh - exeinto "/" - doexe ${FILESDIR}/run.sh + doexe ${FILESDIR}/run insinto "/" doins ${FILESDIR}/oem-release