|
7 | 7 |
|
8 | 8 | set conf = configure.ac |
9 | 9 | set ver = Makefile.am |
| 10 | +set autoinst = linbox-auto-install.sh |
10 | 11 |
|
11 | 12 | #verbatim second argument of AC_INIT |
12 | 13 | set verb = `grep ^AC_INIT $conf | cut -d',' -f2` |
@@ -60,7 +61,7 @@ if ("$answ" == "y") then |
60 | 61 | if ("$newv" != "$verb") then |
61 | 62 | echo -n "Confirmation of incrementation ? (yes/no)" |
62 | 63 | set answ = $< |
63 | | - set backupconf = $conf.back$$ |
| 64 | + set backupconf = $conf.back$$ |
64 | 65 | if ("$answ" == "yes") then |
65 | 66 | \cp -p $conf $backupconf |
66 | 67 | echo "Back-up of $conf made in $backupconf. Now overwriting $conf." |
@@ -94,18 +95,53 @@ if ("$answ" == "y") then |
94 | 95 | diff -u0 $ver $tmpfile |
95 | 96 | echo -n "Confirmation of incrementation ? (yes/no) " |
96 | 97 | set answ = $< |
| 98 | + set backupmake = $ver.back$$ |
97 | 99 | if ("$answ" == "yes") then |
| 100 | + \cp -p $ver $backupmake |
98 | 101 | \mv -f $tmpfile $ver |
99 | | - echo " your old $conf is destroyed..." |
100 | | - \rm -f $backupconf |
101 | 102 | else |
102 | 103 | echo "'$answ' read. Not incrementing anything." |
103 | 104 | echo " your old $conf is restored..." |
104 | 105 | \rm -f $tmpfile |
105 | 106 | \mv -f $backupconf $conf |
106 | 107 | exit 0 |
107 | 108 | endif |
108 | | - |
| 109 | + #now change linbox-auto-install accordingly |
| 110 | + echo -n "Incrementing linbox-auto-install.sh revision accordingly" |
| 111 | + set tmpfile = `mktemp` #tempfile |
| 112 | + set sedfile = `mktemp` #tempfile |
| 113 | + switch ($increm) |
| 114 | + case 0: |
| 115 | + echo -n "s/STABLE_LB=.*/STABLE_LB=$macro.$minor.$pmicro/" >> $sedfile |
| 116 | + breaksw |
| 117 | + case 1: |
| 118 | + echo "s/STABLE_LB=.*/STABLE_LB=$macro.$pminor.0/" > $sedfile |
| 119 | + breaksw |
| 120 | + case 2: |
| 121 | + echo "s/STABLE_LB=.*/STABLE_LB=$pmacro.0.0/" > $sedfile |
| 122 | + breaksw |
| 123 | + default: |
| 124 | + echo "Something abnormal happened" |
| 125 | + exit 1 |
| 126 | + breaksw |
| 127 | + endsw |
| 128 | + sed -f $sedfile $autoinst > $tmpfile |
| 129 | + \rm -f $sedfile |
| 130 | + diff -u0 $autoinst $tmpfile |
| 131 | + echo -n "Confirmation of incrementation ? (yes/no) " |
| 132 | + set answ = $< |
| 133 | + if ("$answ" == "yes") then |
| 134 | + \mv -f $tmpfile $autoinst |
| 135 | + echo " your old $conf and $ver are destroyed..." |
| 136 | + \rm -f $backupconf $backupmake |
| 137 | + else |
| 138 | + echo "'$answ' read. Not incrementing anything." |
| 139 | + echo " your old $conf and $ver are restored..." |
| 140 | + \rm -f $tmpfile |
| 141 | + \mv -f $backupconf $conf |
| 142 | + \mv -f $backupmake $ver |
| 143 | + exit 0 |
| 144 | + endif |
109 | 145 | endif |
110 | 146 | else |
111 | 147 | echo "'$answ' read. Not doing anything." |
|
0 commit comments