diff options
| author | Glenn Morris | 2014-11-15 18:16:28 -0500 |
|---|---|---|
| committer | Glenn Morris | 2014-11-15 18:16:28 -0500 |
| commit | 899a5a9882ddb6106dbabf2012c957ea1340ac2a (patch) | |
| tree | 5a0ca3459dadf087c305505f580b7e2460020a12 /admin/update_autogen | |
| parent | 92f58578cc939e0d955437fcbc87cda80c2ba05c (diff) | |
| download | emacs-899a5a9882ddb6106dbabf2012c957ea1340ac2a.tar.gz emacs-899a5a9882ddb6106dbabf2012c957ea1340ac2a.zip | |
Backport 2014-06-30 admin/update_autogen change
* admin/update_autogen: Auto-detect VCS in use.
(vcs): New variable.
(status, commit, main): Handle git.
Diffstat (limited to 'admin/update_autogen')
| -rwxr-xr-x | admin/update_autogen | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/admin/update_autogen b/admin/update_autogen index b9511969a15..d9d34fa3d6e 100755 --- a/admin/update_autogen +++ b/admin/update_autogen | |||
| @@ -47,6 +47,14 @@ cd $PD | |||
| 47 | cd ../ | 47 | cd ../ |
| 48 | [ -d admin ] || die "Could not locate admin directory" | 48 | [ -d admin ] || die "Could not locate admin directory" |
| 49 | 49 | ||
| 50 | if [ -d .bzr ]; then | ||
| 51 | vcs=bzr | ||
| 52 | elif [ -d .git ]; then | ||
| 53 | vcs=git | ||
| 54 | else | ||
| 55 | die "Cannot determine vcs" | ||
| 56 | fi | ||
| 57 | |||
| 50 | 58 | ||
| 51 | usage () | 59 | usage () |
| 52 | { | 60 | { |
| @@ -143,7 +151,10 @@ OPTIND=1 | |||
| 143 | ## Run status on inputs, list modified files on stdout. | 151 | ## Run status on inputs, list modified files on stdout. |
| 144 | status () | 152 | status () |
| 145 | { | 153 | { |
| 146 | bzr status -S "$@" >| $tempfile || die "bzr status error for $@" | 154 | local statflag="-S" |
| 155 | [ "$vcs" = "git" ] && statflag="-s" | ||
| 156 | |||
| 157 | $vcs status $statflag "$@" >| $tempfile || die "$vcs status error for $@" | ||
| 147 | 158 | ||
| 148 | local stat file modified | 159 | local stat file modified |
| 149 | 160 | ||
| @@ -217,8 +228,11 @@ commit () | |||
| 217 | 228 | ||
| 218 | echo "Committing..." | 229 | echo "Committing..." |
| 219 | 230 | ||
| 220 | ## bzr status output is always relative to top-level, not PWD. | 231 | $vcs commit -m "Auto-commit of $type files." "$@" || return $? |
| 221 | bzr commit -m "Auto-commit of $type files." "$@" || return $? | 232 | |
| 233 | [ "$vcs" = "git" ] && { | ||
| 234 | $vcs push || return $? | ||
| 235 | } | ||
| 222 | 236 | ||
| 223 | echo "Committed files: $@" | 237 | echo "Committed files: $@" |
| 224 | } # function commit | 238 | } # function commit |
| @@ -257,7 +271,7 @@ EOF | |||
| 257 | *-xtra.texi|*efaq-w32.texi) continue ;; | 271 | *-xtra.texi|*efaq-w32.texi) continue ;; |
| 258 | esac | 272 | esac |
| 259 | 273 | ||
| 260 | dircat=`sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file` | 274 | dircat=$(sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file) |
| 261 | 275 | ||
| 262 | ## TODO warn about unknown topics (check-info in top-level | 276 | ## TODO warn about unknown topics (check-info in top-level |
| 263 | ## Makefile does this). | 277 | ## Makefile does this). |
| @@ -291,7 +305,8 @@ EOF | |||
| 291 | 305 | ||
| 292 | modified=$(status $basegen) || die | 306 | modified=$(status $basegen) || die |
| 293 | 307 | ||
| 294 | cd $oldpwd | 308 | ## bzr status output is always relative to top-level, not PWD. |
| 309 | [ "$vcs" = "bzr" ] && cd $oldpwd | ||
| 295 | 310 | ||
| 296 | commit "generated" $modified || die "commit error" | 311 | commit "generated" $modified || die "commit error" |
| 297 | 312 | ||
| @@ -364,7 +379,8 @@ echo "Checking status of loaddef files..." | |||
| 364 | modified=$(status $genfiles ${ldefs_out#lisp/}) || die | 379 | modified=$(status $genfiles ${ldefs_out#lisp/}) || die |
| 365 | 380 | ||
| 366 | 381 | ||
| 367 | cd ../ | 382 | ## bzr status output is always relative to top-level, not PWD. |
| 383 | [ "$vcs" = "bzr" ] && cd ../ | ||
| 368 | 384 | ||
| 369 | 385 | ||
| 370 | commit "loaddefs" $modified || die "commit error" | 386 | commit "loaddefs" $modified || die "commit error" |