[Python-checkins] python/dist/src/Lib/plat-mac bundlebuilder.py,1.34,1.35

jvr@users.sourceforge.net jvr@users.sourceforge.net
Fri, 04 Jul 2003 07:20:06 -0700


Update of /cvsroot/python/python/dist/src/Lib/plat-mac
In directory sc8-pr-cvs1:/tmp/cvs-serv30759

Modified Files:
	bundlebuilder.py 
Log Message:
#765903:
- added bundle_id/--bundle-id option, to specify the CFBundleIndentifier
#765615:
- in the appropriate situation, prepend $PATH with our path instead of
  setting it.


Index: bundlebuilder.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/plat-mac/bundlebuilder.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** bundlebuilder.py	4 Jul 2003 11:05:35 -0000	1.34
--- bundlebuilder.py	4 Jul 2003 14:20:03 -0000	1.35
***************
*** 88,91 ****
--- 88,94 ----
      creator = None
  
+     # the CFBundleIdentifier (this is used for the preferences file name)
+     bundle_id = None
+ 
      # List of files that have to be copied to <bundle>/Contents/Resources.
      resources = []
***************
*** 127,131 ****
                  self.creator = "????"
          plist.CFBundleSignature = self.creator
!         if not hasattr(plist, "CFBundleIdentifier"):
              plist.CFBundleIdentifier = self.name
  
--- 130,136 ----
                  self.creator = "????"
          plist.CFBundleSignature = self.creator
!         if self.bundle_id:
!             plist.CFBundleIdentifier = self.bundle_id
!         elif not hasattr(plist, "CFBundleIdentifier"):
              plist.CFBundleIdentifier = self.name
  
***************
*** 279,285 ****
  
  sys.argv.insert(1, mainprogram)
! os.environ["PYTHONPATH"] = resdir
! if %(standalone)s:
!     os.environ["PYTHONHOME"] = resdir
  os.environ["PYTHONEXECUTABLE"] = executable
  os.environ["DYLD_LIBRARY_PATH"] = libdir
--- 284,296 ----
  
  sys.argv.insert(1, mainprogram)
! if %(standalone)s or %(semi_standalone)s:
!     os.environ["PYTHONPATH"] = resdir
!     if %(standalone)s:
!         os.environ["PYTHONHOME"] = resdir
! else:
!     pypath = os.getenv("PYTHONPATH", "")
!     if pypath:
!         pypath = ":" + pypath
!     os.environ["PYTHONPATH"] = resdir + pypath
  os.environ["PYTHONEXECUTABLE"] = executable
  os.environ["DYLD_LIBRARY_PATH"] = libdir
***************
*** 476,479 ****
--- 487,491 ----
                  hashbang = os.path.realpath(sys.executable)
              standalone = self.standalone
+             semi_standalone = self.semi_standalone
              open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals())
              os.chmod(bootstrappath, 0775)
***************
*** 780,783 ****
--- 792,798 ----
        --iconfile=FILE    filename of the icon (an .icns file) to be used
                           as the Finder icon
+       --bundle-id=ID     the CFBundleIdentifier, in reverse-dns format
+                          (eg. org.python.BuildApplet; this is used for
+                          the preferences file name)
    -l, --link             symlink files/folder instead of copying them
        --link-exec        symlink the executable instead of copying it
***************
*** 814,818 ****
          "link-exec", "help", "verbose", "quiet", "argv", "standalone",
          "exclude=", "include=", "package=", "strip", "iconfile=",
!         "lib=", "python=", "semi-standalone")
  
      try:
--- 829,833 ----
          "link-exec", "help", "verbose", "quiet", "argv", "standalone",
          "exclude=", "include=", "package=", "strip", "iconfile=",
!         "lib=", "python=", "semi-standalone", "bundle-id=")
  
      try:
***************
*** 842,845 ****
--- 857,862 ----
          elif opt in ('-c', '--creator'):
              builder.creator = arg
+         elif opt == '--bundle-id':
+             builder.bundle_id = arg
          elif opt == '--iconfile':
              builder.iconfile = arg