autopkg / joshua-d-miller-recipes

My recipes for autopkg https://github.com/autopkg
13 stars 44 forks source link

Update mactex.download.recipe #143

Closed paul-cossey closed 1 year ago

paul-cossey commented 1 year ago

Hi, @joshua-d-miller

This PR has some updated regex so that it grabs the year/version number. I've also had to add result_output_var_name otherwise it would just append %version% to the imported package.

Output from a successful run

autopkg run -vv /Users/sadmin/Downloads/MacTeX/mactex.munki.recipe 
Processing /Users/sadmin/Downloads/MacTeX/mactex.munki.recipe...
WARNING: /Users/sadmin/Downloads/MacTeX/mactex.munki.recipe is missing trust info and FAIL_RECIPES_WITHOUT_TRUST_INFO is not set. Proceeding...
URLTextSearcher
{'Input': {'re_pattern': 'The MacTeX-([0-9]+) Distribution',
           'result_output_var_name': 'version',
           'url': 'https://tug.org/mactex/'}}
URLTextSearcher: Found matching text (version): 2023
{'Output': {'version': '2023'}}
URLDownloader
{'Input': {'filename': 'MacTeX.pkg',
           'url': 'http://mirror.ctan.org/systems/mac/mactex/MacTeX.pkg'}}
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: Item at URL is unchanged.
URLDownloader: Using existing /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg
{'Output': {'pathname': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg'}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
CodeSignatureVerifier
{'Input': {'expected_authority_names': ['Developer ID Installer: Richard Koch '
                                        '(RBGCY5RJWM)',
                                        'Developer ID Certification Authority',
                                        'Apple Root CA'],
           'input_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg'}}
CodeSignatureVerifier: Verifying installer package signature...
CodeSignatureVerifier: Package "MacTeX.pkg":
CodeSignatureVerifier:    Status: signed by a developer certificate issued by Apple for distribution
CodeSignatureVerifier:    Notarization: trusted by the Apple notary service
CodeSignatureVerifier:    Signed with a trusted timestamp on: 2023-03-14 19:52:01 +0000
CodeSignatureVerifier:    Certificate Chain:
CodeSignatureVerifier:     1. Developer ID Installer: Richard Koch (RBGCY5RJWM)
CodeSignatureVerifier:        Expires: 2027-02-01 22:12:15 +0000
CodeSignatureVerifier:        SHA256 Fingerprint:
CodeSignatureVerifier:            BE B1 9A 8F 8C E4 AB 9E 97 AB AE 5B 99 07 02 DC 9C 0A 20 A2 6E 25 
CodeSignatureVerifier:            70 B2 B2 55 15 42 71 79 5B 75
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
{'Output': {}}
MunkiPkginfoMerger
{'Input': {'additional_pkginfo': {'version': '2023'},
           'pkginfo': {'catalogs': ['testing'],
                       'category': 'Mathematics',
                       'description': 'MacTeX is a product produced by the '
                                      'MacTeX TeXnical working group of the '
                                      'TeX Users Group (TUG). It is the '
                                      'Macintosh component of the TeX '
                                      'Collection DVD, the reference edition '
                                      'of TeX distributed by TeX User Groups '
                                      'across the world. The reference edition '
                                      'runs on Mac OS X, Windows, GNU/Linux, '
                                      'various BSD Unix systems, and most '
                                      'other computer architectures.\n'
                                      '            ',
                       'developer': 'TeX Users Group',
                       'display_name': 'MacTeX',
                       'name': 'MacTeX',
                       'postuninstall_script': '#!/bin/bash\n'
                                               '            /bin/rm -rf '
                                               '/Applications/TeX\n'
                                               '            ',
                       'unattended_install': True}}}
MunkiPkginfoMerger: Merged {'version': '2023'} into pkginfo
{'Output': {'pkginfo': {'catalogs': ['testing'],
                        'category': 'Mathematics',
                        'description': 'MacTeX is a product produced by the '
                                       'MacTeX TeXnical working group of the '
                                       'TeX Users Group (TUG). It is the '
                                       'Macintosh component of the TeX '
                                       'Collection DVD, the reference edition '
                                       'of TeX distributed by TeX User Groups '
                                       'across the world. The reference '
                                       'edition runs on Mac OS X, Windows, '
                                       'GNU/Linux, various BSD Unix systems, '
                                       'and most other computer '
                                       'architectures.\n'
                                       '            ',
                        'developer': 'TeX Users Group',
                        'display_name': 'MacTeX',
                        'name': 'MacTeX',
                        'postuninstall_script': '#!/bin/bash\n'
                                                '            /bin/rm -rf '
                                                '/Applications/TeX\n'
                                                '            ',
                        'unattended_install': True,
                        'version': '2023'}}}
FlatPkgUnpacker
{'Input': {'destination_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/Unpack/',
           'flat_pkg_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg'}}
FlatPkgUnpacker: Unpacked /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg to /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/Unpack/
{'Output': {}}
PkgRootCreator
{'Input': {'pkgdirs': {},
           'pkgroot': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/application_payload/Applications'}}
PkgRootCreator: Created /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/application_payload/Applications
{'Output': {}}
PkgPayloadUnpacker
{'Input': {'destination_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/application_payload',
           'pkg_payload_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/Unpack/GUI-Applications-Start.pkg/Payload',
           'purge_destination': True}}
PkgPayloadUnpacker: Unpacked /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/Unpack/GUI-Applications-Start.pkg/Payload to /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/application_payload
{'Output': {}}
MunkiInstallsItemsCreator
{'Input': {'derive_minimum_os_version': 'YES',
           'faux_root': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/application_payload',
           'installs_item_paths': ['/Applications/TeX/LaTeXiT.app']}}
MunkiInstallsItemsCreator: Created installs item for /Applications/TeX/LaTeXiT.app
MunkiInstallsItemsCreator: Derived minimum os version as: 10.9
{'Output': {'additional_pkginfo': {'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT',
                                                 'CFBundleShortVersionString': '2.16.5',
                                                 'CFBundleVersion': '2.16.5',
                                                 'minosversion': '10.9',
                                                 'path': '/Applications/TeX/LaTeXiT.app',
                                                 'type': 'application',
                                                 'version_comparison_key': 'CFBundleShortVersionString'}],
                                   'minimum_os_version': '10.9',
                                   'version': '2023'}}}
MunkiPkginfoMerger
{'Input': {'additional_pkginfo': {'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT',
                                                'CFBundleShortVersionString': '2.16.5',
                                                'CFBundleVersion': '2.16.5',
                                                'minosversion': '10.9',
                                                'path': '/Applications/TeX/LaTeXiT.app',
                                                'type': 'application',
                                                'version_comparison_key': 'CFBundleShortVersionString'}],
                                  'minimum_os_version': '10.9',
                                  'version': '2023'},
           'pkginfo': {'catalogs': ['testing'],
                       'category': 'Mathematics',
                       'description': 'MacTeX is a product produced by the '
                                      'MacTeX TeXnical working group of the '
                                      'TeX Users Group (TUG). It is the '
                                      'Macintosh component of the TeX '
                                      'Collection DVD, the reference edition '
                                      'of TeX distributed by TeX User Groups '
                                      'across the world. The reference edition '
                                      'runs on Mac OS X, Windows, GNU/Linux, '
                                      'various BSD Unix systems, and most '
                                      'other computer architectures.\n'
                                      '            ',
                       'developer': 'TeX Users Group',
                       'display_name': 'MacTeX',
                       'name': 'MacTeX',
                       'postuninstall_script': '#!/bin/bash\n'
                                               '            /bin/rm -rf '
                                               '/Applications/TeX\n'
                                               '            ',
                       'unattended_install': True,
                       'version': '2023'}}}
