Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:47

0001 #!/bin/sh
0002 
0003 ##u. Usage: RunIgnominy [options] [RELEASE] [CONFDIR]
0004 ##u.
0005 ##u. where options are
0006 ##u. -h, --help      To get help message
0007 ###. -u, --usage     To get the usage message
0008 ##u. -f, --force     Run to run analysis instead of copying from the release
0009 ##u.                 area
0010 ##u. -r, --rescale   To re-scale the postscript file to A4 size for proper
0011 ##u.                 printing
0012 ##u. -A, --allsubsys To generate seperate diagram for all sub-systems. It is
0013 ##u.                 same as if you run this script multiple time with -G <system>
0014 ##u.                 for each sub-system (except the one excluded via the 
0015 ##u.                 exclude-graphs config file).
0016 ##u. -e, --external  To generate externals/imported diagrams (if
0017 ##u.                 exclude-graphs-self exists too)
0018 ##u. -p, --package   To generate packages diagrams
0019 ##u. -s, --subsys    To generate sub-systems diagrams
0020 ##u. -d, --diagrams  <type>
0021 ##u.                 To generate diagram by the <type>, where <type> could be
0022 ##u.                 os 
0023 ##u.                   To generate diagram by origin and with shortest path
0024 ##u.                   to other packages/sub-system deleted.
0025 ##u.                 p           
0026 ##u.                   To generate diagram by purpose of the package/sub-system
0027 ##u.                 ps          
0028 ##u.                   To generate diagram by purpose of the package/sub-system
0029 ##u.                   with shortest path to other packages/sub-system deleted.
0030 ##u.                 ds          
0031 ##u.                   To generate diagram by domain of the package/sub-system
0032 ##u.                   with shortest path to other packages/sub-system deleted.
0033 ##u.                 If -d option not provided then only diagrams by origins
0034 ##u.                 of package/sub-system will be created.
0035 ##u.                 Note: You can use "," seperated list if you wish to use
0036 ##u.                 more then one <type> e.g -d os,p,ps OR use multiple -d
0037 ##u.                 options
0038 ##u. -g, --group <tool|external subsystem>
0039 ##u.                 Group all the packages under this tool or subsystem into
0040 ##u.                 one. e.g. if you use -g POOL then every thing under SEAL
0041 ##u.                 would be grouped in one node (SEAL). You can use this
0042 ##u.                 option multiple times.
0043 ##u.                 If "-g all" is used then all build system based base level
0044 ##u.                 projects will be grouped.
0045 ##u. -G, --notgroup <Subsystem>
0046 ##u.                 Group every other sub-system except <Subsystem>. One can
0047 ##u.                 use it multiple times or provide a "," seperated list of
0048 ##u.                 subsystems.
0049 ##u. -S, --size <n>  Maximum size of the diagram to be generated.
0050 ##u. -a, --all       To generate all diagrams and also rescale
0051 ##u.                 postscripts files to A4 size
0052 ##u. -n, --noanalysis  To skip the ignominy-analysis part and just create new
0053 ##u.                 diagrams
0054 ##u. --keep-ps       Do not delete generated ps files.
0055 ##u. -i, --ignominy  Only run ignominy and generate inc/lib 
0056 ##u. -t, --time      To print out the time it took for different steps
0057 ##u. -j, --jobs <n>  Run <n> jobs in parallel, default is 10
0058 ##u. -b, --buildsystem <buildsystem>
0059 ##u.                 Name if the build system. e.g. "SCRAM". Default is SCRAM
0060 ##u. -P, --project <project>
0061 ##u.                 Name of the project.
0062 ##u. -V, --version <version>
0063 ##u.                 Project version.
0064 ##u. RELEASE         Base path of your project. If notprovided then current 
0065 ##u.                 directory will be used.
0066 ##u. CONFDIR         Directory path where your project-specific ignominy
0067 ##u.                 configuration files exists. If not provided then this
0068 ##u.                 script will search the default paths.
0069 ##h. 
0070 ##h. This script generates an ignominy analysis for any BuildSystem-based
0071 ##h. project.  Usage: Go into the directory into which you want to
0072 ##h. generate the analysis results, and then run this. For example:
0073 ##h.
0074 ##h.  cd /afs/cern.ch/cms/Releases/IGUANA/IGUANA_4_2_1
0075 ##h.  mkdir -p doc/dependencies/linux-2.4
0076 ##h.  cd doc/dependencies/linux-2.4
0077 ##h.  RunIgnominy
0078 ##h.
0079 ##h. RunIgnominy optionaly needs some configuration files (listed below).
0080 ##h. There are three types of configuration files.
0081 ##h. 1) Standalone:  For these type of file RunIgnominy does not append or
0082 ##h.                 insert any thing.
0083 ##h. 2) Concatenate: For these files RunIgnominy searches the project
0084 ##h.                 specific configuration directories and uses the first
0085 ##h.                 file it finds and then append the contents of the same
0086 ##h.                 file from config/IgnominyCommon (if exists) to it.
0087 ##h. 3) Concatenate Reverse: For these files, file is read from
0088 ##h.                 config/IgnominyCommon directory first and then the
0089 ##h.                 contents of the first project specifc file are added to it.
0090 ##h. 
0091 ##h. Project-specific directories and their search order is
0092 ##h. 1) Directory provided via 2nd command-line option
0093 ##h. 2) src/Ig_Documentation/Ignominy (for IGUANA and IGNOMINY)
0094 ##h.    src/VisDocumentation/Ignominy (for IGUANACMS)
0095 ##h.    src/Documentation/Ignominy    (for ORCA, COBRA, OSCAR etc)
0096 ##h. 3) If your release directory is not a base release then the above
0097 ##h.    mentioned directories are also searched for base release
0098 ##h. 4) $CMSSW_BASE/src/Utilities/ReleaseScripts/ignominy/config/Ignominy{PROJECT}
0099 ##h.    e.g $CMSSW_BASE/src/Utilities/ReleaseScripts/ignominy/config/IgnominyCMSSW
0100 ##h. Note: Currecntly 2 & 3 are disabled.
0101 ##h. 
0102 ##h. Common configuration directory is
0103 ##h. $CMSSW_BASE/src/Utilities/ReleaseScripts/ignominy/config/IgnominyCommon
0104 ##h. 
0105 ##h. Configuration files and their types are
0106 ##h.   url.conf                  Type: Concatenate
0107 ##h.                             Mapping of package names to urls.
0108 ##h. 
0109 ##h.   group-purpose.conf        Type: Concatenate Reverse
0110 ##h.                             By-purpose package colour map
0111 ##h. 
0112 ##h.   group-origin.conf         Type: Concatenate Reverse
0113 ##h.                             By-origin package colour map
0114 ##h. 
0115 ##h.   group-domain.conf         Type: Concatenate Reverse
0116 ##h.                             By-origin subsytem colour map
0117 ##h. 
0118 ##h.   rename-short.conf         Type: Concatenate Reverse
0119 ##h.                             Package renaming rules for diagrams
0120 ##h.
0121 ##h.   rename-origin.conf        Type: Concatenate Reverse
0122 ##h.                             Package renaming according to their origin
0123 ##h.                             rules for diagrams
0124 ##h.
0125 ##h.   path.conf                 Type: Standalone
0126 ##h.                             Additional ignominy configuration.
0127 ##h.
0128 ##h.   exclude-graphs            Type: Concatenate Reverse
0129 ##h.                             Packages to reject from the graphs,
0130 ##h.                             such as example programs.
0131 ##h.
0132 ##h.   exclude-graphs-self       Type: Concatenate Reverse
0133 ##h.                             Packages to reject from "imported and
0134 ##h.                             externals" graph.  The graph is
0135 ##h.                             created only if this file exists, and
0136 ##h.                             will contain all packages except those
0137 ##h.                             matched by these regexps; normally the
0138 ##h.                             file names the top-level subsystems
0139 ##h.                             that contain the project's own code.
0140 ##h.
0141 ##h.   exclude-graphs-packages   Type: Concatenate Reverse
0142 ##h.                             Packages to exclude from the diagrams,
0143 ##h.                             such as very commonly used utilities,
0144 ##h.                             e.g. config header packages (space
0145 ##h.                             separated list of perl regexps).
0146 ##h.
0147 ##h.   skip-graphs-subsystems    Type: Concatenate Reverse
0148 ##h.                             No diagrams for these subsystems
0149 ##h.
0150 ##h.   skip-graphs-packages      Type: Concatenate Reverse
0151 ##h.                             No diagrams for these packages
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 # parse command-line arguments
0198 parseargs() {
0199   while [ $# -gt 0 ]; do
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 # Little utilities
0375 
0376 # Extract a named file from the end of this script
0377 getfile () {
0378   sed "1,/^# BEGIN FILE $1\$/d; /^# END FILE $1/,\$d" < $me
0379 }
0380 
0381 ######################################################################
0382 ######################################################################
0383 ######################################################################
0384 # Clean up all generated files.  In theory we could just "rm -fr *",
0385 # but avoid that in case user runs this script in a directory with
0386 # other stuff already in there.  Kill just the files we produce.
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 # Utility to create a ignominy configuration file
0420 # CONFDIR should have a ' ' (space) seperated list of items
0421 # each item could be a ':' seperated list of directories
0422 # each directory in the item will be searched and the first file
0423 # found will be used.
0424 # currently there are two items in CONFDIR
0425 # 1) list of project specific directories i.e
0426 #    a) directory provided as 2nd argument to this script
0427 #    b) ignominy conf area of the project provided as 1st argument 
0428 #       to this script
0429 #       i.e RELEASE/src/{Ig_|Vis}Documentation/Ignominy
0430 #    c) ignominy conf area of the project's release area i.e
0431 #       PROJECT_RELEASE/src/{Ig_|Vis}Documentation/Ignominy
0432 #       (if the RELEASE provided as 1st argument is a development area)
0433 #    d) Ignominy's config/Ignominy{PROJECT} directory
0434 #    e.g. config/IgnominyORCA
0435 # 2) list of common configuration directories i.e
0436 #    a) Ignominy's config/IgnominyCommon
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 # Utility to create all configuration files by searching in different 
0476 # configuration areas
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     #echo "rename .*/([^/]+):\"\$1\"" >> rename-origin.conf
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#PROJECT-02-$g-RO\" >> extra-url.conf
0552       echo ^$g/:\"../subsystem.$g/index-links.html#PROJECT-02-$g-RO\" >> extra-url.conf      
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 # Generate main configuration files for Buildsystem-based releases.  The
0569 # first part is a common unchanged configuration file that we spit out
0570 # from this script (see the end of the script).  The second part is
0571 # tool configuration which we spit out by querying BuildSystem for the
0572 # configuration of this project on this platform.
0573 
0574 mkconfs() {
0575   echo "Generating analysis configuration"
0576 
0577   createconf path.conf concatenate reverse
0578   confs="$DEPDIR/path.conf"
0579 
0580   # Generate configuration by querying Build system
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 # Auto-generate "logical" mappings.  These would be things we know are
0595 # dependencies, but are not found by ignominy, e.g. dependencies via
0596 # string literals and such.  If there are commonly used forms that are
0597 # easy to check for, put the code in here.  For now, nothing to do
0598 # here.
0599 mklogicalmap() {
0600   echo "Guessing for hidden dependencies"
0601 }
0602 
0603 ######################################################################
0604 ######################################################################
0605 ######################################################################
0606 # Perform ignominy project area scan.  Get the project runtime, feed
0607 # in the configuration and capture the output.  Then look for warnings
0608 # and capture them to a separate file.
0609 mkdeps() {
0610   echo "Running ignominy analysis"
0611 
0612   # Get runtime so ldd etc. works correctly, but shield against getting
0613   # into this script's environment.
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   # add the version dependency
0627   if [ -e $DEPDIR/versions-deps.conf ] ; then
0628     echo "" >> dependencies.txt
0629     cat $DEPDIR/versions-deps.conf >> dependencies.txt
0630   fi
0631   
0632   # Get all warnings but filter out symbol matches for "warning" :-)
0633   egrep '(oops|warning):' < log | \
0634     grep -v ': warning: resolved from' > logwarnings
0635 }
0636 
0637 ######################################################################
0638 ######################################################################
0639 ######################################################################
0640 # Generated dependency diagrams.
0641 
0642 mkdiag() {
0643   echo " Generating diagram $3"
0644 
0645   # Options for diagram variants
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      # Purpose
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      # Origin
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      # Domain
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   # Get project parameters
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   # Various categories we are interested in.
0747   binsel="Direct binary"
0748   srcsel="Direct source"
0749   comsel="Direct combined"
0750   domsel="Domain only"
0751   versel="Direct version"
0752 
0753   # Titles
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   # Scan log for the list of packages and subsystems.
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   # Remove all old diagrams
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   # Render jobs we are currently running and will run at most.  Most
0793   # jobs run very fast, usually less than five at a time process for
0794   # more than a few seconds.
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     # Generate subsystem dependency diagram
0802     mkdiag "" "d" PROJECT-00-Subsystems "$domsel" \
0803       "$dirdep:\\nSubsystems Only" "" no '^\(.*\)$' &
0804 
0805     # Generate externals/imported version diagrams
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   # Generate externals/imported diagrams if requested  
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   # Generate in-subsystem diagrams: restricted to the subsystem itself
0827   if [ X"$SUBSYS_DIAGRAMS" = Xyes ]; then
0828     for f in $ps_subsystems; do
0829       # Skip it if it matches perl rejection regexp
0830       perl -e 'exit !grep("'"$f"'" =~ /$_/, qw('"$skip_subsys"'));' && continue
0831 
0832       # Convert subsystem name to regexp
0833       frx=`echo $f | sed 's/+/\\\\+/g'`
0834  
0835       # FIXME: IGUANA allowed diagrams that restricted to IGUANA or
0836       # Anaphe only; do a simpler thing here, restricting to that
0837       # particular subsystem.  It's less useful for IGUANA but much more
0838       # useful for other projects.  This would be better handled if this
0839       # script was a perl script that could read a real config file
0840       # instead of reading simple text files; we don't want too many of
0841       # them.
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   # Generate package diagrams
0850   if [ X"$PACKAGES_DIAGRAMS" = Xyes ]; then
0851     for f in $ps_packages; do
0852       # Skip it if it matches perl rejection regexp
0853       perl -e 'exit !grep("'"$f"'" =~ /$_/, qw('"$skip_pkgs"'));' && continue
0854 
0855       # Convert name to regexp
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   # Rescale all diagrams so they can be printed on A4.
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 # Generate the cross-dependency tables and diagram.  Grep the log
0881 # files for all the dependency data details (which symbol and header
0882 # was included from where and found where), the list of all packages
0883 # and binaries, and generate cross-tabulation info.  Also generate
0884 # postscript diagram with in/out edge map.  Merge the dependency
0885 # tables into a big HTML page and print that table (print disabled,
0886 # pending a tool to generated good postscript from html).
0887 #
0888 # The project configuration can provide a list of packages not to
0889 # include in this detail, as well as logical dependencies table
0890 # (see mkmetrics for details).
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 # Generate the NCCD metrics file.  The project can provide a list of
0966 # applications that should be excluded from the analysis: normally one
0967 # is interested mainly in the complexity of the core library set, and
0968 # the example and test programs can confuse that picture considerably
0969 # as they normally use a much larger set of packages than the library
0970 # being tested or exemplified.  The project may also provide a list of
0971 # hand-crafted "logical" dependency file (cf. mklogical for an auto
0972 # generated one) that should be included in the numbers.
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   # Generate metrics table from direct combined dependency data
0984   deps2metrics dependencies.txt "Direct combined" "$DEPS_SUBPART" "" \
0985     $exclude $extradeps > metrics &
0986 
0987   # Generate metrics table from direct combined dependency data for subpart only
0988   deps2metrics dependencies.txt "Direct combined" "$DEPS_SUBPART" "subpartonly" \
0989     $exclude $extradeps > metrics_local &
0990   wait
0991 }
0992 
0993 ######################################################################
0994 ######################################################################
0995 ######################################################################
0996 # Generate .gif files from all the .ps files.  Our eps2gif utility
0997 # autoscales the images to a certain size, and we record all that info
0998 # into a file ".scales" in this directory.  We later use that data to
0999 # generate image maps for each of the .gif files (mkdirindex).
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 # Generate the final index page.  Add links to the various top-level
1029 # items, plus generate a table for all the diagrams.  This assumes
1030 # mkgifs was already done, and generates appropriate image map using
1031 # the markers dot stuck into the .ps file, plus the scaling
1032 # information we generated with eps2gif in mkgifs.
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='&nbsp;'
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 # Update the subsystem html page
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 # Compress all the files so they take much less space.  Your average
1265 # web browser is smart enough to uncompress them before showing them,
1266 # so no harm is done to the clients.
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 # Utility to find a scram-based release top directory
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 # utility to run a function and also print the results of time it took
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 # Run ignominy for each subsystem
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 # Search the required project/buildsystem specific scripts
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 # Main function body
1464 parseargs $@
1465 
1466 IGNOMINYDIR=$medir/config
1467 
1468 # Determine application title (name and version)
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 # Project specific ignominy configuration directory
1478 searchScripts $APPNAME ":"
1479 
1480 # BuildSystem specific ignominy configuration directory
1481 if [ "X$BUILDSYSTEM" != X -a "X$APPNAME" != "X$BUILDSYSTEM" ] ; then
1482   searchScripts $BUILDSYSTEM " "
1483 fi
1484 
1485 # Ignominy common configuration directory
1486 searchScripts "Common" " "
1487   
1488 # Set dependency data output directory: here
1489 DEPDIR=`/bin/pwd`
1490 dot=`which dot`
1491 if [ "X$dot" != "X" ] ; then
1492   $dot -V
1493 fi
1494 
1495 # Find the SCRAM release area root
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   # Determine base release if $DIST is a development area
1503   RELEASEDIST=`grep RELEASETOP $DIST/.SCRAM/Environment | sed 's|RELEASETOP=||'`
1504   [ -d "$RELEASEDIST" ] && RELEASEDIST=`cd $RELEASEDIST; /bin/pwd`
1505 fi
1506 
1507 # One should not run this script from a ignominy configuration directories
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 # Make sure $CMS_PATH is set (FIXME: needed anymore?)
1527 [ -z $CMS_PATH ] && CMS_PATH=/afs/cern.ch/cms
1528 export CMS_PATH
1529 
1530 # Run the stages
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