[Python-checkins] python/dist/src/Lib/distutils/command bdist_packager.py,1.1,1.2 bdist_pkgtool.py,1.1,1.2

bwarsaw@sourceforge.net bwarsaw@sourceforge.net
Tue, 23 Apr 2002 11:18:45 -0700


Update of /cvsroot/python/python/dist/src/Lib/distutils/command
In directory usw-pr-cvs1:/tmp/cvs-serv24299/Lib/distutils/command

Modified Files:
	bdist_packager.py bdist_pkgtool.py 
Log Message:
Whitespace normalization.  Unka Timmy would be proud.


Index: bdist_packager.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_packager.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bdist_packager.py	17 Apr 2002 20:30:10 -0000	1.1
--- bdist_packager.py	23 Apr 2002 18:18:43 -0000	1.2
***************
*** 3,7 ****
  Modified from bdist_dumb by Mark W. Alexander <slash@dotnetslash.net>
  
! Implements the Distutils 'bdist_packager' abstract command 
  to be subclassed by binary package creation commands."""
  
--- 3,7 ----
  Modified from bdist_dumb by Mark W. Alexander <slash@dotnetslash.net>
  
! Implements the Distutils 'bdist_packager' abstract command
  to be subclassed by binary package creation commands."""
  
***************
*** 34,38 ****
          ('revision=', None,
           "package revision number"),
! 	# the following have moved into the distribution class
          #('packager=', None,
           #"Package maintainer"),
--- 34,38 ----
          ('revision=', None,
           "package revision number"),
!         # the following have moved into the distribution class
          #('packager=', None,
           #"Package maintainer"),
***************
*** 200,207 ****
          self.ensure_string('revision',"1")
          #self.ensure_string('url',d.get_url())
! 	if type(self.distribution.packages) == type([]):
! 		self.root_package=self.distribution.packages[0]
! 	else:
! 		self.root_package=self.name
          self.ensure_string('root_package',self.root_package)
          #self.ensure_string_list('keywords')
--- 200,207 ----
          self.ensure_string('revision',"1")
          #self.ensure_string('url',d.get_url())
!         if type(self.distribution.packages) == type([]):
!             self.root_package=self.distribution.packages[0]
!         else:
!             self.root_package=self.name
          self.ensure_string('root_package',self.root_package)
          #self.ensure_string_list('keywords')

Index: bdist_pkgtool.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/bdist_pkgtool.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** bdist_pkgtool.py	17 Apr 2002 20:30:10 -0000	1.1
--- bdist_pkgtool.py	23 Apr 2002 18:18:43 -0000	1.2
***************
*** 24,28 ****
  # unless --no-autorelocate is requested. Finds the python site-packages
  # directory and prompts for verification
! DEFAULT_REQUEST="""#!/bin/sh 
  ######################################################################
  #         Distutils internal package relocation support              #
--- 24,28 ----
  # unless --no-autorelocate is requested. Finds the python site-packages
  # directory and prompts for verification
! DEFAULT_REQUEST="""#!/bin/sh
  ######################################################################
  #         Distutils internal package relocation support              #
***************
*** 35,39 ****
  if [ $? -ne 0 ]; then
      echo "The python interpretor needs to be on your path!"
!     echo 
      echo "If you have more than one, make sure the first one is where"
      echo "you want this module installed:"
--- 35,39 ----
  if [ $? -ne 0 ]; then
      echo "The python interpretor needs to be on your path!"
!     echo
      echo "If you have more than one, make sure the first one is where"
      echo "you want this module installed:"
***************
*** 46,63 ****
  echo ""
  if [ -z "${PY_DIR}" ]; then
! 	echo "I can't seem to find the python distribution."
! 	echo "I'm assuming the default path for site-packages"
  else
! 	BASEDIR="${PY_PKG_DIR}"
! 	cat <<EOF
! 	Python found! The default path:
  
! 	${BASEDIR}
  
! 	will install ${PRODUCT} such that all python users 
! 	can import it.
  
! 	If you just want individual access, you can install into
! 	any directory and add that directory to your \$PYTHONPATH
  EOF
  fi
--- 46,63 ----
  echo ""
  if [ -z "${PY_DIR}" ]; then
!         echo "I can't seem to find the python distribution."
!         echo "I'm assuming the default path for site-packages"
  else
!         BASEDIR="${PY_PKG_DIR}"
!         cat <<EOF
!         Python found! The default path:
  
!         ${BASEDIR}
  
!         will install ${PRODUCT} such that all python users
!         can import it.
  
!         If you just want individual access, you can install into
!         any directory and add that directory to your \$PYTHONPATH
  EOF
  fi
