autopkg / homebysix-recipes

AutoPkg recipes all the way from Seattle, WA.
Apache License 2.0
147 stars 114 forks source link

Github Desktop .pkg recipe #560

Closed bolaussen closed 1 year ago

bolaussen commented 1 year ago

In my override recipes using the .pkg recipe as the parent, I am getting the following error

Processor: PkgCreator: Error: Invalid package name

The following error is when I run the recipe locally with verbose output

PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor

homebysix commented 1 year ago

Could you please provide the verbose output of the pkg recipe run?

bolaussen commented 1 year ago

URLDownloader {'Input': {'filename': 'GitHubDesktop-darwin-arm64.zip', 'url': 'https://central.github.com/deployments/desktop/desktop/latest/darwin-arm64'}} URLDownloader: No value supplied for prefetch_filename, setting default value of: False URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False URLDownloader: Curl command: ['/opt/chefdk/embedded/bin/curl', '--silent', '--show-error', '--no-buffer', '--dump-header', '-', '--speed-time', '30', '--location', '--url', 'https://central.github.com/deployments/desktop/desktop/latest/darwin-arm64', '--fail', '--output', '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/downloads/tmpgvk5ocmq', '--header', 'If-None-Match: 0x8DAB19E398AA4D1', '--header', 'If-Modified-Since: Wed, 19 Oct 2022 06:50:35 GMT'] URLDownloader: Item at URL is unchanged. URLDownloader: Using existing /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/downloads/GitHubDesktop-darwin-arm64.zip {'Output': {'pathname': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/downloads/GitHubDesktop-darwin-arm64.zip'}} EndOfCheckPhase {'Input': {}} {'Output': {}} Unarchiver {'Input': {'archive_path': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/downloads/GitHubDesktop-darwin-arm64.zip', 'destination_path': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub ' 'Desktop (Apple Silicon)/Applications', 'purge_destination': True}} Unarchiver: No value supplied for USE_PYTHON_NATIVE_EXTRACTOR, setting default value of: False Unarchiver: Guessed archive format 'zip' from filename GitHubDesktop-darwin-arm64.zip Unarchiver: Unarchived /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/downloads/GitHubDesktop-darwin-arm64.zip to /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub Desktop (Apple Silicon)/Applications {'Output': {}} CodeSignatureVerifier {'Input': {'input_path': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub ' 'Desktop (Apple Silicon)/Applications/GitHub ' 'Desktop.app', 'requirement': '(identifier "com.github.GitHub" or identifier ' '"com.github.GHAskPass") and anchor apple generic ' 'and certificate ' 'leaf[field.1.2.840.113635.100.6.1.9] / exists / ' 'or anchor apple generic and certificate ' '1[field.1.2.840.113635.100.6.2.6] / exists / and ' 'certificate leaf[field.1.2.840.113635.100.6.1.13] ' '/ exists / and certificate leaf[subject.OU] = ' 'VEKTX9H2N7'}} CodeSignatureVerifier: Verifying code signature... CodeSignatureVerifier: Deep verification enabled... CodeSignatureVerifier: Strict verification not defined. Using codesign defaults... CodeSignatureVerifier: /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub Desktop (Apple Silicon)/Applications/GitHub Desktop.app: valid on disk CodeSignatureVerifier: /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub Desktop (Apple Silicon)/Applications/GitHub Desktop.app: satisfies its Designated Requirement CodeSignatureVerifier: /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub Desktop (Apple Silicon)/Applications/GitHub Desktop.app: explicit requirement satisfied CodeSignatureVerifier: Signature is valid {'Output': {}} Versioner {'Input': {'input_plist_path': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub ' 'Desktop (Apple Silicon)/Applications/GitHub ' 'Desktop.app/Contents/Info.plist'}} Versioner: No value supplied for plist_version_key, setting default value of: CFBundleShortVersionString Versioner: No value supplied for skip_single_root_dir, setting default value of: False Versioner: Found version 3.1.2 in file /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub Desktop (Apple Silicon)/Applications/GitHub Desktop.app/Contents/Info.plist {'Output': {'version': '3.1.2'}} PkgCreator {'Input': {'pkg_request': {'chown': [{'group': 'admin', 'path': 'Applications', 'user': 'root'}], 'id': 'com.github.GitHub', 'options': 'purge_ds_store', 'pkgname': 'GitHub Desktop (Apple ' 'Silicon)-darwin-arm64-3.1.2', 'pkgroot': '/Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/GitHub ' 'Desktop (Apple Silicon)', 'scripts': 'scripts', 'version': '3.1.2'}}} PkgCreator: Connecting PkgCreator: Sending packaging request PkgCreator: Disconnecting PkgCreator: Failed to close socket: [Errno 9] Bad file descriptor Traceback (most recent call last): File "/Library/AutoPkg/autopkglib/init.py", line 840, in process self.env = processor.process() File "/Library/AutoPkg/autopkglib/init.py", line 626, in process self.main() File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 274, in main self.package() File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 223, in package pkg_path = self.send_request(request) File "/Library/AutoPkg/autopkglib/PkgCreator.py", line 263, in send_request raise ProcessorError(", ".join([s.replace("ERROR:", "") for s in errors])) autopkglib.ProcessorError: Invalid package name File "/Library/AutoPkg/autopkglib/init.py", line 840, in process self.env = processor.process() Invalid package name Failed. Receipt written to /Users/bolaussen/Library/AutoPkg/Cache/com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test/receipts/GitHubDesktopAppleSilicon-test.jamf-receipt-20221216-104137.plist

The following recipes failed: /Users/bolaussen/Documents/GitHub/autopkg/overrides/GitHub/GitHubDesktopAppleSilicon-test.jamf.recipe Error in com.github.fastly.recipes.jamf.GitHubDesktopAppleSilicon-test: Processor: PkgCreator: Error: Invalid package name

Nothing downloaded, packaged or imported.

MLBZ521 commented 1 year ago

@bolaussen The issue is the package name as the error suggests: GitHub Desktop (Apple Silicon)-darwin-arm64-3.1.2

The package name cannot contain () parentheses. If you want the package to contain those, you'll need to rename the package after the package is created. (This is what I do in my recipes; I'm now using a custom processor to do just this, RenamePath that's in my repo.)

bolaussen commented 1 year ago

@MLBZ521 thanks! I actually decided to try and just change the naming scheme of my recipes which ended up fixing it! Appreciate the help!

MLBZ521 commented 1 year ago

Yeah, no problem. I was adding something similar to package names in my environment (e.g. (ARM) or (Intel)) for reference for our Site Admins to be able to identify if/which architecture a .pkg might be for. So I just renamed the .pkg before my Jamf Upload steps.