-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from antjost/patch-6
Create moveDist
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#! /bin/sh | ||
# moveDist <dir> | ||
# moveDist <module> <dir> | ||
# recopie le module dans un nouveau directory d'installation | ||
# ex: moveDist Transform /home/benoit/Cassiopee/Dist/bin/x86_r8 | ||
|
||
if [ "$CASSIOPEE" = "" ]; then | ||
echo "You must specify a CASSIOPEE variable in your environment." | ||
echo "This variable specifies the installation path of *Cassiopee*." | ||
exit | ||
fi | ||
if [ "$ELSAPROD" = "" ]; then | ||
echo "You must specify a ELSAPROD in your environment." | ||
echo "This variable identifies the processor type." | ||
exit | ||
fi | ||
|
||
if [ "$PYTHONEXE" = "python3" ]; then | ||
pyversion="python"`python3 -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"` | ||
alias python=python3 | ||
else | ||
pyversion="python"`python -c "import sys; print('.'.join(str(n) for n in sys.version_info[:2]))"` | ||
fi | ||
|
||
if ([ $# -eq 0 ]); then | ||
echo "moveDist <dir>" | ||
echo "moveDist /tmp/Cassiopee/Dist/bin/x86_r8" | ||
echo "Recopie le Dist dans <dir>" | ||
echo "moveDist <module> <dir>" | ||
echo "ex: moveDist Transform /tmp/Cassiopee/Dist/bin/x86_r8" | ||
echo "Recopie le Dist du module dans <dir>/lib/$pyversion/site-packages" | ||
fi | ||
|
||
# push module a la position dir | ||
if [ $# -eq 2 ]; then | ||
module=$1 | ||
path=$2 | ||
mkdir -p $path | ||
|
||
here=`pwd` | ||
cd "$CASSIOPEE/Dist/bin/$ELSAPROD/lib/$pyversion/site-packages" | ||
tar cvf $module.tar $module | ||
mv $module.tar $path | ||
cd $path | ||
mkdir -p lib/$pyversion/site-packages | ||
if [ -L lib64 ]; then | ||
rm lib64 | ||
ln -s lib lib64 | ||
else | ||
ln -s lib lib64 | ||
fi | ||
mv $module.tar lib/$pyversion/site-packages | ||
cd lib/$pyversion/site-packages | ||
tar xvf $module.tar | ||
rm $module.tar | ||
cd $here | ||
fi | ||
|
||
# push all modules a la position dir | ||
if [ $# -eq 1 ]; then | ||
path=$1 | ||
mkdir -p $path | ||
here=`pwd` | ||
cd "$CASSIOPEE/Dist/bin/$ELSAPROD" | ||
tar cvf all.tar . | ||
mv all.tar $path | ||
cd $path | ||
tar xvf all.tar | ||
rm all.tar | ||
if [ -L lib64 ]; then | ||
rm lib64 | ||
ln -s lib lib64 | ||
else | ||
ln -s lib lib64 | ||
fi | ||
# Change installPath | ||
cd lib/$pyversion/site-packages | ||
cd KCore | ||
cp "$CASSIOPEE/Dist/bin/$ELSAPROD/lib/$pyversion/site-packages/KCore/installPath.py" . | ||
|
||
cp installPath.py installPath_old.py | ||
dirname=$(dirname $(dirname $(dirname $path))) | ||
s1=$(sed 's/[\/&]/\\&/g' <<< $CASSIOPEE) | ||
s2=$(sed 's/[\/&]/\\&/g' <<< $dirname) | ||
# Remplace $CASSIOPEE par $dirname | ||
sed -i "s/$s1/$s2/g" installPath.py | ||
more installPath.py | ||
cd $here | ||
fi |