allow making dmgs for things other than mussa
authorDiane Trout <diane@caltech.edu>
Tue, 4 Apr 2006 03:33:58 +0000 (03:33 +0000)
committerDiane Trout <diane@caltech.edu>
Tue, 4 Apr 2006 03:33:58 +0000 (03:33 +0000)
osxdist.py

index 383ed016bf138499634668e7815932b5468f1093..500cdd5b729b0f3616d5103e7746e2cea7d48aa3 100644 (file)
@@ -25,11 +25,11 @@ def mkdir(path):
 # http://developer.apple.com/documentation/Porting/Conceptual/PortingUnix
 # http://developer.apple.com/documentation/developertools/Conceptual/SoftwareDistribution/Concepts/sd_disk_images.html
 
-def makedmg(app_dir):
+def makedmg(dirlist, volname):
   # need to detect what the real volume name is
-  mussa_mount = '/Volumes/Mussa'
-  mussarw_dmg = 'mussarw.dmg'
-  mussa_dmg = 'mussa.dmg'
+  mussa_mount = '/Volumes/%s' %(volname)
+  mussarw_dmg = '%sw.dmg' %(volname)
+  mussa_dmg = '%s.dmg' %(volname)
   system('hdiutil detach '+mussa_mount)
   if os.path.exists(mussa_mount):
     print >>sys.stderr, "Something is in", mussa_mount
@@ -38,10 +38,11 @@ def makedmg(app_dir):
     os.unlink(mussarw_dmg)
   if os.path.exists(mussa_dmg):
     os.unlink(mussa_dmg)
-  system('hdiutil create -size 64m -fs HFS+ -volname "Mussa" '+mussarw_dmg)
+  system('hdiutil create -size 64m -fs HFS+ -volname "%s" %s'%(volname, mussarw_dmg))
   system('hdiutil attach '+mussarw_dmg)
   # copy files
-  copytree(app_dir, os.path.join(mussa_mount, app_dir))
+  for d in dirlist:
+    copytree(d, os.path.join(mussa_mount, d))
 
   system('hdiutil detach '+mussa_mount)
   system('hdiutil convert '+mussarw_dmg +' -format UDZO -o '+mussa_dmg)
@@ -81,7 +82,7 @@ def main(args):
       contents_exe_path %= ({'framework': frame2})
       system("install_name_tool -change "+qtframe2+" "+contents_exe_path+" "+
              appframe)
-  makedmg(app_dir)
+  makedmg([app_dir], 'mussa')
 
 if __name__ == "__main__":
   main(sys.argv[1:])