[Python-checkins] CVS: distutils/distutils/command sdist.py,1.19,1.20

Greg Ward python-dev@python.org
Fri, 26 May 2000 20:03:26 -0700


Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv31359

Modified Files:
	sdist.py 
Log Message:
Patch from Andrew Kuchling: prune out the build and source distribution
directories after all is said and done, so we don't accidentally include
those files in the source distribution.

(This is the quick and easy way to fix this; Andrew says: "Changing
findall() looked like it was going to be messy, so I tried this instead.
The only problem is that redundant directory traversals are being done,
walking through build/ only to throw out all the files found at the end.").


Index: sdist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/sdist.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** sdist.py	2000/05/25 01:10:04	1.19
--- sdist.py	2000/05/27 03:03:23	1.20
***************
*** 5,9 ****
  # created 1999/09/22, Greg Ward
  
! __revision__ = "$Id: sdist.py,v 1.19 2000/05/25 01:10:04 gward Exp $"
  
  import sys, os, string, re
--- 5,9 ----
  # created 1999/09/22, Greg Ward
  
! __revision__ = "$Id: sdist.py,v 1.20 2000/05/27 03:03:23 gward Exp $"
  
  import sys, os, string, re
***************
*** 440,443 ****
--- 440,450 ----
  
          # while loop over lines of template file
+ 
+         # Prune away the build and source distribution directories
+         build = self.find_peer ('build')
+         exclude_pattern (self.files, None, prefix=build.build_base)
+ 
+         base_dir = self.distribution.get_fullname()
+         exclude_pattern (self.files, None, prefix=base_dir)
  
      # read_template ()