Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Major version naming and arbitrary suffix #35

Merged
merged 2 commits into from Oct 4, 2019
Merged

Major version naming and arbitrary suffix #35

merged 2 commits into from Oct 4, 2019

Conversation

macjustice
Copy link

Versioned Xcodes are now imported as XcodeX instead of XcodeX.Y.Z, so minor and patch versions will be upgraded as new versions are imported.

Also adds the ability to insert an optional arbitrary string, for cosmetic/political reasons.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@nmcspadden
Copy link
Contributor

The changes look fine, but please provide the output of autopkg run -vv in the PR to show that it works.

@macjustice
Copy link
Author

❯ autopkg run XcodeVersionedName.munki -vv
Processing XcodeVersionedName.munki...
Use of undefined key in variable substitution: u'RECIPE_CACHE_DIR'
AppleDataGatherer
{'Input': {'appID_key': u'891bd3417a7776362562d2197f89480a8547b108fd934911bcbea0110d07f757',
           'apple_id': u'appleid@hamtown.city',
           'password_file': u'secret.txt'}}
AppleDataGatherer: Writing data to file
{'Output': {'data_pathname': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/login_data'}}
AppleCookieDownloader
{'Input': {'login_data': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/login_data'}}
AppleCookieDownloader: No value supplied for CURL_PATH, setting default value of: /usr/bin/curl
AppleCookieDownloader: Getting login cookie
AppleCookieDownloader: Getting download cookie
AppleCookieDownloader: Unzipping download list
{'Output': {'download_cookies': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/download_cookies'}}
AppleURLSearcher
{'Input': {'re_pattern': u'(.*\\/Xcode_.*\\/Xcode.*.xip)'}}
AppleURLSearcher: No value supplied for result_output_var_name, setting default value of: match
AppleURLSearcher: Beta flag not set, searching More downloads list...
AppleURLSearcher: Found matching item: Xcode_11_GM_Seed_2
AppleURLSearcher: Full URL: https://download.developer.apple.com/Developer_Tools/Xcode_11_GM_Seed_2/Xcode_11_GM_Seed_2.xip
{'Output': {'match': u'https://download.developer.apple.com/Developer_Tools/Xcode_11_GM_Seed_2/Xcode_11_GM_Seed_2.xip'}}
AppleCookieDownloader
{'Input': {'CURL_PATH': '/usr/bin/curl',
           'login_data': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/login_data'}}
AppleCookieDownloader: Getting login cookie
AppleCookieDownloader: Getting download cookie
AppleCookieDownloader: Unzipping download list
{'Output': {'download_cookies': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/download_cookies'}}
XcodeVersionEmitter
{'Input': {'dont_skip': u'',
           'output_filepath': u'%RECIPE_CACHE_DIR%/xcode_tag',
           'url': u'https://download.developer.apple.com/Developer_Tools/Xcode_11_GM_Seed_2/Xcode_11_GM_Seed_2.xip'}}
XcodeVersionEmitter: dont_skip is false, so skipping this Processor.
{'Output': {}}
EndOfCheckPhase
{'Input': {}}
{'Output': {}}
URLDownloader
{'Input': {'CURL_PATH': '/usr/bin/curl',
           'curl_opts': (
    "--request",
    GET,
    "--cookie",
    "/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/download_cookies"
),
           'url': u'https://download.developer.apple.com/Developer_Tools/Xcode_11_GM_Seed_2/Xcode_11_GM_Seed_2.xip'}}
URLDownloader: No value supplied for CHECK_FILESIZE_ONLY, setting default value of: False
URLDownloader: Item at URL is unchanged.
URLDownloader: Using existing /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/Xcode_11_GM_Seed_2.xip
{'Output': {'pathname': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/Xcode_11_GM_Seed_2.xip'}}
PathDeleter
{'Input': {'path_list': (
    "/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/login_data"
)}}
PathDeleter: Deleted /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/login_data
{'Output': {}}
XcodeXIPUnpacker
{'Input': {'PKG': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/downloads/Xcode_11_GM_Seed_2.xip'}}
XcodeXIPUnpacker: Extracting xip archive, please be patient, this could take a long time...
XcodeXIPUnpacker: Finished xip unpack.
{'Output': {}}
FileFinder
{'Input': {'pattern': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/*.app'}}
FileFinder: No value supplied for find_method, setting default value of: glob
FileFinder: Found file match: '/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app' from globbed '/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/*.app'
{'Output': {'found_filename': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app'}}
CodeSignatureVerifier
{'Input': {'input_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app',
           'requirement': u'identifier "com.apple.dt.Xcode" and anchor apple'}}
CodeSignatureVerifier: Verifying code signature...
CodeSignatureVerifier: Deep verification enabled...
CodeSignatureVerifier: Strict verification not defined. Using codesign defaults...
CodeSignatureVerifier: /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app: valid on disk
CodeSignatureVerifier: /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app: satisfies its Designated Requirement
CodeSignatureVerifier: /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app: explicit requirement satisfied
CodeSignatureVerifier: Signature is valid
{'Output': {}}
PlistReader
{'Input': {'info_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app/Contents/version.plist',
           'plist_keys': {
    CFBundleShortVersionString = version;
    CFBundleVersion = "bundle_version";
    ProductBuildVersion = "build_version";
}}}
PlistReader: Reading: /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app/Contents/version.plist
PlistReader: Assigning value of '11A420a' to output variable 'build_version'
PlistReader: Assigning value of '14936' to output variable 'bundle_version'
PlistReader: Assigning value of '11.0' to output variable 'version'
{'Output': {'plist_reader_output_variables': {u'build_version': u'11A420a',
                                              u'bundle_version': u'14936',
                                              u'version': u'11.0'}}}
XcodeVersioner
{'Input': {'app_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app',
           'version': u'11.0'}}
XcodeVersioner: Major version: 11
XcodeVersioner: Minor version: 0
XcodeVersioner: Normalizing patch to 0
XcodeVersioner: Patch version: 0
{'Output': {'major_version': '11', 'minor_version': '0', 'patch_version': '0'}}
XcodeVersioner
{'Input': {'app_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app',
           'version': u'11.0'}}
XcodeVersioner: Major version: 11
XcodeVersioner: Minor version: 0
XcodeVersioner: Normalizing patch to 0
XcodeVersioner: Patch version: 0
{'Output': {'major_version': '11', 'minor_version': '0', 'patch_version': '0'}}
FileMover
{'Input': {'source': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app',
           'target': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app'}}
FileMover: File /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack/Xcode.app moved to /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app
{'Output': {}}
DmgCreator
{'Input': {'dmg_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.dmg',
           'dmg_root': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app'}}
DmgCreator: Created dmg from /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app at /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.dmg
{'Output': {}}
MunkiPkginfoMerger
{'Input': {'additional_pkginfo': {
    "display_name" = "Xcode 11.0.0";
    "icon_name" = "Xcode.png";
    name = Xcode11;
    version = "11.0.0";
},
           'pkginfo': {
    catalogs =     (
        dev
    );
    description = Xcode;
    "display_name" = Xcode;
    name = Xcode;
    "unattended_install" = 1;
}}}
MunkiPkginfoMerger: Merged {
    "display_name" = "Xcode 11.0.0";
    "icon_name" = "Xcode.png";
    name = Xcode11;
    version = "11.0.0";
} into pkginfo
{'Output': {'pkginfo': {
    catalogs =     (
        dev
    );
    description = Xcode;
    "display_name" = "Xcode 11.0.0";
    "icon_name" = "Xcode.png";
    name = Xcode11;
    "unattended_install" = 1;
    version = "11.0.0";
}}}
MunkiImporter
{'Input': {'MUNKI_REPO': u'/Users/resu/src/munki',
           'pkg_path': u'/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.dmg',
           'pkginfo': {
    catalogs =     (
        dev
    );
    description = Xcode;
    "display_name" = "Xcode 11.0.0";
    "icon_name" = "Xcode.png";
    name = Xcode11;
    "unattended_install" = 1;
    version = "11.0.0";
},
           'repo_subdirectory': u'apps/apple/xcode/'}}
MunkiImporter: Copied pkginfo to /Users/resu/src/munki/pkgsinfo/apps/apple/xcode/Xcode11-11.0.0.plist
MunkiImporter: Copied pkg to /Users/resu/src/munki/pkgs/apps/apple/xcode/Xcode_11.0.0.dmg
{'Output': {'munki_importer_summary_result': {'data': {'catalogs': u'dev',
                                                       'name': u'Xcode11',
                                                       'pkg_repo_path': u'apps/apple/xcode/Xcode_11.0.0.dmg',
                                                       'pkginfo_path': u'apps/apple/xcode/Xcode11-11.0.0.plist',
                                                       'version': u'11.0.0'},
                                              'report_fields': ['name',
                                                                'version',
                                                                'catalogs',
                                                                'pkginfo_path',
                                                                'pkg_repo_path'],
                                              'summary_text': 'The following new items were imported into Munki:'},
            'munki_info': {
    "_metadata" =     {
        "created_by" = resu;
        "creation_date" = "2019-10-04 17:46:29 +0000";
        "munki_version" = "3.6.3.3784";
        "os_version" = "10.15";
    };
    autoremove = 0;
    catalogs =     (
        dev
    );
    description = Xcode;
    "display_name" = "Xcode 11.0.0";
    "icon_name" = "Xcode.png";
    "installer_item_hash" = 1d1ad84fafe16b11b0f4f0830f3180c24beb1256288301dbfd8b9d72aa57ec13;
    "installer_item_location" = "apps/apple/xcode/Xcode_11.0.0.dmg";
    "installer_item_size" = 8123499;
    "installer_type" = "copy_from_dmg";
    installs =     (
                {
            CFBundleIdentifier = "com.apple.dt.Xcode";
            CFBundleName = Xcode;
            CFBundleShortVersionString = "11.0";
            CFBundleVersion = 14936;
            minosversion = "10.14.4";
            path = "/Applications/Xcode_11.0.0.app";
            type = application;
            "version_comparison_key" = CFBundleShortVersionString;
        }
    );
    "items_to_copy" =     (
                {
            "destination_path" = "/Applications";
            "source_item" = "Xcode_11.0.0.app";
        }
    );
    "minimum_os_version" = "10.14.4";
    name = Xcode11;
    "unattended_install" = 1;
    "uninstall_method" = "remove_copied_items";
    uninstallable = 1;
    version = "11.0.0";
},
            'munki_repo_changed': True,
            'pkg_repo_path': u'/Users/resu/src/munki/pkgs/apps/apple/xcode/Xcode_11.0.0.dmg',
            'pkginfo_repo_path': u'/Users/resu/src/munki/pkgsinfo/apps/apple/xcode/Xcode11-11.0.0.plist'}}
PathDeleter
{'Input': {'path_list': (
    "/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack",
    "/Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app"
)}}
PathDeleter: Deleted /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_unpack
PathDeleter: Deleted /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/Xcode_11.0.0.app
{'Output': {}}
Receipt written to /Users/resu/Library/AutoPkg/Cache/local.munki.XcodeVersionedName/receipts/XcodeVersionedName-receipt-20191004-104736.plist

The following new items were imported into Munki:
    Name     Version  Catalogs  Pkginfo Path                           Pkg Repo Path                      
    ----     -------  --------  ------------                           -------------                      
    Xcode11  11.0.0   dev       apps/apple/xcode/Xcode11-11.0.0.plist  apps/apple/xcode/Xcode_11.0.0.dmg 

@nmcspadden nmcspadden merged commit 2dfde19 into facebookarchive:master Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants