autopkg / hjuutilainen-recipes

Recipes for AutoPkg
MIT License
49 stars 74 forks source link

Added ARCH_MAP to account for alternative name of x86_64 and amd64. #231

Closed coreyramirezgomez closed 1 year ago

coreyramirezgomez commented 1 year ago

Received the following error when trying to autopkg run Vagrant.recipe.munki:

STDOUT:

Processing /Users/rundeck/autopkgr-ansible/autopkgr/overrides/local.munki.Vagrant.recipe.munki...
HashiCorpURLProvider
Receipt written to /Users/rundeck/Library/AutoPkg/Cache/local.munki.Vagrant/receipts/local.munki.Vagrant.recipe-receipt-20220815-154236.plist

The following recipes failed:
    /Users/rundeck/autopkgr-ansible/autopkgr/overrides/local.munki.Vagrant.recipe.munki
        Error in local.munki.Vagrant: Processor: HashiCorpURLProvider: Error: No build for os: darwin, arch: x86_64

Nothing downloaded, packaged or imported.

STDERR:

No build for os: darwin, arch: x86_64
Failed.

MSG:

non-zero return code

Looks like HashiCorp changed the references to 'x86_64' to the rebrand of 'amd64', so the python script is failing to find the matching package.

I added a map and a check to add in both architectures when searching for the corresponding package for backward compatibility.

Test results of change:

autopkg run -v Vagrant-test.munki.recipe
Processing Vagrant-test.munki.recipe...
HashiCorpURLProvider
HashiCorpURLProvider: Found URL https://releases.hashicorp.com/vagrant/2.3.0/vagrant_2.3.0_darwin_amd64.dmg
URLDownloader
URLDownloader: Storing new Last-Modified header: Tue, 09 Aug 2022 15:28:07 GMT
URLDownloader: Storing new ETag header: "d74deb67f1aa9f065416885282e512ff"
URLDownloader: Downloaded /Users/rundeck/Library/AutoPkg/Cache/local.munki.Vagrant-test/downloads/Vagrant.dmg
EndOfCheckPhase
CodeSignatureVerifier
CodeSignatureVerifier: Mounted disk image /Users/rundeck/Library/AutoPkg/Cache/local.munki.Vagrant-test/downloads/Vagrant.dmg
CodeSignatureVerifier: Verifying installer package signature...
CodeSignatureVerifier: Package "vagrant.pkg":
CodeSignatureVerifier:    Status: signed by a developer certificate issued by Apple for distribution
CodeSignatureVerifier:    Certificate Chain:
CodeSignatureVerifier:     1. Developer ID Installer: Hashicorp, Inc. (D38WU7D763)
CodeSignatureVerifier:        Expires: 2022-12-05 23:44:55 +0000
CodeSignatureVerifier:        SHA256 Fingerprint:
CodeSignatureVerifier:            17 A8 A5 84 33 E9 C1 8F 31 52 49 BC 5A 2F 76 67 88 01 2F D6 E9 9F
CodeSignatureVerifier:            2E C5 2D B4 5D 89 50 63 B1 90
CodeSignatureVerifier:        ------------------------------------------------------------------------
CodeSignatureVerifier:     2. Developer ID Certification Authority
CodeSignatureVerifier:        Expires: 2027-02-01 22:12:15 +0000
CodeSignatureVerifier:        SHA256 Fingerprint:
CodeSignatureVerifier:            7A FC 9D 01 A6 2F 03 A2 DE 96 37 93 6D 4A FE 68 09 0D 2D E1 8D 03
CodeSignatureVerifier:            F2 9C 88 CF B0 B1 BA 63 58 7F
CodeSignatureVerifier:        ------------------------------------------------------------------------
CodeSignatureVerifier:     3. Apple Root CA
CodeSignatureVerifier:        Expires: 2035-02-09 21:40:36 +0000
CodeSignatureVerifier:        SHA256 Fingerprint:
CodeSignatureVerifier:            B0 B1 73 0E CB C7 FF 45 05 14 2C 49 F1 29 5E 6E DA 6B CA ED 7E 2C
CodeSignatureVerifier:            68 C5 BE 91 B5 A1 10 01 F0 24
CodeSignatureVerifier:
CodeSignatureVerifier: Signature is valid
CodeSignatureVerifier: Authority name chain is valid
MunkiImporter
MunkiImporter: Using repo lib: AutoPkgLib
MunkiImporter:         plugin: FileRepo
MunkiImporter:           repo: /Volumes/Munki/repo
MunkiImporter: Copied pkginfo to: /Volumes/Munki/repo/pkgsinfo/apps/Vagrant/Vagrant-2.3.0.plist
MunkiImporter:            pkg to: /Volumes/Munki/repo/pkgs/apps/Vagrant/Vagrant-2.3.0.dmg
Receipt written to /Users/rundeck/Library/AutoPkg/Cache/local.munki.Vagrant-test/receipts/Vagrant-test.munki-receipt-20220815-163209.plist

The following new items were downloaded:
    Download Path
    -------------
    /Users/rundeck/Library/AutoPkg/Cache/local.munki.Vagrant-test/downloads/Vagrant.dmg

The following new items were imported into Munki:
    Name     Version  Catalogs  Pkginfo Path                      Pkg Repo Path                   Icon Repo Path
    ----     -------  --------  ------------                      -------------                   --------------
    Vagrant  2.3.0    testing   apps/Vagrant/Vagrant-2.3.0.plist  apps/Vagrant/Vagrant-2.3.0.dmg
hjuutilainen commented 1 year ago

Closing as fixed in #229