MunkiPkginfoMerger: Merged {'version': '2023', 'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT', 'CFBundleShortVersionString': '2.16.5', 'CFBundleVersion': '2.16.5', 'minosversion': '10.9', 'path': '/Applications/TeX/LaTeXiT.app', 'type': 'application', 'version_comparison_key': 'CFBundleShortVersionString'}], 'minimum_os_version': '10.9'} into pkginfo
{'Output': {'pkginfo': {'catalogs': ['testing'],
                        'category': 'Mathematics',
                        'description': 'MacTeX is a product produced by the '
                                       'MacTeX TeXnical working group of the '
                                       'TeX Users Group (TUG). It is the '
                                       'Macintosh component of the TeX '
                                       'Collection DVD, the reference edition '
                                       'of TeX distributed by TeX User Groups '
                                       'across the world. The reference '
                                       'edition runs on Mac OS X, Windows, '
                                       'GNU/Linux, various BSD Unix systems, '
                                       'and most other computer '
                                       'architectures.\n'
                                       '            ',
                        'developer': 'TeX Users Group',
                        'display_name': 'MacTeX',
                        'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT',
                                      'CFBundleShortVersionString': '2.16.5',
                                      'CFBundleVersion': '2.16.5',
                                      'minosversion': '10.9',
                                      'path': '/Applications/TeX/LaTeXiT.app',
                                      'type': 'application',
                                      'version_comparison_key': 'CFBundleShortVersionString'}],
                        'minimum_os_version': '10.9',
                        'name': 'MacTeX',
                        'postuninstall_script': '#!/bin/bash\n'
                                                '            /bin/rm -rf '
                                                '/Applications/TeX\n'
                                                '            ',
                        'unattended_install': True,
                        'version': '2023'}}}
