[PATCH] Consolidated patch to install contrib/ on posix platforms

Jonathan S. Shapiro shap at eros-os.com
Sun Sep 9 15:17:08 CDT 2007


On Sun, 2007-09-09 at 16:22 -0300, Alexis S. L. Carvalho wrote:
> Thus spake Jonathan S. Shapiro:
> > # HG changeset patch
> > # User Jonathan S. Shapiro <shap at eros-os.com>
> > # Date 1188579402 14400
> > # Node ID 9085dc8f7de9c2642e1ee690bfc1780b6b2f1a42
> > # Parent  694eb9ccb54d9f9c2e63a65368df0fdc9843f98f
> > Consolidated patch to install contrib/ on posix platforms.
> 
> I have 2 issues with this patch:
> 
> - it hard codes /usr/share/mercurial, making it impossible to install it
>   in another prefix, $HOME in particular (I think - I haven't actually
>   tested it);

At the time I wrote it I did not know about --prefix yet. Note, however,
that there is a real problem in the whole installation model of
setup_tools: it isn't designed to deal with this sort of system-specific
install. The install model you are asking for is mildly schizophrenic.
Basically, you are saying that if the install goes into the magic
prefix /usr, then this stuff should go in /usr/share. But where does the
magic stop?

My thoughts:

  prefix       contrib dir
  /usr         /usr/share/mercurial/contrib
  /usr/local   /usr/local/share/mercurial/contrib
  other        put it in site-package/mercurial/contrib

But you see the problem: the first two are $prefix/share/contrib, while
the last is something else entirely.

> - I'm really not sure we want to install everything in contrib/ like
>   this.

Filtering contrib/ involves policy decisions about what should be
installed. I'm not the right person to make those policy decisions. My
"policy" was that if it comes in the tarball it isn't my job to throw it
away. That is a decision for the mercurial team to make.

>   I think you can make a good argument that hgk should be installed
>   somewhere, since hgext/hgk.py depends on it, but I'd rather let
>   distributions decide where to install the other files, _if_ they want
>   to install them.

Initially I thought so too. Later I realized that if the location of the
contrib/ install is well defined, you can simply stick the path to hgk
into the system-wide or user-specific hgrc, so the installer doesn't
need to do this.

>   For example, the Debian package installs most files in
>   /usr/share/doc/mercurial/examples, which is a pretty standard place
>   for this kind of thing in Debian.  It also puts the bash completion
>   file in /etc/bash_completion.d/ and mercurial.el in some emacs
>   directory, so that both are automatically used.
> 
>   OTOH it doesn't bother with contrib/win32 and contrib/macosx, which
>   are not interesting to Debian users.

Using examples on fedora is definitely not appropriate. The bash and
emacs thoughts seem reasonable to me.
-- 
Jonathan S. Shapiro
Managing Director
The EROS Group, LLC
www.coyotos.org, www.eros-os.org



More information about the Mercurial-devel mailing list