***************
*** 65,69 ****
  
  BASEDIR=`ckpath -d ${BASEDIR} -ay \
! 	-p "Where should ${PRODUCT} be installed? [${BASEDIR}]"` || exit $?
  
  ######################################################################
--- 65,69 ----
  
  BASEDIR=`ckpath -d ${BASEDIR} -ay \
!         -p "Where should ${PRODUCT} be installed? [${BASEDIR}]"` || exit $?
  
  ######################################################################
***************
*** 78,83 ****
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
! 	python -c "import compileall;compileall.compile_dir(\\"${BASEDIR}/__DISTUTILS_NAME__\\")"
! 	chown -R root:other ${BASEDIR}/__DISTUTILS_NAME__
  fi
  """
--- 78,83 ----
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
!         python -c "import compileall;compileall.compile_dir(\\"${BASEDIR}/__DISTUTILS_NAME__\\")"
!         chown -R root:other ${BASEDIR}/__DISTUTILS_NAME__
  fi
  """
***************
*** 92,96 ****
  if [ $? -ne 0 ]; then
      echo "The python interpretor needs to be on your path!"
!     echo 
      echo "If you have more than one, make sure the first one is where"
      echo "you want this module removed from"
--- 92,96 ----
  if [ $? -ne 0 ]; then
      echo "The python interpretor needs to be on your path!"
!     echo
      echo "If you have more than one, make sure the first one is where"
      echo "you want this module removed from"
***************
*** 100,105 ****
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
! 	find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyc" -exec rm {} \;
! 	find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyo" -exec rm {} \;
  fi
  """
--- 100,105 ----
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
!         find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyc" -exec rm {} \;
!         find ${BASEDIR}/__DISTUTILS_NAME__ -name "*.pyo" -exec rm {} \;
  fi
  """
***************
*** 112,118 ****
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
! 	if [ `find ${BASEDIR}/__DISTUTILS_NAME__ ! -type d | wc -l` -eq 0 ]; then
!     	rm -rf ${BASEDIR}/__DISTUTILS_NAME__
! 	fi
  fi
  """
--- 112,118 ----
  /usr/bin/test -d ${BASEDIR}/__DISTUTILS_NAME__
  if [ $? -eq 0 ]; then
!         if [ `find ${BASEDIR}/__DISTUTILS_NAME__ ! -type d | wc -l` -eq 0 ]; then
!         rm -rf ${BASEDIR}/__DISTUTILS_NAME__
!         fi
  fi
  """
***************
*** 172,182 ****
          self.ensure_string('vendor', None)
          if self.__dict__.has_key('author'):
!                 if self.__dict__.has_key('author_email'):
!                         self.ensure_string('vendor',
!                                 "%s <%s>" % (self.author,
!                                    self.author_email))
!                 else:
!                         self.ensure_string('vendor',
!                              "%s" % (self.author))
          self.ensure_string('category', "System,application")
          self.ensure_script('compver')
--- 172,182 ----
          self.ensure_string('vendor', None)
          if self.__dict__.has_key('author'):
!             if self.__dict__.has_key('author_email'):
!                 self.ensure_string('vendor',
!                         "%s <%s>" % (self.author,
!                            self.author_email))
!             else:
!                 self.ensure_string('vendor',
!                      "%s" % (self.author))
          self.ensure_string('category', "System,application")
          self.ensure_script('compver')
***************
*** 189,193 ****
              "pkg-abrev (%s) must be less than 9 characters" % self.pkg_abrev
          # Update default scripts with our metadata name
