File: //proc/2/cwd/proc/self/root/usr/lib/python2.4/distutils/util.pyo
m
=5Dc @ s d Z d Z d k Z d k Z d k Z d k Z d k l Z d k l Z d k
l Z d k l
Z
d Z d Z d Z d
a d Z d Z d
d Z d a a a d Z d Z d d
d
d Z d Z d
d
d d d d
d d Z d Z d S( su distutils.util
Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
s1 $Id: util.py 36560 2004-07-18 06:16:08Z tim_one $N( s DistutilsPlatformError( s newer( s spawn( s logc C s t i d j p t t d o t i Sn t i \ } } } } } t i | } t i
| d d } t i
| d d } | d d j o d | | f Sn | d d
j oA | d d j o, d
} d t | d d | d f } qn | d d j o d | | f Snw | d d j o d | | | f SnQ | d d j o? d } t i d } | i | } | o | i } qn d | | | f S( s Return a string that identifies the current platform. This is used
mainly to distinguish platform-specific build directories and
platform-specific built distributions. Typically includes the OS name
and version and the architecture (as supplied by 'os.uname()'),
although the exact information included depends on the OS; eg. for IRIX
the architecture isn't particularly important (IRIX only runs on SGI
hardware), but for Linux the kernel version isn't particularly
important.
Examples of returned values:
linux-i586
linux-alpha (?)
solaris-2.6-sun4u
irix-5.3
irix64-6.2
For non-POSIX platforms, currently just returns 'sys.platform'.
t posixt unamet /t t t _i t linuxs %s-%st sunosi t 5t solariss %d.%si i i t irixt aixs %s-%s.%si t cygwins [\d.]+s %s-%s-%sN( t ost namet hasattrt syst platformR t osnamet hostt releaset versiont machinet stringt lowert replacet intt ret compilet rel_ret matcht mt group( R R R R R R R ( ( t$ /usr/lib/python2.4/distutils/util.pyt get_platform s0 !*c C s t i d j o | Sn | p | Sn | d d j o t d | n | d d j o t d | n t i | d } x d | j o | i d q W| p t i Sn t t i
i | S( s Return 'pathname' as a name that will work on the native filesystem,
i.e. split it on '/' and put it back together again using the current
directory separator. Needed because filenames in the setup script are
always supplied in Unix style, and have to be converted to the local
convention before we can actually use them in the filesystem. Raises
ValueError on non-Unix-ish systems if 'pathname' either starts or
ends with a slash.
R i s path '%s' cannot be absoluteis path '%s' cannot end with '/'t .N( R
t sept pathnamet
ValueErrorR t splitt pathst removet curdirt applyt patht join( R% R( ( ( R! t convert_pathK s
c C s t i d j oE t i i | p t i i | | Sqt i i | | d SnDt i d j oN t i i | \ } } | d d j o | d } n t i i | | Sn t i d j oQ t i i | \ } } | d t i j o | d } n t i i | | Sn t i d j od t i i | p t i i | | Sqt
i | d d } d | d } t i i | | Sn t
d t i d
S( s Return 'pathname' with 'new_root' prepended. If 'pathname' is
relative, this is equivalent to "os.path.join(new_root,pathname)".
Otherwise, it requires making 'pathname' relative and then joining the
two, which is tricky on DOS/Windows and Mac OS.
R i t nti s \t os2t mact :s! nothing known about platform '%s'N( R
R R, t isabsR% R- t new_roott
splitdrivet driveR$ R R' t elementst DistutilsPlatformError( R4 R% R7 R6 R, ( ( R! t change_rootg s, i c C s t o d Sn t i d j oA t i i d o- d k } | i t i d t i d <n t i i d p t t i d <n d a d S( sL Ensure that 'os.environ' has all the environment variables we
guarantee that users can use in config files, command-line options,
etc. Currently this includes:
HOME - user's home directory (Unix only)
PLAT - description of the current platform, including hardware
and OS (see 'get_platform()')
NR t HOMEi t PLATi ( t _environ_checkedR
R t environt has_keyt pwdt getpwuidt getuidR"