Index: mttroot/mtt/bin/mtt
==================================================================
--- mttroot/mtt/bin/mtt
+++ mttroot/mtt/bin/mtt
@@ -12,10 +12,14 @@
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
+## Revision 1.118 1998/02/05 12:00:11 peterg
+## Tidy mode now default.
+## It seems to work ok but not for book type documents.
+##
## Revision 1.117 1998/02/04 16:50:50 peterg
## Introduced the tidy (-t and -T) options
##
## Revision 1.116 1998/02/04 11:00:04 peterg
## Added view of subsystems.
@@ -405,11 +409,11 @@
## Revision 1.1 1996/08/04 17:29:42 peter
## Initial revision
##
###############################################################
-#Check $MTTPATH has bee set
+#Check $MTTPATH has been set
mtt_check_var "$MTTPATH" "MTTPATH"
# MTT recursion level is zero unless explicitly set
level=0
@@ -450,10 +454,12 @@
-s )
mtt_switches="$mtt_switches $1";
switches=1 ;;
-d )
directory=$2; cd $directory; shift ;;
+ -S )
+ directory=$2; shift;;
-D )
mtt_switches="$mtt_switches $1";
debug=debug ;;
-t )
tidy=tidy ;;
@@ -512,10 +518,13 @@
echo ' -p print environment variables'
echo ' -c c-code generation'
echo ' -o ode and dae are the same'
echo ' -s use switch (ISW and CSW) components'
echo ' -d
use directory '
+ echo ' -t tidy mode (default)'
+ echo ' -u untidy mode (leaves files in current dir)'
+ echo ' -d use directory '
echo ' -D debug -- leave log files etc'
exit
fi
fi
@@ -619,11 +628,17 @@
fi
if [ "$2" = "rep" ]; then
documenttype=article
# See if we are making a book -- ie representation rep on a directory
- isdirectory=`file $1 | awk '{print $2}' | grep directory`
+ isMTT_work=`pwd | grep 'MTT_work`
+ if [ -n "$isMTT_work" ]; then
+ dotdot='../'
+ fi
+echo $dotdot$1
+
+ isdirectory=`file $dotdot$1 | awk '{print $2}' | grep directory`
if [ -n "$isdirectory" ]; then
documenttype=book
fi
else
documenttype=section
@@ -732,13 +747,14 @@
fi
# Tidy mode - operate in the directory MTT-work
if [ "$tidy" = "tidy" ]; then
mkdir -p MTT_work
- cp -u *_*.* MTT_work
+ cp -u -f *_*.* MTT_work
cd MTT_work
- mtt -u -q $mtt_switches $1 $2 $3 $4
+ Directory=$directory/MTT_work
+ mtt -u -q $mtt_switches -S $Directory $1 $2 $3 $4
if [ "$3" != "view" ]; then
cp -f $1_$2.$3 ..
fi
# Remove the MTT_work directory if very tidy
@@ -1069,11 +1085,11 @@
#SUMMARY rep report (view)
ifeq ($documenttype,book)
$1_rep.txt:
- dir2rep $1;
+ dir2rep $1 $dotdot;
else
$1_rep.txt:
echo Creating $1_rep.txt;
( \
echo "# Outline report file for system $1 ($1_rep.txt)"; \
@@ -1641,10 +1657,10 @@
# Remove logs if not debugging
if [ "$debug" != "debug" ]; then
rm -f *.log
else
- echo Debugging - log files retained in $directory/LOGFILES
+ echo Debugging - log files retained in LOGFILES
mkdir -p LOGFILES
mv -f *.log LOGFILES
fi