daemon: tweak regexp for file type detection (RHBZ#1575640)

Newer versions of file slightly changed the output, removing the comma
between the type, and the architecture string.

Tweak the regular expression so:
- the comma is optional, but if missing then only the architecture
  string will follow
- the architecture string has no commas
This commit is contained in:
Pino Toscano
2018-05-07 17:06:11 +02:00
parent 662dc5d0bf
commit 3151d5e927

View File

@@ -25,7 +25,7 @@ open Unix_utils
open Utils
let re_file_elf =
PCRE.compile "ELF (\\d+)-bit (MSB|LSB).*(?:executable|shared object|relocatable), (.+?),"
PCRE.compile "ELF (\\d+)-bit (MSB|LSB).*(?:executable|shared object|relocatable)(?:,)? ([^,]+?),"
let re_file_elf_ppc64 = PCRE.compile ".*64.*PowerPC"