- Timestamp:
- Jan 14, 2008, 6:18:51 PM (17 years ago)
- Location:
- CMT/HEAD
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
CMT/HEAD/ChangeLog
r431 r432 1 2008-01-14 <rybkin@lal.in2p3.fr> 338 2 3 * mgr/cmt_dcc_version.sh: Optimise by reducing the number of processes 4 making use of sed 5 * mgr/cmt_gcc_version.sh: idem 6 * mgr/cmt_filter_version.sh: idem 7 * mgr/cmt_filter3_version.sh: idem 8 * mgr/cmt_linux_version.sh: Optimise by reducing the number of processes 9 making use of sed and the POSIX shell features (patch from KELEMEN Peter) 10 1 11 2008-01-14 <rybkin@lal.in2p3.fr> 337 2 12 -
CMT/HEAD/mgr/cmt_dcc_version.sh
r28 r432 1 1 2 2 cc -v 2>&1 |\ 3 grep version |\ 4 cut -d ' ' -f3 |\ 5 sed -e 's#^[0-9]#gcc-&#' 6 7 3 sed -n '/version/s#^[^ ]* [^ ]* \([0-9][^ ]*\) *.*#gcc-\1#p' -
CMT/HEAD/mgr/cmt_filter3_version.sh
r27 r432 10 10 # 11 11 # Output format 12 # <some letters><field1><field2> 12 # <some letters><field1><field2><field3> 13 13 # 14 14 # o only the first two numeric fields are kept … … 17 17 #-------------------------------------------------- 18 18 19 read value 20 21 c=`echo $value | sed -e 's#[-.0-9]##g'` 22 v=`echo $value | \ 23 sed -e 's#[^-.0-9]##g' -e 's#^[^0-9]##' -e 's#[-]#.#g' | \ 24 cut -d '.' -f1-3 | \ 25 sed -e 's#[-.]##g'` 26 27 echo ${c}${v} 28 19 exec sed -n ' 20 h 21 s#[-.0-9]##g 22 x 23 s#[^-.0-9]##g 24 s#^[^0-9]## 25 y#-.# # 26 s#^\([0-9]*\) *\([0-9]*\) *\([0-9]*\) *.*#\1\2\3# 27 G 28 s#\(.*\)\n\(.*\)#\2\1#p 29 ' -
CMT/HEAD/mgr/cmt_filter_version.sh
r27 r432 17 17 #-------------------------------------------------- 18 18 19 read value 20 21 c=`echo $value | sed -e 's#[-.0-9]##g'` 22 v=`echo $value | \ 23 sed -e 's#[^-.0-9]##g' -e 's#^[^0-9]##' -e 's#[-]#.#g' | \ 24 cut -d '.' -f1,2 | \ 25 sed -e 's#[-.]##g'` 26 27 echo ${c}${v} 28 19 exec sed -n ' 20 h 21 s#[-.0-9]##g 22 x 23 s#[^-.0-9]##g 24 s#^[^0-9]## 25 y#-.# # 26 s#^\([0-9]*\) *\([0-9]*\) *.*#\1\2# 27 G 28 s#\(.*\)\n\(.*\)#\2\1#p 29 ' -
CMT/HEAD/mgr/cmt_gcc_version.sh
r27 r432 1 1 2 2 gcc -v 2>&1 |\ 3 grep version |\ 4 cut -d ' ' -f3 |\ 5 sed -e 's#^[0-9]#gcc-&#' 6 3 sed -n '/version/s#^[^ ]* [^ ]* \([0-9][^ ]*\) *.*#gcc-\1#p' -
CMT/HEAD/mgr/cmt_linux_version.sh
r27 r432 5 5 # Check for GNU/Linux distributions 6 6 if [ -f /etc/SuSE-release ]; then 7 DISTRIBUTION="suse" 7 DISTRIBUTION="suse" 8 VERSION=`sed -n '/VERSION/{s#[^0-9]##gp;q}' /etc/SuSE-release` 8 9 elif [ -f /etc/UnitedLinux-release ]; then 9 DISTRIBUTION="united" 10 DISTRIBUTION="united" 11 VERSION=`cat /etc/UnitedLinux-release` 10 12 elif [ -f /etc/debian_version ]; then 11 DISTRIBUTION="debian" 12 elif [ -f /etc/redhat-release ]; then 13 a=`grep -i 'red.*hat.*enterprise.*linux' /etc/redhat-release` 14 if test $? = 0; then 15 DISTRIBUTION=rhel 16 else 17 a=`grep -i 'red.*hat.*linux' /etc/redhat-release` 18 if test $? = 0; then 19 DISTRIBUTION=rh 20 else 21 a=`grep -i 'cern.*e.*linux' /etc/redhat-release` 22 if test $? = 0; then 23 DISTRIBUTION=cel 24 else 25 a=`grep -i 'scientific.*linux' /etc/redhat-release` 26 DISTRIBUTION="slc" 27 fi 28 fi 29 fi 30 else 31 DISTRIBUTION="unknown" 32 fi 33 34 ### VERSION=`rpm -q redhat-release | sed -e 's#redhat[-]release[-]##'` 35 36 case ${DISTRIBUTION} in 37 rh|cel|rhel|slc) 38 VERSION=`cat /etc/redhat-release | sed -e 's#[^0-9]##g' -e 's#7[0-2]#73#'` 39 ;; 40 debian) 13 DISTRIBUTION="debian" 41 14 VERSION=`cat /etc/debian_version` 42 15 if [ ${VERSION} = "testing/unstable" ]; then … … 46 19 VERSION="" 47 20 fi 48 ;; 49 suse) 50 VERSION=`cat /etc/SuSE-release | grep 'VERSION' | sed -e 's#[^0-9]##g'` 51 ;; 52 united) 53 VERSION=`cat /etc/UnitedLinux-release` 54 ;; 55 *) 21 elif [ -f /etc/redhat-release ]; then 22 read a </etc/redhat-release 23 case "$a" in 24 Red*Hat*Enterprise*Linux*) 25 DISTRIBUTION=rhel 26 ;; 27 Red*Hat*Linux*) 28 DISTRIBUTION=rh 29 ;; 30 CERN*E*Linux*) 31 DISTRIBUTION=cel 32 ;; 33 Scientific*Linux*) 34 DISTRIBUTION=slc 35 ;; 36 # Scientific*Linux*CERN*) 37 *) 38 DISTRIBUTION=slc 39 ;; 40 esac 41 VERSION="" 42 while [ -n "$a" ]; do 43 t="${a#?}" # all but first char of $a 44 c=${a%"${t}"} # first char of $a 45 a="${t}" # remove first char from $a 46 case "$c" in 47 [0-9]) 48 VERSION="${VERSION}${c}" 49 ;; 50 esac 51 done 52 case "$VERSION" in 53 70|71|72) 54 VERSION=73 55 ;; 56 esac 57 else 58 DISTRIBUTION="unknown" 56 59 VERSION='00' 57 ;; 58 esac; 60 fi 59 61 60 62 echo ${DISTRIBUTION}${VERSION}
Note: See TracChangeset
for help on using the changeset viewer.