[Python-checkins] CVS: distutils/distutils/command sdist.py,1.11,1.12
Greg Ward
python-dev@python.org
2000年4月21日 00:31:14 -0400 (EDT)
Update of /projects/cvsroot/distutils/distutils/command
In directory newcnri:/tmp/cvs-serv17476
Modified Files:
sdist.py
Log Message:
Patch from Andrew Kuchling: allow multiple include/exclude patterns
for all commands except 'prune' and 'graft'.
Index: sdist.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/command/sdist.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** sdist.py 2000年04月14日 00:49:30 1.11
--- sdist.py 2000年04月21日 04:31:10 1.12
***************
*** 5,9 ****
# created 1999年09月22日, Greg Ward
! __revision__ = "$Id: sdist.py,v 1.11 2000年04月14日 00:49:30 gward Exp $"
import sys, os, string, re
--- 5,9 ----
# created 1999年09月22日, Greg Ward
! __revision__ = "$Id: sdist.py,v 1.12 2000年04月21日 04:31:10 gward Exp $"
import sys, os, string, re
***************
*** 311,332 ****
if action in ('include','exclude',
'global-include','global-exclude'):
! if len (words) != 2:
template.warn \
("invalid manifest template line: " +
! "'%s' expects a single <pattern>" %
action)
continue
! pattern = native_path (words[1])
elif action in ('recursive-include','recursive-exclude'):
! if len (words) != 3:
template.warn \
("invalid manifest template line: " +
! "'%s' expects <dir> <pattern>" %
action)
continue
! (dir, pattern) = map (native_path, words[1:3])
elif action in ('graft','prune'):
--- 311,333 ----
if action in ('include','exclude',
'global-include','global-exclude'):
! if len (words) < 2:
template.warn \
("invalid manifest template line: " +
! "'%s' expects <pattern1> <pattern2> ..." %
action)
continue
! pattern_list = map(native_path, words[1:])
elif action in ('recursive-include','recursive-exclude'):
! if len (words) < 3:
template.warn \
("invalid manifest template line: " +
! "'%s' expects <dir> <pattern1> <pattern2> ..." %
action)
continue
! dir = native_path(words[1])
! pattern_list = map (native_path, words[2:])
elif action in ('graft','prune'):
***************
*** 353,408 ****
if action == 'include':
! print "include", pattern
! files = select_pattern (all_files, pattern, anchor=1)
! if not files:
! template.warn ("no files found matching '%s'" % pattern)
! else:
! self.files.extend (files)
elif action == 'exclude':
! print "exclude", pattern
! num = exclude_pattern (self.files, pattern, anchor=1)
! if num == 0:
! template.warn \
! ("no previously-included files found matching '%s'" %
! pattern)
elif action == 'global-include':
! print "global-include", pattern
! files = select_pattern (all_files, pattern, anchor=0)
! if not files:
! template.warn (("no files found matching '%s' " +
! "anywhere in distribution") %
! pattern)
! else:
! self.files.extend (files)
elif action == 'global-exclude':
! print "global-exclude", pattern
! num = exclude_pattern (self.files, pattern, anchor=0)
! if num == 0:
! template.warn \
! (("no previously-included files matching '%s' " +
! "found anywhere in distribution") %
! pattern)
elif action == 'recursive-include':
! print "recursive-include", dir, pattern
! files = select_pattern (all_files, pattern, prefix=dir)
! if not files:
! template.warn (("no files found matching '%s' " +
! "under directory '%s'") %
! (pattern, dir))
! else:
! self.files.extend (files)
elif action == 'recursive-exclude':
! print "recursive-exclude", dir, pattern
! num = exclude_pattern (self.files, pattern, prefix=dir)
! if num == 0:
! template.warn \
! (("no previously-included files matching '%s' " +
! "found under directory '%s'") %
! (pattern, dir))
elif action == 'graft':
--- 354,415 ----
if action == 'include':
! print "include", string.join(pattern_list)
! for pattern in pattern_list:
! files = select_pattern (all_files, pattern, anchor=1)
! if not files:
! template.warn ("no files found matching '%s'" % pattern)
! else:
! self.files.extend (files)
elif action == 'exclude':
! print "exclude", string.join(pattern_list)
! for pattern in pattern_list:
! num = exclude_pattern (self.files, pattern, anchor=1)
! if num == 0:
! template.warn (
! "no previously-included files found matching '%s'"%
! pattern)
elif action == 'global-include':
! print "global-include", string.join(pattern_list)
! for pattern in pattern_list:
! files = select_pattern (all_files, pattern, anchor=0)
! if not files:
! template.warn (("no files found matching '%s' " +
! "anywhere in distribution") %
! pattern)
! else:
! self.files.extend (files)
elif action == 'global-exclude':
! print "global-exclude", string.join(pattern_list)
! for pattern in pattern_list:
! num = exclude_pattern (self.files, pattern, anchor=0)
! if num == 0:
! template.warn \
! (("no previously-included files matching '%s' " +
! "found anywhere in distribution") %
! pattern)
elif action == 'recursive-include':
! print "recursive-include", dir, string.join(pattern_list)
! for pattern in pattern_list:
! files = select_pattern (all_files, pattern, prefix=dir)
! if not files:
! template.warn (("no files found matching '%s' " +
! "under directory '%s'") %
! (pattern, dir))
! else:
! self.files.extend (files)
elif action == 'recursive-exclude':
! print "recursive-exclude", dir, string.join(pattern_list)
! for pattern in pattern_list:
! num = exclude_pattern (self.files, pattern, prefix=dir)
! if num == 0:
! template.warn \
! (("no previously-included files matching '%s' " +
! "found under directory '%s'") %
! (pattern, dir))
elif action == 'graft':