!         DEFAULT_REQUEST = string.replace(DEFAULT_REQUEST, 
              "__DISTUTILS_NAME__", self.root_package)
          DEFAULT_POSTINSTALL = string.replace(DEFAULT_POSTINSTALL,
--- 189,193 ----
              "pkg-abrev (%s) must be less than 9 characters" % self.pkg_abrev
          # Update default scripts with our metadata name
!         DEFAULT_REQUEST = string.replace(DEFAULT_REQUEST,
              "__DISTUTILS_NAME__", self.root_package)
          DEFAULT_POSTINSTALL = string.replace(DEFAULT_POSTINSTALL,
***************
*** 244,248 ****
          self.write_script(os.path.join(pkg_dir, "depend"),
                   'depend',None)
!             
          self.announce('Creating prototype file')
          path = os.path.join(pkg_dir, "prototype")
--- 244,248 ----
          self.write_script(os.path.join(pkg_dir, "depend"),
                   'depend',None)
! 
          self.announce('Creating prototype file')
          path = os.path.join(pkg_dir, "prototype")
***************
*** 264,269 ****
          self.spawn(pkg_cmd)
          pkg_cmd = ['pkgtrans', '-s', '/var/spool/pkg']
!         path = os.path.join(os.environ['PWD'],pkg_dir, 
! 		           self.get_binary_name() + ".pkg")
          self.announce('Transferring package to ' + pkg_dir)
          pkg_cmd.append(path)
--- 264,269 ----
          self.spawn(pkg_cmd)
          pkg_cmd = ['pkgtrans', '-s', '/var/spool/pkg']
!         path = os.path.join(os.environ['PWD'],pkg_dir,
!                            self.get_binary_name() + ".pkg")
          self.announce('Transferring package to ' + pkg_dir)
          pkg_cmd.append(path)
***************
*** 271,275 ****
          self.spawn(pkg_cmd)
          os.system("rm -rf /var/spool/pkg/%s" % self.pkg_abrev)
!         
  
      def run (self):
--- 271,275 ----
          self.spawn(pkg_cmd)
          os.system("rm -rf /var/spool/pkg/%s" % self.pkg_abrev)
! 
  
      def run (self):
***************
*** 282,286 ****
      # run()
  
!   
      def _make_prototype(self):
          proto_file = ["i pkginfo"]
--- 282,286 ----
      # run()
  
! 
      def _make_prototype(self):
          proto_file = ["i pkginfo"]
***************
*** 303,315 ****
  
          try:
!                 self.distribution.packages[0]
!                 file_list=string.split( 
!                 getoutput("pkgproto %s/%s=%s" % (build.build_lib,
!                 self.distribution.packages[0], 
! 		self.distribution.packages[0])),"\012")
          except:
!                 file_list=string.split( 
!                 getoutput("pkgproto %s=" % (build.build_lib)),"\012")
!         ownership="%s %s" % (pwd.getpwuid(os.getuid())[0], 
              grp.getgrgid(os.getgid())[0])
          for i in range(len(file_list)):
--- 303,315 ----
  
          try:
!             self.distribution.packages[0]
!             file_list=string.split(
!             getoutput("pkgproto %s/%s=%s" % (build.build_lib,
!             self.distribution.packages[0],
!             self.distribution.packages[0])),"\012")
          except:
!             file_list=string.split(
!             getoutput("pkgproto %s=" % (build.build_lib)),"\012")
!         ownership="%s %s" % (pwd.getpwuid(os.getuid())[0],
              grp.getgrgid(os.getgid())[0])
          for i in range(len(file_list)):
***************
*** 325,329 ****
          # The request script will simply be the autorelocate script
          if self.no_autorelocate==0:
!                 request=string.split(DEFAULT_REQUEST,"\012")
          else:
              self.announce('Creating relocation request script')
--- 325,329 ----
          # The request script will simply be the autorelocate script
          if self.no_autorelocate==0:
!             request=string.split(DEFAULT_REQUEST,"\012")
          else:
              self.announce('Creating relocation request script')
***************
*** 335,339 ****
                  for i in users_request:
                      request.append(i)
!             
          if self.no_autorelocate==0:
              request.append("#############################################")
--- 335,339 ----
                  for i in users_request:
                      request.append(i)
! 
          if self.no_autorelocate==0:
              request.append("#############################################")
***************
*** 356,365 ****
              ]
          info_file.extend(['VENDOR="%s (%s)"' % (self.distribution.maintainer, \
! 		self.distribution.license) ])
          info_file.extend(['EMAIL="%s"' % self.distribution.maintainer_email ])
!         
          p = self.distribution.get_platforms()
! 	if p is None or p==['UNKNOWN']:
! 	    archs=getoutput('uname -p')
          else:
              archs=string.join(self.distribution.get_platforms(),',')
--- 356,365 ----
              ]
          info_file.extend(['VENDOR="%s (%s)"' % (self.distribution.maintainer, \
!                 self.distribution.license) ])
          info_file.extend(['EMAIL="%s"' % self.distribution.maintainer_email ])
! 
          p = self.distribution.get_platforms()
!         if p is None or p==['UNKNOWN']:
!             archs=getoutput('uname -p')
          else:
              archs=string.join(self.distribution.get_platforms(),',')
***************
*** 382,386 ****
          if site:
              info_file.extend(['BASEDIR="%s"' % site ])
!                       
          return info_file
  
--- 382,386 ----
          if site:
              info_file.extend(['BASEDIR="%s"' % site ])
! 
          return info_file
  
***************
*** 401,409 ****
              else:
                  new_changelog.append('  ' + line)
!                 
          # strip trailing newline inserted by first changelog entry
          if not new_changelog[0]:
              del new_changelog[0]
!         
          return new_changelog
  
--- 401,409 ----
              else:
                  new_changelog.append('  ' + line)
! 
          # strip trailing newline inserted by first changelog entry
          if not new_changelog[0]:
              del new_changelog[0]
! 
          return new_changelog