From: Hongxu Jia Date: Sat, 8 Nov 2014 05:56:19 +0000 (+0800) Subject: compress_doc.bbclass: improve manual file detection X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~31944 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=886685d207bd5e6e2e236a7c5591f62f5de26090;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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. Signed-off-by: Hongxu Jia Signed-off-by: Ross Burton --- diff --git a/meta/classes/compress_doc.bbclass b/meta/classes/compress_doc.bbclass index 6a4e635982a..afa9cd614ae 100644 --- a/meta/classes/compress_doc.bbclass +++ b/meta/classes/compress_doc.bbclass @@ -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