~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Lib/distutils/util.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
one of the other *util.py modules.
5
5
"""
6
6
 
7
 
__revision__ = "$Id: util.py 74807 2009-09-15 19:14:37Z ronald.oussoren $"
 
7
__revision__ = "$Id: util.py 77376 2010-01-08 23:27:23Z tarek.ziade $"
8
8
 
9
9
import sys, os, string, re
10
10
from distutils.errors import DistutilsPlatformError
11
11
from distutils.dep_util import newer
12
12
from distutils.spawn import spawn
13
13
from distutils import log
 
14
from distutils.errors import DistutilsByteCompileError
14
15
 
15
16
def get_platform ():
16
17
    """Return a string that identifies the current platform.  This is used
162
163
                    raise ValueError(
163
164
                       "Don't know machine value for archs=%r"%(archs,))
164
165
 
 
166
            elif machine == 'i386':
 
167
                # On OSX the machine type returned by uname is always the
 
168
                # 32-bit variant, even if the executable architecture is
 
169
                # the 64-bit variant
 
170
                if sys.maxint >= 2**32:
 
171
                    machine = 'x86_64'
165
172
 
166
173
            elif machine in ('PowerPC', 'Power_Macintosh'):
167
174
                # Pick a sane name for the PPC architecture.
168
175
                machine = 'ppc'
169
176
 
 
177
                # See 'i386' case
 
178
                if sys.maxint >= 2**32:
 
179
                    machine = 'ppc64'
 
180
 
170
181
    return "%s-%s-%s" % (osname, release, machine)
171
182
 
172
183
# get_platform ()
447
458
    generated in indirect mode; unless you know what you're doing, leave
448
459
    it set to None.
449
460
    """
 
461
    # nothing is done if sys.dont_write_bytecode is True
 
462
    if sys.dont_write_bytecode:
 
463
        raise DistutilsByteCompileError('byte-compiling is disabled.')
450
464
 
451
465
    # First, if the caller didn't force us into direct or indirect mode,
452
466
    # figure out which mode we should be in.  We take a conservative
559
573
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
560
574
    """
561
575
    lines = string.split(header, '\n')
562
 
    lines = map(string.strip, lines)
563
576
    header = string.join(lines, '\n' + 8*' ')
564
577
    return header