mirror of
https://github.com/grahampugh/macadmin-scripts.git
synced 2025-12-18 10:16:37 +00:00
Added volume name to DMG image to avoid localization issues
This commit is contained in:
parent
251a07048c
commit
369909c4ae
@ -129,13 +129,13 @@ def make_sparse_image(volume_name, output_path):
|
|||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
|
|
||||||
def make_compressed_dmg(app_path, diskimagepath):
|
def make_compressed_dmg(app_path, diskimagepath, volume_name):
|
||||||
"""Returns path to newly-created compressed r/o disk image containing
|
"""Returns path to newly-created compressed r/o disk image containing
|
||||||
Install macOS.app"""
|
Install macOS.app"""
|
||||||
|
|
||||||
print ('Making read-only compressed disk image containing %s...'
|
print ('Making read-only compressed disk image containing %s...'
|
||||||
% os.path.basename(app_path))
|
% os.path.basename(app_path))
|
||||||
cmd = ['/usr/bin/hdiutil', 'create', '-fs', 'HFS+',
|
cmd = ['/usr/bin/hdiutil', 'create', '-volname "%s"' % volume_name, '-fs', 'HFS+',
|
||||||
'-srcfolder', app_path, diskimagepath]
|
'-srcfolder', app_path, diskimagepath]
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
@ -408,6 +408,14 @@ def os_installer_product_info(catalog, workdir, ignore_cache=False):
|
|||||||
return product_info
|
return product_info
|
||||||
|
|
||||||
|
|
||||||
|
def get_lowest_version(current_item, lowest_item):
|
||||||
|
'''Compares versions between two values and returns the lowest value'''
|
||||||
|
if LooseVersion(current_item) < LooseVersion(lowest_item):
|
||||||
|
return current_item
|
||||||
|
else:
|
||||||
|
return lowest_item
|
||||||
|
|
||||||
|
|
||||||
def replicate_product(catalog, product_id, workdir, ignore_cache=False):
|
def replicate_product(catalog, product_id, workdir, ignore_cache=False):
|
||||||
'''Downloads all the packages for a product'''
|
'''Downloads all the packages for a product'''
|
||||||
product = catalog['Products'][product_id]
|
product = catalog['Products'][product_id]
|
||||||
@ -444,14 +452,6 @@ def find_installer_app(mountpoint):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def get_lowest_version(current_item, lowest_item):
|
|
||||||
'''Compares versions between two values and returns the lowest value'''
|
|
||||||
if LooseVersion(current_item) < LooseVersion(lowest_item):
|
|
||||||
return current_item
|
|
||||||
else:
|
|
||||||
return lowest_item
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
'''Do the main thing here'''
|
'''Do the main thing here'''
|
||||||
|
|
||||||
@ -549,7 +549,7 @@ def main():
|
|||||||
not_valid
|
not_valid
|
||||||
)
|
)
|
||||||
|
|
||||||
# go through various options for automatically determining the answer
|
# go through various options for automatically determining the answer:
|
||||||
|
|
||||||
# skip if build is not suitable for current device
|
# skip if build is not suitable for current device
|
||||||
# and a validation parameter was chosen
|
# and a validation parameter was chosen
|
||||||
@ -692,7 +692,7 @@ def main():
|
|||||||
os.unlink(compressed_diskimagepath)
|
os.unlink(compressed_diskimagepath)
|
||||||
app_path = find_installer_app(mountpoint)
|
app_path = find_installer_app(mountpoint)
|
||||||
if app_path:
|
if app_path:
|
||||||
make_compressed_dmg(app_path, compressed_diskimagepath)
|
make_compressed_dmg(app_path, compressed_diskimagepath, volname)
|
||||||
# unmount sparseimage
|
# unmount sparseimage
|
||||||
unmountdmg(mountpoint)
|
unmountdmg(mountpoint)
|
||||||
# delete sparseimage since we don't need it any longer
|
# delete sparseimage since we don't need it any longer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user