macadmins / installapplications

A tool for dynamically using installapplication
Apache License 2.0
285 stars 62 forks source link

add support for skipping packages depending on arch #96

Closed chilcote closed 3 years ago

chilcote commented 3 years ago

Tested with adding this to bootstrap.json:

    {
      "file": "/Library/installapplications/chef-17.3.48-1.x86_64.pkg",
      "hash": "de5f090b0d6ca1a1804a1790739412a05d9a2e0365db7b21aecb7b6ebff253c3",
      "name": "chef_intel_pkg",
      "packageid": "com.getchef.pkg.chef",
      "skip_if": "arm64",
      "type": "package",
      "url": "https://url.to.repo/chef-17.3.48-1.x86_64.pkg",
      "version": "17.3.48"
    },
    {
      "file": "/Library/installapplications/chef-17.3.48-1.arm64.pkg",
      "hash": "35489a2d4616fd978b49e524f30bdf1b2615c0fb30bb9222766f8b48faee1d80",
      "name": "chef_arm_pkg",
      "packageid": "com.getchef.pkg.chef",
      "skip_if": "x86_64",
      "type": "package",
      "url": "https://url.to.repo/chef-17.3.48-1.arm64.pkg",
      "version": "17.3.48"
    },

Used updated InstallApplications package and it successfully installed the packages and skipped the ones marked:

On intel it skipped the arm one

2021-08-13 10:44:13.500 Python[2240:33808] [InstallApplications] Skipping chef_intel_pkg - passes skip_if criteria: arm64

On arm it skipped the intel one

2021-08-13 10:44:21.939 Python[18761:121744] [InstallApplications] Skipping chef_arm_pkg - passes skip_if criteria: x86_64
erikng commented 3 years ago

ty