webitup/puke — Issue #4: Add dmg support to unpack
Author: dmp42
Created: 2012-01-26 22:44:38+00:00
State: open

Here is how I do it:

@staticmethod
def __dodmg(packpath, localname, dest):
# http://hints.macworld.com/article.php?story=2005050606123892
ret = puke.sh('hdid %s' % packpath, output = False)
ret = ret.split("\n")
ret.pop()
ret = ret.pop()
ret = ret.split("\t")
vol = ret.pop()
ret.pop()
disk = ret.pop()
puke.FileSystem.makedir(dest)
list = puke.FileList(puke.FileSystem.join(vol, localname), filter = "*")
puke.deepcopy(list, dest)
puke.sh('hdid hdiutil detach %s -force' % disk, output = False)

Yeah, you need hdid to proceed.
And I think you can even mount remote dmgs.