compress_doc.bbclass: improve manual file detection

The previous detection missing the following manual file:
...
gawk-doc/usr/share/man/man3/readfile.3am
libpcap-doc/usr/share/man/man3/pcap_dump_open.3pcap
...

We use re to imporve it.

(From OE-Core rev: 886685d207bd5e6e2e236a7c5591f62f5de26090)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Hongxu Jia
2014-11-08 13:56:19 +08:00
committed by Richard Purdie
parent 97d5b997cf
commit 887ffa0d7e

View File

@@ -136,11 +136,14 @@ def _is_info(file):
return False
def _is_man(file):
import re
# It refers MANSECT-var in man(1.6g)'s man.config
flags = '.1:.1p:.8:.2:.3:.3p:.4:.5:.6:.7:.9:.0p:.tcl:.n:.l:.p:.o'.split(':')
for flag in flags:
if os.path.basename(file).endswith(flag):
return True
# ".1:.1p:.8:.2:.3:.3p:.4:.5:.6:.7:.9:.0p:.tcl:.n:.l:.p:.o"
# Not start with '.', and contain the above colon-seperate element
p = re.compile(r'[^\.]+\.([1-9lnop]|0p|tcl)')
if p.search(file):
return True
return False