From patchwork Fri Dec 13 23:21:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 181609 Delivered-To: patch@linaro.org Received: by 2002:ac9:44c4:0:0:0:0:0 with SMTP id t4csp1377043och; Fri, 13 Dec 2019 15:22:06 -0800 (PST) X-Google-Smtp-Source: APXvYqwVR3rtoPUCxSJFBUGH5wzGcfGpZLPs9iWZSiLBLd1qfRJqSUhOnLbeJXS05o3KVw3//Ani X-Received: by 2002:a62:8602:: with SMTP id x2mr2295442pfd.39.1576279325928; Fri, 13 Dec 2019 15:22:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576279325; cv=none; d=google.com; s=arc-20160816; b=Oc0kbbhxV5J4/AIVjmcImi2gXMEwZo5Jm9JkyrpR094YuRSlI1heRv305zgEQxSr5I GmInMPvFzZQeuaWHnok6ejf4zZB1Dg8lVP0u/lsFxayQd/0jyv4wSu7D/0K1QHtX3oQC 1M+8veg4awtFxr+xy9+uoNkSYQwbsOG39ApbvoA7DKfCGYMNNuP+EwkwHim9Sxmbzo2r 9Np2DZxyMLh7NRX82/+cm2fA50XXACOiv+xUBF4IISkmQP2+xQmdGH1yiha72DxnIaM4 rFoqbxhdAbBIrL32mEp2GTFgO8yU5rjQqZITlCmcAkeHmwWVtWaYOC2KTpnXg5gl4U5a pJTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=l0gMJXZvDot7Fb1kG/PlqmexPP2ypmyM4rDMH77+XxY=; b=jGLrOKSIjultM78fdT0b7EzoaDfOgEaXAN4YSb8HeXL4KJDiBk+CXmt9j7yuHemDJn obAxAnn9Pos83RqCJotlWambkc4Mb0canED0f3YP2ZXsZZkl8LC/Gn2tiehCZr0O1+/I fFDPPvsQB4kT/z/TjRuhbRmgWdmtm+gpAEHY2uExhu1lE/Z1hyJe6giP0kNQYxCAJQdh +MuijEH6saOiFUHC90QXrQKtjVfQvxliy5zrReaGqAlP4adnDzN12u9NvXSYyCWAvT35 JplXfGQA7m3aCuI/K8aM7ZMCEawRUqGGIEsSIFi0QoKBwazt7jZlfqjfpoSCiFcFeCgg PkLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=c7IkSIUP; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id f10si8856195pje.57.2019.12.13.15.22.05; Fri, 13 Dec 2019 15:22:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=c7IkSIUP; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 309437F8B9; Fri, 13 Dec 2019 23:22:01 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mail.openembedded.org (Postfix) with ESMTP id DCE8A7CE26 for ; Fri, 13 Dec 2019 23:21:59 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id y11so492179wrt.6 for ; Fri, 13 Dec 2019 15:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7tUIRugy7/gE58w7d7w3UAA6Qj3aK4jFurRyb5vTqqk=; b=c7IkSIUP4EHPXvTA3luqUIa69sJMd+ViomqNHmikBqwxJ9Se+zRvEigr79WLYTGB6k eicwsoF9+mILAiFaAx/t9X8l79fXUJVeZI7gazvQHK3DnI6nspTI9xcBfM272Ql5KjVC Whg05JoO6eNX7Nq47yntA2FwZaui4X6hoG1rSCVmux9YY7ohnCwFsNLKDvE0DSjU+7cp /vV3Mc+PyDmWwLzAfhg528fPi/HnwmDPXXuTkx70HFP3kQPncr34lCyZmx9g0kiAVfp+ gaqxP2v+KWnveFxeAFgca/J8z7xtXgcI7fXB7+AFYfzYVnpLzKweal95tmY4jpyWyiAs E8vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7tUIRugy7/gE58w7d7w3UAA6Qj3aK4jFurRyb5vTqqk=; b=cc3OKAmMhGCuj/4epvCXUkI0+z0P31NGTjDw05/Jvjiu9EDCwPjKguX9OdbulQLMhO Gl6NN9u87wcGFfRBWYURNtQwTBNn+/F/QumGAABW5HI23ELJC3l7oQmr6ybzCodPNzyV v5OrhxAVkUPyPmWqo4wxVxTCKP4nv4QoXCADQDL3bBnvcG4/0C2cK7Hx/3gjQsNXHOUW pjKUzdagQ4l3G0omgiyjKhltT53LY+1x72+kIAAdyu/LANoxT5yyifzNlSJYlRPvyWgL W8D3pxHcqYMdDeXxwpLqn2wLE2+eZWyKeVJGAzf6o0g3Ff3OtNIfkgkvKnTXNrQqXup7 HXzg== X-Gm-Message-State: APjAAAWdamJZvXCQNsnO4t5LQ+o0td+Hykx+VGOGCY6g1kctdadicOU9 ynKfKasS411u+qBSuDDQZ/r9OLoHzao= X-Received: by 2002:a5d:4e0a:: with SMTP id p10mr15078437wrt.229.1576279320101; Fri, 13 Dec 2019 15:22:00 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id z6sm11180507wmz.12.2019.12.13.15.21.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2019 15:21:58 -0800 (PST) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Fri, 13 Dec 2019 23:21:55 +0000 Message-Id: <20191213232156.28367-1-ross.burton@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [RFC PATCH 1/2] podfix: class to remove Pod::Man versions from manpages X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Manpages generated by Pod::Man contain the version number, which isn't reproducible if we're using the host Perl to generate manpage. One option is to always depend on perl-native when generating manpages but this is a heavy dependency, so instead strip out the versions in do_install(). Signed-off-by: Ross Burton --- meta/classes/podfix.bbclass | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meta/classes/podfix.bbclass -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/podfix.bbclass b/meta/classes/podfix.bbclass new file mode 100644 index 00000000000..54fff6a0a23 --- /dev/null +++ b/meta/classes/podfix.bbclass @@ -0,0 +1,32 @@ +python pod_strip_version() { + import re + + def opener(filename, mode): + if filename.endswith(".gz"): + import gzip + return gzip.open(filename, mode) + elif filename.endswith(".bz2"): + import bz2 + return bz2.open(filename, mode) + else: + return open(filename, mode) + + bad_re = re.compile(rb"Automatically generated by Pod::Man( [0-9]+.+)") + + for root, dirs, files in os.walk(d.expand("${D}${mandir}")): + for filename in files: + filename = os.path.join(root, filename) + with opener(filename, "rb") as manfile: + manpage = manfile.read() + m = bad_re.search(manpage) + if not m: + continue + + bb.note("podfix: stripping version from %s" % filename) + os.unlink(filename) + with opener(filename, "wb") as manfile: + manfile.write(manpage[:m.start(1)]) + manfile.write(manpage[m.end(1):]) +} + +do_install[postfuncs] += "pod_strip_version"