- Timestamp:
- Nov 13, 2013, 2:26:58 PM (11 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 3 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r654 r655 1 2013-11-13 <rybkin@lal.in2p3.fr> 514 2 3 * source/cmt_use.cxx: In class Use get_strategy function, make use of now 4 fast get_project function rather than compute, in fill_standard_macros, 5 get_package_name, get_project functions, simplify code 6 * source/cmt_parser.cxx: In class Cmt install_scripts functions, make 7 generated setup and cleanup scrips call CMT executable directly rather than 8 via shell script wrapper 9 * src/setup.sh: Reduce usage of external shell utilities by using POSIX 10 shell features instead 11 * src/cleanup.sh: idem, unset everything set by setup.sh 12 * src/setup.csh: Reduce usage of external shell utilities by using C shell 13 features instead 14 * src/cleanup.csh: idem, unset everything set by setup.csh 15 * src/cleanup.tcsh: Add script to unset TCSH specific environment setup 16 * src/cleanup.zsh: Add script to unset Z shell specific environment setup 17 * src/cleanup.bash: Add script to unset BASH specific environment setup 18 1 19 2013-11-08 <rybkin@lal.in2p3.fr> 513 2 20 -
CMT/HEAD/source/cmt_parser.cxx
r654 r655 6262 6262 fprintf (f, "endif\n"); 6263 6263 fprintf (f, "source ${CMTROOT}/mgr/setup.csh\n"); 6264 fprintf (f, "set cmt%stempfile=`${CMTROOT}/ mgr/cmt-quiet build temporary_name`\n", mangled_package.c_str ());6264 fprintf (f, "set cmt%stempfile=`${CMTROOT}/${CMTBIN}/cmt.exe -quiet build temporary_name`\n", mangled_package.c_str ()); 6265 6265 fprintf (f, "if $status != 0 then\n set cmt%stempfile=/tmp/cmt.$$\nendif\n", mangled_package.c_str ()); 6266 //fprintf (f, "${CMTROOT}/mgr/cmt setup -%s " 6267 fprintf (f, "${CMTROOT}/mgr/cmt %s -%s " 6266 fprintf (f, "${CMTROOT}/${CMTBIN}/cmt.exe %s -%s " 6268 6267 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\n", 6269 6268 action.c_str (), … … 6276 6275 fprintf (f, 6277 6276 "if ( $status != 0 ) then\n" 6278 " echo \"${CMTROOT}/ mgr/cmt%s -%s "6277 " echo \"${CMTROOT}/${CMTBIN}/cmt.exe %s -%s " 6279 6278 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\"\n" 6280 6279 " set cmt%sstatus=2\n" … … 6322 6321 fprintf (f, "fi\n"); 6323 6322 fprintf (f, ". ${CMTROOT}/mgr/setup.sh\n"); 6324 fprintf (f, "cmt%stempfile=`${CMTROOT}/ mgr/cmt-quiet build temporary_name`\n", mangled_package.c_str ());6323 fprintf (f, "cmt%stempfile=`${CMTROOT}/${CMTBIN}/cmt.exe -quiet build temporary_name`\n", mangled_package.c_str ()); 6325 6324 fprintf (f, "if test ! $? = 0 ; then cmt%stempfile=/tmp/cmt.$$; fi\n", mangled_package.c_str ()); 6326 //fprintf (f, "${CMTROOT}/mgr/cmt setup -%s " 6327 fprintf (f, "${CMTROOT}/mgr/cmt %s -%s " 6325 fprintf (f, "${CMTROOT}/${CMTBIN}/cmt.exe %s -%s " 6328 6326 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\n", 6329 6327 action.c_str (), … … 6336 6334 fprintf (f, 6337 6335 "if test $? != 0 ; then\n" 6338 " echo >&2 \"${CMTROOT}/ mgr/cmt%s -%s "6336 " echo >&2 \"${CMTROOT}/${CMTBIN}/cmt.exe %s -%s " 6339 6337 "-pack=%s -version=%s -path=%s %s $* >${cmt%stempfile}\"\n" 6340 6338 " cmt%sstatus=2\n" … … 6370 6368 else if (mode[i] == Bat) 6371 6369 { 6372 //fprintf (f, "rem Setting %s %s in %%~d0%%~p0\n",6373 6370 fprintf (f, "rem %s %s %s in %%~d0%%~p0\n", 6374 6371 action.c_str (), -
CMT/HEAD/source/cmt_use.cxx
r652 r655 3653 3653 bool Use::get_strategy (const cmt_string& name) const 3654 3654 { 3655 const Project* p = 3655 const Project* p = get_project (); 3656 /* 3656 3657 Project::find_by_cmtpath (m_realpath.size () 3657 3658 ? Project::find_in_cmt_paths (m_realpath, true) 3658 3659 : Project::find_in_cmt_paths (real_path) 3659 3660 ); 3660 // const Project* p = Project::find_by_cmtpath (Project::find_in_cmt_paths (real_path));3661 */ 3661 3662 3662 3663 bool strategy; … … 3798 3799 buffer += "\n"; 3799 3800 3801 const Project* p = m_project 3802 ? m_project 3803 : Project::find_by_cmtpath (cmtpath) 3804 ; 3805 /* 3800 3806 const Project* p (m_project); 3801 3807 if (!p) 3802 3808 p = Project::find_by_cmtpath (cmtpath); 3809 */ 3803 3810 3804 3811 buffer += "macro "; … … 4556 4563 static const cmt_string null = ""; 4557 4564 4565 return m_package ? m_package->get_name () : null ; 4566 /* 4558 4567 Package* p = m_package; 4559 4568 if (p == 0) return (null); 4560 4569 4561 4570 return (p->get_name ()); 4571 */ 4562 4572 } 4563 4573 … … 5771 5781 return m_project; 5772 5782 5783 return Project::find_by_cmtpath (m_realpath.size () 5784 ? Project::find_in_cmt_paths (m_realpath, true) 5785 : Project::find_in_cmt_paths (real_path) 5786 ); 5787 /* 5773 5788 cmt_string cmtpath = m_realpath.size () 5774 5789 ? Project::find_in_cmt_paths (m_realpath, true) … … 5776 5791 ; 5777 5792 return Project::find_by_cmtpath (cmtpath); 5793 */ 5778 5794 /* 5779 5795 Project* p; -
CMT/HEAD/src/cleanup.csh
r11 r655 2 2 # Copyright Christian Arnault LAL-Orsay CNRS 3 3 # arnault@lal.in2p3.fr 4 # Modified by Grigory Rybkin 4 5 # See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 #----------------------------------------------------------- 6 7 7 set newpath= 8 unsetenv CMTBIN 9 unsetenv CMTCONFIG 8 10 9 foreach p ( `echo ${PATH} | sed 's#:# #g'` ) 10 echo ${p} | egrep '/CMT/' >& /dev/null 11 set s=${status} 12 if ( "${s}" != 0 ) then 13 if ( ${newpath} == "" ) then 14 set newpath=${p} 11 if ( $?CMTROOT == 1 ) then 12 if ( $?0 == 0 ) then 13 if ( $?tcsh == 1 ) then 14 source ${CMTROOT}/src/cleanup.tcsh 15 else if ( "${shell:t}" == "tcsh" ) then 16 source ${CMTROOT}/src/cleanup.tcsh 17 endif 18 endif 19 endif 20 21 unsetenv CMTROOT 22 23 # Remove CMT entries, if any 24 set newpath=() 25 foreach p (${path:q}) 26 if ( "${p}" !~ "*/CMT/*" ) then 27 if ( ${#newpath} != 0 ) then 28 set newpath=(${newpath:q} ${p:q}) 15 29 else 16 set newpath= ${newpath}:${p}30 set newpath=(${p:q}) 17 31 endif 18 32 endif 19 33 end 20 34 21 setenv PATH ${newpath} 22 unsetenv CMTCONFIG 23 unsetenv CMTROOT 35 set path=(${newpath:q}) 36 unset newpath 24 37 38 unalias cmt 39 40 if ( $?CLASSPATH == 1 ) then 41 if ( "${CLASSPATH}" =~ "*/CMT/*" ) then 42 # Remove CMT entries 43 set _p="${CLASSPATH}" 44 while ( "$_p" =~ "*:*" ) 45 set _p="${_p:s/:/ /}" 46 end 47 48 set newpath= 49 foreach p (${_p}) 50 if ( "${p}" !~ "*/CMT/*" ) then 51 if ( "${newpath}" != "" ) then 52 set newpath=${newpath}:${p} 53 else 54 set newpath=${p} 55 endif 56 endif 57 end 58 59 if ( "${newpath}" != "" ) then 60 setenv CLASSPATH ${newpath} 61 else 62 unsetenv CLASSPATH 63 endif 64 unset _p newpath 65 endif 66 endif 67 68 unalias jcmt 69 70 # Unset MAKEFLAGS, if looks set by CMT 71 if ( $?MAKEFLAGS == 1 ) then 72 if ( "$MAKEFLAGS" =~ "*QUICK=1" ) then 73 unsetenv MAKEFLAGS 74 endif 75 endif -
CMT/HEAD/src/cleanup.sh
r11 r655 2 2 # Copyright Christian Arnault LAL-Orsay CNRS 3 3 # arnault@lal.in2p3.fr 4 # Modified by Grigory Rybkin 4 5 # See the complete license in cmt_license.txt "http://www.cecill.info". 5 6 #----------------------------------------------------------- 6 7 7 newpath="" 8 for p in `echo ${PATH} | sed 's/:/ /g'`; do 9 if test ! "`echo ${p} | egrep CMT`" ; then 10 if test "${newpath}" = "" ; then 11 newpath=${p} 12 else 13 newpath=${newpath}:${p} 8 [ -z ${CMTBIN+CMT} ] || unset CMTBIN 9 [ -z ${CMTCONFIG+CMT} ] || unset CMTCONFIG 10 11 if [ "${CMTROOT+CMT}" = CMT ]; then 12 if [ -n "$-" ] && [ "${-#*i}" != "$-" ]; then 13 if [ -n "${ZSH_NAME-}" ]; then 14 . ${CMTROOT}/src/cleanup.zsh 15 elif [ -n "${BASH-}" ]; then 16 . ${CMTROOT}/src/cleanup.bash 17 fi 18 fi 19 fi 20 21 [ -z ${CMTROOT+CMT} ] || unset CMTROOT 22 23 cmt_clean_path() 24 { 25 # Remove CMT entries, if any 26 _np= 27 _p="$1" 28 while [ -n "$_p" ]; do 29 __p="${_p#:}" 30 while [ "$__p" != "$_p" ]; do 31 _p="${__p}" 32 __p="${_p#:}" 33 done 34 _e="${_p%%:*}" 35 _p="${_p#${_e}}" 36 if [ "${_e%/CMT/*}" = "${_e}" ] && [ -n "${_e}" ]; then 37 if [ -n "${_np}" ]; then 38 _np="${_np}:${_e}" 39 else 40 _np="${_e}" 41 fi 14 42 fi 43 done 44 echo "$_np" 45 unset _np _p __p _e 46 } 47 48 if [ "${PATH%/CMT/*}" != "${PATH}" ]; then 49 newpath=`cmt_clean_path "${PATH}"` 50 PATH=${newpath} 51 unset newpath 52 fi 53 54 if alias cmt >/dev/null 2>&1; then 55 unalias cmt 56 fi 57 58 if [ -n "${CLASSPATH-}" ]; then 59 if [ "${CLASSPATH%/CMT/*}" != "${CLASSPATH}" ]; then 60 newpath=`cmt_clean_path "${CLASSPATH}"` 61 if [ -n "${newpath}" ]; then 62 CLASSPATH=${newpath} 63 else 64 unset CLASSPATH 15 65 fi 16 done 66 unset newpath 67 fi 68 fi 17 69 18 PATH=${newpath}; export PATH 70 if alias jcmt >/dev/null 2>&1; then 71 unalias jcmt 72 fi 19 73 20 CMTCONFIG=; export CMTCONFIG 21 CMTROOT=; export CMTROOT 74 unset -f cmt_clean_path 75 76 # Unset MAKEFLAGS, if looks set by CMT 77 if [ "${MAKEFLAGS+CMT}" = CMT ]; then 78 if [ "${MAKEFLAGS%QUICK=1}" != "${MAKEFLAGS}" ]; then 79 unset MAKEFLAGS 80 fi 81 fi -
CMT/HEAD/src/setup.csh
r612 r655 6 6 #----------------------------------------------------------- 7 7 8 setenv CMTBIN `uname`-`uname -m | tr -d ' '` 8 # Remove spaces, if any 9 set _m="`uname -m`" 10 while ( "$_m" =~ "* *" ) 11 set _m="${_m:s/ //}" 12 end 13 setenv CMTBIN `uname`-"$_m" 14 unset _m 9 15 10 16 if ( $?CMTCONFIG == 0 ) then … … 15 21 if ( $?tcsh == 1 ) then 16 22 source ${CMTROOT}/src/setup.tcsh 17 else if ( `basename "$shell"`== "tcsh" ) then23 else if ( "${shell:t}" == "tcsh" ) then 18 24 source ${CMTROOT}/src/setup.tcsh 19 25 endif 20 26 endif 21 27 28 # Remove CMT entries, if any 22 29 set newpath=() 23 foreach p (${path })30 foreach p (${path:q}) 24 31 if ( "${p}" !~ "*/CMT/*" ) then 25 32 if ( ${#newpath} != 0 ) then 26 set newpath=(${newpath } ${p})33 set newpath=(${newpath:q} ${p:q}) 27 34 else 28 set newpath=(${p })35 set newpath=(${p:q}) 29 36 endif 30 37 endif 31 38 end 32 39 33 set path=(${newpath} "${CMTROOT}/${CMTBIN}") 40 set path=(${newpath:q} "${CMTROOT}/${CMTBIN}") 41 unset newpath 42 34 43 alias cmt '${CMTROOT}/${CMTBIN}/cmt.exe' 35 unset newpath36 44 37 45 if ( $?CLASSPATH == 0 ) then … … 42 50 setenv CLASSPATH ${CLASSPATH}:${CMTROOT}/java/cmt.jar 43 51 else 52 # Remove CMT entries 53 set _p="${CLASSPATH}" 54 while ( "$_p" =~ "*:*" ) 55 set _p="${_p:s/:/ /}" 56 end 57 44 58 set newpath= 45 foreach p ( `echo ${CLASSPATH} | tr ':' ' '`)59 foreach p (${_p}) 46 60 if ( "${p}" !~ "*/CMT/*" ) then 47 61 if ( "${newpath}" != "" ) then … … 58 72 setenv CLASSPATH ${CMTROOT}/java/cmt.jar 59 73 endif 60 unset newpath74 unset _p newpath 61 75 endif 62 76 -
CMT/HEAD/src/setup.sh
r611 r655 6 6 #----------------------------------------------------------- 7 7 8 CMTBIN=`uname`-`uname -m | tr -d ' '`; export CMTBIN 8 # Remove spaces, if any 9 _m="`uname -m`" 10 _nm= 11 while [ -n "$_m" ]; do 12 _t="${_m#?}" 13 _a="${_m%${_t}}" 14 if [ "${_a}" != " " ]; then 15 _nm="${_nm}${_a}" 16 fi 17 _m="$_t" 18 done 19 CMTBIN=`uname`-"$_nm"; export CMTBIN 20 unset _m _nm _t _a 9 21 10 22 if test "${CMTCONFIG}" = "" ; then … … 20 32 fi 21 33 34 cmt_clean_path() 35 { 36 # Remove CMT entries, if any 37 _np= 38 _p="$1" 39 while [ -n "$_p" ]; do 40 __p="${_p#:}" 41 while [ "$__p" != "$_p" ]; do 42 _p="${__p}" 43 __p="${_p#:}" 44 done 45 _e="${_p%%:*}" 46 _p="${_p#${_e}}" 47 if [ "${_e%/CMT/*}" = "${_e}" ] && [ -n "${_e}" ]; then 48 if [ -n "${_np}" ]; then 49 _np="${_np}:${_e}" 50 else 51 _np="${_e}" 52 fi 53 fi 54 done 55 echo "$_np" 56 unset _np _p __p _e 57 } 58 22 59 if [ "${PATH%/CMT/*}" = "${PATH}" ]; then 23 60 PATH=${PATH}:${CMTROOT}/${CMTBIN}; export PATH 24 61 else 25 newpath= 26 for p in `echo ${PATH} | tr ':' ' '`; do 27 if [ "${p%/CMT/*}" = "${p}" ]; then 28 if [ -n "${newpath}" ]; then 29 newpath=${newpath}:${p} 30 else 31 newpath=${p} 32 fi 33 fi 34 done 35 62 newpath=`cmt_clean_path "${PATH}"` 36 63 PATH=${newpath}:${CMTROOT}/${CMTBIN}; export PATH 37 64 unset newpath 38 65 fi 39 66 40 alias cmt='${CMTROOT}/${CMTBIN}/cmt.exe' ; export cmt67 alias cmt='${CMTROOT}/${CMTBIN}/cmt.exe' 41 68 42 69 if [ -z "${CLASSPATH-}" ]; then … … 45 72 CLASSPATH=${CLASSPATH}:${CMTROOT}/java/cmt.jar; export CLASSPATH 46 73 else 47 newpath= 48 for p in `echo ${CLASSPATH-} | tr ':' ' '`; do 49 if [ "${p%/CMT/*}" = "${p}" ]; then 50 if [ -n "${newpath}" ]; then 51 newpath=${newpath}:${p} 52 else 53 newpath=${p} 54 fi 55 fi 56 done 57 74 newpath=`cmt_clean_path "${CLASSPATH}"` 58 75 if [ -n "${newpath}" ]; then 59 76 CLASSPATH=${newpath}:${CMTROOT}/java/cmt.jar; export CLASSPATH … … 64 81 fi 65 82 66 alias jcmt='(java cmt_parser)'; export jcmt 83 alias jcmt='(java cmt_parser)' 84 85 unset -f cmt_clean_path 67 86 68 87 # Set MAKEFLAGS, if unset (similar to NPROC with Plan 9 mk utility)
Note: See TracChangeset
for help on using the changeset viewer.