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

Martin Geisler mg at lazybytes.net
Tue Nov 24 09:27:26 CST 2009


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

> On 22 Nov 2009, at 22:45, Martin Geisler wrote:
>
>> Dan Villiom Podlaski Christiansen <danchr at gmail.com> writes:
>> 
>>> 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?
>
> Perhaps I should name the directories zsh_completion and
> bash_completion instead?

I would go with contrib/bash/hg and contrib/zsh/_hg -- short and simple.

>>> +# 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?
>
> Assuming that every platform will want to put the data files in there,
> yes. I don't know about Windows, but I suspect ‘share’ isn't
> appropriate there. Maybe something like ‘AppData’ or whatever…

Let's keep it simple at first and use 'share/' everywhere. Fewer hacks,
more simplicity... that's our motto :-)

>>> -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.
>
> That would lead to names like ‘mercurial/hgweb/hgweb.cgi’ which feels
> ugly to me. Is ‘www-scripts’ better?

Nah, I see your point -- let's go with www then.

-- 
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/20091124/4404dcad/attachment.pgp>


More information about the Mercurial-devel mailing list