buildbot/Dockerfile.template: Adjust Python 2 dependency
authorW. Trevor King <wking@tremily.us>
Thu, 31 Jul 2014 21:51:51 +0000 (14:51 -0700)
committerW. Trevor King <wking@tremily.us>
Fri, 29 Aug 2014 07:25:18 +0000 (00:25 -0700)
Now that the ancestor gentoo-python image is removing Python 2, we
need to get it back for Buildbot [1,2].  We need to keep the
USE_PYTHON setting (with a tweaked value) because buildbot hasn't
transitioned to the *-r1 Python eclasses yet:

  $ grep 'inherit.*distutils' /usr/portage/dev-util/buildbot*/*ebuild
  /usr/portage/dev-util/buildbot-slave/buildbot-slave-0.8.7_p1.ebuild:inherit distutils readme.gentoo user
  /usr/portage/dev-util/buildbot-slave/buildbot-slave-0.8.8-r1.ebuild:inherit distutils readme.gentoo systemd user
  /usr/portage/dev-util/buildbot-slave/buildbot-slave-0.8.8.ebuild:inherit distutils readme.gentoo user
  /usr/portage/dev-util/buildbot-slave/buildbot-slave-0.8.9.ebuild:inherit distutils readme.gentoo systemd user
  /usr/portage/dev-util/buildbot-slave/buildbot-slave-9999.ebuild:inherit distutils readme.gentoo user
  /usr/portage/dev-util/buildbot/buildbot-0.8.7_p1-r1.ebuild:inherit distutils readme.gentoo user
  /usr/portage/dev-util/buildbot/buildbot-0.8.8-r2.ebuild:inherit distutils readme.gentoo systemd user
  /usr/portage/dev-util/buildbot/buildbot-0.8.9.ebuild:inherit distutils readme.gentoo systemd user
  /usr/portage/dev-util/buildbot/buildbot-9999.ebuild:inherit distutils readme.gentoo user systemd

Also, instead of hardcoding the packages effected by the sqlite USE
flag change, just use --newuse on @system and @world and let Portage
figure out what needs to be rebuilt.

[1]: Buildbot will transition after Twisted
     (http://trac.buildbot.net/wiki/CompatibilityPolicy#Python3)
[2]: Twisted is 60% of the way there (94/157 Python 3 tickets,
     https://twistedmatrix.com/trac/milestone/Python-3.x)

buildbot/Dockerfile.template

index b0e278b20aa677009af95ac1e2d2c17ca4992907..07dd6021899bf00e596d662992baa0cc8330bcf6 100644 (file)
@@ -26,10 +26,11 @@ FROM ${NAMESPACE}/gentoo-syslog:${TAG}
 MAINTAINER ${MAINTAINER}
 #VOLUME ["${PORTAGE}:/usr/portage:ro", "${PORTAGE}/distfiles:/usr/portage/distfiles:rw"]
 RUN echo 'USE="${USE} sqlite"' >> /etc/portage/make.conf
 MAINTAINER ${MAINTAINER}
 #VOLUME ["${PORTAGE}:/usr/portage:ro", "${PORTAGE}/distfiles:/usr/portage/distfiles:rw"]
 RUN echo 'USE="${USE} sqlite"' >> /etc/portage/make.conf
-RUN echo 'PYTHON_TARGETS="python2_7 python3_3"' >> /etc/portage/make.conf
-RUN echo 'PYTHON_SINGLE_TARGET="python3_3"' >> /etc/portage/make.conf
-RUN echo 'USE_PYTHON="2.7 3.3"' >> /etc/portage/make.conf
-RUN emerge -v1 --newuse dev-lang/python:2.7 dev-lang/python:3.3
+RUN sed -i 's/\(PYTHON_TARGETS\)=.*/\1="python2_7"/' /etc/portage/make.conf
+RUN sed -i 's/\(PYTHON_SINGLE_TARGET\)=.*/\1="python2_7"/' /etc/portage/make.conf
+RUN echo 'USE_PYTHON="2.7"' >> /etc/portage/make.conf
+RUN emerge -v --newuse --deep --with-bdeps=y @system @world
+RUN eselect python set $(eselect python show --python2)
 RUN emerge -v dev-util/buildbot dev-util/buildbot-slave
 RUN eselect news read new
 RUN rc-update add buildmaster default
 RUN emerge -v dev-util/buildbot dev-util/buildbot-slave
 RUN eselect news read new
 RUN rc-update add buildmaster default