Skip to content

Commit dbbc5b7

Browse files
committed
Ignore missing packages if PackageCompleteURL is present
1 parent 016304b commit dbbc5b7

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ All notable changes to this project will be documented in this file. This projec
1212

1313
## [Unreleased]
1414

15-
Nothing yet.
15+
### Changed
16+
17+
- `check-munki-pkgsinfo` now skips warning about missing packages if a `PackageCompleteURL` key is set in the pkginfo.
1618

1719
## [1.22.0] - 2025-11-25
1820

pre_commit_macadmin_hooks/check_munki_pkgsinfo.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def main(argv: Optional[List[str]] = None) -> int:
176176
# Check for rogue categories.
177177
if args.categories and pkginfo.get("category") not in args.categories:
178178
print(
179-
f"{filename}: category \"{pkginfo.get('category')}\" is not in list of approved categories"
179+
f'{filename}: category "{pkginfo.get("category")}" is not in list of approved categories'
180180
)
181181
retval = 1
182182

@@ -204,13 +204,17 @@ def main(argv: Optional[List[str]] = None) -> int:
204204

205205
# Begin checks that apply to both installers and uninstallers
206206
for i_type in ("installer", "uninstaller"):
207-
208207
# Check for missing or case-conflicted installer or uninstaller items
209208
if not _check_case_sensitive_path(
210209
os.path.join(
211210
args.munki_repo, "pkgs", pkginfo.get(f"{i_type}_item_location", "")
212211
)
213212
):
213+
if i_type == "installer" and "PackageCompleteURL" in pkginfo:
214+
# PackageCompleteURL allows download from a URL outside of the Munki repo,
215+
# so the installer need not exist in the repo.
216+
continue
217+
214218
msg = f"{i_type} item does not exist or path is not case sensitive"
215219
if args.warn_on_missing_installer_items:
216220
print(f"{filename}: WARNING: {msg}")

0 commit comments

Comments
 (0)