view hg @ 23932:d7a90949fc18 stable

osx: use bdist_mpkg.script_bdist_mpkg module instead of bdist_mpkg command It seems like a default installation of bdist_mpkg makes it available as Python module, but the corresponding executable is placed in a location like /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/bin which is not in $PATH and thus not directly available. 'make osx' would thus fail. Instead, skip the bdist_mpkg executable and invoke it as a Python module. That works out of the box here.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 21 Jan 2015 05:04:48 +0100
parents 73e4a02e6d23
children 2ea9c9aa6e60
line wrap: on
line source

#!/usr/bin/env python
#
# mercurial - scalable distributed SCM
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

import os
import sys

if os.environ.get('HGUNICODEPEDANTRY', False):
    reload(sys)
    sys.setdefaultencoding("undefined")


libdir = '@LIBDIR@'

if libdir != '@' 'LIBDIR' '@':
    if not os.path.isabs(libdir):
        libdir = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                              libdir)
        libdir = os.path.abspath(libdir)
    sys.path.insert(0, libdir)

# enable importing on demand to reduce startup time
try:
    from mercurial import demandimport; demandimport.enable()
except ImportError:
    import sys
    sys.stderr.write("abort: couldn't find mercurial libraries in [%s]\n" %
                     ' '.join(sys.path))
    sys.stderr.write("(check your install and PYTHONPATH)\n")
    sys.exit(-1)

import mercurial.util
import mercurial.dispatch

for fp in (sys.stdin, sys.stdout, sys.stderr):
    mercurial.util.setbinary(fp)

mercurial.dispatch.run()