Skip to content

Commit

Permalink
If app filename differs from app name, use filename in paths.
Browse files Browse the repository at this point in the history
Discovered while troubleshooting #119.
  • Loading branch information
homebysix committed Dec 8, 2016
1 parent 9243b0d commit 5ae743f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ All notable changes to this project will be documented in this file. This projec
- Updated app code to comply with Swift 2.3 syntax.
- `MinimumVersion` of AutoPkg on generated recipes is now 1.0.0.

### Fixed
- Better handles apps where the filename of the app differs from the display name of the app.


## [1.0.4] - 2016-10-13

Expand Down
35 changes: 23 additions & 12 deletions scripts/recipe_robot_lib/recipe_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ def generate_download_recipe(facts, prefs, recipe):
input_path = "%pathname%/{0}{1}.app".format(
facts.get("relative_path", ""), facts["app_name"])
elif facts["download_format"] in SUPPORTED_ARCHIVE_FORMATS:
input_path = (
"%RECIPE_CACHE_DIR%/%NAME%/Applications/{0}{1}.app".format(
facts.get("relative_path", ""), facts["app_name"]))
input_path = ("%RECIPE_CACHE_DIR%/%NAME%/Applications/"
"{0}{1}.app".format(facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"])))
elif facts["download_format"] in SUPPORTED_INSTALL_FORMATS:
# The download is in pkg format, and the pkg is signed.
# TODO(Elliot): Need a few test cases to prove this works.
Expand All @@ -320,12 +320,14 @@ def generate_download_recipe(facts, prefs, recipe):
if facts["download_format"] in SUPPORTED_IMAGE_FORMATS:
versioner.input_plist_path = (
"%pathname%/{0}{1}.app/Contents/Info.plist".format(
facts.get("relative_path", ""), facts["app_name"]))
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"])))
else:
versioner.input_plist_path = (
"%RECIPE_CACHE_DIR%/%NAME%/Applications/"
"{0}{1}.app/Contents/Info.plist".format(
facts.get("relative_path", ""), facts["app_name"]))
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"])))
versioner.plist_version_key = facts["version_key"]
recipe.append_processor(versioner)

Expand Down Expand Up @@ -474,7 +476,8 @@ def generate_munki_recipe(facts, prefs, recipe):
"Arguments": {
"input_plist_path":
("%pathname%/{0}{1}.app/Contents/Info.plist".format(
facts.get("relative_path", ""), facts["app_name"])),
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"]))),
"plist_version_key": facts["version_key"]
}
})
Expand Down Expand Up @@ -630,7 +633,8 @@ def generate_pkg_recipe(facts, prefs, recipe):
"Processor": "AppPkgCreator",
"Arguments": {
"app_path": "%pathname%/{0}{1}.app".format(
facts.get("relative_path", ""), facts["app_name"])
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"]))
}
})
else:
Expand Down Expand Up @@ -659,15 +663,17 @@ def generate_pkg_recipe(facts, prefs, recipe):
"app_path": "%RECIPE_CACHE_DIR%/%NAME%/Applications/"
"{0}{1}.app".format(
facts.get("relative_path", ""),
facts["app_name"])
facts.get("app_file", facts["app_name"]))
}
})
else:
recipe.append_processor({
"Processor": "AppPkgCreator",
"Arguments": {
"app_path": "%RECIPE_CACHE_DIR%/%NAME%/Applications/"
"{0}.app".format(facts["app_name"])
"{0}.app".format(
facts.get("app_file",
facts["app_name"]))
}
})

Expand Down Expand Up @@ -709,7 +715,9 @@ def generate_install_recipe(facts, prefs, recipe):
"Arguments": {
"dmg_path": "%pathname%",
"items_to_copy": [{
"source_item": "{0}{1}.app".format(facts.get("relative_path", ""), facts["app_name"]),
"source_item": "{0}{1}.app".format(
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"])),
"destination_path": "/Applications"
}]
}
Expand Down Expand Up @@ -739,7 +747,9 @@ def generate_install_recipe(facts, prefs, recipe):
"Arguments": {
"dmg_path": "%dmg_path%",
"items_to_copy": [{
"source_item": "{0}{1}.app".format(facts.get("relative_path", ""), facts["app_name"]),
"source_item": "{0}{1}.app".format(
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"])),
"destination_path": "/Applications"
}]
}
Expand Down Expand Up @@ -1009,7 +1019,8 @@ def generate_filewave_recipe(facts, prefs, recipe):
"Arguments": {
"input_plist_path": (
"%pathname%/{0}{1}.app/Contents/Info.plist".format(
facts.get("relative_path", ""), facts["app_name"])),
facts.get("relative_path", ""),
facts.get("app_file", facts["app_name"]))),
"plist_version_key": facts["version_key"]
}
})
Expand Down

0 comments on commit 5ae743f

Please sign in to comment.