mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 14:11:07 +02:00
Rather than having to find /home/${SUDO_USER:-${USER}}/trunk, instead just look for /mnt/host/trunk (defined by common.sh as $CHROOT_TRUNK_DIR). This simplifies code flow, and is a requirement for shoving chromite into PYTHONPATH globally w/in the chroot. BUG=chromium-os:37347 TEST=cros_sdk --replace; cros_sdk w/ chroot upgrade. Change-Id: I9ee3e6556541a91193f49cbf74ffc5a8e090537f Reviewed-on: https://gerrit.chromium.org/gerrit/39921 Tested-by: Brian Harring <ferringb@chromium.org> Reviewed-by: David James <davidjames@chromium.org>
14 lines
583 B
Plaintext
14 lines
583 B
Plaintext
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
python_path=$(python -c 'import sys;print sys.version[:3]')
|
|
python_path="/usr/lib/python${python_path}/site-packages/chromite"
|
|
if [ ! -L "${python_path}" ]; then
|
|
sudo rm -rf "${python_path}" \
|
|
"/home/${PORTAGE_USERNAME:-${SUDO_USER:-${USER}}}/.local/lib/python2.6/site-packages/chromite"
|
|
sudo mkdir -p "$(dirname "${python_path}")"
|
|
sudo ln -s "${CHROOT_TRUNK_DIR}"/chromite "${python_path}"
|
|
fi
|
|
|
|
exit 0
|