Relax python file magic regex somewhat
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 7 May 2012 12:17:45 +0000 (15:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 22 May 2012 10:52:29 +0000 (13:52 +0300)
- libmagic sometimes adds trailing descriptions about encodings, line
  terminators and whatnot, we dont want to care about those (RhBug:796218)
- not all python-related strings start with [pP]ython either, sometimes
  libmagic says "a python script" or "a /usr/bin/python script" and
  whatnot, so loose the start-of-line restriction as well
(cherry picked from commit f2f4bfe9a57ee3da4a63ae4b93d0cca444d9389e)

fileattrs/python.attr

index 4eaad76..0f3c2cc 100644 (file)
@@ -1,4 +1,4 @@
 %__python_provides     %{_rpmconfigdir}/pythondeps.sh --provides
 %__python_requires     %{_rpmconfigdir}/pythondeps.sh --requires
 %__python_path ^((/usr/lib(64)?/python[[:digit:]]\\.[[:digit:]]/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]\\.[[:digit:]]))$
-%__python_magic                ^[Pp]ython.*(executable|byte-compiled)$
+%__python_magic                [Pp]ython.*(executable|byte-compiled)