MunkiImporter
{'Input': {'MUNKI_REPO': '/Volumes/test-auto-update',
           'pkg_path': '/Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/downloads/MacTeX.pkg',
           'pkginfo': {'catalogs': ['testing'],
                       'category': 'Mathematics',
                       'description': 'MacTeX is a product produced by the '
                                      'MacTeX TeXnical working group of the '
                                      'TeX Users Group (TUG). It is the '
                                      'Macintosh component of the TeX '
                                      'Collection DVD, the reference edition '
                                      'of TeX distributed by TeX User Groups '
                                      'across the world. The reference edition '
                                      'runs on Mac OS X, Windows, GNU/Linux, '
                                      'various BSD Unix systems, and most '
                                      'other computer architectures.\n'
                                      '            ',
                       'developer': 'TeX Users Group',
                       'display_name': 'MacTeX',
                       'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT',
                                     'CFBundleShortVersionString': '2.16.5',
                                     'CFBundleVersion': '2.16.5',
                                     'minosversion': '10.9',
                                     'path': '/Applications/TeX/LaTeXiT.app',
                                     'type': 'application',
                                     'version_comparison_key': 'CFBundleShortVersionString'}],
                       'minimum_os_version': '10.9',
                       'name': 'MacTeX',
                       'postuninstall_script': '#!/bin/bash\n'
                                               '            /bin/rm -rf '
                                               '/Applications/TeX\n'
                                               '            ',
                       'unattended_install': True,
                       'version': '2023'},
           'repo_subdirectory': 'apps/mactex'}}
