[Python-checkins] CVS: distutils/distutils/command sdist.py,1.36,1.37

Greg Ward python-dev@python.org
Tue, 4 Jul 2000 20:06:49 -0700


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

Modified Files:
	sdist.py 
Log Message:
Added the --dist-dir option to control where the archive(s) are put;
defaults to 'dist' (ie. no longer in the distribution root).

Index: sdist.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/sdist.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** sdist.py	2000/06/29 02:06:29	1.36
--- sdist.py	2000/07/05 03:06:46	1.37
***************
*** 65,68 ****
--- 65,71 ----
           "keep the distribution tree around after creating " +
           "archive file(s)"),
+         ('dist-dir=', 'd',
+          "directory to put the source distribution archive(s) in "
+          "[default: dist]"),
          ]
  
***************
*** 95,98 ****
--- 98,102 ----
          self.formats = None
          self.keep_tree = 0
+         self.dist_dir = None
  
          self.archive_files = None
***************
*** 119,123 ****
--- 123,130 ----
                    "unknown archive format '%s'" % bad_format
  
+         if self.dist_dir is None:
+             self.dist_dir = "dist"
  
+ 
      def run (self):
  
***************
*** 668,676 ****
          # done elsewhere.
          base_dir = self.distribution.get_fullname()
  
          self.make_release_tree (base_dir, self.files)
          archive_files = []              # remember names of files we create
          for fmt in self.formats:
!             file = self.make_archive (base_dir, fmt, base_dir=base_dir)
              archive_files.append(file)
  
--- 675,686 ----
          # done elsewhere.
          base_dir = self.distribution.get_fullname()
+         base_name = os.path.join(self.dist_dir, base_dir)
  
          self.make_release_tree (base_dir, self.files)
          archive_files = []              # remember names of files we create
+         if self.dist_dir:
+             self.mkpath(self.dist_dir)
          for fmt in self.formats:
!             file = self.make_archive (base_name, fmt, base_dir=base_dir)
              archive_files.append(file)