Overview
Comment:Put in the no-file version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 9b35dc5560bc4c4e79f182c5d598bc02f6d61f36811559dccb92eea482cedabb
User & Date: gawthrop@users.sourceforge.net on 2000-10-12 13:45:13
Other Links: branch diff | manifest | tags
Context
2000-10-12
15:11:30
Added the update switch check-in: 57f41d684e user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:45:13
Put in the no-file version check-in: 9b35dc5560 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:32:23
Initial revision check-in: 62bb84791a user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/mtt_update from [5698aa8ff7] to [720294f8fa].

9
10
11
12
13
14
15



16
17
18
19
20
21
22
23
24
25
26

27
28




29
30
31
32
33
34
35
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



##
###############################################################


sys=$1 # System name
rep=$2 # System representation

textfile=$1_$2.txt
infofile=$1_sympar.txt
default='0.0'


# Inform User
echo Checking $textfile





# Remove tmp files
rm -f mtt_in_text mtt_in_info

# Strip files
strip_comments <$textfile >mtt_text
strip_comments <$infofile >mtt_info







>
>
>











>
|
|
>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1  2000/10/12 12:32:23  peterg
## Initial revision
##
##
###############################################################


sys=$1 # System name
rep=$2 # System representation

textfile=$1_$2.txt
infofile=$1_sympar.txt
default='0.0'

if [ -f "$textfile" ]; then
  # Inform User
  echo Checking $textfile
else
  sympar2numpar_txt2txt $1
  exit    
fi

# Remove tmp files
rm -f mtt_in_text mtt_in_info

# Strip files
strip_comments <$textfile >mtt_text
strip_comments <$infofile >mtt_info
58
59
60
61
62
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104
105
106
if [ -f "mtt_in_text" ]; then
  in_text=`cat mtt_in_text`
  echo "The following variables are defined in $textfile, but do not exist:"
  echo $in_text    

  while [ -z "$answered" ]; do
    echo "Update $textfile (y/n)?"
    read answer
    case $answer in
	y)
	    answered=yes
 	    for old in $in_text; do
	      sed "s/\($old[ \t]*=\)/## Removed by MTT on `date`: \1/" <$textfile > mtt_tmp
              mv mtt_tmp $textfile

	    done
	    ;;
	n)
	    answered=yes
	    ;;
	*)
    esac
  done      
fi

answered=''
if [ -f "mtt_in_info" ]; then
  in_info=`cat mtt_in_info`
  echo "The following variables exist, but are not defined in $textfile:"
  echo $in_info

  while [ -z "$answered" ]; do
    echo "Update $textfile (y/n)?"
    read answer
    case $answer in
	y)
	    answered=yes
 	    for new in $in_info; do
		echo "$new = $default; # Added by MTT on `date`" >> $textfile

	    done
	    ;;
	n)
	    answered=yes
	    ;;
	*)
    esac
  done      
fi









|






>


















|





>









<
<
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114


if [ -f "mtt_in_text" ]; then
  in_text=`cat mtt_in_text`
  echo "The following variables are defined in $textfile, but do not exist:"
  echo $in_text    

  while [ -z "$answered" ]; do
    echo "Update $textfile (y/n)?"
    read answer < /dev/tty
    case $answer in
	y)
	    answered=yes
 	    for old in $in_text; do
	      sed "s/\($old[ \t]*=\)/## Removed by MTT on `date`: \1/" <$textfile > mtt_tmp
              mv mtt_tmp $textfile
              changed=yes
	    done
	    ;;
	n)
	    answered=yes
	    ;;
	*)
    esac
  done      
fi

answered=''
if [ -f "mtt_in_info" ]; then
  in_info=`cat mtt_in_info`
  echo "The following variables exist, but are not defined in $textfile:"
  echo $in_info

  while [ -z "$answered" ]; do
    echo "Update $textfile (y/n)?"
    read answer < /dev/tty
    case $answer in
	y)
	    answered=yes
 	    for new in $in_info; do
		echo "$new = $default; # Added by MTT on `date`" >> $textfile
                changed=yes
	    done
	    ;;
	n)
	    answered=yes
	    ;;
	*)
    esac
  done      
fi



MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]