[Python-checkins] python/dist/src/Lib/plat-mac pimp.py, 1.27, 1.27.4.1

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Sat Feb 28 18:21:53 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28905

Modified Files:
      Tag: release23-maint
	pimp.py 
Log Message:
Backport of 1.29 and 1.30 (1.28 is obsolete):
Started on version 0.4: better scheme for finding correct database:
- Try not only "darwin-7.X.Y" but also "darwin-7.X" and "darwin-7",
  so far we've never had to create anew database for a minor release.
- Distinguish between the various different installs (user-installed
  MacPython, apple-installed MacPython, other).



Index: pimp.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/pimp.py,v
retrieving revision 1.27
retrieving revision 1.27.4.1
diff -C2 -d -r1.27 -r1.27.4.1
*** pimp.py	21 Jul 2003 20:47:11 -0000	1.27
--- pimp.py	28 Feb 2004 23:21:50 -0000	1.27.4.1
***************
*** 36,40 ****
  NO_EXECUTE=0
  
! PIMP_VERSION="0.3"
  
  # Flavors:
--- 36,40 ----
  NO_EXECUTE=0
  
! PIMP_VERSION="0.4"
  
  # Flavors:
***************
*** 45,49 ****
  DEFAULT_BUILDDIR='/tmp'
  DEFAULT_INSTALLDIR=distutils.sysconfig.get_python_lib()
! DEFAULT_PIMPDATABASE="http://www.python.org/packman/version-0.3/%s.plist" % distutils.util.get_platform()
  
  def _cmd(output, dir, *cmditems):
--- 45,94 ----
  DEFAULT_BUILDDIR='/tmp'
  DEFAULT_INSTALLDIR=distutils.sysconfig.get_python_lib()
! DEFAULT_PIMPDATABASE_FMT="http://www.python.org/packman/version-%s/%s-%s-%s-%s-%s.plist"
! 
! def getDefaultDatabase(experimental=False):
! 	if experimental:
! 		status = "exp"
! 	else:
! 		status = "prod"
! 		
! 	major, minor, micro, state, extra = sys.version_info
! 	pyvers = '%d.%d' % (major, minor)
! 	if state != 'final':
! 		pyvers = pyvers + '%s%d' % (state, extra)
! 		
! 	longplatform = distutils.util.get_platform()
! 	osname, release, machine = longplatform.split('-')
! 	# For some platforms we may want to differentiate between
! 	# installation types
! 	if osname == 'darwin':
! 		if sys.prefix.startswith('/System/Library/Frameworks/Python.framework'):
! 			osname = 'darwin_apple'
! 		elif sys.prefix.startswith('/Library/Frameworks/Python.framework'):
! 			osname = 'darwin_macpython'
! 		# Otherwise we don't know...
! 	# Now we try various URLs by playing with the release string.
! 	# We remove numbers off the end until we find a match.
! 	rel = release
! 	while True:
! 		url = DEFAULT_PIMPDATABASE_FMT % (PIMP_VERSION, status, pyvers, osname, rel, machine)
! 		try:
! 			urllib2.urlopen(url)
! 		except urllib2.HTTPError, arg:
! 			pass
! 		else:
! 			break
! 		if not rel:
! 			# We're out of version numbers to try. Use the
! 			# full release number, this will give a reasonable
! 			# error message later
! 			url = DEFAULT_PIMPDATABASE_FMT % (PIMP_VERSION, status, pyvers, osname, release, machine)
! 			break
! 		idx = rel.rfind('.')
! 		if idx < 0:
! 			rel = ''
! 		else:
! 			rel = rel[:idx]
! 	return url
  
  def _cmd(output, dir, *cmditems):
***************
*** 164,168 ****
              buildDir = DEFAULT_BUILDDIR
          if not pimpDatabase:
!             pimpDatabase = DEFAULT_PIMPDATABASE
          self.setInstallDir(installDir)
          self.flavorOrder = flavorOrder
--- 209,213 ----
              buildDir = DEFAULT_BUILDDIR
          if not pimpDatabase:
!             pimpDatabase = getDefaultDatabase()
          self.setInstallDir(installDir)
          self.flavorOrder = flavorOrder
***************
*** 933,937 ****
          print "              (default: %s)" % DEFAULT_INSTALLDIR
          print "       -u url URL for database"
-         print "              (default: %s)" % DEFAULT_PIMPDATABASE
          sys.exit(1)
          
--- 978,981 ----




More information about the Python-checkins mailing list