summaryrefslogtreecommitdiffstats
path: root/meta/classes/podfix.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/podfix.bbclass')
-rw-r--r--meta/classes/podfix.bbclass35
1 files changed, 0 insertions, 35 deletions
diff --git a/meta/classes/podfix.bbclass b/meta/classes/podfix.bbclass
deleted file mode 100644
index cc8210a27e..0000000000
--- a/meta/classes/podfix.bbclass
+++ /dev/null
@@ -1,35 +0,0 @@
1python pod_strip_version() {
2 import re
3
4 def opener(filename, mode):
5 if filename.endswith(".gz"):
6 import gzip
7 return gzip.open(filename, mode)
8 elif filename.endswith(".bz2"):
9 import bz2
10 return bz2.open(filename, mode)
11 else:
12 return open(filename, mode)
13
14 bad_re = re.compile(rb"Automatically generated by Pod::Man( [0-9]+.+)")
15
16 for root, dirs, files in os.walk(d.expand("${D}${mandir}")):
17 for filename in files:
18 filename = os.path.join(root, filename)
19 if not os.path.isfile(filename):
20 continue
21
22 with opener(filename, "rb") as manfile:
23 manpage = manfile.read()
24 m = bad_re.search(manpage)
25 if not m:
26 continue
27
28 bb.note("podfix: stripping version from %s" % filename)
29 os.unlink(filename)
30 with opener(filename, "wb") as manfile:
31 manfile.write(manpage[:m.start(1)])
32 manfile.write(manpage[m.end(1):])
33}
34
35do_install[postfuncs] += "pod_strip_version"