Skip to content

Commit

Permalink
Adding FriendlyPathDeleter
Browse files Browse the repository at this point in the history
- Modification to PathDeleter with a flag that can be set so it doesn't fail when a given path is not found
- Updating recipes that use PathDeleter, and moving them to FriendlyPathDeleter
  • Loading branch information
smithjw committed Dec 21, 2021
1 parent 086d511 commit 2e4a63c
Show file tree
Hide file tree
Showing 28 changed files with 355 additions and 239 deletions.
27 changes: 14 additions & 13 deletions Cisco/Webex.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion Cisco/Webex.sign.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
35 changes: 18 additions & 17 deletions DisplayLink/DisplayLink Manager.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
27 changes: 14 additions & 13 deletions Docker/Docker.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
19 changes: 10 additions & 9 deletions Docker/Docker.sign.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion GitHub/GitHub_Desktop.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion GitHub/GitHub_Desktop.sign.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
39 changes: 20 additions & 19 deletions Google/Google_Chrome.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 2 additions & 1 deletion Handbrake/Handbrake.sign.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
31 changes: 16 additions & 15 deletions Logitech/Logi_Options.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
- Processor: com.github.smithjw.processors/FriendlyPathDeleter
Arguments:
fail_deleter_silently: True
path_list:
- '%RECIPE_CACHE_DIR%/unpack'
49 changes: 25 additions & 24 deletions Microsoft/Microsoft_Company_Portal.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
49 changes: 25 additions & 24 deletions Microsoft/Microsoft_Defender.pkg.recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Loading

0 comments on commit 2e4a63c

Please sign in to comment.