Support for providing 'destination_item' name when processing a "drag n drop" installation.

This commit is contained in:
Heig Gregorian
2012-07-02 12:54:21 -07:00
parent 0ab2b9c6a3
commit 647cb861f4

View File

@@ -127,11 +127,17 @@ def getCatalogInfoFromDmg(dmgpath, options):
break
if iteminfo:
item_to_copy = {}
if options.destinationitem:
dest_item = options.destinationitem
item_to_copy['destination_item'] = options.destinationitem
else:
dest_item = item
if options.destinationpath:
iteminfo['path'] = os.path.join(options.destinationpath,
item)
else:
iteminfo['path'] = os.path.join("/Applications", item)
dest_item)
else:
iteminfo['path'] = os.path.join("/Applications", dest_item)
cataloginfo = {}
cataloginfo['name'] = iteminfo.get('CFBundleName',
os.path.splitext(item)[0])
@@ -139,7 +145,6 @@ def getCatalogInfoFromDmg(dmgpath, options):
iteminfo.get('CFBundleShortVersionString', "0")
cataloginfo['installs'] = [iteminfo]
cataloginfo['installer_type'] = "copy_from_dmg"
item_to_copy = {}
item_to_copy['source_item'] = item
item_to_copy['destination_path'] = \
options.destinationpath or "/Applications"
@@ -399,6 +404,11 @@ def main():
help=('Path to which the item should be copied. Defaults to '
'"/Applications".')
)
dragdrop_options.add_option(
'--destinationitem',
metavar='NAME',
help='Alternate name for which the item should be copied as.'
)
dragdrop_options.add_option(
'-o', '--owner',
metavar='USER',