diff options
| author | Glenn Morris | 2014-01-13 16:17:18 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-01-13 16:17:18 -0500 |
| commit | d6b738fcf5a98309f93ba1d74a28980111087c05 (patch) | |
| tree | cae4a9ae0a502f9b998d0b208929c718389febb9 /admin/update_autogen | |
| parent | 0aa9ec078e7ae5b3c9fdbb0a5e61513bec6aeed2 (diff) | |
| download | emacs-d6b738fcf5a98309f93ba1d74a28980111087c05.tar.gz emacs-d6b738fcf5a98309f93ba1d74a28980111087c05.zip | |
* admin/update_autogen (status): New function. Use throughout.
Diffstat (limited to 'admin/update_autogen')
| -rwxr-xr-x | admin/update_autogen | 85 |
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 | ||
| 143 | echo "Running bzr status..." | 143 | ## Run status on inputs, list modified files on stdout. |
| 144 | status () | ||
| 145 | { | ||
| 146 | bzr status -S "$@" >| $tempfile || die "bzr status error for $@" | ||
| 144 | 147 | ||
| 145 | bzr 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 |
| 150 | while 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 | |
| 160 | done < $tempfile | 158 | echo "$modified" |
| 159 | |||
| 160 | return 0 | ||
| 161 | } # function status | ||
| 162 | |||
| 163 | |||
| 164 | echo "Checking input file status..." | ||
| 165 | |||
| 166 | ## The lisp portion could be more permissive, eg only care about .el files. | ||
| 167 | modified=$(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. |
| 374 | bzr status -S $genfiles ${ldefs_out#lisp/} >| $tempfile || \ | 364 | modified=$(status $genfiles ${ldefs_out#lisp/}) || die |
| 375 | die "bzr status error for generated files" | ||
| 376 | |||
| 377 | |||
| 378 | modified= | ||
| 379 | |||
| 380 | while read stat file; do | ||
| 381 | |||
| 382 | [ "$stat" != "M" ] && die "Unexpected status ($stat) for generated $file" | ||
| 383 | modified="$modified $file" | ||
| 384 | |||
| 385 | done < $tempfile | ||
| 386 | 365 | ||
| 387 | 366 | ||
| 388 | cd ../ | 367 | cd ../ |
| 389 | 368 | ||
| 390 | 369 | ||
| 391 | commit "loaddefs" $modified || die "bzr commit error" | 370 | commit "loaddefs" $modified || die "commit error" |
| 392 | 371 | ||
| 393 | 372 | ||
| 394 | exit 0 | 373 | exit 0 |