From cc5aa6a2b061b554e8c6b6701daf257e8de9e213 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Jan 09 2023 01:02:32 +0000 Subject: pyrpkg.spec.SpecFile: More lenient parser for Source/Patch lines RPM syntax allows whitespace before the colon, and a few Fedora packages use them. This results in an error like this one: $ fedpkg srpm Not downloading unused cups-bjnp-2.0.3.tar.gz error: Bad source: …/cups-bjnp/cups-bjnp-2.0.3.tar.gz: No such file or directory Could not execute srpm: Failed to execute command. This commits changes the regular expression to accept the additional whitespace. Signed-off-by: Florian Weimer --- diff --git a/pyrpkg/spec.py b/pyrpkg/spec.py index bd862f1..d72f1fb 100644 --- a/pyrpkg/spec.py +++ b/pyrpkg/spec.py @@ -15,7 +15,7 @@ from pyrpkg.errors import rpkgError class SpecFile(object): """Simple specfile parser that finds source file names""" sourcefile_expression = re.compile( - r'^((source[0-9]*|patch[0-9]*):\s*(?P.*))\s*$', + r'^((source[0-9]*|patch[0-9]*)\s*:\s*(?P.*))\s*$', re.IGNORECASE) def __init__(self, spec, sourcedir):