aboutsummaryrefslogtreecommitdiffstats
path: root/admin/update_autogen
diff options
context:
space:
mode:
authorGlenn Morris2014-01-13 16:17:18 -0500
committerGlenn Morris2014-01-13 16:17:18 -0500
commitd6b738fcf5a98309f93ba1d74a28980111087c05 (patch)
treecae4a9ae0a502f9b998d0b208929c718389febb9 /admin/update_autogen
parent0aa9ec078e7ae5b3c9fdbb0a5e61513bec6aeed2 (diff)
downloademacs-d6b738fcf5a98309f93ba1d74a28980111087c05.tar.gz
emacs-d6b738fcf5a98309f93ba1d74a28980111087c05.zip
* admin/update_autogen (status): New function. Use throughout.
Diffstat (limited to 'admin/update_autogen')
-rwxr-xr-xadmin/update_autogen85
1 files changed, 32 insertions, 53 deletions
diff --git a/admin/update_autogen b/admin/update_autogen
index 02b15c3aaa1..b9511969a15 100755
--- a/admin/update_autogen
+++ b/admin/update_autogen
@@ -140,24 +140,36 @@ OPTIND=1
140[ "$quiet" ] && exec 1> /dev/null 140[ "$quiet" ] && exec 1> /dev/null
141 141
142 142
143echo "Running bzr status..." 143## Run status on inputs, list modified files on stdout.
144status ()
145{
146 bzr status -S "$@" >| $tempfile || die "bzr status error for $@"
144 147
145bzr status -S ${autogendir:+$sources} ${ldefs_flag:+lisp} \ 148 local stat file modified
146 ${info_flag:+doc} >| $tempfile || \
147 die "bzr status error for input files"
148 149
149## The lisp portion could be more permissive, eg only care about .el files. 150 while read stat file; do
150while read stat file; do
151 151
152 case $stat in 152 [ "$stat" != "M" ] && \
153 M) 153 die "Unexpected status ($stat) for generated $file"
154 echo "Locally modified: $file" 154 modified="$modified $file"
155 [ "$force" ] || die "There are local modifications"
156 ;;
157 155
158 *) die "Unexpected status ($stat) for $file" ;; 156 done < $tempfile
159 esac 157
160done < $tempfile 158 echo "$modified"
159
160 return 0
161} # function status
162
163
164echo "Checking input file status..."
165
166## The lisp portion could be more permissive, eg only care about .el files.
167modified=$(status ${autogendir:+$sources} ${ldefs_flag:+lisp} ${info_flag:+doc}) || die
168
169[ "$modified" ] && {
170 echo "Locally modified: $modified"
171 [ "$force" ] || die "There are local modifications"
172}
161 173
162 174
163## Probably this is overkill, and there's no need to "bootstrap" just 175## Probably this is overkill, and there's no need to "bootstrap" just
@@ -259,21 +271,11 @@ EOF
259 done 271 done
260 done 272 done
261 273
262 bzr status -S $outfile >| $tempfile || \
263 die "bzr status error for generated $outfile"
264
265 local modified 274 local modified
266 275
267 while read stat file; do 276 modified=$(status $outfile) || die
268 277
269 [ "$stat" != "M" ] && \ 278 commit "info/dir" $modified || die "commit error"
270 die "Unexpected status ($stat) for generated $file"
271
272 modified="$modified $file"
273
274 done < $tempfile
275
276 commit "info/dir" $modified || die "bzr commit error"
277} # function info_dir 279} # function info_dir
278 280
279 281
@@ -287,23 +289,11 @@ EOF
287 289
288 echo "Checking status of generated files..." 290 echo "Checking status of generated files..."
289 291
290 bzr status -S $basegen >| $tempfile || \ 292 modified=$(status $basegen) || die
291 die "bzr status error for generated files"
292
293 modified=
294
295 while read stat file; do
296
297 [ "$stat" != "M" ] && \
298 die "Unexpected status ($stat) for generated $file"
299
300 modified="$modified $file"
301
302 done < $tempfile
303 293
304 cd $oldpwd 294 cd $oldpwd
305 295
306 commit "generated" $modified || die "bzr commit error" 296 commit "generated" $modified || die "commit error"
307 297
308 exit 0 298 exit 0
309} # $autogendir 299} # $autogendir
@@ -371,24 +361,13 @@ echo "Checking status of loaddef files..."
371## It probably would be fine to just check+commit lisp/, since 361## It probably would be fine to just check+commit lisp/, since
372## making autoloads should not effect any other files. But better 362## making autoloads should not effect any other files. But better
373## safe than sorry. 363## safe than sorry.
374bzr status -S $genfiles ${ldefs_out#lisp/} >| $tempfile || \ 364modified=$(status $genfiles ${ldefs_out#lisp/}) || die
375 die "bzr status error for generated files"
376
377
378modified=
379
380while read stat file; do
381
382 [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file"
383 modified="$modified $file"
384
385done < $tempfile
386 365
387 366
388cd ../ 367cd ../
389 368
390 369
391commit "loaddefs" $modified || die "bzr commit error" 370commit "loaddefs" $modified || die "commit error"
392 371
393 372
394exit 0 373exit 0