[Python-checkins] CVS: python/dist/src setup.py,1.74,1.75

Michael Hudson mwh@users.sourceforge.net
Wed, 16 Jan 2002 07:26:50 -0800


Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv12584

Modified Files:
	setup.py 
Log Message:
Apply a variant of patch

[ #420565 ] makes setup.py search sys.prefix

I think this also fixes some bug in the tracker about not searching 
directories that don't exist, but I can't find the report :(



Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** setup.py	2002/01/01 20:18:30	1.74
--- setup.py	2002/01/16 15:26:48	1.75
***************
*** 15,18 ****
--- 15,25 ----
  disabled_module_list = []
  
+ def add_dir_to_list(dirlist, dir):
+     """Add the directory 'dir' to the list 'dirlist' (at the front) if
+     1) 'dir' is not already in 'dirlist'
+     2) 'dir' actually exists, and is a directory."""
+     if os.path.isdir(dir) and dir not in dirlist:
+         dirlist.insert(0, dir)
+ 
  def find_file(filename, std_dirs, paths):
      """Searches for the directory where a given file is located,
***************
*** 194,201 ****
      def detect_modules(self):
          # Ensure that /usr/local is always used
!         if '/usr/local/lib' not in self.compiler.library_dirs:
!             self.compiler.library_dirs.insert(0, '/usr/local/lib')
!         if '/usr/local/include' not in self.compiler.include_dirs:
!             self.compiler.include_dirs.insert(0, '/usr/local/include' )
  
          try:
--- 201,211 ----
      def detect_modules(self):
          # Ensure that /usr/local is always used
!         add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
!         add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
! 
!         add_dir_to_list(self.compiler.library_dirs,
!                         sysconfig.get_config_var("LIBDIR"))
!         add_dir_to_list(self.compiler.include_dirs,
!                         sysconfig.get_config_var("INCLUDEDIR"))
  
          try: