cd ../
[ -d admin ] || die "Could not locate admin directory"
+if [ -d .bzr ]; then
+ vcs=bzr
+elif [ -d .git ]; then
+ vcs=git
+else
+ die "Cannot determine vcs"
+fi
+
usage ()
{
## Run status on inputs, list modified files on stdout.
status ()
{
- bzr status -S "$@" >| $tempfile || die "bzr status error for $@"
+ local statflag="-S"
+ [ "$vcs" = "git" ] && statflag="-s"
+
+ $vcs status $statflag "$@" >| $tempfile || die "$vcs status error for $@"
local stat file modified
echo "Committing..."
- ## bzr status output is always relative to top-level, not PWD.
- bzr commit -m "Auto-commit of $type files." "$@" || return $?
+ $vcs commit -m "Auto-commit of $type files." "$@" || return $?
+
+ [ "$vcs" = "git" ] && {
+ $vcs push || return $?
+ }
echo "Committed files: $@"
} # function commit
*-xtra.texi|*efaq-w32.texi) continue ;;
esac
- dircat=`sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file`
+ dircat=$(sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file)
## TODO warn about unknown topics (check-info in top-level
## Makefile does this).
modified=$(status $basegen) || die
- cd $oldpwd
+ ## bzr status output is always relative to top-level, not PWD.
+ [ "$vcs" = "bzr" ] && cd $oldpwd
commit "generated" $modified || die "commit error"
echo "Finding loaddef targets..."
-sed -n -e '/^AUTOGEN_VCS/,/^$/p' lisp/Makefile.in | \
- sed -e '/AUTOGEN_VCS/d' -e '/^$/d' -e 's/\\//' \
- >| $tempfile || die "sed error"
+find lisp -name '*.el' -exec grep '^;.*generated-autoload-file:' {} + | \
+ sed -e '/loaddefs\|esh-groups/d' -e 's|/[^/]*: "|/|' -e 's/"//g' \
+ >| $tempfile || die "Error finding targets"
genfiles=
while read genfile; do
- [ -r lisp/$genfile ] || die "Unable to read $genfile"
+ ## Or we can just use sort -u when making tempfile...
+ case " $genfiles " in
+ *" $genfile "*) continue ;;
+ esac
+
+ [ -r $genfile ] || die "Unable to read $genfile"
genfiles="$genfiles $genfile"
done < $tempfile
cp $ldefs_in $ldefs_out || die "cp ldefs_boot error"
-cd lisp
-
echo "Checking status of loaddef files..."
## It probably would be fine to just check+commit lisp/, since
## making autoloads should not effect any other files. But better
## safe than sorry.
-modified=$(status $genfiles ${ldefs_out#lisp/}) || die
-
-
-cd ../
+modified=$(status $genfiles $ldefs_out) || die
commit "loaddefs" $modified || die "commit error"