setup.py
changeset 32670 331dcf199039
parent 32539 2dcb3d52ef41
child 32675 7dab4c0cdb41
equal deleted inserted replaced
32669:b4356d1cf3e4 32670:331dcf199039
    75 from distutils.dist import Distribution
    75 from distutils.dist import Distribution
    76 from distutils.command.build import build
    76 from distutils.command.build import build
    77 from distutils.command.build_ext import build_ext
    77 from distutils.command.build_ext import build_ext
    78 from distutils.command.build_py import build_py
    78 from distutils.command.build_py import build_py
    79 from distutils.command.build_scripts import build_scripts
    79 from distutils.command.build_scripts import build_scripts
       
    80 from distutils.command.install import install
    80 from distutils.command.install_lib import install_lib
    81 from distutils.command.install_lib import install_lib
    81 from distutils.command.install_scripts import install_scripts
    82 from distutils.command.install_scripts import install_scripts
    82 from distutils.spawn import spawn, find_executable
    83 from distutils.spawn import spawn, find_executable
    83 from distutils import file_util
    84 from distutils import file_util
    84 from distutils.errors import (
    85 from distutils.errors import (
   462     @property
   463     @property
   463     def hgexepath(self):
   464     def hgexepath(self):
   464         dir = os.path.dirname(self.get_ext_fullpath('dummy'))
   465         dir = os.path.dirname(self.get_ext_fullpath('dummy'))
   465         return os.path.join(self.build_temp, dir, 'hg.exe')
   466         return os.path.join(self.build_temp, dir, 'hg.exe')
   466 
   467 
       
   468 class hginstall(install):
       
   469     def get_sub_commands(self):
       
   470         # Screen out egg related commands to prevent egg generation.  But allow
       
   471         # mercurial.egg-info generation, since that is part of modern
       
   472         # packaging.
       
   473         excl = {'bdist_egg'}
       
   474         return filter(lambda x: x not in excl, install.get_sub_commands(self))
       
   475 
   467 class hginstalllib(install_lib):
   476 class hginstalllib(install_lib):
   468     '''
   477     '''
   469     This is a specialization of install_lib that replaces the copy_file used
   478     This is a specialization of install_lib that replaces the copy_file used
   470     there so that it supports setting the mode of files after copying them,
   479     there so that it supports setting the mode of files after copying them,
   471     instead of just preserving the mode that the files originally had.  If your
   480     instead of just preserving the mode that the files originally had.  If your
   573             'build_mo': hgbuildmo,
   582             'build_mo': hgbuildmo,
   574             'build_ext': hgbuildext,
   583             'build_ext': hgbuildext,
   575             'build_py': hgbuildpy,
   584             'build_py': hgbuildpy,
   576             'build_scripts': hgbuildscripts,
   585             'build_scripts': hgbuildscripts,
   577             'build_hgextindex': buildhgextindex,
   586             'build_hgextindex': buildhgextindex,
       
   587             'install': hginstall,
   578             'install_lib': hginstalllib,
   588             'install_lib': hginstalllib,
   579             'install_scripts': hginstallscripts,
   589             'install_scripts': hginstallscripts,
   580             'build_hgexe': buildhgexe,
   590             'build_hgexe': buildhgexe,
   581             }
   591             }
   582 
   592