]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added --plat-name option to override sysconfig.get_platform() in
authorGreg Ward <gward@python.net>
Mon, 11 Sep 2000 00:47:35 +0000 (00:47 +0000)
committerGreg Ward <gward@python.net>
Mon, 11 Sep 2000 00:47:35 +0000 (00:47 +0000)
generated filenames.

Lib/distutils/command/bdist.py
Lib/distutils/command/bdist_dumb.py

index 1c862d585d101b5e5038a4184ba2f044cc1e4478..cc0c3985cf19fd956393525aff7c9b83818249fe 100644 (file)
@@ -32,6 +32,9 @@ class bdist (Command):
 
     user_options = [('bdist-base=', 'b',
                      "temporary directory for creating built distributions"),
+                    ('plat-name=', 'p',
+                     "platform name to embed in generated filenames "
+                     "(default: %s)" % get_platform()),
                     ('formats=', None,
                      "formats for distribution (comma-separated list)"),
                     ('dist-dir=', 'd',
@@ -70,6 +73,7 @@ class bdist (Command):
 
     def initialize_options (self):
         self.bdist_base = None
+        self.plat_name = None
         self.formats = None
         self.dist_dir = None
 
@@ -77,13 +81,16 @@ class bdist (Command):
 
 
     def finalize_options (self):
+        # have to finalize 'plat_name' before 'bdist_base'
+        if self.plat_name is None:
+            self.plat_name = get_platform()
+
         # 'bdist_base' -- parent of per-built-distribution-format
         # temporary directories (eg. we'll probably have
         # "build/bdist.<plat>/dumb", "build/bdist.<plat>/rpm", etc.)
         if self.bdist_base is None:
             build_base = self.get_finalized_command('build').build_base
-            plat = get_platform()
-            self.bdist_base = os.path.join (build_base, 'bdist.' + plat)
+            self.bdist_base = os.path.join(build_base, 'bdist.' + self.plat_name)
 
         self.ensure_string_list('formats')
         if self.formats is None:
index e93c6b7272f5273019e6158035fdf5c0e9c867a6..0fb8e83b2f8cc8769b15544c303ef0800bbf1d61 100644 (file)
@@ -20,6 +20,9 @@ class bdist_dumb (Command):
 
     user_options = [('bdist-dir=', 'd',
                      "temporary directory for creating the distribution"),
+                    ('plat-name=', 'p',
+                     "platform name to embed in generated filenames "
+                     "(default: %s)" % get_platform()),
                     ('format=', 'f',
                      "archive format to create (tar, ztar, gztar, zip)"),
                     ('keep-tree', 'k',
@@ -35,6 +38,7 @@ class bdist_dumb (Command):
 
     def initialize_options (self):
         self.bdist_dir = None
+        self.plat_name = None
         self.format = None
         self.keep_tree = 0
         self.dist_dir = None
@@ -43,6 +47,7 @@ class bdist_dumb (Command):
 
 
     def finalize_options (self):
+
         if self.bdist_dir is None:
             bdist_base = self.get_finalized_command('bdist').bdist_base
             self.bdist_dir = os.path.join(bdist_base, 'dumb')
@@ -55,7 +60,9 @@ class bdist_dumb (Command):
                       ("don't know how to create dumb built distributions " +
                        "on platform %s") % os.name
 
-        self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
+        self.set_undefined_options('bdist',
+                                   ('dist_dir', 'dist_dir'),
+                                   ('plat_name', 'plat_name'))
 
     # finalize_options()
 
@@ -74,7 +81,7 @@ class bdist_dumb (Command):
         # And make an archive relative to the root of the
         # pseudo-installation tree.
         archive_basename = "%s.%s" % (self.distribution.get_fullname(),
-                                      get_platform())
+                                      self.plat_name)
         print "self.bdist_dir = %s" % self.bdist_dir
         print "self.format = %s" % self.format
         self.make_archive (os.path.join(self.dist_dir, archive_basename),