| | 497 | An easy way to do this, from the '''opt''' folder containing '''dybinst''' : |
| | 498 | |
| | 499 | {{{ |
| | 500 | [blyth@belle7 opt]$ . installation/trunk/dybinst/scripts/dybinst-common.sh ## source bash funcs |
| | 501 | [blyth@belle7 opt]$ type opt-by-default- ## check what the func is going to do |
| | 502 | opt-by-default- is a function |
| | 503 | opt-by-default- () |
| | 504 | { |
| | 505 | local msg="=== $FUNCNAME :"; |
| | 506 | local req=${1:-.}/NuWa-trunk/setup/default/cmt/requirements; |
| | 507 | [ ! -f "$req" ] && echo $msg ABORT cannot find req $req && return 0; |
| | 508 | local add="macro host-optdbg 'opt'"; |
| | 509 | echo $msg insert \"$add\" into $req; |
| | 510 | perl -pi -e 'BEGIN{ undef $/ ; }' -e "s,(^use LCG_Settings v\*\n)(^set CMTCONFIG .*\$),\$1$add\n\$2,msg" $req |
| | 511 | } |
| | 512 | |
| | 513 | [blyth@belle7 opt]$ opt-by-default- ## run the func |
| | 514 | === opt-by-default- : insert "macro host-optdbg 'opt'" into ./NuWa-trunk/setup/default/cmt/requirements |
| | 515 | |
| | 516 | [blyth@belle7 opt]$ cat ./NuWa-trunk/setup/default/cmt/requirements ## check |
| | 517 | package default |
| | 518 | version v0 |
| | 519 | use LCG_Settings v* |
| | 520 | macro host-optdbg 'opt' |
| | 521 | set CMTCONFIG ${host-cmtconfig} |
| | 522 | |
| | 523 | }}} |
| | 524 | |
| | 525 | |
| | 526 | |