File indexing completed on 2024-04-06 12:31:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156 APPNAME=
0157 APPVERSION=
0158 DIST=
0159 DIST_SRC=
0160 RESCALE=
0161 EXTERNALS_DIAGRAMS=
0162 PACKAGES_DIAGRAMS=
0163 SUBSYS_DIAGRAMS=
0164 OS_DIAGRAMS=
0165 P_DIAGRAMS=
0166 PS_DIAGRAMS=
0167 DS_DIAGRAMS=
0168 DIAGRAM_GROUPS=
0169 DIAGRAM_NGROUPS=
0170 DIAGRAM_NGROUPS_NAME=
0171 MAXSIZE=1600
0172 CONFDIR=
0173 SKIP_ANALYSIS=
0174 TIMINGS=
0175 FORCE_ANA=
0176 MAXJOBS=10
0177 ALL_SUBSYSTEM=
0178 ALL_BUILDSYS_BASE_PROJECTS="SEAL POOL PI CORAL IGNOMINY IGUANA COBRA ORCA OSCAR IGUANACMS Geometry CMSSW"
0179 ALL_SUB_SYSTEM=
0180 BUILDSYSTEM="SCRAM"
0181 BUILDSYSTEM_ARCH=
0182 DEPS_ARCH=
0183 DEPS_DOC_RELDIR=
0184 SEARCHPATH_SCRIPT=
0185 SETENV_SCRIPT=
0186 IGNOMINYCONF_SCRIPT=
0187 IGNOMINY_ONLY=
0188 EXTRA_OPTIONS=
0189 KEEP_PS=
0190 me=`ls -l $0 | sed 's|.* ||'`
0191 case $me in /* ) ;; * ) me=$PWD/$me ;; esac
0192 medir=`dirname $me`
0193
0194
0195
0196
0197
0198 parseargs() {
0199 while [ $
0200 arg=$1; shift
0201 case $arg in
0202 -* )
0203 case $arg in
0204 -A | --allsubsys ) ALL_SUBSYSTEM=yes ;;
0205 -f | --force ) FORCE_ANA=yes ;;
0206 -r | --rescale ) RESCALE=yes ;;
0207 -e | --external ) EXTERNALS_DIAGRAMS=yes ;;
0208 -p | --package ) PACKAGES_DIAGRAMS=yes ;;
0209 -s | --subsys ) SUBSYS_DIAGRAMS=yes ;;
0210 --keep-ps ) KEEP_PS=yes ;;
0211 -d | --diagrams | --diagrams=* )
0212 case $arg in
0213 --diagrams=* )
0214 value=`echo $arg | sed 's|--diagrams=||'`
0215 arg="--diagrams"
0216 ;;
0217 * ) value=$1; shift ;;
0218 esac
0219 for t in `echo $value | tr ',' ' '`; do
0220 case $t in
0221 os|so ) OS_DIAGRAMS=yes; EXTRA_OPTIONS="$EXTRA_OPTIONS -d os" ;;
0222 p ) P_DIAGRAMS=yes; EXTRA_OPTIONS="$EXTRA_OPTIONS -d p" ;;
0223 ps|sp ) PS_DIAGRAMS=yes; EXTRA_OPTIONS="$EXTRA_OPTIONS -d ps" ;;
0224 ds|sd ) DS_DIAGRAMS=yes; EXTRA_OPTIONS="$EXTRA_OPTIONS -d ds" ;;
0225 * )
0226 echo "Wrong type \"$t\" with command-line argument \"$arg\". Valid types are os, p, ps and ds" 1>&2
0227 echo "Use -u option to get the usage." 1>&2
0228 exit 1
0229 ;;
0230 esac
0231 done
0232 ;;
0233 -a | --all )
0234 RESCALE=yes
0235 MAKESTATS=yes
0236 EXTERNALS_DIAGRAMS=yes
0237 PACKAGES_DIAGRAMS=yes
0238 SUBSYS_DIAGRAMS=yes
0239 OS_DIAGRAMS=yes
0240 P_DIAGRAMS=yes
0241 PS_DIAGRAMS=yes
0242 DS_DIAGRAMS=yes
0243 ;;
0244 -n | --noanalysis ) SKIP_ANALYSIS=yes ;;
0245 -i | --ignominy ) IGNOMINY_ONLY="-i" ;;
0246 -t | --time ) TIMINGS=yes ;;
0247 -j | --jobs | --jobs=* )
0248 case $arg in
0249 --jobs=* )
0250 value=`echo $arg | sed 's|--jobs=||'`
0251 arg="--jobs"
0252 ;;
0253 * ) value=$1; shift ;;
0254 esac
0255 MAXJOBS=`echo $value | tr -d '[0-9]'`
0256 if [ X"$MAXJOBS" != X ]; then
0257 echo "Wrong number of jobs \"$value\" given with \"$arg\" option. Use -u option to get the usage." 1>&2
0258 exit 1
0259 fi
0260 MAXJOBS=$value
0261 ;;
0262 -S | --size | --size=* )
0263 case $arg in
0264 --size=* )
0265 value=`echo $arg | sed 's|--size=||'`
0266 arg="--size"
0267 ;;
0268 * ) value=$1; shift ;;
0269 esac
0270 MAXSIZE=`echo $value | tr -d '[0-9]'`
0271 if [ X"$MAXSIZE" != X ]; then
0272 echo "Wrong max size \"$value\" of gif file given with \"$arg\" option. Use -u option to get the usage." 1>&2
0273 exit 1
0274 fi
0275 MAXSIZE=$value
0276 ;;
0277 -b | --buildsys | --buildsys=* )
0278 case $arg in
0279 --buildsys=* )
0280 value=`echo $arg | sed 's|--buildsys=||'`
0281 arg="--buildsys"
0282 ;;
0283 * ) value=$1; shift ;;
0284 esac
0285 BUILDSYSTEM=$value
0286 ;;
0287 -P | --project | --project=* )
0288 case $arg in
0289 --project=* )
0290 value=`echo $arg | sed 's|--project=||'`
0291 arg="--project"
0292 ;;
0293 * ) value=$1; shift ;;
0294 esac
0295 APPNAME=$value
0296 ;;
0297 -V | --version | --version=* )
0298 case $arg in
0299 --version=* )
0300 value=`echo $arg | sed 's|--version=||'`
0301 arg="--version"
0302 ;;
0303 * ) value=$1; shift ;;
0304 esac
0305 APPVERSION=$value
0306 ;;
0307 -g | --group | --group=* )
0308 case $arg in
0309 --group=* )
0310 value=`echo $arg | sed 's|--group=||'`
0311 arg="--group"
0312 ;;
0313 * ) value=$1; shift ;;
0314 esac
0315 for v in `echo $value | tr ',' ' '`; do
0316 if [ X$v = Xall ] ; then
0317 v="$ALL_BUILDSYS_BASE_PROJECTS"
0318 fi
0319 if [ X"$DIAGRAM_GROUPS" = X ] ; then
0320 DIAGRAM_GROUPS="$v"
0321 else
0322 DIAGRAM_GROUPS="$DIAGRAM_GROUPS $v"
0323 fi
0324 done
0325 ;;
0326 -G | --notgroup | --notgroup=* )
0327 case $arg in
0328 --notgroup=* )
0329 value=`echo $arg | sed 's|--notgroup=||'`
0330 arg="--notgroup"
0331 ;;
0332 * ) value=$1; shift ;;
0333 esac
0334 for v in `echo $value | tr ',' ' '`; do
0335 if [ X"$DIAGRAM_NGROUPS" = X ] ; then
0336 DIAGRAM_NGROUPS="$v"
0337 DIAGRAM_NGROUPS_NAME="$v"
0338 else
0339 DIAGRAM_NGROUPS="$DIAGRAM_NGROUPS\|$v"
0340 DIAGRAM_NGROUPS_NAME="$DIAGRAM_NGROUPS_NAME $v"
0341 fi
0342 done
0343 ;;
0344 -h | --help )
0345 grep '^##u\.' "$me" | sed 's/^##u\.\( \|\)//'
0346 grep '^##h\.' "$me" | sed 's/^##h\.\( \|\)//'
0347 exit ;;
0348 -u | --usage )
0349 grep '^##u\.' "$me" | sed 's/^##u\.\( \|\)//'
0350 exit ;;
0351 * )
0352 echo "Unknown option: $arg. Use -u option to get the usage." 1>&2
0353 exit 1
0354 esac ;;
0355 * )
0356 if [ X"$DIST" = X ]; then
0357 DIST=`cd $arg; /bin/pwd`
0358 elif [ X"$CONFDIR" = X ]; then
0359 CONFDIR=`cd $arg; /bin/pwd`
0360 else
0361 echo "Unknown option or argument provided: $arg. Use -u option to get the usage." 1>&2
0362 exit 1
0363 fi
0364 esac
0365 done
0366 if [ X"$DIST" = X ]; then
0367 DIST=`/bin/pwd`
0368 fi
0369 }
0370
0371
0372
0373
0374
0375
0376
0377 getfile () {
0378 sed "1,/^# BEGIN FILE $1\$/d; /^# END FILE $1/,\$d" < $me
0379 }
0380
0381
0382
0383
0384
0385
0386
0387 cleanup() {
0388 echo "Cleaning up previous results"
0389
0390 rm -f PROJECT-*.gif
0391 rm -f PROJECT-*.dot
0392 rm -f PROJECT-*.gz
0393 rm -f PROJECT-*
0394 rm -f A4-*
0395 rm -f dependencies*
0396 rm -f xdeps*
0397 rm -f index*.html
0398 rm -f *.conf
0399 rm -f log* exclude-* extra-* skip-* metrics* versions
0400 rm -f *.html
0401 }
0402
0403
0404
0405
0406 genArg () {
0407 argFile=$1 ; shift
0408 argValue=$1; shift
0409 if [ -f $argFile ] ; then
0410 echo "${argValue}${argFile}"
0411 else
0412 echo ""
0413 fi
0414 }
0415
0416
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435
0436
0437
0438 createconf (){
0439 src=$1; shift
0440 concatenate=$1; shift
0441 order=$1; shift
0442 list=
0443
0444 rm -rf $DEPDIR/$src
0445 for dir in $CONFDIR; do
0446 for subdir in `echo $dir | tr ':' ' '`; do
0447 if [ -f $subdir/$src ]; then
0448 if [ X"$concatenate" = X ]; then
0449 cat $subdir/$src > $DEPDIR/$src
0450 return
0451 elif [ X"$order" = X ]; then
0452 list="$list $subdir/$src"
0453 else
0454 list="$subdir/$src $list"
0455 fi
0456 break
0457 fi
0458 done
0459 done
0460 if [ X"$list" != X ]; then
0461 touch $DEPDIR/$src
0462 for f in $list ; do
0463 echo "####################################" >> $DEPDIR/$src
0464 echo "#ADDING contents of $f" >> $DEPDIR/$src
0465 echo "####################################" >> $DEPDIR/$src
0466 cat $f >> $DEPDIR/$src
0467 echo "" >> $DEPDIR/$src
0468 done
0469 fi
0470 }
0471
0472
0473
0474
0475
0476
0477
0478 initconfs(){
0479 initgraphsconfs
0480 createconf path.conf
0481 }
0482
0483 updategroups(){
0484 group_name=`echo $APPNAME | tr '[A-Z]' '[a-z]'`
0485 group_color=
0486 if [ -f group-purpose.conf ] ; then
0487 group_color="`grep $group_name group-purpose.conf| grep $APPNAME | head -1 | sed 's|.*-- *||'`"
0488 fi
0489 if [ "X$group_color" != X ] ; then
0490 group_line="`echo group $group_name $GROUP_SUBSYSTEMS -- $group_color`"
0491 touch group-origin.conf; echo "$group_line" >> group-origin.conf
0492 touch group-domain.conf; echo "$group_line" >> group-domain.conf
0493 touch group-purpose.conf; echo "group $group_name .+ -- $group_color" >> group-purpose.conf
0494 touch exclude-graphs-self; echo "$GROUP_SUBSYSTEMS" >> exclude-graphs-self
0495 fi
0496 tmpRENAME_ORIGIN=`echo $PROJECT_SUBSYSTEMS | tr ' ' '|'`
0497 if [ "X$tmpRENAME_ORIGIN" != X ] ; then
0498 touch rename-origin.conf; echo "rename ^($tmpRENAME_ORIGIN)$:\"\$1($APPNAME)\"" >> rename-origin.conf
0499 echo "rename ^(($tmpRENAME_ORIGIN)/(.+))$:\"\$1($APPNAME)\"" >> rename-origin.conf
0500
0501 fi
0502 }
0503
0504 initgraphsconfs(){
0505 echo "Creating configuration files"
0506
0507 createconf url.conf concatenate
0508 createconf rename-short.conf concatenate reverse
0509 createconf rename-origin.conf concatenate reverse
0510 createconf group-purpose.conf concatenate reverse
0511 createconf group-origin.conf concatenate reverse
0512 createconf group-domain.conf concatenate reverse
0513 createconf exclude-graphs concatenate reverse
0514 createconf exclude-graphs-self concatenate reverse
0515 createconf exclude-graphs-packages concatenate reverse
0516 createconf exclude-xdeps concatenate reverse
0517 createconf exclude-metrics concatenate reverse
0518 createconf extra-deps concatenate reverse
0519 createconf skip-graphs-subsystems concatenate reverse
0520 createconf skip-graphs-packages concatenate reverse
0521
0522 rm -f extra-rename-short.conf; touch extra-rename-short.conf
0523 for g in $RENAME_SHORT; do
0524 if [ X`echo "$g" | grep ".*:.*"` != X ] ; then
0525 echo "rename $g" >> extra-rename-short.conf
0526 else
0527 echo "rename ^$g/.+:\"$g\"" >> extra-rename-short.conf
0528 fi
0529 done
0530 if [ -f rename-short.conf ]; then
0531 cat rename-short.conf >> extra-rename-short.conf
0532 fi
0533 mv extra-rename-short.conf rename-short.conf
0534
0535 rm -f extra-rename-origin.conf; touch extra-rename-origin.conf
0536 for g in $RENAME_ORIGIN; do
0537 if [ X`echo "$g" | grep ".*:.*"` != X ] ; then
0538 echo "rename $g" >> extra-rename-origin.conf
0539 else
0540 echo "rename ^$g/.+:\"$g\"" >> extra-rename-origin.conf
0541 fi
0542 done
0543 if [ -f rename-origin.conf ]; then
0544 cat rename-origin.conf >> extra-rename-origin.conf
0545 fi
0546 mv extra-rename-origin.conf rename-origin.conf
0547
0548 rm -f extra-url.conf; touch extra-url.conf
0549 for g in $XDIAGRAM_GROUPS; do
0550 if [ X$ALL_SUBSYSTEM != X -o "X`echo $PROJECT_SUBSYSTEMS | tr ' ' '\n' | grep ^$g$`" = X -o -d ../subsystem.$g ] ; then
0551 echo ^$g$:\"../subsystem.$g/index-links.html
0552 echo ^$g/:\"../subsystem.$g/index-links.html
0553 else
0554 echo ^$g$:undef >> extra-url.conf
0555 echo ^$g/:undef >> extra-url.conf
0556 fi
0557 done
0558 if [ -f url.conf ]; then
0559 cat url.conf >> extra-url.conf
0560 fi
0561 mv extra-url.conf url.conf
0562 updategroups
0563 }
0564
0565
0566
0567
0568
0569
0570
0571
0572
0573
0574 mkconfs() {
0575 echo "Generating analysis configuration"
0576
0577 createconf path.conf concatenate reverse
0578 confs="$DEPDIR/path.conf"
0579
0580
0581 sconf=$DEPDIR/path-${BUILDSYSTEM}.conf
0582 confs="$confs $sconf"
0583 rm -f $sconf
0584 $SEARCHPATH_SCRIPT $DIST $DEPDIR > $sconf
0585 if [ $? != 0 ] ; then
0586 cat $sconf
0587 exit
0588 fi
0589 }
0590
0591
0592
0593
0594
0595
0596
0597
0598
0599 mklogicalmap() {
0600 echo "Guessing for hidden dependencies"
0601 }
0602
0603
0604
0605
0606
0607
0608
0609 mkdeps() {
0610 echo "Running ignominy analysis"
0611
0612
0613
0614 touch toplevel
0615 ignominy_script=$medir/ignominy
0616 ignominy_args="--jobs=$MAXJOBS --root=$DIST --skip=makedeps"
0617 if [ -f extra-args ] ; then
0618 ignominy_args=`cat extra-args`;
0619 fi
0620 echo "Extra args passed to ignominy are: $ignominy_args"
0621 ( eval `cd $DIST; $SETENV_SCRIPT $DIST`
0622 $ignominy_script --verbose $ignominy_args \
0623 `for f in $confs; do echo --conf=$f; done` \
0624 > dependencies.txt 2> log )
0625
0626
0627 if [ -e $DEPDIR/versions-deps.conf ] ; then
0628 echo "" >> dependencies.txt
0629 cat $DEPDIR/versions-deps.conf >> dependencies.txt
0630 fi
0631
0632
0633 egrep '(oops|warning):' < log | \
0634 grep -v ': warning: resolved from' > logwarnings
0635 }
0636
0637
0638
0639
0640
0641
0642 mkdiag() {
0643 echo " Generating diagram $3"
0644
0645
0646 xopts=$1; shift
0647 opts="$xopts --shape=ellipse"
0648 confp="`genArg url.conf --url=$DEPDIR/` `genArg group-purpose.conf --group=$DEPDIR/` `genArg rename-short.conf --rename=$DEPDIR/`"
0649 confo="`genArg url.conf --url=$DEPDIR/` `genArg group-origin.conf --group=$DEPDIR/` `genArg rename-short.conf --rename=$DEPDIR/`"
0650 confd="`genArg url.conf --url=$DEPDIR/` `genArg group-domain.conf --group=$DEPDIR/` `genArg rename-short.conf --rename=$DEPDIR/`"
0651
0652 types=$1; shift
0653 base=$1; shift
0654 sel=$1; shift
0655 title=$1; shift
0656 restrict=$1; shift
0657 if [ "X$dot" = "X" ]; then
0658 exit 1
0659 fi
0660
0661 R= res_title=
0662 if [ X"$restrict" != X ]; then
0663 R=R res_title="\\n(Restricted to $restrict)"
0664 fi
0665 for t in $types; do case $t in
0666 p )
0667
0668 if [ X"$P_DIAGRAMS" = Xyes ]; then
0669 deps2dot $opts $confp dependencies.txt \
0670 "$sel" "$DEPS_SUBPART" "$title by Purpose $res_title" \
0671 ${1+"$@"} > $base-${R}P.dot
0672 $dot -Tps -o $base-${R}P.ps $base-${R}P.dot
0673 fi
0674
0675 if [ X"$PS_DIAGRAMS" = Xyes ]; then
0676 deps2dot $opts $confp --long-edges=no dependencies.txt \
0677 "$sel" "$DEPS_SUBPART" "$title by Purpose $res_title\\n(Edges Suppressed!)" \
0678 ${1+"$@"} > $base-${R}PS.dot
0679 $dot -Tps -o $base-${R}PS.ps $base-${R}PS.dot
0680 fi
0681 ;;
0682
0683 o )
0684
0685 deps2dot $opts $confo dependencies.txt \
0686 "$sel" "$DEPS_SUBPART" "$title by Origin $res_title" \
0687 ${1+"$@"} > $base-${R}O.dot
0688 $dot -Tps -o $base-${R}O.ps $base-${R}O.dot
0689
0690 if [ X"$OS_DIAGRAMS" = Xyes ]; then
0691 deps2dot $opts $confo --long-edges=no dependencies.txt \
0692 "$sel" "$DEPS_SUBPART" "$title by Origin $res_title\\n(Edges Suppressed!)" \
0693 ${1+"$@"} > $base-${R}OS.dot
0694 $dot -Tps -o $base-${R}OS.ps $base-${R}OS.dot
0695 fi
0696 ;;
0697
0698 d )
0699
0700 deps2dot $opts $confd dependencies.txt \
0701 "$sel" "" "$title by Domain $res_title" \
0702 ${1+"$@"} > $base-${R}O.dot
0703 $dot -Tps -o $base-${R}O.ps $base-${R}O.dot
0704
0705 if [ X"$DS_DIAGRAMS" = Xyes ]; then
0706 deps2dot $opts $confd --long-edges=no dependencies.txt \
0707 "$sel" "" "$title by Domain $res_title\\n(Edges Suppressed!)" \
0708 ${1+"$@"} > $base-${R}OS.dot
0709 $dot -Tps -o $base-${R}OS.ps $base-${R}OS.dot
0710 fi
0711 ;;
0712
0713 * )
0714 echo "internal error: mkdiag: unrecognised diagram type \`$t'" 1>&2
0715 exit 1
0716 ;;
0717
0718 esac; done
0719 }
0720
0721 mkgraphs() {
0722 echo "Generating diagrams"
0723
0724
0725 exclude=; [ -f $DEPDIR/exclude-graphs ] &&
0726 exclude="`cat $DEPDIR/exclude-graphs | tr '\n' ' '`"
0727
0728 exclude_self=; [ -f $DEPDIR/exclude-graphs-self ] &&
0729 exclude_self="`cat $DEPDIR/exclude-graphs-self | tr '\n' ' '`"
0730
0731 exclude_pkgs=; [ -f $DEPDIR/exclude-graphs-packages ] &&
0732 exclude_pkgs="`cat $DEPDIR/exclude-graphs-packages | tr '\n' ' '`"
0733
0734 skip_subsys=; [ -f $DEPDIR/skip-graphs-subsystems ] &&
0735 skip_subsys="`cat $DEPDIR/skip-graphs-subsystems | tr '\n' ' '`"
0736
0737 [ "X$xskip_subsys" != X ] &&
0738 skip_subsys="$xskip_subsys $skip_subsys"
0739
0740 skip_pkgs=; [ -f $DEPDIR/skip-graphs-packages ] &&
0741 skip_pkgs="`cat $DEPDIR/skip-graphs-packages | tr '\n' ' '`"
0742
0743 [ "X$xskip_pkgs" != X ] &&
0744 skip_pkgs="$xskip_pkgs $skip_pkgs"
0745
0746
0747 binsel="Direct binary"
0748 srcsel="Direct source"
0749 comsel="Direct combined"
0750 domsel="Domain only"
0751 versel="Direct version"
0752
0753
0754 bindep="$APP Direct Binary Dependencies"
0755 srcdep="$APP Direct Source Dependencies"
0756 dirdep="$APP Direct Dependencies"
0757 verdep="$APP Direct Version Dependencies"
0758
0759
0760 hpgl_packages=
0761 TOPLEVELDIR=$BASE_ANALYSIS_DIR
0762 if [ -f toplevel ] ; then
0763 [ -f log.gz ] && gunzip log.gz
0764 grep '^found package.* of type `leaf' log | \
0765 sed 's/.* package `//; s/'\''.*//' > toplevel-pkg &
0766 grep '^found package.* of type `subsystem' log | \
0767 sed 's/.* package `//; s/'\''.*//' > toplevel-subsys &
0768 wait
0769 grep 'instantiating package' log | \
0770 sed 's/.*package //' | grep -v '<' >> toplevel-pkg &
0771 grep 'instantiating package' log | \
0772 sed 's/.*package //; /^[^\/]*$/d; s|/.*||' >> toplevel-subsys &
0773 wait
0774 cat toplevel-subsys | grep -v '^tools$' | sort | uniq > toplevel-subsys.new
0775 cat toplevel-pkg | grep -v '^tools/' > toplevel-pkg.new
0776 mv toplevel-subsys.new toplevel-subsys
0777 mv toplevel-pkg.new toplevel-pkg
0778 TOPLEVELDIR=.
0779 fi
0780 ps_packages=`cat $TOPLEVELDIR/toplevel-pkg`
0781 ps_subsystems=`cat $TOPLEVELDIR/toplevel-subsys`
0782 ps_subsystems="$ps_subsystems"
0783
0784
0785 rm -f *.dot
0786 rm -f *.hpgl
0787 rm -f *.gif
0788 touch $$.ps $$.ps.gz $$.html
0789 rm -f *.html
0790 rm -f *.ps *.ps.gz
0791
0792
0793
0794
0795 jobs=0 maxjobs=$MAXJOBS
0796 verfile=
0797 if [ -f $DEPDIR/tool-versions.conf ] ; then
0798 verfile="--version=$DEPDIR/tool-versions.conf"
0799 fi
0800 if [ X"$DIAGRAM_NGROUPS" = X ] ; then
0801
0802 mkdiag "" "d" PROJECT-00-Subsystems "$domsel" \
0803 "$dirdep:\\nSubsystems Only" "" no '^\(.*\)$' &
0804
0805
0806 tmpDEPS_SUBPART=$DEPS_SUBPART; DEPS_SUBPART=""
0807 mkdiag "$verfile" "o" PROJECT-01-ImportAndExternalVersion "$versel" \
0808 "$verdep:\\nImported and Externals Versions" "" no $exclude $exclude_self &
0809 DEPS_SUBPART=$tmpDEPS_SUBPART
0810 fi
0811
0812
0813 if [ X"$DIAGRAM_NGROUPS" = X -a X"$EXTERNALS_DIAGRAMS" = Xyes ]; then
0814 if [ X"$exclude" != X -o X"$exclude_self" != X ]; then
0815 tmpDEPS_SUBPART=$DEPS_SUBPART; DEPS_SUBPART=""
0816 mkdiag "$verfile" "p o" PROJECT-01-ImportAndExternal "$comsel" \
0817 "$dirdep:\\nImported and Externals" "" no $exclude $exclude_self &
0818 DEPS_SUBPART=$tmpDEPS_SUBPART
0819 fi
0820 if [ X"$exclude" != X ]; then
0821 mkdiag "" "p o" PROJECT-01-AllLibs "$comsel" \
0822 "$dirdep:\\nLibraries" "" no $exclude &
0823 fi
0824 fi
0825
0826
0827 if [ X"$SUBSYS_DIAGRAMS" = Xyes ]; then
0828 for f in $ps_subsystems; do
0829
0830 perl -e 'exit !grep("'"$f"'" =~ /$_/, qw('"$skip_subsys"'));' && continue
0831
0832
0833 frx=`echo $f | sed 's/+/\\\\+/g'`
0834
0835
0836
0837
0838
0839
0840
0841
0842 [ $jobs -lt $maxjobs ] || { wait; jobs=0; }
0843 jobs=`expr $jobs + 1`
0844 mkdiag "" "p o" PROJECT-02-`echo $f | sed 's|/|-|g'` "$comsel" \
0845 "$dirdep:\\nSubsystem $f" "$f only" yes $frx/ ! yes $frx/ &
0846 done
0847 fi
0848
0849
0850 if [ X"$PACKAGES_DIAGRAMS" = Xyes ]; then
0851 for f in $ps_packages; do
0852
0853 perl -e 'exit !grep("'"$f"'" =~ /$_/, qw('"$skip_pkgs"'));' && continue
0854
0855
0856 frx=`echo $f | sed 's/+/\\\\+/g'`
0857
0858 res=; [ X"$exclude_pkgs" != X ] && res="! no $exclude_pkgs"
0859
0860 [ $jobs -lt $maxjobs ] || { wait; jobs=0; }
0861 jobs=`expr $jobs + 1`
0862 mkdiag "" "p o" PROJECT-`echo $f | sed 's|/|-|g'` "$comsel" \
0863 "$dirdep:\\n$f" "" yes $frx\$ $res &
0864 done
0865 fi
0866 wait
0867 }
0868
0869 rescaleps() {
0870
0871 if [ X"$RESCALE" = Xyes ]; then
0872 echo "Rescaling all diagrams to A4 size"
0873 rescale PROJECT-*.ps
0874 fi
0875 }
0876
0877
0878
0879
0880
0881
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891 mkxdeps() {
0892 rm -f xdeps.* xdeps-*
0893
0894 echo "Generating dependency statistics tables"
0895 exclude=yes; [ -f $DEPDIR/exclude-xdeps ] &&
0896 exclude="no `cat $DEPDIR/exclude-xdeps`"
0897
0898 extradeps=; [ -f $DEPDIR/extra-deps ] &&
0899 extradeps="-- $DEPDIR/extra-deps yes"
0900
0901 confp="`genArg group-purpose.conf --group=$DEPDIR/` `genArg rename-origin.conf --rename=$DEPDIR/`"
0902 confo="`genArg group-origin.conf --group=$DEPDIR/` `genArg rename-origin.conf --rename=$DEPDIR/`"
0903
0904 TOPLEVELDIR=$BASE_ANALYSIS_DIR
0905 if [ -f toplevel ] ; then
0906 [ -f log.gz ] && gunzip log.gz
0907 grep '^binary .* found in ' log | \
0908 sed 's/^binary /s%/; s/ found in /($| )%/; s/$/$1%go;/; s/+/\\+/g' > toplevel.perl &
0909
0910 grep '^.*: .*: resolved from ' log | \
0911 sed 's/: .*: resolved from / /;' | \
0912 perl -ne '/^(\S+)\s+(\S+(,\s+\S+)*)$/; map { print "$1 $_\n" } split(/,\s+/,$2)' \
0913 > toplevel.lib-raw &
0914 wait
0915 sort < toplevel.lib-raw | uniq -c > xdeps.lib-raw &
0916 perl -p toplevel.perl < toplevel.lib-raw | egrep -v '<.*>' | sort | uniq -c > xdeps.lib &
0917 grep 'source dependency' log | \
0918 sed 's/^ *//; s/: source dependency on//; s/ via.*//;' | \
0919 egrep -v '<.*>' | \
0920 sort | uniq -c > xdeps.inc &
0921
0922 grep 'source dependency' log | \
0923 sed 's/^ *//; s/: source dependency on//;' | \
0924 egrep -v '<.*>' | \
0925 sort | uniq -c > xdeps.incdetail &
0926 wait
0927 rm -f toplevel.perl toplevel.lib-raw
0928 TOPLEVELDIR=.
0929 else
0930 ln -s $TOPLEVELDIR/xdeps.lib-raw xdeps.lib-raw
0931 mindeps $TOPLEVELDIR/xdeps.inc "$DEPS_SUBPART" > xdeps.inc &
0932 mindeps $TOPLEVELDIR/xdeps.lib "$DEPS_SUBPART" > xdeps.lib &
0933 mindeps $TOPLEVELDIR/xdeps.incdetail "$DEPS_SUBPART" > xdeps.incdetail &
0934 wait
0935 fi
0936 if [ "X$IGNOMINY_ONLY" = X ] ; then
0937 set -x
0938 xmerge $confp xdeps.inc xdeps.lib "$DEPS_SUBPART" $exclude $extradeps > xdeps.all
0939 xmerge $confp --side-by-side xdeps.inc xdeps.lib "$DEPS_SUBPART" $exclude $extradeps > xdeps-purpose.ps
0940 xmerge $confo --side-by-side xdeps.inc xdeps.lib "$DEPS_SUBPART" $exclude $extradeps > xdeps-origin.ps
0941 set +x
0942 (echo 'h3.page-break { page-break-before: always; }'
0943 echo '@html2ps {'
0944 echo ' margin { left: 1cm; right 1cm; top: 1cm; bottom: 1cm }'
0945 echo ' font { arial { names: "Helvetica Helvetica-Oblique Helvetica-Bold Helvetica-BoldOblique" } }'
0946 echo '}'
0947 echo 'ol { font-family: arial, helvetica, sans-serif; font-size: 7pt; }'
0948 echo 'table { font-family: arial, helvetica, sans-serif; font-size: 7pt; }'
0949 echo 'td { font-family: arial, helvetica, sans-serif; font-size: 7pt; text-align: center; }'
0950 echo 'th { font-family: arial, helvetica, sans-serif; font-size: 7pt; font-weight: normal; }'
0951 ) > xdeps.css
0952 (echo "<HTML><TITLE>$APP Dependency Statistics</TITLE>"
0953 echo '<LINK REL="stylesheet" href="xdeps.css" type="text/css">'
0954 echo '<BODY>'
0955 xmerge $confp --html xdeps.inc xdeps.lib "$DEPS_SUBPART" $exclude $extradeps
0956 echo '</BODY></HTML>') > xdeps.html
0957 else
0958 touch xdeps.html
0959 fi
0960 }
0961
0962
0963
0964
0965
0966
0967
0968
0969
0970
0971
0972
0973 mkmetrics() {
0974 echo "Generating dependency metrics"
0975
0976 rm -f metrics metrics_local
0977 exclude=yes; [ -f $DEPDIR/exclude-metrics ] &&
0978 exclude="no `cat $DEPDIR/exclude-metrics | tr '\n' ' '`"
0979
0980 extradeps=; [ -f $DEPDIR/extra-deps ] &&
0981 extradeps="-- $DEPDIR/extra-deps yes"
0982
0983
0984 deps2metrics dependencies.txt "Direct combined" "$DEPS_SUBPART" "" \
0985 $exclude $extradeps > metrics &
0986
0987
0988 deps2metrics dependencies.txt "Direct combined" "$DEPS_SUBPART" "subpartonly" \
0989 $exclude $extradeps > metrics_local &
0990 wait
0991 }
0992
0993
0994
0995
0996
0997
0998
0999
1000 mkgifs() {
1001
1002 echo "Converting diagrams to GIFs"
1003 jobs=0 maxjobs=$MAXJOBS
1004 for f in *.ps *.eps; do
1005 [ -f $f ] || continue
1006 [ $jobs -lt $maxjobs ] || { wait; jobs=0; }
1007 jobs=`expr $jobs + 1`
1008
1009 case $f in *.html.ps | A4-* ) continue ;; esac
1010 base=`echo $f | sed 's/\.[^.]*$//'`
1011 gif=$base.gif
1012 type=`echo $f | sed 's/.*\.//'`
1013 eps2gif --maxsize=$MAXSIZE --$type --record-title=$base \
1014 --record=.scales.$f $f > $gif &
1015 done
1016
1017 wait
1018 if [ X$KEEP_PS = X ] ; then
1019 rm -f *.ps *.ps.gz
1020 fi
1021 cat .scales.* > .scales
1022 rm .scales.*
1023 }
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034 mkdirindex() {
1035 echo "Creating HTML index"
1036
1037 rm -f index*.html
1038 { echo "<HEAD><TITLE>$APP Dependency Information</TITLE></HEAD>"
1039 echo "<FRAMESET BORDER=1 ROWS='50%, *'>"
1040 echo " <FRAME SRC='index-links.html' NAME='DIAGRAMS'>"
1041 echo " <FRAME SRC='dependencies.txt' NAME='GIF'>"
1042 echo "</FRAMESET>"
1043 echo "</HTML>"
1044 } > index.html
1045
1046 { echo "<HEAD><TITLE>$APP Dependency Information</TITLE></HEAD>"
1047 echo "<BODY BGCOLOR='#ffffff'>"
1048 echo "<H1>$APP Dependency Information</H1>"
1049 tmp_flag=
1050 if [ -f dependencies.txt ] ; then
1051 if [ `stat -t dependencies.txt | awk '{print $2}'` != 0 ] ; then
1052 echo "<P><A TARGET='GIF' HREF='dependencies.txt'>Dependency data</A></P>"
1053 tmp_flag=ok
1054 fi
1055 fi
1056 if [ X$tmp_flag = X ] ; then
1057 echo "<P>Dependency data</P>"
1058 fi
1059 tmp_flag=
1060 if [ -f xdeps.html ] ; then
1061 if [ `stat -t xdeps.html | awk '{print $2}'` != 0 ] ; then
1062 echo "<P><A TARGET='GIF' HREF='xdeps.html'>Dependency statistics</A></P>"
1063 tmp_flag=ok
1064 fi
1065 fi
1066 if [ X$tmp_flag = X ] ; then
1067 echo "<P>Dependency statistics</P>"
1068 fi
1069 tmp_flag=
1070 if [ -f versions ] ; then
1071 if [ `stat -t versions| awk '{print $2}'` != 0 ] ; then
1072 echo "<P><A TARGET='GIF' HREF='versions'>External tools versions</A></P>"
1073 tmp_flag=ok
1074 fi
1075 fi
1076 if [ X$tmp_flag = X ] ; then
1077 echo "<P>External tools versions</P>"
1078 fi
1079 if [ "X$BASE_ANALYSIS_DIR" = X ] ; then
1080 echo "<P><A TARGET='GIF' HREF='index-subsystem.html'>Individual Sub-Systems</A></P>"
1081 fi
1082 echo "<P>Metrics: "
1083 tmp_flag=
1084 if [ -f metrics ] ; then
1085 if [ `stat -t metrics | awk '{print $2}'` != 0 ] ; then
1086 echo "<A TARGET='GIF' HREF='metrics'>All</A> |"
1087 tmp_flag=ok
1088 fi
1089 fi
1090 if [ X$tmp_flag = X ] ; then
1091 echo "All |"
1092 fi
1093 tmp_flag=
1094 if [ -f metrics_local ] ; then
1095 if [ `stat -t metrics_local | awk '{print $2}'` != 0 ] ; then
1096 echo "<A TARGET='GIF' HREF='metrics_local'>Project/Subsystem Only</A>"
1097 tmp_flag=ok
1098 fi
1099 fi
1100 if [ X$tmp_flag = X ] ; then
1101 echo "Project/Subsystem Only"
1102 fi
1103 echo "</P><P>Extra detail: "
1104 tmp_flag=
1105 if [ -f xdeps.all ] ; then
1106 if [ `stat -t xdeps.all | awk '{print $2}'` != 0 ] ; then
1107 echo "<A TARGET='GIF' HREF='xdeps.all'>All</A> |"
1108 tmp_flag=ok
1109 fi
1110 fi
1111 if [ X$tmp_flag = X ] ; then
1112 echo "All |"
1113 fi
1114 tmp_flag=
1115 if [ -f xdeps.inc ] ; then
1116 if [ `stat -t xdeps.inc | awk '{print $2}'` != 0 ] ; then
1117 echo "<A TARGET='GIF' HREF='xdeps.inc'>Includes</A> |"
1118 tmp_flag=ok
1119 fi
1120 fi
1121 if [ X$tmp_flag = X ] ; then
1122 echo "Includes |"
1123 fi
1124 tmp_flag=
1125 if [ -f xdeps.incdetail ] ; then
1126 if [ `stat -t xdeps.incdetail | awk '{print $2}'` != 0 ] ; then
1127 echo "<A TARGET='GIF' HREF='xdeps.incdetail'>Includes (detailed)</A> |"
1128 tmp_flag=ok
1129 fi
1130 fi
1131 if [ X$tmp_flag = X ] ; then
1132 echo "Includes (detailed) |"
1133 fi
1134 tmp_flag=
1135 if [ -f xdeps.lib ] ; then
1136 if [ `stat -t xdeps.lib | awk '{print $2}'` != 0 ] ; then
1137 echo "<A TARGET='GIF' HREF='xdeps.lib'>Libraries</A> |"
1138 tmp_flag=ok
1139 fi
1140 fi
1141 if [ X$tmp_flag = X ] ; then
1142 echo "Libraries |"
1143 fi
1144 tmp_flag=
1145 if [ -f xdeps.lib-raw ] ; then
1146 if [ `stat -t xdeps.lib-raw | awk '{print $2}'` != 0 ] ; then
1147 echo "<A TARGET='GIF' HREF='xdeps.lib-raw'>Libraries (raw)</A>"
1148 tmp_flag=ok
1149 fi
1150 fi
1151 if [ X$tmp_flag = X ] ; then
1152 echo "Libraries (raw)"
1153 fi
1154 echo "</P><P><A TARGET='GIF' HREF='log.gz'>Log</A> |"
1155 tmp_flag=
1156 if [ -f logwarnings ] ; then
1157 if [ `stat -t logwarnings| awk '{print $2}'` != 0 ] ; then
1158 echo "<A TARGET='GIF' HREF='logwarnings'>Warnings only</A></P>"
1159 tmp_flag=ok
1160 fi
1161 fi
1162 if [ X$tmp_flag = X ] ; then
1163 echo "Warnings only</P>"
1164 fi
1165 echo "<P><HR BORDER='1'>"
1166 echo "<P>C: Concentrated; L: Logical; M: Maximial Logical; R: Restricted to Domain<BR>"
1167 echo "B: Binary Only; PP: PACKAGE Dependencies<BR>"
1168 echo "P: By Package Purpose; O: By Package Origin<BR>"
1169 echo "S: Only longest edges kept</P>"
1170 echo "<TABLE BORDER='0'>"
1171 echo "<TR BGCOLOR='#ffff00'><TH COLSPAN='2'>Diagram</TH><TH COLSPAN='5'>Plots</TH></TR>"
1172 for f in *.gif; do
1173 [ -f $f ] || continue
1174 base=`echo $f | sed 's/\.[^.]*$//'`
1175 ps=$base.ps
1176 gif=$base.gif
1177 name="`echo $base|sed 's/^[A-Z0-9]*-//;s/^0[012]-//;s/-/ /g'`"
1178 namebeg="`echo $base|sed 's/^[A-Z0-9]*-//;s/^0[012]-//;s/-[A-Z]*$//;s/-/ /g'`"
1179 nametrail="`echo $base|sed 's/.*-\([A-Z]*\)$/\1/'`"
1180 [ $nametrail = $base ] && nametrail=' '
1181
1182 echo "<TR>"
1183 echo " <TD>$nametrail</TD>"
1184 echo " <TD><A NAME='$base'>$namebeg</A></TD>"
1185 if [ -f $gif ] ; then
1186 echo " <TD><A TARGET='GIF' HREF='$gif.html'>GIF</A></TD>"
1187 else
1188 echo " <TD>GIF</TD>"
1189 fi
1190 if [ -f $ps ] ; then
1191 echo " <TD>| <A TARGET='GIF' HREF='$ps.gz'>PS</A></TD>"
1192 else
1193 echo " <TD>| PS</TD>"
1194 fi
1195 if [ -f A4-$ps ]; then
1196 echo " <TD>| <A TARGET='GIF' HREF='A4-$ps.gz'>PS (A4 scaled)</A></TD>"
1197 else
1198 echo " <TD>| PS (A4 scaled)</TD>"
1199 fi
1200 if [ -f "$base.hpgl" ]; then
1201 echo " <TD>| <A TARGET='GIF' HREF='$base.hpgl'>HPGL</A></TD>"
1202 else
1203 echo " <TD>| HPGL</TD>"
1204 fi
1205 if [ -f "$base.dot" ] ; then
1206 echo " <TD>| <A TARGET='GIF' HREF='$base.dot'>DOT</A></TD>"
1207 else
1208 echo " <TD>| DOT</TD>"
1209 fi
1210 echo "</TR>"
1211
1212 { echo "<HEAD><TITLE>$APP Dependency Information: $name</TITLE></HEAD>"
1213 echo "<BODY BGCOLOR='#ffffff'>"
1214 echo "<H1>$APP Dependency Information: $name</H1>"
1215 echo "<P><IMG BORDER='0' SRC='$f' USEMAP='#MAP-${base}'>"
1216 ps2map --target=DIAGRAMS `grep "^$base " .scales | sed 's/^/MAP-/'` $ps
1217 } > $gif.html
1218 done
1219 echo "</TABLE>"
1220 } > index-links.html
1221 }
1222
1223
1224
1225
1226
1227
1228 mksubsystemindex (){
1229 echo "Creating HTML Sub-system index"
1230
1231 rm -f index-subsystem.html
1232 subsys_dirs=
1233 for dir in `ls | grep "subsystem.*"` ; do
1234 if [ -d $dir ] ; then
1235 subsys_dirs="$subsys_dirs $dir"
1236 fi
1237 done
1238 if [ "X$subsys_dirs" = X ] ; then
1239 { echo "<HEAD><TITLE>$APP Sub-system Level Analysis</TITLE></HEAD>"
1240 echo "<BODY BGCOLOR='#ffffff'>"
1241 echo "<H1>$APP Sub-system Level Analysis</H1>"
1242 echo "<P>There are no sub-system level ignominy analysis available."
1243 } > index-subsystem.html
1244 else
1245 { echo "<HEAD><TITLE>$APP Sub-system Level Analysis</TITLE></HEAD>"
1246 echo "<BODY BGCOLOR='#ffffff'>"
1247 echo "<H1>$APP Sub-system Level Analysis</H1>"
1248 echo "<BR><BR><TABLE CELLPADDING=\"2\" CELLSPACING=\"2\" BORDER=\"1\""
1249 echo "STYLE=\"WIDTH: 30%; TEXT-ALIGN: CENTER; MARGIN-LEFT: AUTO; MARGIN-RIGHT: AUTO; "
1250 echo "BACKGROUND-COLOR: RGB(255, 255, 204);\"><TBODY>"
1251 echo "<TR><TD><B>Sub-System Name</B></TD></TR>"
1252 } > index-subsystem.html
1253 for dir in $subsys_dirs ; do
1254 dir1=`echo $dir | sed 's|subsystem.||'`
1255 echo "<TR><TD><A TARGET=_blank HREF=\"$dir/index.html\">$dir1</A></TD></TR>" >> index-subsystem.html
1256 done
1257 echo "</TBODY></TABLE></BODY></HTML>" >> index-subsystem.html
1258 fi
1259 }
1260
1261
1262
1263
1264
1265
1266
1267 zipfiles() {
1268 echo "Compressing files"
1269 [ -f log ] && gzip --best log
1270 touch $$-tmp.ps
1271 gzip --best *.ps
1272 rm -f $$-tmp.ps $$-tmp.ps.gz
1273 }
1274
1275
1276
1277
1278
1279
1280 scramreleasetop() {
1281 dir=$1; shift
1282 while [ ! -d "$dir/.SCRAM" -a X$dir != X/ ]; do
1283 dir=`dirname $dir`
1284 done
1285 if [ ! -d "$dir/.SCRAM" ]; then
1286 dir=""
1287 fi
1288 echo $dir
1289 }
1290
1291
1292
1293
1294
1295 timeit() {
1296 func=$1; shift
1297 if [ X"$TIMINGS" = X ]; then
1298 $func $@
1299 else
1300 func_list="$func_list/`basename $func`"
1301 echo "Starting:$func"
1302 time $func $@
1303 func=`basename $func_list`
1304 func_list=`dirname $func_list`
1305 echo "Done:$func"
1306 fi
1307 }
1308
1309
1310
1311
1312
1313 run_ignominy () {
1314 if [ X"$DIAGRAM_NGROUPS" != X ] ; then
1315 echo "Generationg Dependency Diagrams for $DIAGRAM_NGROUPS"
1316 exclude=; [ -f $DEPDIR/exclude-graphs ] &&
1317 exclude="`cat $DEPDIR/exclude-graphs | tr '\n' ' '`"
1318
1319 for exclude_subsys in $exclude ; do
1320 if [ "X`echo $DIAGRAM_NGROUPS | grep $exclude_subsys`" != X ] ; then
1321 return
1322 fi
1323 done
1324
1325 XDIAGRAM_GROUPS=`echo $PROJECT_SUBSYSTEMS | tr ' ' '\n' | grep -v ^$DIAGRAM_NGROUPS$ | tr '\n' ' '`
1326 RENAME_SHORT=
1327 RENAME_ORIGIN=
1328 DEPS_SUBPART=
1329 for subsys in $DIAGRAM_NGROUPS_NAME ; do
1330 RENAME_SHORT=^\($subsys/.+\):\"\$1\"" $RENAME_SHORT"
1331 RENAME_ORIGIN=^\($subsys/.+\):\"\$1"($APPNAME)\" $RENAME_ORIGIN"
1332 if [ "X$DEPS_SUBPART" = X ] ; then
1333 DEPS_SUBPART="^$subsys/"
1334 else
1335 DEPS_SUBPART="^$subsys/|$DEPS_SUBPART"
1336 fi
1337 done
1338
1339 RENAME_ORIGIN=^\(`echo $XDIAGRAM_GROUPS | tr ' ' '|'`\)/.+:\"\$1\($APPNAME\)\"" $RENAME_ORIGIN"
1340 RENAME_ORIGIN="$RENAME_ORIGIN $DIAGRAM_GROUPS"
1341
1342 SKIP_ANALYSIS=yes
1343 DIAGRAM_NGROUPS_NAME=subsystem.`echo $DIAGRAM_NGROUPS_NAME | tr ' ' '\n' | sort | tr '\n' '.' | sed 's|.$||'`
1344 rm -rf $DIAGRAM_NGROUPS_NAME
1345 mkdir $DIAGRAM_NGROUPS_NAME
1346 cd $DIAGRAM_NGROUPS_NAME
1347 ln -s $BASE_ANALYSIS_DIR/log.gz .
1348 for file in dependencies.txt versions logwarnings tool-versions.conf ; do
1349 if [ -f $BASE_ANALYSIS_DIR/$file ] ; then
1350 ln -s $BASE_ANALYSIS_DIR/$file .
1351 fi
1352 done
1353 for file in `ls $BASE_ANALYSIS_DIR/xdeps.*` ; do
1354 file=`basename $file`
1355 ln -s $BASE_ANALYSIS_DIR/$file .
1356 done
1357
1358 RENAME_SHORT="$RENAME_SHORT $XDIAGRAM_GROUPS $DIAGRAM_GROUPS"
1359 xskip_subsys=
1360 xskip_pkgs=
1361 for exclude_subsys in $XDIAGRAM_GROUPS ; do
1362 if [ "X$xskip_subsys" = X ] ; then
1363 xskip_subsys="^$exclude_subsys\$ ^$exclude_subsys/"
1364 else
1365 xskip_subsys="$xskip_subsys ^$exclude_subsys\$ ^$exclude_subsys/"
1366 fi
1367 done
1368 xskip_pkgs="$xskip_subsys"
1369 echo "Working on $DIAGRAM_NGROUPS_NAME"
1370 DEPDIR=`pwd`
1371 else
1372 RENAME_ORIGIN="$DIAGRAM_GROUPS"
1373 RENAME_SHORT="$DIAGRAM_GROUPS"
1374 DEPS_SUBPART="$DEPS_SUBPART_PROJECT"
1375 fi
1376 if [ X"$SKIP_ANALYSIS" = X ] ; then
1377 timeit cleanup
1378 timeit initconfs
1379 timeit mkconfs
1380 timeit mklogicalmap
1381 timeit mkdeps
1382 else
1383 echo "Skipping analysis"
1384 initgraphsconfs
1385 fi
1386 timeit mkmetrics &
1387 if [ "X$IGNOMINY_ONLY" = "X" ] ; then
1388 timeit mkxdeps &
1389 timeit mkgraphs
1390 timeit rescaleps
1391 timeit mkgifs
1392 wait
1393 timeit mkdirindex
1394 timeit zipfiles
1395 else
1396 wait
1397 fi
1398 rm -f core.* .scales
1399
1400 if [ "X$DIAGRAM_NGROUPS" != X ] ; then
1401 cd ..
1402 echo "Done Dependency Diagrams for $DIAGRAM_NGROUPS"
1403 fi
1404
1405 }
1406
1407
1408
1409
1410
1411
1412 allsubsys_ignominy () {
1413 jobs=0 maxjobs=4
1414 PRE_MAXJOBS=$MAXJOBS
1415 MAXJOBS=`expr $PRE_MAXJOBS / $maxjobs`
1416 if [ $MAXJOBS -le 3 ] ; then
1417 MAXJOBS=4
1418 fi
1419 echo "Max. sub-system processing in parallel: $maxjobs"
1420 echo "Max. jobs/sub-system: $MAXJOBS"
1421 for subsys in $PROJECT_SUBSYSTEMS; do
1422 DIAGRAM_NGROUPS=$subsys
1423 DIAGRAM_NGROUPS_NAME=$subsys
1424 [ $jobs -lt $maxjobs ] || { wait; jobs=0; }
1425 jobs=`expr $jobs + 1`
1426 timeit run_ignominy &
1427 done
1428 wait
1429 MAXJOBS=$PRE_MAXJOBS
1430 }
1431
1432
1433
1434
1435
1436
1437 searchScripts () {
1438 type=$1 ; shift
1439 sep=$1 ; shift
1440 if [ -d "$IGNOMINYDIR/Ignominy${type}" ] ; then
1441 if [ X"$CONFDIR" != X ]; then
1442 CONFDIR="${CONFDIR}${sep}${IGNOMINYDIR}/Ignominy${type}"
1443 else
1444 CONFDIR="${IGNOMINYDIR}/Ignominy${type}"
1445 fi
1446 for script in searchPath setEnv IgnominyConf ; do
1447 uc_script=`echo $script | tr '[a-z]' '[A-Z]'`
1448 tmpscript=${uc_script}_SCRIPT
1449 eval "tmpscriptv=\$$tmpscript"
1450 if [ "X$tmpscriptv" = X ] ; then
1451 tscript=${IGNOMINYDIR}/Ignominy${type}/${script}
1452 if [ -x $tscript ] ; then
1453 eval "$tmpscript=$tscript"
1454 fi
1455 fi
1456 done
1457 fi
1458 }
1459
1460
1461
1462
1463
1464 parseargs $@
1465
1466 IGNOMINYDIR=$medir/config
1467
1468
1469 if [ "X$APPNAME" = X ] ; then
1470 APPNAME="`echo $DIST | sed 's|.*/||; s|_.*||'`"
1471 fi
1472 if [ "X$APPVERSION" = X ] ; then
1473 APPVERSION="`echo $DIST | sed 's|.*/||; s|^[^_]*_||; s|_|.|g'`"
1474 fi
1475 APP="$APPNAME $APPVERSION"
1476
1477
1478 searchScripts $APPNAME ":"
1479
1480
1481 if [ "X$BUILDSYSTEM" != X -a "X$APPNAME" != "X$BUILDSYSTEM" ] ; then
1482 searchScripts $BUILDSYSTEM " "
1483 fi
1484
1485
1486 searchScripts "Common" " "
1487
1488
1489 DEPDIR=`/bin/pwd`
1490 dot=`which dot`
1491 if [ "X$dot" != "X" ] ; then
1492 $dot -V
1493 fi
1494
1495
1496 if [ "X$BUILDSYSTEM" = "XSCRAM" ] ; then
1497 DIST=`scramreleasetop $DIST`
1498 if [ X"$DIST" = X ]; then
1499 echo "Can't find SCRAM release root" 1>&2
1500 exit 1
1501 fi
1502
1503 RELEASEDIST=`grep RELEASETOP $DIST/.SCRAM/Environment | sed 's|RELEASETOP=||'`
1504 [ -d "$RELEASEDIST" ] && RELEASEDIST=`cd $RELEASEDIST; /bin/pwd`
1505 fi
1506
1507
1508 for dir in $CONFDIR; do
1509 for subdir in `echo $dir | tr ':' ' '`; do
1510 if [ $subdir = $DEPDIR ]; then
1511 echo "oops: You should not run this script from a ignominy configuration area, otherwise it will delete your configuration files" 1>&2
1512 exit 1
1513 fi
1514 done
1515 done
1516 if [ X`echo $DEPDIR | grep "^$IGNOMINYDIR"` != X ] ; then
1517 echo "Error: You should not run it from any directory under $IGNOMINYDIR"
1518 exit 1
1519 fi
1520
1521 if [ X"$CONFDIR" = X ]; then
1522 echo "Can't locate any ignominy configuration directory for this project" 1>&2
1523 exit 1
1524 fi
1525
1526
1527 [ -z $CMS_PATH ] && CMS_PATH=/afs/cern.ch/cms
1528 export CMS_PATH
1529
1530
1531 echo "Running analysis for $APP"
1532 echo "Ignominy Directory: $IGNOMINYDIR"
1533 echo "Release Directory:$DIST"
1534 echo "IGNOMINY Configuration Directories:$CONFDIR"
1535 echo "Number of jobs:$MAXJOBS"
1536 echo "App Name: $APPNAME"
1537 echo "App Version: $APPVERSION"
1538 echo "Build system: $BUILDSYSTEM"
1539 echo "Environment setting script: $SETENV_SCRIPT"
1540 echo "src/bin search script: $SEARCHPATH_SCRIPT"
1541 echo "Ignominy Configuration script: $IGNOMINYCONF_SCRIPT"
1542
1543 . $IGNOMINYCONF_SCRIPT
1544 DEPS_ARCH=`echo $BUILDSYSTEM_ARCH | sed 's/[_/][_/]*/-/g' | tr '[A-Z]' '[a-z]'`
1545 DEPS_DOC_RELDIR="doc/deps/$DEPS_ARCH"
1546
1547 PROJECT_SUBSYSTEMS=
1548 DEPS_SUBPART_PROJECT=
1549 GROUP_SUBSYSTEMS=
1550 for subsys in $ALL_SUB_SYSTEM ; do
1551 if [ ! -d "$DIST_SRC/$subsys" ] ; then
1552 continue
1553 elif [ "X$PROJECT_SUBSYSTEMS" = X ] ; then
1554 PROJECT_SUBSYSTEMS=$subsys
1555 DEPS_SUBPART_PROJECT="^$subsys/"
1556 GROUP_SUBSYSTEMS="^$subsys\$ ^$subsys/"
1557 else
1558 PROJECT_SUBSYSTEMS="$PROJECT_SUBSYSTEMS $subsys"
1559 DEPS_SUBPART_PROJECT="^$subsys/|$DEPS_SUBPART_PROJECT"
1560 GROUP_SUBSYSTEMS="$GROUP_SUBSYSTEMS ^$subsys\$ ^$subsys/"
1561 fi
1562 done
1563
1564 BASE_ANALYSIS_DIR=
1565 if [ X"$DIAGRAM_NGROUPS" != X -o X$ALL_SUBSYSTEM != X ] ; then
1566 if [ -f log.gz ] ; then
1567 BASE_ANALYSIS_DIR=".."
1568 elif [ X$FORCE_ANA = X -a -f $DIST/$DEPS_DOC_RELDIR/log.gz ] ; then
1569 BASE_ANALYSIS_DIR=$DIST/$DEPS_DOC_RELDIR
1570 fi
1571 if [ "X$BASE_ANALYSIS_DIR" = X ] ; then
1572 OPTS="$IGNOMINY_ONLY -j $MAXJOBS -b $BUILDSYSTEM -P $APPNAME -V $APPVERSION"
1573 if [ X"$DIAGRAM_GROUPS" != X ] ; then
1574 OPTS="$OPTS --group=`echo $DIAGRAM_GROUPS | tr ' ' ','`"
1575 fi
1576 echo "Running Analysis ..."
1577 echo ">> Running: $me $EXTRA_OPTIONS $OPTS $DIST"
1578 timeit $me $EXTRA_OPTIONS $OPTS $DIST
1579 echo "Done Analysis"
1580 if [ ! -f log.gz ] ; then
1581 exit
1582 fi
1583 if [ "X$IGNOMINY_ONLY" != "X" ] ; then
1584 exit
1585 fi
1586 BASE_ANALYSIS_DIR=".."
1587 fi
1588 if [ X$PACKAGES_DIAGRAMS = X -a X$SUBSYS_DIAGRAMS = X ] ; then
1589 PACKAGES_DIAGRAMS=yes
1590 SUBSYS_DIAGRAMS=yes
1591 fi
1592 fi
1593
1594 if [ X$ALL_SUBSYSTEM != X ] ; then
1595 timeit allsubsys_ignominy
1596 else
1597 timeit run_ignominy
1598 fi
1599 echo "Finished analysis"
1600
1601 if [ "X$BASE_ANALYSIS_DIR" = "X.." -o "X$BASE_ANALYSIS_DIR" = X ] ; then
1602 mksubsystemindex
1603 fi
1604
1605 exit