[Python-checkins] CVS: distutils/distutils/command sdist.py,1.30,1.31
Greg Ward
python-dev@python.org
Wed, 7 Jun 2000 18:06:05 -0700
Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv23972
Modified Files:
sdist.py
Log Message:
Moved the code that prunes the file list after reading the manifest
template into a new method 'prune_file_list()', called from
'get_file_list()' rather than 'read_manifest()' -- this keeps
'read_manifest()' more general.
Deleted the redundant call to 'exclude_pattern()' in 'make_distribution()'
-- this had the same intention as 'prune_file_list()', but was incomplete
(only pruned the release tree, not the build tree) and in the wrong
place (the prune wouldn't be reflected in the manifest file).
Index: sdist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/sdist.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** sdist.py 2000/06/08 00:52:52 1.30
--- sdist.py 2000/06/08 01:06:02 1.31
***************
*** 5,9 ****
# created 1999/09/22, Greg Ward
! __revision__ = "$Id: sdist.py,v 1.30 2000/06/08 00:52:52 gward Exp $"
import sys, os, string, re
--- 5,9 ----
# created 1999/09/22, Greg Ward
! __revision__ = "$Id: sdist.py,v 1.31 2000/06/08 01:06:02 gward Exp $"
import sys, os, string, re
***************
*** 196,199 ****
--- 196,202 ----
self.read_template ()
+ # Prune away the build and source distribution directories
+ self.prune_file_list()
+
# File list now complete -- sort it so that higher-level files
# come first
***************
*** 476,488 ****
# while loop over lines of template file
! # Prune away the build and source distribution directories
! build = self.get_finalized_command ('build')
! self.exclude_pattern (self.files, None, prefix=build.build_base)
base_dir = self.distribution.get_fullname()
self.exclude_pattern (self.files, None, prefix=base_dir)
- # read_template ()
-
def select_pattern (self, files, pattern, anchor=1, prefix=None):
--- 479,497 ----
# while loop over lines of template file
! # read_template ()
!
+ def prune_file_list (self):
+ """Prune off branches that might slip into the file list as created
+ by 'read_template()', but really don't belong there: specifically,
+ the build tree (typically "build") and the release tree itself
+ (only an issue if we ran "sdist" previously with --keep-tree, or it
+ aborted).
+ """
+ build = self.get_finalized_command('build')
base_dir = self.distribution.get_fullname()
+ self.exclude_pattern (self.files, None, prefix=build.build_base)
self.exclude_pattern (self.files, None, prefix=base_dir)
def select_pattern (self, files, pattern, anchor=1, prefix=None):
***************
*** 613,620 ****
base_dir = self.distribution.get_fullname()
- # Remove any files that match "base_dir" from the fileset -- we
- # don't want to go distributing the distribution inside itself!
- self.exclude_pattern (self.files, base_dir + "*")
-
self.make_release_tree (base_dir, self.files)
archive_files = [] # remember names of files we create
--- 622,625 ----