[Python-checkins] CVS: distutils/distutils/command sdist.py,1.12,1.13

Greg Ward python-dev@python.org
Fri, 21 Apr 2000 00:37:17 -0400 (EDT)


Update of /projects/cvsroot/distutils/distutils/command
In directory newcnri:/tmp/cvs-serv17540

Modified Files:
	sdist.py 
Log Message:
Fix 'check_metadata()' so it grovels through the distribution's metadata
object, rather than through the distribution itself (since I moved the meta-
data out to a DistributionMetadata instance).

Index: sdist.py
===================================================================
RCS file: /projects/cvsroot/distutils/distutils/command/sdist.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** sdist.py	2000/04/21 04:31:10	1.12
--- sdist.py	2000/04/21 04:37:12	1.13
***************
*** 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
--- 5,9 ----
  # created 1999/09/22, Greg Ward
  
! __revision__ = "$Id: sdist.py,v 1.13 2000/04/21 04:37:12 gward Exp $"
  
  import sys, os, string, re
***************
*** 108,116 ****
      def check_metadata (self):
  
!         dist = self.distribution
  
          missing = []
          for attr in ('name', 'version', 'url'):
!             if not (hasattr (dist, attr) and getattr (dist, attr)):
                  missing.append (attr)
  
--- 108,116 ----
      def check_metadata (self):
  
!         metadata = self.distribution.metadata
  
          missing = []
          for attr in ('name', 'version', 'url'):
!             if not (hasattr (metadata, attr) and getattr (metadata, attr)):
                  missing.append (attr)
  
***************
*** 119,128 ****
                         string.join (missing, ", "))
  
!         if dist.author:
!             if not dist.author_email:
                  self.warn ("missing meta-data: if 'author' supplied, " +
                             "'author_email' must be supplied too")
!         elif dist.maintainer:
!             if not dist.maintainer_email:
                  self.warn ("missing meta-data: if 'maintainer' supplied, " +
                             "'maintainer_email' must be supplied too")
--- 119,128 ----
                         string.join (missing, ", "))
  
!         if metadata.author:
!             if not metadata.author_email:
                  self.warn ("missing meta-data: if 'author' supplied, " +
                             "'author_email' must be supplied too")
!         elif metadata.maintainer:
!             if not metadata.maintainer_email:
                  self.warn ("missing meta-data: if 'maintainer' supplied, " +
                             "'maintainer_email' must be supplied too")