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: dfc38970f638bdd7b4c82f0697faad137dcf01b0373ef1dafb5e964bb6fcbd6c
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: 826a543aae user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:45:13
Put in the no-file version check-in: dfc38970f6 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
12:32:23
Initial revision check-in: 8baddcf689 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
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
  # 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
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
    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
    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 ]