[PATCH 2 of 3 RFC] setup: install some useful data files

Martin Geisler mg at lazybytes.net
Sun Nov 22 15:45:13 CST 2009


Dan Villiom Podlaski Christiansen <danchr at gmail.com> writes:

> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
> # Date 1257773193 -3600
> # Node ID 9cf85ff4e6016a227dba8f94708f8e89a9814440
> # Parent  40a9bb89ffbff69a966089dccd2c8ddeef415eb6
> setup: install some useful data files.
>
> diff --git a/contrib/bash_completion b/contrib/completion/bash/hg
> rename from contrib/bash_completion
> rename to contrib/completion/bash/hg
> diff --git a/contrib/zsh_completion b/contrib/completion/zsh/_hg
> rename from contrib/zsh_completion
> rename to contrib/completion/zsh/_hg

I don't think we need the extra completion/ directory?

> diff --git a/setup.py b/setup.py
> --- a/setup.py
> +++ b/setup.py
> @@ -34,9 +34,18 @@ from distutils.dist import Distribution
>  from distutils.command.install_data import install_data
>  from distutils.command.build import build
>  from distutils.command.build_py import build_py
> +from distutils.command.install import INSTALL_SCHEMES
>  from distutils.spawn import spawn, find_executable
>  from distutils.ccompiler import new_compiler
>  
> +# on UNIX-like systems, the distutils default is install data directly in
> +# $PREFIX, $HOME or whatever the base is. In such cases, change the default
> +# to the standard `share' directory.
> +for platform, scheme in INSTALL_SCHEMES.iteritems():
> +  if platform.split('_', 1)[0] == 'unix':
> +    if scheme['data'][0] == '$' and '/' not in scheme['data']:
> +      scheme['data'] += '/share'

I think it is simpler and more explicit to add the 'share/' prefix to
the four directories below. That would give the same effect, right?

>  extra = {}
>  scripts = ['hg']
>  if os.name == 'nt':
> @@ -271,7 +280,14 @@ if sys.platform == 'linux2' and os.uname
>                                       ['hgext/inotify/linux/_inotify.c']))
>          packages.extend(['hgext.inotify', 'hgext.inotify.linux'])
>  
> -datafiles = []
> +datafiles = [
> +    ('bash_completion.d', ['contrib/completion/bash/hg']),
> +    ('zsh/site-functions', ['contrib/completion/zsh/_hg']),
> +    ('mercurial/www', ['hgweb.cgi', 'hgwebdir.cgi',
> +                       'contrib/hgwebdir.fcgi',
> +                       'contrib/hgwebdir.wsgi']),

I think /usr/local/share/mercurial/hgweb would be a better name for the
hgweb scripts.

> +    ('mercurial/examples', ['contrib/sample.hgrc', 'contrib/mergetools.hgrc']),
> +]


-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091122/56c3eae4/attachment.pgp>


More information about the Mercurial-devel mailing list