diff --git a/Cisco/Webex.pkg.recipe.yaml b/Cisco/Webex.pkg.recipe.yaml index 329b951..56ec67e 100644 --- a/Cisco/Webex.pkg.recipe.yaml +++ b/Cisco/Webex.pkg.recipe.yaml @@ -4,20 +4,21 @@ ParentRecipe: com.github.smithjw.download.webex MinimumVersion: '2.3' Input: - NAME: Webex + NAME: Webex Process: - - Processor: PkgRootCreator - Arguments: - pkgdirs: {} - pkgroot: '%RECIPE_CACHE_DIR%/payload' + - Processor: PkgRootCreator + Arguments: + pkgdirs: {} + pkgroot: '%RECIPE_CACHE_DIR%/payload' - - Processor: AppPkgCreator - Arguments: - app_path: '%pathname%/Webex.app' - pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%.pkg' + - Processor: AppPkgCreator + Arguments: + app_path: '%pathname%/Webex.app' + pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%.pkg' - - Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/payload' diff --git a/Cisco/Webex.sign.recipe.yaml b/Cisco/Webex.sign.recipe.yaml index 5f91a36..397a62f 100644 --- a/Cisco/Webex.sign.recipe.yaml +++ b/Cisco/Webex.sign.recipe.yaml @@ -12,7 +12,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%-unsigned.pkg' diff --git a/DisplayLink/DisplayLink Manager.pkg.recipe.yaml b/DisplayLink/DisplayLink Manager.pkg.recipe.yaml index 48d45bc..afcdeff 100644 --- a/DisplayLink/DisplayLink Manager.pkg.recipe.yaml +++ b/DisplayLink/DisplayLink Manager.pkg.recipe.yaml @@ -8,24 +8,25 @@ Input: DOWNLOAD_URL: https://www.displaylink.com/downloads Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - flat_pkg_path: '%pathname%' - skip_payload: true + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + flat_pkg_path: '%pathname%' + skip_payload: true -- Processor: com.facebook.autopkg.shared/PackageInfoVersioner - Arguments: - package_info_path: '%RECIPE_CACHE_DIR%/unpack/DisplayLinkManagerApp.pkg/PackageInfo' + - Processor: com.facebook.autopkg.shared/PackageInfoVersioner + Arguments: + package_info_path: '%RECIPE_CACHE_DIR%/unpack/DisplayLinkManagerApp.pkg/PackageInfo' -- Processor: com.github.homebysix.VersionSplitter/VersionSplitter + - Processor: com.github.homebysix.VersionSplitter/VersionSplitter -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' diff --git a/Docker/Docker.pkg.recipe.yaml b/Docker/Docker.pkg.recipe.yaml index ca63f9e..1502230 100644 --- a/Docker/Docker.pkg.recipe.yaml +++ b/Docker/Docker.pkg.recipe.yaml @@ -4,20 +4,21 @@ ParentRecipe: com.github.smithjw.download.Docker MinimumVersion: '2.3' Input: - NAME: Docker + NAME: Docker Process: - - Processor: PkgRootCreator - Arguments: - pkgdirs: {} - pkgroot: '%RECIPE_CACHE_DIR%/payload' + - Processor: PkgRootCreator + Arguments: + pkgdirs: {} + pkgroot: '%RECIPE_CACHE_DIR%/payload' - - Processor: AppPkgCreator - Arguments: - app_path: '%pathname%/%NAME%.app' - pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%.pkg' + - Processor: AppPkgCreator + Arguments: + app_path: '%pathname%/%NAME%.app' + pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%.pkg' - - Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/payload' diff --git a/Docker/Docker.sign.recipe.yaml b/Docker/Docker.sign.recipe.yaml index b696ed5..d3b91af 100644 --- a/Docker/Docker.sign.recipe.yaml +++ b/Docker/Docker.sign.recipe.yaml @@ -4,15 +4,16 @@ ParentRecipe: com.github.smithjw.pkg.Docker MinimumVersion: '2.3' Input: - SIGNING_CERTIFICATE: Override_This_Value + SIGNING_CERTIFICATE: Override_This_Value Process: - - Processor: com.github.rtrouton.SharedProcessors/PkgSigner - Arguments: - pkg_path: '%pkg_path%' - signing_cert: '%SIGNING_CERTIFICATE%' + - Processor: com.github.rtrouton.SharedProcessors/PkgSigner + Arguments: + pkg_path: '%pkg_path%' + signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%-unsigned.pkg' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%-unsigned.pkg' diff --git a/GitHub/GitHub_Desktop.pkg.recipe.yaml b/GitHub/GitHub_Desktop.pkg.recipe.yaml index 403ef5c..9eb7fb8 100644 --- a/GitHub/GitHub_Desktop.pkg.recipe.yaml +++ b/GitHub/GitHub_Desktop.pkg.recipe.yaml @@ -18,8 +18,9 @@ Process: app_path: '%RECIPE_CACHE_DIR%/unpack/%NAME%.app' pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%ARCHITECTURE%-%version%.pkg' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/unpack' - '%RECIPE_CACHE_DIR%/payload' diff --git a/GitHub/GitHub_Desktop.sign.recipe.yaml b/GitHub/GitHub_Desktop.sign.recipe.yaml index e576826..446c8fb 100644 --- a/GitHub/GitHub_Desktop.sign.recipe.yaml +++ b/GitHub/GitHub_Desktop.sign.recipe.yaml @@ -12,7 +12,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%ARCHITECTURE%-%version%-unsigned.pkg' diff --git a/Google/Google_Chrome.pkg.recipe.yaml b/Google/Google_Chrome.pkg.recipe.yaml index ee6d4f2..bc0baa4 100644 --- a/Google/Google_Chrome.pkg.recipe.yaml +++ b/Google/Google_Chrome.pkg.recipe.yaml @@ -7,26 +7,27 @@ Input: NAME: Google Chrome Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + flat_pkg_path: '%pathname%' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - pkg_payload_path: '%RECIPE_CACHE_DIR%/unpack/%PKGPAYLOADNAME%.pkg/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + pkg_payload_path: '%RECIPE_CACHE_DIR%/unpack/%PKGPAYLOADNAME%.pkg/Payload' -- Processor: PlistReader - Arguments: - info_path: '%RECIPE_CACHE_DIR%/unpack/%NAME%.app' + - Processor: PlistReader + Arguments: + info_path: '%RECIPE_CACHE_DIR%/unpack/%NAME%.app' -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARETITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARETITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' diff --git a/Handbrake/Handbrake.sign.recipe.yaml b/Handbrake/Handbrake.sign.recipe.yaml index 75aeb58..58b84e0 100644 --- a/Handbrake/Handbrake.sign.recipe.yaml +++ b/Handbrake/Handbrake.sign.recipe.yaml @@ -12,7 +12,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%-%version%-unsigned.pkg' diff --git a/Logitech/Logi_Options.pkg.recipe.yaml b/Logitech/Logi_Options.pkg.recipe.yaml index 57fafbe..de0aa7f 100644 --- a/Logitech/Logi_Options.pkg.recipe.yaml +++ b/Logitech/Logi_Options.pkg.recipe.yaml @@ -8,21 +8,22 @@ Input: SOFTWARE_TITLE: Logi_Options Process: -- Processor: FileFinder - Arguments: - pattern: '%RECIPE_CACHE_DIR%/unpack/LogiMgr Installer*.app/Contents/Info.plist' + - Processor: FileFinder + Arguments: + pattern: '%RECIPE_CACHE_DIR%/unpack/LogiMgr Installer*.app/Contents/Info.plist' -- Processor: Versioner - Arguments: - input_plist_path: '%found_filename%' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%found_filename%' + plist_version_key: CFBundleShortVersionString -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%INSTALLER_PKG%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%INSTALLER_PKG%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' \ No newline at end of file + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' diff --git a/Microsoft/Microsoft_Company_Portal.pkg.recipe.yaml b/Microsoft/Microsoft_Company_Portal.pkg.recipe.yaml index 1984a5f..baf6086 100644 --- a/Microsoft/Microsoft_Company_Portal.pkg.recipe.yaml +++ b/Microsoft/Microsoft_Company_Portal.pkg.recipe.yaml @@ -8,32 +8,33 @@ Input: SOFTWARE_TITLE: Microsoft_Company_Portal Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' + flat_pkg_path: '%pathname%' -- Processor: FileFinder - Arguments: - pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*CompanyPortal*.pkg' + - Processor: FileFinder + Arguments: + pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*CompanyPortal*.pkg' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' - pkg_payload_path: '%found_filename%/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' + pkg_payload_path: '%found_filename%/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Applications/Company Portal.app/Contents/Info.plist' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Applications/Company Portal.app/Contents/Info.plist' + plist_version_key: CFBundleShortVersionString -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/downloads/unpack' - - '%RECIPE_CACHE_DIR%/downloads/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/downloads/unpack' + - '%RECIPE_CACHE_DIR%/downloads/payload' diff --git a/Microsoft/Microsoft_Defender.pkg.recipe.yaml b/Microsoft/Microsoft_Defender.pkg.recipe.yaml index 5b78dc2..f7ba0df 100644 --- a/Microsoft/Microsoft_Defender.pkg.recipe.yaml +++ b/Microsoft/Microsoft_Defender.pkg.recipe.yaml @@ -8,32 +8,33 @@ Input: SOFTWARE_TITLE: Microsoft_Defender Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + flat_pkg_path: '%pathname%' -- Processor: FileFinder - Arguments: - pattern: '%RECIPE_CACHE_DIR%/unpack/*wdav*.pkg' + - Processor: FileFinder + Arguments: + pattern: '%RECIPE_CACHE_DIR%/unpack/*wdav*.pkg' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/payload' - pkg_payload_path: '%found_filename%/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/payload' + pkg_payload_path: '%found_filename%/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/payload/Microsoft Defender ATP.app/Contents/Info.plist' - plist_version_key: 'CFBundleShortVersionString' + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/payload/Microsoft Defender ATP.app/Contents/Info.plist' + plist_version_key: 'CFBundleShortVersionString' -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' - - '%RECIPE_CACHE_DIR%/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' + - '%RECIPE_CACHE_DIR%/payload' diff --git a/Microsoft/Microsoft_Edge.pkg.recipe.yaml b/Microsoft/Microsoft_Edge.pkg.recipe.yaml index dc6117d..2ae64d4 100644 --- a/Microsoft/Microsoft_Edge.pkg.recipe.yaml +++ b/Microsoft/Microsoft_Edge.pkg.recipe.yaml @@ -8,32 +8,33 @@ Input: SOFTWARE_TITLE: Microsoft_Edge Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' + flat_pkg_path: '%pathname%' -- Processor: FileFinder - Arguments: - pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*Edge*.pkg' + - Processor: FileFinder + Arguments: + pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*Edge*.pkg' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' - pkg_payload_path: '%found_filename%/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' + pkg_payload_path: '%found_filename%/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Microsoft Edge.app/Contents/Info.plist' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Microsoft Edge.app/Contents/Info.plist' + plist_version_key: CFBundleShortVersionString -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/downloads/unpack' - - '%RECIPE_CACHE_DIR%/downloads/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/downloads/unpack' + - '%RECIPE_CACHE_DIR%/downloads/payload' diff --git a/Microsoft/Microsoft_Teams.pkg.recipe.yaml b/Microsoft/Microsoft_Teams.pkg.recipe.yaml index cbf9229..81bd398 100644 --- a/Microsoft/Microsoft_Teams.pkg.recipe.yaml +++ b/Microsoft/Microsoft_Teams.pkg.recipe.yaml @@ -8,32 +8,33 @@ Input: SOFTWARE_TITLE: Microsoft_Teams Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/unpack' + flat_pkg_path: '%pathname%' -- Processor: FileFinder - Arguments: - pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*Teams*.pkg' + - Processor: FileFinder + Arguments: + pattern: '%RECIPE_CACHE_DIR%/downloads/unpack/*Teams*.pkg' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' - pkg_payload_path: '%found_filename%/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/downloads/payload' + pkg_payload_path: '%found_filename%/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Microsoft Teams.app/Contents/Info.plist' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/downloads/payload/Microsoft Teams.app/Contents/Info.plist' + plist_version_key: CFBundleShortVersionString -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/downloads/unpack' - - '%RECIPE_CACHE_DIR%/downloads/payload' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/downloads/unpack' + - '%RECIPE_CACHE_DIR%/downloads/payload' diff --git a/NSLogger/NSLogger.pkg.recipe.yaml b/NSLogger/NSLogger.pkg.recipe.yaml index fc38557..26c3072 100644 --- a/NSLogger/NSLogger.pkg.recipe.yaml +++ b/NSLogger/NSLogger.pkg.recipe.yaml @@ -16,8 +16,9 @@ Process: Arguments: app_path: '%RECIPE_CACHE_DIR%/downloads/%NAME%.app' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/downloads/%NAME%.app' - '%RECIPE_CACHE_DIR%/payload' diff --git a/NSLogger/NSLogger.sign.recipe.yaml b/NSLogger/NSLogger.sign.recipe.yaml index bb980ca..9429028 100644 --- a/NSLogger/NSLogger.sign.recipe.yaml +++ b/NSLogger/NSLogger.sign.recipe.yaml @@ -12,7 +12,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%-%version%-unsigned.pkg' diff --git a/Poly/Plantronics_Hub.pkg.recipe.yaml b/Poly/Plantronics_Hub.pkg.recipe.yaml index 35b24ac..a1b0404 100644 --- a/Poly/Plantronics_Hub.pkg.recipe.yaml +++ b/Poly/Plantronics_Hub.pkg.recipe.yaml @@ -8,28 +8,29 @@ Input: SOFTWARE_TITLE: Plantronics_Hub Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - flat_pkg_path: '%pathname%/Plantronics Software.pkg' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + flat_pkg_path: '%pathname%/Plantronics Software.pkg' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/version_check' - pkg_payload_path: '%RECIPE_CACHE_DIR%/unpack/inner.pkg/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/version_check' + pkg_payload_path: '%RECIPE_CACHE_DIR%/unpack/inner.pkg/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/version_check/Contents/Info.plist' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/version_check/Contents/Info.plist' + plist_version_key: CFBundleShortVersionString -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - source_pkg: '%pathname%/Plantronics Software.pkg' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' + source_pkg: '%pathname%/Plantronics Software.pkg' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' - - '%RECIPE_CACHE_DIR%/version_check' + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' + - '%RECIPE_CACHE_DIR%/version_check' diff --git a/SharedProcessors/FriendlyPathDeleter.py b/SharedProcessors/FriendlyPathDeleter.py new file mode 100644 index 0000000..b63f5fb --- /dev/null +++ b/SharedProcessors/FriendlyPathDeleter.py @@ -0,0 +1,85 @@ +#!/usr/local/autopkg/python +# +# Copyright 2013 Greg Neagle +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""See docstring for FriendlyPathDeleter class""" + +import os +import shutil + +from autopkglib import Processor, ProcessorError + +__all__ = ["FriendlyPathDeleter"] + + +class FriendlyPathDeleter(Processor): + """Deletes file paths.""" + + input_variables = { + "path_list": { + "required": True, + "description": ( + "An array or list of pathnames to be deleted, " + "even if that list contains a single item." + ), + }, + "fail_deleter_silently": { + "required": False, + "description": ( + "If this is set to True, FriendlyPathDeleter " + "will not error out when it can't find a given path to remove. " + "False by default" + ), + }, + } + output_variables = {} + description = __doc__ + + def main(self): + # if recipe writer gave us a single string instead of a list of strings, + # convert it to a list of strings + if isinstance(self.env["path_list"], str): + self.env["path_list"] = [self.env["path_list"]] + + fail_deleter_silently = self.env.get("fail_deleter_silently", False) + + for path in self.env["path_list"]: + try: + if os.path.isfile(path) or os.path.islink(path): + os.remove(path) + self.output(f"Deleted {path}") + elif os.path.isdir(path): + shutil.rmtree(path) + self.output(f"Deleted {path}") + elif not os.path.exists(path): + if not fail_deleter_silently: + raise ProcessorError( + f"Could not remove {path} - it does not exist! " + "You can set '--key fail_deleter_silently=True' to bypass " + "this error." + ) + else: + self.output(f"Path does not exist, skipping: {path}") + else: + raise ProcessorError( + f"Could not remove {path} - it is not a file, link, " + "or directory" + ) + except OSError as err: + raise ProcessorError(f"Could not remove {path}: {err}") + + +if __name__ == "__main__": + PROCESSOR = FriendlyPathDeleter() + PROCESSOR.execute_shell() diff --git a/SharedProcessors/FriendlyPathDeleter.recipe.yaml b/SharedProcessors/FriendlyPathDeleter.recipe.yaml new file mode 100644 index 0000000..98287dd --- /dev/null +++ b/SharedProcessors/FriendlyPathDeleter.recipe.yaml @@ -0,0 +1,5 @@ +Description: Recipe stub for any Processors in this directory. +Identifier: com.github.smithjw.processors +Input: {} +MinimumVersion: '2.3' +Process: [] diff --git a/Slack/Slack.jamf.recipe.yaml b/Slack/Slack.jamf.recipe.yaml index 6caedce..5c8dffa 100644 --- a/Slack/Slack.jamf.recipe.yaml +++ b/Slack/Slack.jamf.recipe.yaml @@ -22,9 +22,10 @@ Input: UPDATE_PREDICATE: 'pkg_uploaded == False' Process: - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter # Cleanup parent pkg recipe Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%' diff --git a/Wireshark/Wireshark.pkg.recipe.yaml b/Wireshark/Wireshark.pkg.recipe.yaml index 5a6258e..9b8e5c8 100644 --- a/Wireshark/Wireshark.pkg.recipe.yaml +++ b/Wireshark/Wireshark.pkg.recipe.yaml @@ -14,7 +14,8 @@ Process: - Processor: AppPkgCreator - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/payload' diff --git a/Wireshark/Wireshark.sign.recipe.yaml b/Wireshark/Wireshark.sign.recipe.yaml index fee0985..ad7c89d 100644 --- a/Wireshark/Wireshark.sign.recipe.yaml +++ b/Wireshark/Wireshark.sign.recipe.yaml @@ -12,7 +12,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%-%ARCHITECTURE%-%version%-unsigned.pkg' diff --git a/Xcode/Xcode.pkg.recipe.yaml b/Xcode/Xcode.pkg.recipe.yaml index b6121e6..27f0d58 100644 --- a/Xcode/Xcode.pkg.recipe.yaml +++ b/Xcode/Xcode.pkg.recipe.yaml @@ -17,8 +17,9 @@ Process: dmg_path: '%RECIPE_CACHE_DIR%/%NAME%-%version%.dmg' dmg_root: '%RECIPE_CACHE_DIR%/%NAME%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%' diff --git a/Xray Exploratory App/Xray_Exploratory_App.pkg.recipe.yaml b/Xray Exploratory App/Xray_Exploratory_App.pkg.recipe.yaml index 8b16af4..445de79 100644 --- a/Xray Exploratory App/Xray_Exploratory_App.pkg.recipe.yaml +++ b/Xray Exploratory App/Xray_Exploratory_App.pkg.recipe.yaml @@ -17,7 +17,8 @@ Process: Arguments: pkg_path: '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%.pkg' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/payload' diff --git a/Xray Exploratory App/Xray_Exploratory_App.sign.recipe.yaml b/Xray Exploratory App/Xray_Exploratory_App.sign.recipe.yaml index 6fe1f08..ad3ef4b 100644 --- a/Xray Exploratory App/Xray_Exploratory_App.sign.recipe.yaml +++ b/Xray Exploratory App/Xray_Exploratory_App.sign.recipe.yaml @@ -13,7 +13,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%SOFTWARE_TITLE%-%version%-unsigned.pkg' diff --git a/Zoom/Zoom_IT.pkg.recipe.yaml b/Zoom/Zoom_IT.pkg.recipe.yaml index e8b723b..0082753 100644 --- a/Zoom/Zoom_IT.pkg.recipe.yaml +++ b/Zoom/Zoom_IT.pkg.recipe.yaml @@ -7,30 +7,31 @@ Input: NAME: Zoom Process: -- Processor: FlatPkgUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/expand' - flat_pkg_path: '%pathname%' + - Processor: FlatPkgUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/expand' + flat_pkg_path: '%pathname%' -- Processor: PkgPayloadUnpacker - Arguments: - destination_path: '%RECIPE_CACHE_DIR%/unpack' - pkg_payload_path: '%RECIPE_CACHE_DIR%/expand/zoomus.pkg/Payload' + - Processor: PkgPayloadUnpacker + Arguments: + destination_path: '%RECIPE_CACHE_DIR%/unpack' + pkg_payload_path: '%RECIPE_CACHE_DIR%/expand/zoomus.pkg/Payload' -- Processor: Versioner - Arguments: - input_plist_path: '%RECIPE_CACHE_DIR%/unpack/zoom.us.app/Contents/Info.plist' - plist_version_key: CFBundleShortVersionString + - Processor: Versioner + Arguments: + input_plist_path: '%RECIPE_CACHE_DIR%/unpack/zoom.us.app/Contents/Info.plist' + plist_version_key: CFBundleShortVersionString -- Processor: com.github.homebysix.VersionSplitter/VersionSplitter + - Processor: com.github.homebysix.VersionSplitter/VersionSplitter -- Processor: PkgCopier - Arguments: - pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%version%.pkg' - source_pkg: '%pathname%' + - Processor: PkgCopier + Arguments: + pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%version%.pkg' + source_pkg: '%pathname%' -- Processor: PathDeleter - Arguments: - path_list: - - '%RECIPE_CACHE_DIR%/unpack' - - '%RECIPE_CACHE_DIR%/expand' \ No newline at end of file + - Processor: com.github.smithjw.processors/FriendlyPathDeleter + Arguments: + fail_deleter_silently: True + path_list: + - '%RECIPE_CACHE_DIR%/unpack' + - '%RECIPE_CACHE_DIR%/expand' diff --git a/iTerm2/iTerm2.pkg.recipe.yaml b/iTerm2/iTerm2.pkg.recipe.yaml index b971439..3a472aa 100644 --- a/iTerm2/iTerm2.pkg.recipe.yaml +++ b/iTerm2/iTerm2.pkg.recipe.yaml @@ -17,8 +17,9 @@ Process: app_path: '%RECIPE_CACHE_DIR%/unpack/iTerm.app' pkg_path: '%RECIPE_CACHE_DIR%/%NAME%-%version%.pkg' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/unpack' - '%RECIPE_CACHE_DIR%/payload' diff --git a/iTerm2/iTerm2.sign.recipe.yaml b/iTerm2/iTerm2.sign.recipe.yaml index b0f653d..6b7b4d2 100644 --- a/iTerm2/iTerm2.sign.recipe.yaml +++ b/iTerm2/iTerm2.sign.recipe.yaml @@ -14,7 +14,8 @@ Process: pkg_path: '%pkg_path%' signing_cert: '%SIGNING_CERTIFICATE%' - - Processor: PathDeleter + - Processor: com.github.smithjw.processors/FriendlyPathDeleter Arguments: + fail_deleter_silently: True path_list: - '%RECIPE_CACHE_DIR%/%NAME%-%version%-unsigned.pkg'