util: Fix regex for detecting debuginfo packages
The `re.match` function already anchors the pattern at the start of the string, but allows for other characters to continue after match. This is causing problems with packages like `elfutils-debuginfod-client` which are not debuginfo. Let's be safe and explicitly anchor both start and end. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
		
							parent
							
								
									4efdacd0a0
								
							
						
					
					
						commit
						4a78514162
					
				| @ -37,7 +37,9 @@ from productmd.common import get_major_version | ||||
| 
 | ||||
| # Patterns that match all names of debuginfo packages | ||||
| DEBUG_PATTERNS = ["*-debuginfo", "*-debuginfo-*", "*-debugsource"] | ||||
| DEBUG_PATTERN_RE = re.compile(r".*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource") | ||||
| DEBUG_PATTERN_RE = re.compile( | ||||
|     r"^(?:.*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource)$" | ||||
| ) | ||||
| 
 | ||||
| 
 | ||||
| def _doRunCommand( | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user