1414 validate_required_keys ,
1515 validate_restart_action_key ,
1616 validate_shebangs ,
17+ validate_uninstall_method ,
1718)
1819
1920
@@ -39,7 +40,7 @@ def build_argument_parser():
3940 )
4041 parser .add_argument ("filenames" , nargs = "*" , help = "Filenames to check." )
4142 parser .add_argument (
42- "--munki-repo" , default = "." , help = "path to local munki repo defaults to '.'"
43+ "--munki-repo" , default = "." , help = "path to local munki repo. Defaults to '.'"
4344 )
4445 parser .add_argument (
4546 "--warn-on-missing-icons" ,
@@ -117,11 +118,15 @@ def main(argv=None):
117118 if not validate_restart_action_key (pkginfo , filename ):
118119 retval = 1
119120
121+ # Validate uninstall method.
122+ if not validate_uninstall_method (pkginfo , filename ):
123+ retval = 1
124+
120125 # Check for deprecated pkginfo keys.
121126 if not detect_deprecated_keys (pkginfo , filename ):
122127 retval = 1
123128
124- # Check for common mistakes key names.
129+ # Check for common mistakes in key names.
125130 if not detect_typoed_keys (pkginfo , filename ):
126131 retval = 1
127132
@@ -194,21 +199,6 @@ def main(argv=None):
194199 print (f"{ filename } : { msg } " )
195200 retval = 1
196201
197- # Ensure uninstall method is set correctly if uninstall_script exists.
198- uninst_method = pkginfo .get ("uninstall_method" )
199- if "uninstall_script" in pkginfo and uninst_method != "uninstall_script" :
200- print (
201- f"{ filename } : has an uninstall script, but the uninstall "
202- f'method is set to "{ uninst_method } "'
203- )
204- retval = 1
205- elif "uninstall_script" not in pkginfo and uninst_method == "uninstall_script" :
206- print (
207- f"{ filename } : uninstall_method is set to uninstall_script, "
208- 'but no uninstall script is present"'
209- )
210- retval = 1
211-
212202 # Ensure all pkginfo scripts have a proper shebang.
213203 script_types = (
214204 "installcheck_script" ,
0 commit comments