From patchwork Thu Jan 9 04:49:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Kuster X-Patchwork-Id: 182765 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3141829ile; Sun, 12 Jan 2020 08:27:36 -0800 (PST) X-Google-Smtp-Source: APXvYqwZiSbGeMq5hbmcMdOvZ4dljDlB1NunAdgaSP6UgXs9Jjauea9+WaOFv/yPi9aESe3W961r X-Received: by 2002:a17:902:9698:: with SMTP id n24mr10101791plp.312.1578846456645; Sun, 12 Jan 2020 08:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578846456; cv=none; d=google.com; s=arc-20160816; b=hnx2I7/RBmRkt/eHrWOxfQNB4hA56DHtgqqDdaEGr7/h/G0nfwRw6uLngefjsT+FgC TYLLxnX8+Ik1FhC+UN5mrUWcOlaIz0Pd1LaZVGuOENpdYs5TqA4BNQvc4leRzvVH53yD ryDnfy6XzTayfkssIcE6L2kwCYriUj5ZIEYjNI/os+rAym49Dh2AhQbI/bfKASvygmv5 w53HbgmczrzWUpjIbg859/MIukDXCAJgcJJNkLO/z3b9KcfnC9MypZ+LskMq+H/p5mYe yVXIaw+4Gm03xb4lZWxcLSl5VCK+nyiRGmwdQSntZsmWZIiA0DjbAaIH0s1bl5RjRAL4 W2dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=YQ7KmeBvvKlZTvVnuKVvOxyduXSBpGryN8QksTG9jPs=; b=K8Ln91UqyvTHY68MuPw32nl/Kvv0LBTNwzAAEdoqQopxqFrkcmw66bL1C9kFDTDW1K 3hXtG/DrH03bYdyXhF+cPGuz3XNgfEVAzHTKEZ0P9DcP1SVBWPCnP79ycbNmrVeWqQMS 4vFu7Lt0NKTpPm/bk4cbg6z0HTNVGo9yyldEGgjru4R7Mn59oOgvAfOmJQ4Nq6/d0yTD VYlvuHv6c/14eWzlmbvsv660JrEfSmHUKnu04NcNfo4ci+fiLZgHe3r9Pyqoh3A2sqcu bPszmpns6Y76QJzG3noxRJT5joKWx6BvUfUAI4MPpcZf2fZyM/QFRfXFao3CpIz7lRMq Wovw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="rEcZX/AO"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id w9si9277483pgk.252.2020.01.12.08.27.36 for ; Sun, 12 Jan 2020 08:27:36 -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=@gmail.com header.s=20161025 header.b="rEcZX/AO"; 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=QUARANTINE dis=NONE) header.from=gmail.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 129C47FF1F; Thu, 9 Jan 2020 04:50:40 +0000 (UTC) X-Original-To: openembedded-core@openembedded.org Delivered-To: openembedded-core@openembedded.org Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by mail.openembedded.org (Postfix) with ESMTP id 0767D7FE90 for ; Thu, 9 Jan 2020 04:50:12 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id l35so581942pje.3 for ; Wed, 08 Jan 2020 20:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=BsDBnP893xYrOqhxaJ/9kWLbXkFhz5YGzFpX1B1PC50=; b=rEcZX/AO8K17EMnWiZGoYhzzA+kdEGZe7HvpgKHutP0hZ75O/MiLsJPdO6+oIMvW+5 WZ5I+zAoOHWUgnwyJyJ9pvyU8TA0Abm5eWEM8bUduTsOA44sVbVFWCBRs0Pq+/wsT/s5 +mf9OVe8sk6FF85yOs3TjMCiGP490pwB99LTultrG19Xj5ALSMhbWBKkGeR4T8nOea9t 48dlqshX4yTcwv17sGmovKkustZtcTDjpT9LsdPYCbGmTdBXyEGx1OGqVAqS2rBajt3y 4XsEOeJqqy77fsrL5Z4V+lBcOesoIMrwFDzl6BAxzuRBp1hm5LyWVSPF2hrWjWMEMKwd lGpw== 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:in-reply-to :references; bh=BsDBnP893xYrOqhxaJ/9kWLbXkFhz5YGzFpX1B1PC50=; b=QQBcWb50gFSuXG8y6o847tsdllguzx6p9L8hmp2WLVOrwL0eYFpVc+k4Vz3Mcu59FQ G/tclt/VIk3/7Ya3xHfdUm38VXgqFScr4X4VjamC/IdvWYRx8RESygqRLEc4ZZEmnPjY DXHE4hJZ8V9aiZcBao7iLIQX72Bn0dtT82wbPqaKlLNHyqy1oW17skvgW4DV1YhFe6BR i2Ed6Iye/1M0YezgkyvBobpZP8DuzWa2Z/rbQ/764WKqtBZMpEFO8jnkxjWHmBzPgWpR z9sQlKDopvvMM679Tk6+u1JifJKO5uyw1d0iykPh07IR191qfxXCXTOC2uf2u9xoBE7L v0Tg== X-Gm-Message-State: APjAAAXBICCh+Y5+dFzQY5Gq7oE2tXYGNoNdLd3MLLsK1xVutMIpL/zY htQ7lysTEriUvOzVmCZV6SjUMGNV X-Received: by 2002:a17:902:8484:: with SMTP id c4mr9204843plo.339.1578545413093; Wed, 08 Jan 2020 20:50:13 -0800 (PST) Received: from akuster-ThinkPad-T460s.mvista.com ([2601:202:4180:a5c0:304b:2b9c:bcb7:ff1a]) by smtp.gmail.com with ESMTPSA id l9sm5018427pgh.34.2020.01.08.20.50.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 20:50:12 -0800 (PST) From: Armin Kuster To: openembedded-core@openembedded.org Date: Wed, 8 Jan 2020 20:49:38 -0800 Message-Id: <88255abe6bb4d10d50a660022ab3f9a1c2954ec7.1578544698.git.akuster808@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Subject: [OE-core] [zeus 19/28] 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: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Ross Burton 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 Signed-off-by: Richard Purdie (cherry picked from commit 18d8e5ac689d6eb6098f68ac785f43e9d5f5938a) Signed-off-by: Armin Kuster --- meta/classes/podfix.bbclass | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 meta/classes/podfix.bbclass -- 2.17.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 0000000000..54fff6a0a2 --- /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"