1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

[Ndiff] The setup.py installation script now suggests installing the

python-dev package in a certain error situation. Previously the
error message it printed was misleading:
  error: invalid Python installation: unable to open
  /usr/lib/python2.6/config/Makefile (No such file or directory)
The change was suggested by Aaron Leininger.
This commit is contained in:
david
2009-04-20 19:15:00 +00:00
parent ea36c6c890
commit 017339e372
2 changed files with 27 additions and 6 deletions

View File

@@ -1,5 +1,12 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o [Ndiff] The setup.py installation script now suggests installing the
python-dev package in a certain error situation. Previously the
error message it printed was misleading:
error: invalid Python installation: unable to open
/usr/lib/python2.6/config/Makefile (No such file or directory)
The change was suggested by Aaron Leininger. [David]
o Ncat's HTTP proxy now supports the GET, HEAD, and POST methods in o Ncat's HTTP proxy now supports the GET, HEAD, and POST methods in
addition to the CONNECT tunneling method, so it can be used as a addition to the CONNECT tunneling method, so it can be used as a
proxy with an ordinary web browser. [David] proxy with an ordinary web browser. [David]

View File

@@ -1,9 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
from distutils.core import setup import distutils.command
from distutils.cmd import Command import distutils.command.install
import distutils.core
import distutils.cmd
import distutils.errors
class null_command(Command): class null_command(distutils.cmd.Command):
"""This is a dummy distutils command that does nothing. We use it to replace """This is a dummy distutils command that does nothing. We use it to replace
the install_egg_info and avoid installing a .egg-info file, because there's the install_egg_info and avoid installing a .egg-info file, because there's
no option to disable that.""" no option to disable that."""
@@ -14,6 +17,17 @@ class null_command(Command):
def run(self): def run(self):
pass pass
setup(name = u"ndiff", scripts = [u"ndiff"], class checked_install(distutils.command.install.install):
data_files = [(u"share/man/man1", [u"docs/ndiff.1"])], """This is a wrapper around the install command that checks for an error
cmdclass = {"install_egg_info": null_command}) caused by not having the python-dev package installed. By default, distutils
gives a misleading error message: "invalid Python installation." """
def finalize_options(self):
try:
distutils.command.install.install.finalize_options(self)
except distutils.errors.DistutilsPlatformError, e:
raise distutils.errors.DistutilsPlatformError(str(e) + "\n"
+ "Installing your distribution's python-dev package may solve this problem.")
distutils.core.setup(name = u"ndiff", scripts = [u"ndiff"],
data_files = [(u"share/man/man1", [u"docs/ndiff.1"])],
cmdclass = {"install_egg_info": null_command, "install": checked_install})