File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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+ ### Added
16+
17+ - ` check-munki-pkgsinfo ` now produces an error if ` uninstall_method ` is set to ` uninstall_script ` but no uninstall script is present in the pkginfo.
1618
1719## [ 1.17.0] - 2024-12-22
1820
Original file line number Diff line number Diff line change @@ -202,12 +202,19 @@ def main(argv=None):
202202 retval = 1
203203
204204 # Ensure uninstall method is set correctly if uninstall_script exists.
205- if "uninstall_script" in pkginfo :
206- if pkginfo .get ("uninstall_method" ) != "uninstall_script" :
207- print (
208- f'{ filename } : has uninstall script, but the uninstall method is set to "{ pkginfo .get ("uninstall_method" )} "'
209- )
210- retval = 1
205+ uninst_method = pkginfo .get ("uninstall_method" )
206+ if "uninstall_script" in pkginfo and uninst_method != "uninstall_script" :
207+ print (
208+ f"{ filename } : has an uninstall script, but the uninstall "
209+ f'method is set to "{ uninst_method } "'
210+ )
211+ retval = 1
212+ elif "uninstall_script" not in pkginfo and uninst_method == "uninstall_script" :
213+ print (
214+ f"{ filename } : uninstall_method is set to uninstall_script, "
215+ 'but no uninstall script is present"'
216+ )
217+ retval = 1
211218
212219 # Ensure all pkginfo scripts have a proper shebang.
213220 script_types = (
You can’t perform that action at this time.
0 commit comments