Commit Graph
1864 Commits
Author SHA1 Message Date
Elliot Jordan 41e6d38cc5 Spelling fixes for Munki 7 branch (#1263)
* Fix SidebarViewController.swift file name

* Fix spelling in comments

* Fix spelling in strings and output

* Fix spelling in variables and key names

* One more pass at spelling fixes
2025-08-27 12:27:12 -07:00
Greg Neagle d100d682e4 Bump python libraries version to match 6.7.0 release 2025-08-25 16:39:11 -07:00
Greg Neagle 1c109d384d Add sucatalog URL for macOS 26 2025-08-25 10:51:18 -07:00
Greg Neagle 6ce2321a4a Reduce code duplication in pkginfolib.getiteminfo 2025-08-15 10:34:29 -07:00
Paul Cossey 547e297c53 Update pkginfolib.py (#1258)
# Pull Request: Fix incomplete metadata extraction for audio plugins and other bundles

## Problem Summary

The `getiteminfo()` function in `pkginfolib.py` currently provides inconsistent metadata extraction between applications (.app files) and other bundle types (audio plugins like .vst, .component, .aaxplugin, .vst3).

**Current behavior:**
- ✅ **Applications (.app)**: Extract comprehensive metadata including `CFBundleName`, `CFBundleIdentifier`, `CFBundleShortVersionString`, `CFBundleVersion`, and `LSMinimumSystemVersion`
- ❌ **Other bundles**: Only extract `CFBundleShortVersionString` and `CFBundleVersion`

This results in incomplete installs arrays for audio plugins and other bundle types, missing critical metadata for proper tracking and identification.

## Impact

Audio plugin packages (and other non-application bundles) generate installs array entries like this:

**Before (incomplete):**
```xml
<dict>
    <key>CFBundleVersion</key>
    <string>4.5</string>
    <key>path</key>
    <string>/Library/Audio/Plug-Ins/VST/BC Chorus 4 VST(Mono).vst</string>
    <key>type</key>
    <string>bundle</string>
    <key>version_comparison_key</key>
    <string>CFBundleVersion</string>
</dict>
```

**After (complete):**
```xml
<dict>
    <key>CFBundleIdentifier</key>
    <string>com.bluecataudio.bc-chorus-4-vst-mono-</string>
    <key>CFBundleVersion</key>
    <string>4.5</string>
    <key>minosversion</key>
    <string>10.9</string>
    <key>path</key>
    <string>/Library/Audio/Plug-Ins/VST/BC Chorus 4 VST(Mono).vst</string>
    <key>type</key>
    <string>bundle</string>
    <key>version_comparison_key</key>
    <string>CFBundleVersion</string>
</dict>
```

## Root Cause

In the `getiteminfo()` function, the bundle handling section only extracts version-related keys:

```python
# Current problematic code
for key in ['CFBundleShortVersionString', 'CFBundleVersion']:
    if key in plist:
        infodict[key] = plist[key]
```

While the application handling section extracts comprehensive metadata:

```python
# Application code (working correctly)
for key in ['CFBundleName', 'CFBundleIdentifier',
            'CFBundleShortVersionString', 'CFBundleVersion']:
    if key in plist:
        infodict[key] = plist[key]
# Plus LSMinimumSystemVersion handling
```

## Solution

Align bundle metadata extraction with application metadata extraction by expanding the bundle handling section to extract the same keys and minimum OS version information.

## Files Changed

- `code/client/munkilib/pkginfolib.py` - Modified `getiteminfo()` function

## Changes Made

**Modified bundle handling section in `getiteminfo()` function:**

```python
elif (os.path.exists(os.path.join(itempath, 'Contents', 'Info.plist')) or
      os.path.exists(os.path.join(itempath, 'Resources', 'Info.plist'))):
    infodict['type'] = 'bundle'
    infodict['path'] = itempath
    plist = pkgutils.getBundleInfo(itempath)
    # Extract the same keys as applications
    for key in ['CFBundleName', 'CFBundleIdentifier',
                'CFBundleShortVersionString', 'CFBundleVersion']:
        if key in plist:
            infodict[key] = plist[key]
    # Also extract minimum OS version info like applications
    if 'LSMinimumSystemVersion' in plist:
        infodict['minosversion'] = plist['LSMinimumSystemVersion']
    elif 'LSMinimumSystemVersionByArchitecture' in plist:
        # just grab the highest version if more than one is listed
        versions = [item[1] for item in
                    plist['LSMinimumSystemVersionByArchitecture'].items()]
        highest_version = str(max([pkgutils.MunkiLooseVersion(version)
                                   for version in versions]))
        infodict['minosversion'] = highest_version
    elif 'SystemVersionCheck:MinimumSystemVersion' in plist:
        infodict['minosversion'] = \
            plist['SystemVersionCheck:MinimumSystemVersion']
```

## Benefits

1. **Consistent metadata extraction**: All bundle types now get the same comprehensive metadata as applications
2. **Better plugin tracking**: Audio plugins (.vst, .component, .aaxplugin, .vst3) now have unique identifiers
3. **Improved OS compatibility**: Minimum OS version detection for all bundle types
4. **Enhanced debugging**: More metadata available for troubleshooting installs array issues
5. **Future-proof**: Any bundle type with standard Info.plist structure will benefit

## Affected Bundle Types

This fix applies to all bundle types that aren't applications, including:
- Audio Unit Components (`.component`)
- VST Plugins (`.vst`)
- VST3 Plugins (`.vst3`)
- AAX Plugins (`.aaxplugin`)
- Other macOS bundles with Info.plist files

## Testing

Verified with Blue Cat Audio plugins that all plugin formats now extract:
- `CFBundleIdentifier` (when present)
- `CFBundleName` (when present, particularly in AAX plugins)
- `LSMinimumSystemVersion` converted to `minosversion`
- Existing version extraction continues to work
- Some AutoPkg Recipe's that can be used for testing
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Chorus
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Flanger
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Free%20Amp
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Freeceiver
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20FreqAnalyst
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Gain%20Suite
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Phaser
-- https://github.com/autopkg/dataJAR-recipes/tree/master/Blue%20Cat%20Triple%20EQ
2025-08-15 10:34:29 -07:00
Greg Neagle a4e19992b4 Remove debugging print() statement 2025-06-10 15:20:13 -07:00
Greg Neagle 6d33d5b33d More reliable identification of flat pkg PackageInfo and Distribution files 2025-04-02 09:18:19 -07:00
Greg Neagle 6ee386247d Merge branch 'PythonPowerManager' into Munki6dev 2025-02-11 09:26:14 -08:00
Greg Neagle 46b81f061c Bump version for future release 2025-02-10 13:04:44 -08:00
Greg Neagle f88d10eaef Skip user notification if a process has made a display sleep assertion, which may mean the user is 'presenting' or in a meeting 2025-02-06 17:17:18 -08:00
Liam Nicholson 189a9054e2 Add Chain Support in Client Certificate Authentication (#1236)
* add chain support in the Client Certificate mechanism

* update comment
2025-02-06 09:35:10 -08:00
Greg Neagle 41e4a5cf89 Wait longer for a reponse from fdesetup so the client doesn't timeout too fast 2025-01-29 13:38:15 -08:00
Greg Neagle b720ed5e59 Bump version for future release 2025-01-29 08:20:10 -08:00
Greg Neagle 6b4ad647c4 Update copyright dates 2025-01-25 15:35:09 -08:00
Greg Neagle 40b44aef2a Test that /usr/bin/aa exists before attempting to call it, avoiding a crash on older macOSes 2025-01-17 10:53:19 -08:00
Greg Neagle aa41b00217 Bump version for future release 2024-10-07 09:28:31 -07:00
Greg Neagle 85e82c68c7 iconutils: if pax can't expand files from a package Payload archive, try aa 2024-09-20 11:28:38 -07:00
Greg Neagle 93b26403d1 When processing optional_installs, correctly record installed_size if available instead of just duplicating installer_item_size 2024-09-05 11:56:47 -07:00
Greg Neagle f0b2f9756e Bump version.plist for future release 2024-09-05 10:06:15 -07:00
Greg Neagle ee5d52442b Add softwareupdate catalog for macOS 15 2024-08-29 15:01:06 -07:00
Greg Neagle 7756827e40 Update selfservice.py
Fix an error message that would have provided wrong info
2024-08-20 10:07:01 -07:00
Greg Neagle eff2ebc2c9 Bump version.plist for future release 2024-08-14 08:45:58 -07:00
Graham Gilbert 752376875c Add --show-config-plist option (#1224) 2024-08-14 08:24:21 -07:00
Greg Neagle dd80a61875 Merge branch 'main' into Munki6dev 2024-07-01 09:46:11 -07:00
aysiu cccfba0500 Display force_install_after_date in managedsoftwareupdate summary (if applicable) (#1220)
* Show force_install_after_date in summary after managedsoftwareupdate run
---------

Authored-by: Alan Siu <alanysiu@gmail.com>
2024-07-01 09:44:47 -07:00
Greg Neagle d7a27ea4fd Bump version for future release 2024-06-24 10:51:29 -07:00
Greg Neagle 793e468b87 Bump version.plist for future release 2024-06-04 13:41:34 -07:00
Greg Neagle 6c4a8bc29f Restore 'catalogs' as an item included in ManagedInstallReport.plist under 'Conditions'. Addresses #1218 2024-06-04 13:39:24 -07:00
Greg Neagle bb2d1e0ca2 When running an embedded pkginfo script, ignore errors when converting script output to UTF-8 2024-06-03 09:03:01 -07:00
Greg Neagle fbe22d2ce1 Fix so new conditional/predicate comparisons based on installed applications actually work.
Bump version to 6.5.1 for future release.
2024-05-21 15:17:07 -07:00
Greg Neagle 6bb572b148 Add more detail to warning message when failing to import a middleware file 2024-04-17 08:56:01 -07:00
Greg Neagle aeac6e96a9 Start consolidating functions that deal with date/times and rely less on undocumented pyObjc conversions 2024-04-12 13:56:11 -07:00
Greg Neagle 2edea029eb Fix string format error for new package references messages 2024-04-10 09:31:06 -07:00
Greg Neagle c9e3250859 Improved debug warnings when attempting to find a valid uninstall method for an item 2024-04-01 10:57:21 -07:00
Greg Neagle 29fd72a80c Fix for deprecation messages new in macOS 14.4 that corrupt installer output 2024-03-22 10:35:27 -07:00
Greg Neagle bf1ce5a3d1 Add support for installed application info for conditional expressions 2024-03-02 11:31:26 -08:00
Greg Neagle 45b7ac64e7 Print additional info when an item cannot be removed because all its pkgs are shared with other items 2024-02-29 11:17:10 -08:00
Greg Neagle 18ea6c42ca Tweaks around behvaiors with requires dependencies that cannot be resolved, and how they interact with autoremove 2024-02-29 10:52:21 -08:00
Greg Neagle 64dea93562 Update version for future release 2024-02-23 09:05:54 -08:00
Greg Neagle 1850dbe077 Replace use of deprecated imp module with importlib.util for middleware and repo plugins 2024-02-20 10:46:32 -08:00
Greg Neagle 2b327569b4 Update copyright dates 2024-01-30 16:14:29 -08:00
Greg Neagle 98863a7206 Bump version for future release 2024-01-30 08:52:40 -08:00
Greg Neagle 8edfc6a825 Rename 'board-id' and 'device-id' 'facts' to 'board_id' and 'device_id, respectively. (Hyphens appear to be illegal in attribute names in NSPredicate expressions). Thanks to @mattydee99. See issue #1201. 2024-01-24 14:39:06 -08:00
Greg Neagle dd74af60b1 More gracefully handle exceptions when evaluating a predicate (used in conditional_items and installable_condition). Thanks to @mattydee99. See issue #1201 2024-01-24 14:33:17 -08:00
Greg Neagle 8aab28f37f Bumping version for future release 2024-01-17 16:53:29 -08:00
Patrick Gallagher 4754ecc960 Add preference to ignore middleware (#1194)
* Add preference to ignore middleware

* Changed to suggested more pythonic code
2024-01-17 15:51:44 -08:00
Greg Neagle 5d5d8adcee Return an error from updatecheck.check() when we can't download the primary manifest 2024-01-17 09:36:39 -08:00
Greg Neagle 262ef188ec Bump munki version for future release 2024-01-02 11:54:10 -08:00
Greg Neagle 150418ff4e Fix names of board-id and device-id attributes 2023-12-07 15:42:06 -08:00
Greg Neagle c3846fd24a Refine generated installable_condition predicate 2023-12-07 15:39:45 -08:00