diff options
Diffstat (limited to 'meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch')
-rw-r--r-- | meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch b/meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch index c03bccd3da..43994e0cac 100644 --- a/meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch +++ b/meta-openembedded/meta-multimedia/recipes-multimedia/mycroft/files/0001-Remove-python-venv.patch @@ -1,4 +1,4 @@ -From 6272f36080bd440a5825b526f4c06223c5bb9fbb Mon Sep 17 00:00:00 2001 +From 07fce2101d83b5334de78e661ba0361c2874ebdf Mon Sep 17 00:00:00 2001 From: Alistair Francis <alistair.francis@wdc.com> Date: Mon, 18 Mar 2019 16:30:45 -0700 Subject: [PATCH 1/5] Remove python venv @@ -9,75 +9,77 @@ python and pip pacakges. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Upstream-Status: Inappropriate [embedded specific] --- - dev_setup.sh | 36 ------------------------------------ + dev_setup.sh | 39 --------------------------------------- start-mycroft.sh | 13 ------------- venv-activate.sh | 44 +------------------------------------------- - 3 files changed, 1 insertion(+), 92 deletions(-) + 3 files changed, 1 insertion(+), 95 deletions(-) diff --git a/dev_setup.sh b/dev_setup.sh -index e0b07bf25cf..aed54b2167a 100755 +index cf81ed25f0f..99a44bfd8a7 100755 --- a/dev_setup.sh +++ b/dev_setup.sh -@@ -310,18 +310,6 @@ function install_deps() { +@@ -338,18 +338,6 @@ ${YELLOW}Make sure to manually install:$BLUE git python3 python-setuptools pytho fi } -VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${TOP}/.venv"} - -function install_venv() { -- ${opt_python} -m venv "${VIRTUALENV_ROOT}/" --without-pip +- $opt_python -m venv "${VIRTUALENV_ROOT}/" --without-pip - # Force version of pip for reproducability, but there is nothing special - # about this version. Update whenever a new version is released and - # verified functional. - curl https://bootstrap.pypa.io/3.3/get-pip.py | "${VIRTUALENV_ROOT}/bin/python" - 'pip==18.0.0' - # Function status depending on if pip exists -- [ -x "${VIRTUALENV_ROOT}/bin/pip" ] +- [[ -x ${VIRTUALENV_ROOT}/bin/pip ]] -} - install_deps # Configure to use the standard commit template for -@@ -355,15 +343,7 @@ else +@@ -383,17 +371,6 @@ else fi fi --if [ ! -x "${VIRTUALENV_ROOT}/bin/activate" ] ; then +-if [[ ! -x ${VIRTUALENV_ROOT}/bin/activate ]] ; then - if ! install_venv ; then -- echo "Failed to set up virtualenv for mycroft, exiting setup." +- echo 'Failed to set up virtualenv for mycroft, exiting setup.' - exit 1 - fi -fi - - # Start the virtual environment +-# Start the virtual environment -source "${VIRTUALENV_ROOT}/bin/activate" - cd "${TOP}" - +-cd "$TOP" +- # Install pep8 pre-commit hook -@@ -380,22 +360,6 @@ fi + HOOK_FILE='./.git/hooks/pre-commit' + if [[ -n $INSTALL_PRECOMMIT_HOOK ]] || grep -q 'MYCROFT DEV SETUP' $HOOK_FILE; then +@@ -408,22 +385,6 @@ fi - PYTHON=$( python -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))" ) + PYTHON=$(python -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))") -# Add mycroft-core to the virtualenv path -# (This is equivalent to typing 'add2virtualenv $TOP', except -# you can't invoke that shell function from inside a script) -VENV_PATH_FILE="${VIRTUALENV_ROOT}/lib/$PYTHON/site-packages/_virtualenv_path_extensions.pth" --if [ ! -f "$VENV_PATH_FILE" ] ; then -- echo "import sys; sys.__plen = len(sys.path)" > "$VENV_PATH_FILE" || return 1 +-if [[ ! -f $VENV_PATH_FILE ]] ; then +- echo 'import sys; sys.__plen = len(sys.path)' > "$VENV_PATH_FILE" || return 1 - echo "import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)" >> "$VENV_PATH_FILE" || return 1 -fi - -if ! grep -q "$TOP" $VENV_PATH_FILE ; then -- echo "Adding mycroft-core to virtualenv path" +- echo 'Adding mycroft-core to virtualenv path' - sed -i.tmp '1 a\ -'"$TOP"' --' "${VENV_PATH_FILE}" +-' "$VENV_PATH_FILE" -fi - # install required python modules if ! pip install -r requirements.txt ; then - echo "Warning: Failed to install all requirements. Continue? y/N" + echo 'Warning: Failed to install all requirements. Continue? y/N' diff --git a/start-mycroft.sh b/start-mycroft.sh -index b9514a61ba5..64e0216a62f 100755 +index 0f88430982e..3aed2f189d4 100755 --- a/start-mycroft.sh +++ b/start-mycroft.sh @@ -20,7 +20,6 @@ script=${0} @@ -130,7 +132,7 @@ index b9514a61ba5..64e0216a62f 100755 "sdkdoc") - source-venv cd doc - make ${opt} + make ${_params} cd .. diff --git a/venv-activate.sh b/venv-activate.sh index d1e7bcb44e7..10b46d4de3b 100644 @@ -188,5 +190,5 @@ index d1e7bcb44e7..10b46d4de3b 100644 main $@ -- -2.21.0 +2.23.0 |