MunkiImporter: No value supplied for MUNKI_REPO_PLUGIN, setting default value of: FileRepo
MunkiImporter: No value supplied for MUNKILIB_DIR, setting default value of: /usr/local/munki
MunkiImporter: No value supplied for force_munki_repo_lib, setting default value of: False
MunkiImporter: Using repo lib: AutoPkgLib
MunkiImporter:         plugin: FileRepo
MunkiImporter:           repo: /Volumes/test-auto-update
MunkiImporter: Copied pkginfo to: /Volumes/test-auto-update/pkgsinfo/apps/mactex/MacTeX-2023.plist
MunkiImporter:            pkg to: /Volumes/test-auto-update/pkgs/apps/mactex/MacTeX-2023.pkg
{'Output': {'munki_importer_summary_result': {'data': {'catalogs': 'testing',
                                                       'icon_repo_path': '',
                                                       'name': 'MacTeX',
                                                       'pkg_repo_path': 'apps/mactex/MacTeX-2023.pkg',
                                                       'pkginfo_path': 'apps/mactex/MacTeX-2023.plist',
                                                       'version': '2023'},
                                              'report_fields': ['name',
                                                                'version',
                                                                'catalogs',
                                                                'pkginfo_path',
                                                                'pkg_repo_path',
                                                                'icon_repo_path'],
                                              'summary_text': 'The following '
                                                              'new items were '
                                                              'imported into '
                                                              'Munki:'},
            'munki_info': {'_metadata': {'created_by': 'sadmin',
                                         'creation_date': datetime.datetime(2023, 4, 20, 14, 6, 5),
                                         'munki_version': '6.2.1.4545',
                                         'os_version': '13.2.1'},
                           'autoremove': False,
                           'catalogs': ['testing'],
                           'category': 'Mathematics',
                           'description': 'MacTeX is a product produced by the '
                                          'MacTeX TeXnical working group of '
                                          'the TeX Users Group (TUG). It is '
                                          'the Macintosh component of the TeX '
                                          'Collection DVD, the reference '
                                          'edition of TeX distributed by TeX '
                                          'User Groups across the world. The '
                                          'reference edition runs on Mac OS X, '
                                          'Windows, GNU/Linux, various BSD '
                                          'Unix systems, and most other '
                                          'computer architectures.\n'
                                          '            ',
                           'developer': 'TeX Users Group',
                           'display_name': 'MacTeX',
                           'installed_size': 8459439,
                           'installer_item_hash': '57304ece58618f0dfc6a41be39d1d6e8f688d81247c84a89eb1cc788b280050b',
                           'installer_item_location': 'apps/mactex/MacTeX-2023.pkg',
                           'installer_item_size': 5385026,
                           'installs': [{'CFBundleIdentifier': 'fr.chachatelier.pierre.LaTeXiT',
                                         'CFBundleShortVersionString': '2.16.5',
                                         'CFBundleVersion': '2.16.5',
                                         'minosversion': '10.9',
                                         'path': '/Applications/TeX/LaTeXiT.app',
                                         'type': 'application',
                                         'version_comparison_key': 'CFBundleShortVersionString'}],
                           'minimum_os_version': '10.9',
                           'name': 'MacTeX',
                           'postuninstall_script': '#!/bin/bash\n'
                                                   '            /bin/rm -rf '
                                                   '/Applications/TeX\n'
                                                   '            ',
                           'receipts': [{'installed_size': 141144,
                                         'packageid': 'org.tug.mactex.ghostscript10.00',
                                         'version': '10.00'},
                                        {'installed_size': 57775,
                                         'packageid': 'org.tug.mactex.ghostscript10.00-libgs',
                                         'version': '10.00'},
                                        {'installed_size': 282120,
                                         'packageid': 'org.tug.mactex.gui2023',
                                         'version': '2023'},
                                        {'installed_size': 7978400,
                                         'packageid': 'org.tug.mactex.texlive2023',
                                         'version': '2023'}],
                           'unattended_install': True,
                           'uninstall_method': 'removepackages',
                           'uninstallable': True,
                           'version': '2023'},
            'munki_repo_changed': True,
            'pkg_repo_path': '/Volumes/test-auto-update/pkgs/apps/mactex/MacTeX-2023.pkg',
            'pkginfo_repo_path': '/Volumes/test-auto-update/pkgsinfo/apps/mactex/MacTeX-2023.plist'}}
Receipt written to /Users/sadmin/Library/AutoPkg/Cache/com.github.joshua-d-miller.autopkg.munki.MacTeX/receipts/mactex.munki-receipt-20230420-150701.plist

The following new items were imported into Munki:
    Name    Version  Catalogs  Pkginfo Path                   Pkg Repo Path                Icon Repo Path  
    ----    -------  --------  ------------                   -------------                --------------  
    MacTeX  2023     testing   apps/mactex/MacTeX-2023.plist  apps/mactex/MacTeX-2023.pkg 
joshua-d-miller commented 1 year ago

This was merged by a previous pull request. I'll go ahead and close this one.