From b376948ccd59aa02022123102eaae359a536e4e6 Mon Sep 17 00:00:00 2001 From: antialias Date: Thu, 31 Jan 2013 16:37:50 -0500 Subject: fixed error on create pre-existing symlink (1509). --- pkg/postmkvenv.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/postmkvenv.sh') diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh index 593b11da..a503052a 100755 --- a/pkg/postmkvenv.sh +++ b/pkg/postmkvenv.sh @@ -34,5 +34,7 @@ fi for LIB in ${LIBS[@]} do - ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB + if [[ ! -e $LIB_VIRTUALENV_PATH/$LIB ]]; then + ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB + fi done -- cgit v1.2.3 From 5ff29dc57e2877a14e705d09b7042cddf4165d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 6 Mar 2013 15:27:23 -0300 Subject: Remove everything to start from scratch --- pkg/postmkvenv.sh | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100755 pkg/postmkvenv.sh (limited to 'pkg/postmkvenv.sh') diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh deleted file mode 100755 index a503052a..00000000 --- a/pkg/postmkvenv.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# This hook is run after a new virtualenv is activated. -# ~/.virtualenvs/postmkvirtualenv -# tested and working in debian - -# Symlinks PyQt4 from global installation into virtualenv site-packages -# XXX TODO: -# script fails in ubuntu, with path: /usr/lib/pymodules/python2.7/PyQt4 -# use import PyQt4; PyQt4.__path__ instead - -platform='unknown' -unamestr=`uname` -if [[ "$unamestr" == 'Linux' ]]; then - platform='linux' -elif [[ "$unamestr" == 'Darwin' ]]; then - platform='darwin' -fi - -LIBS=( PyQt4 sip.so ) - -PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") -VAR=( $(which -a $PYTHON_VERSION) ) - -GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" -LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") - -if [[ $platform == 'linux' ]]; then - LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD") -elif [[ $platform == 'darwin' ]]; then - LIB_SYSTEM_PATH=$(/opt/local/bin/python2.6 -c "$GET_PYTHON_LIB_CMD") -else - echo "unsupported platform; not doing symlinks" -fi - -for LIB in ${LIBS[@]} -do - if [[ ! -e $LIB_VIRTUALENV_PATH/$LIB ]]; then - ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB - fi -done -- cgit v1.2.3 From 99e644bf4d941dfa430d21dba9ac99f138f5f7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 11 Mar 2013 13:58:47 -0300 Subject: Add postmkvenv script with PySide --- pkg/postmkvenv.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 pkg/postmkvenv.sh (limited to 'pkg/postmkvenv.sh') diff --git a/pkg/postmkvenv.sh b/pkg/postmkvenv.sh new file mode 100755 index 00000000..2f0cba45 --- /dev/null +++ b/pkg/postmkvenv.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# This hook is run after a new virtualenv is activated. +# ~/.virtualenvs/postmkvirtualenv +# tested and working in debian + +# Symlinks PyQt4 from global installation into virtualenv site-packages +# XXX TODO: +# script fails in ubuntu, with path: /usr/lib/pymodules/python2.7/PyQt4 +# use import PyQt4; PyQt4.__path__ instead + +platform='unknown' +unamestr=$(uname) +if [[ "$unamestr" == 'Linux' ]]; then + platform='linux' +elif [[ "$unamestr" == 'Darwin' ]]; then + platform='darwin' +fi + +LIBS=( PySide ) + +PYTHON_VERSION=python$(python -c "import sys; print (str(sys.version_info[0])+'.'+str(sys.version_info[1]))") +VAR=( $(which -a $PYTHON_VERSION) ) + +GET_PYTHON_LIB_CMD="from distutils.sysconfig import get_python_lib; print (get_python_lib())" +LIB_VIRTUALENV_PATH=$(python -c "$GET_PYTHON_LIB_CMD") + +if [[ $platform == 'linux' ]]; then + LIB_SYSTEM_PATH=$(${VAR[-1]} -c "$GET_PYTHON_LIB_CMD") +elif [[ $platform == 'darwin' ]]; then + LIB_SYSTEM_PATH=$(/opt/local/bin/python2.6 -c "$GET_PYTHON_LIB_CMD") +else + echo "unsupported platform; not doing symlinks" +fi + +for LIB in ${LIBS[@]} +do + if [[ ! -e $LIB_VIRTUALENV_PATH/$LIB ]]; then + ln -s $LIB_SYSTEM_PATH/$LIB $LIB_VIRTUALENV_PATH/$LIB + fi +done -- cgit v1.2.3