]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
compress_doc.bbclass: improve manual file detection
authorHongxu Jia <hongxu.jia@windriver.com>
Sat, 8 Nov 2014 05:56:19 +0000 (13:56 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 3 Dec 2014 12:22:41 +0000 (12:22 +0000)
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 <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/compress_doc.bbclass

index 6a4e635982ae50f6c0d01ee89ff5b133b73b6e1b..afa9cd614ae671f31fa58385bb4d86d94102d3f1 100644 (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