From 6304adc473dc169229ee2dafbea854fa7fd255a7 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Wed, 20 Oct 2010 13:40:33 -0700 Subject: [PATCH] Setup python symlinks for python on stateful partition. Change-Id: Ifbfbd3b55ae97ea94ea5bba40a001c6a1ddbf7a0 BUG=720 TEST=Ran suite_Smoke in a VM and ran python from command line and checked to see if I could import packages from /usr/local/site-packages. Review URL: http://codereview.chromium.org/3972001 --- build_image | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build_image b/build_image index 3b3f061df6..0865243b0a 100755 --- a/build_image +++ b/build_image @@ -427,6 +427,18 @@ update_dev_packages() { ${ROOT_FS_DIR}/usr/local/lib/python2.6/site-packages/pygtk.pth" fi + # If python is installed on stateful-dev, fix python symlinks. + local python_path="/usr/local/bin/python2.6" + if [ -e "${ROOT_FS_DIR}${python_path}" ]; then + info "Fixing python symlinks for developer and test images." + local python_paths="/usr/bin/python /usr/local/bin/python \ + /usr/bin/python2 /usr/local/bin/python2" + for path in ${python_paths}; do + sudo rm -f "${ROOT_FS_DIR}${path}" + sudo ln -s ${python_path} "${ROOT_FS_DIR}${path}" + done + fi + # Check that the image has been correctly created. Only do it if not # building a factory install image and not a dev install shim, as the # INSTALL_MASK for it will make test_image fail.