Patch for setup.py to install contrib directory

Jonathan S. Shapiro shap at eros-os.com
Wed Aug 29 23:54:14 CDT 2007


As promised, here is a correction. It's a pure replacement, so I'm not
building a patch.

There is a better way to do the OS-specific check. This puts the focus
on assigning an appropriate contrib install directory, which is the
important part of the problem. The only reason I moved the walk of the
contrib directory out of the call to setup() is so that it could be
conditioned on the operating system. If the patch is accepted, please
use the following code instead.

NOTE: this was typed in to the email. I have NOT tested this
replacement, and it may have a typo in it.

contrib_dir = None
contrib_files = []  # default
if os.name in ['posix']:
  contrib_dir = '/usr/share/mercurial'

if contrib_dir != None:
    contrib_files = [(os.path.join(contrib_dir, root),
                      [os.path.join(root, file_) for file_ in files])
                     for root, dirs, files in os.walk('contrib')]
    contrib_files = contrib_files + [('/usr/share/mercurial',
                                      ['hgwebdir.cgi', 'hgweb.cgi'])]
-- 
Jonathan S. Shapiro, Ph.D.
Managing Director
The EROS Group, LLC



More information about the Mercurial-devel mailing list