@@ -82,6 +82,7 @@ def _run(self):
8282 if self .options ['explain' ]:
8383 self .print_explanation (self .options ['explain' ], self .config )
8484 return retcode
85+
8586 # if there are installed arguments just load them up as extra
8687 # items to the rpmfile option
8788 if self .options ['installed' ]:
@@ -240,8 +241,10 @@ def _print_header(self):
240241 print ('' )
241242
242243 def validate_installed_packages (self , packages ):
244+ # Do not run post checks if there are also plain rpm/spec files to validate
245+ run_post_checks = not bool (self .options ['rpmfile' ])
243246 for pkg in packages :
244- self .run_checks (pkg , pkg == packages [- 1 ])
247+ self .run_checks (pkg , run_post_checks and pkg == packages [- 1 ])
245248 self .reset_checks ()
246249
247250 def validate_files (self , files ):
@@ -275,7 +278,7 @@ def _expand_filelist(self, files):
275278
276279 def validate_file (self , pname , is_last ):
277280 try :
278- if pname .suffix == '.rpm' or pname . suffix == '.spm' :
281+ if pname .suffix in ( '.rpm' , '.spm' ) :
279282 with Pkg (pname , self .config .configuration ['ExtractDir' ],
280283 verbose = self .config .info ) as pkg :
281284 for k , v in pkg .timers .items ():
@@ -288,8 +291,7 @@ def validate_file(self, pname, is_last):
288291 print_warning (f'(none): E: fatal error while reading { pname } : { e } ' )
289292 if self .config .info :
290293 raise e
291- else :
292- sys .exit (3 )
294+ sys .exit (3 )
293295
294296 def run_checks (self , pkg , is_last ):
295297 spec_checks = isinstance (pkg , FakePkg )
0 commit comments