@@ -221,61 +221,6 @@ def summary(self) -> None:
221221 preparations = fmf .utils .listed (self .preparations_applied , 'preparation' )
222222 self .info ('summary' , f'{ preparations } applied' , 'green' , shift = 1 )
223223
224- def _extract_failed_packages (self , exceptions : list [Exception ]) -> set [str ]:
225- """
226- Extract package names from installation exceptions.
227-
228- Returns a list of package names that failed to install.
229- """
230-
231- failed_packages : set [str ] = set ()
232- import re
233-
234- for exc in exceptions :
235- # Extract failed packages from RunError stderr/stdout
236- if isinstance (exc , tmt .utils .RunError ):
237- error_text = ''
238- if exc .stderr :
239- error_text += exc .stderr + '\n '
240- if exc .stdout :
241- error_text += exc .stdout
242-
243- if error_text :
244- # dnf, dnf5, yum, apt, apk specific patterns
245- patterns = [
246- r'no package provides\s+([^\s\n]+)' ,
247- r'Unable to find a match:\s+([^\s\n]+)' ,
248- r'No match for argument:\s+([^\s\n]+)' ,
249- r'No package\s+([^\s\n]+)\s+available' ,
250- r'Unable to locate package\s+([^\s]+)' ,
251- r'E:\s+Unable to locate package\s+([^\s]+)' ,
252- ]
253-
254- for pattern in patterns :
255- matches = re .findall (pattern , error_text , re .IGNORECASE )
256- failed_packages .update (matches )
257-
258- return failed_packages
259-
260- def _show_failed_packages_with_tests (self , failed_packages : set [str ]) -> None :
261- """
262- Show failed packages and which tests require them.
263- """
264-
265- # Get test dependencies from discover step
266- dependencies_to_tests = self .plan .discover .dependencies_to_tests
267-
268- # Show failed packages with their associated tests
269- self .info ('' )
270- self .info ('failed packages' , '' , 'red' , shift = 1 )
271-
272- for failed_package in failed_packages :
273- matching_tests = []
274- if failed_package in dependencies_to_tests :
275- matching_tests = dependencies_to_tests [failed_package ]
276- sorted_matching_tests = ', ' .join (sorted (matching_tests ))
277- self .info (failed_package , f'required by { sorted_matching_tests } ' , color = 'red' , shift = 2 )
278-
279224 def go (self , force : bool = False ) -> None :
280225 """
281226 Prepare the guests
@@ -553,9 +498,7 @@ def _record_exception(
553498 self ._save_results (self .results )
554499
555500 if exceptions :
556- failed_packages = self ._extract_failed_packages (exceptions )
557- if failed_packages :
558- self ._show_failed_packages_with_tests (failed_packages )
501+ # TODO: needs a better message...
559502 raise tmt .utils .PrepareError (
560503 'prepare step failed' ,
561504 causes = exceptions ,
0 commit comments