Jonathan Nieder <jrnie...@gmail.com> writes:
>
> Just try it out and send a diff.

Err, I didn't try a full build, but I get some joy from the files below,
tested in an unpack/repack.

I looked through the long list of startup autoloads and pruned them to
just the entrypoints I could identify.  Can always add back later, but
I'm pretty sure the two left are the only ones that should be there.


For what it's worth I'm not sure how well the code works in emacs21 or
xemacs21, but it byte-compiles successfully so that's enough for the
packaging and can worry later if it needs a bit of help.


;; -*-emacs-lisp-*-
;;
;; Emacs startup file, e.g.  /etc/emacs/site-start.d/50git-core.el
;; for the Debian git-core package


(let ((dir (concat "/usr/share/"
                   (symbol-name debian-emacs-flavor)
                   "/site-lisp/git-core")))
  (if (not (file-exists-p dir))
      (message "git-core removed but not purged, skipping setup")

    ;; debian-pkg-add-load-path-item as from debian 3.1 "sarge",
    ;; emacsen-common 1.4.14 of June 2002
    (debian-pkg-add-load-path-item dir)

    ;; Compatibility note: In debian git-core 1:1.7.0-1 there was a long
    ;; list of generated autoloads here, but now pruned back to the
    ;; interactive entrypoints.  If you were using those autoloads in elisp
    ;; code, don't do that, use (require 'git) to express the dependency.

    ;; git.el

    (autoload 'git-status "git" "Entry point into git-status mode." t)

    ;; git-blame.el

    ;; this autoload as recommended by git-blame.el comments
    (autoload 'git-blame-mode "git-blame"
      "Minor mode for incremental blame for Git." t)))

;; End of file
#!/bin/sh
set -e

# This install uses the ".el symlinks with the .elc" style.
# It makes the .el source available to the various Emacs
# help tools, and having the .el and .elc in the same dir
# makes `list-load-path-shadows' happy.
#
# There used to be a copy of vc-git.el in git-core, but no
# longer.  It's included in Emacs itself in Emacs 22.2 up.
#

FLAVOR=$1
echo install/git-core: Handling install of emacsen flavor $FLAVOR

el_files="git.el git-blame.el"
el_dir=/usr/share/doc/git-core/contrib/emacs
elc_dir=/usr/share/$FLAVOR/site-lisp/git-core

if [ $FLAVOR != emacs ]
then
  echo install/git-core: byte-compiling for $FLAVOR

  [ -d $elc_dir ] || mkdir $elc_dir

  # Symlink .el file(s)
  cd $elc_dir
  for i in $el_files
  do
    ln -s $el_dir/$i $i
  done

  # Byte compile .el file(s)
  set -x
  $FLAVOR -batch -q -no-site-file -f batch-byte-compile $el_files
  set +x
fi
exit 0
#!/bin/sh
set -e

FLAVOR=$1
elc_dir=/usr/share/${FLAVOR}/site-lisp/git-core

echo remove/git-core: Handling removal of emacsen flavor ${FLAVOR}

if [ ${FLAVOR} != emacs ]
then
  echo git-core: purging byte-compiled files for ${FLAVOR}

  # -f to ignore if the directory is somehow already gone
  rm -f $elc_dir/*.el $elc_dir/*.elc
  # || true to quietly ignore if the directory is somehow not empty
  rmdir $elc_dir || true
fi
exit 0

Reply via email to