From patchwork Fri Aug 19 09:20:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Zhukov X-Patchwork-Id: 11640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E682C25B0E for ; Fri, 19 Aug 2022 09:20:59 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mx.groups.io with SMTP id smtpd.web10.1037.1660900855197382414 for ; Fri, 19 Aug 2022 02:20:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@zhukoff.net header.s=fm1 header.b=kyDVQw3i; spf=pass (domain: zhukoff.net, ip: 64.147.123.21, mailfrom: pavel@zhukoff.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8A094320015C; Fri, 19 Aug 2022 05:20:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Aug 2022 05:20:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhukoff.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t=1660900853; x=1660987253; bh=kHf/5+bSUayyDrRyxeZj9W4tR PYJZhtgv2xhNiMi+P8=; b=kyDVQw3iFbOkIO1+oPCtMiGKqMLaU9uEm4jIPL2uF PwipoUi3VzKxpR2TtnUhaYIaglIArIJRW62qODJ2BB97t4qmPTe4jWF/PCacEp9c uaj3vPjVg/Ec7ir3Jeto7b7fwulvyuHGu3rQXwpgHrD0pwaSZgaSKef7K0I8qruB Cv6TTQe6qb3geaW+fE1YeIzn0f0dHYYNQhU68w2s290qv6e85ajSk7MSYqXiuxlB wLNrcVJI15HbSSxb7PXpBKraUN4lL6owcDM7ZVsar8gI+0rGdYXwC7H323wvK5fj qT3rjE993n+2N0DQorIKJoisTxAKMD9RSZsaZZz+Nc4mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1660900853; x=1660987253; bh=kHf/5+bSUayyDrRyxeZj9W4tRPYJZhtgv2x hNiMi+P8=; b=wMMmfioUZcQhB7ZONIpCxIAN4eriTusaYKanSVI0uNMb8ggw9OF nwCnuFM++G0UQOaHhTcxDs+MrajHQftUIAxhxdSm5KihbN8ODmaSRkFQ8NQ/fW7w u1Pccmzvepf+OpjOuHbC1h71AEcumBrkIfZ7UBqmN6PDGs0xX7EP3W2YxbkrWAAN fC7G3LEutfVWdoD/Y0rghEdPbIQdyuCbV/EducFz+VdiBrUCbdiaA9/fEmH9jnZt o5IlqIFpu2tP4Pc7qUBldlknhBLKiyJb4bNx1wN8f6h39ZWXslxz4qyUa6RQd+tM a6EBBZNJyExj0vTyHFQIlCc/rVod5yODTJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeiuddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpefrrghvvghlucgkhhhukhhovhcuoehprghvvghlseiihhhukhho fhhfrdhnvghtqeenucggtffrrghtthgvrhhnpedtveetkeejudduhefhtdfhtefhvdffhe elffdtffeileefudelieeuffdvffdtieenucffohhmrghinhepghhithhhuhgsrdgtohhm necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgrvh gvlhesiihhuhhkohhffhdrnhgvth X-ME-Proxy: Feedback-ID: ib94946c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Aug 2022 05:20:52 -0400 (EDT) From: Pavel Zhukov To: openembedded-core@lists.openembedded.org Cc: pavel@zhukoff.net Subject: [PATCH 1/2] package_rpm: Do not replace square brackets in %files Date: Fri, 19 Aug 2022 11:20:02 +0200 Message-Id: <20220819092002.31294-1-pavel@zhukoff.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 19 Aug 2022 09:20:59 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/169616 This reverts commit f95adb749619e70920c6cc6cd01c6d02cd348fd8. At some point RPM stopped treating "[]?" characters in quoted text as a glob This causes rpmbuild error [1] in oe-core if package contains filenames with such characters [Yocto #13746]. Reverting commit which replaces "[]" with "?" fixes the issue. It should be safe now becuase rpm tries to use filename directly if not found by glob [2]. [1] | error: File not found: /mnt/builds/yocto/build/build/tmp/work/core2-64-poky-linux/testrpm/0.0.1-r0/package/42 All-Time Classics (E) ?v1.1?.cht | File not found: /mnt/builds/yocto/build/build/tmp/work/core2-64-poky-linux/testrpm/0.0.1-r0/package/42 All-Time Classics (E) ?v1.1?.cht | [2] https://github.com/rpm-software-management/rpm/commit/c16c70cbd6b31cd93541d5c22d23ba98d212ad3d --- meta/classes-global/package_rpm.bbclass | 6 ------ 1 file changed, 6 deletions(-) diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass index 63c1b077a30..81a2060b68d 100644 --- a/meta/classes-global/package_rpm.bbclass +++ b/meta/classes-global/package_rpm.bbclass @@ -199,8 +199,6 @@ python write_specfile () { if path.endswith("DEBIAN") or path.endswith("CONTROL"): continue path = path.replace("%", "%%%%%%%%") - path = path.replace("[", "?") - path = path.replace("]", "?") # Treat all symlinks to directories as normal files. # os.walk() lists them as directories. @@ -220,8 +218,6 @@ python write_specfile () { if dir == "CONTROL" or dir == "DEBIAN": continue dir = dir.replace("%", "%%%%%%%%") - dir = dir.replace("[", "?") - dir = dir.replace("]", "?") # All packages own the directories their files are in... target.append('%dir "' + path + '/' + dir + '"') else: @@ -236,8 +232,6 @@ python write_specfile () { if file == "CONTROL" or file == "DEBIAN": continue file = file.replace("%", "%%%%%%%%") - file = file.replace("[", "?") - file = file.replace("]", "?") if conffiles.count(path + '/' + file): target.append('%config "' + path + '/' + file + '"') else: From patchwork Fri Aug 19 09:20:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Zhukov X-Patchwork-Id: 11641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90AD3C32771 for ; Fri, 19 Aug 2022 09:21:19 +0000 (UTC) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mx.groups.io with SMTP id smtpd.web08.1101.1660900878818356126 for ; Fri, 19 Aug 2022 02:21:19 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@zhukoff.net header.s=fm1 header.b=hGOrmpDf; spf=pass (domain: zhukoff.net, ip: 64.147.123.21, mailfrom: pavel@zhukoff.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id A1A8D320046E; Fri, 19 Aug 2022 05:21:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 19 Aug 2022 05:21:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zhukoff.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1660900877; x=1660987277; bh=Li RSNHb8oRQbmRvclDvICjxJKOczfodMhA5jDE8Y3xI=; b=hGOrmpDflGKmFcL8sK 9PF1V5k4wAJEuE4CFG772hnfixa3GcO3IKKE1u/Q0yeVr9R1f/SvA1v5Ty/xTsVN d2e8ihJb3BUqBETVQaqnuBRb0w+cCFKcz+aowKhMXLEVJarI0f4th59E5zeEjLjs u6j1FVFhpdZFCei5+IjjeabIWQyEy6Xq4DW9FlzRWLpXOCx8T1hum1x7/KrSUPbt DOTysgteYhCx6DRPHlqZ57GlkYISOTM0QZIR5KVVvoabfQHwIghaByT9eSdMYcq+ FXddHSO8khl3Hvia1OQwnENwzdJ0YDP+G9qUvq7wJGJGICt5oe/yNVzcMc4UbMGd t0pw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1660900877; x=1660987277; bh=LiRSNHb8oRQbm RvclDvICjxJKOczfodMhA5jDE8Y3xI=; b=k/xJdso1q4Tdbb5+dgsfgUNUPo0eA 291ij03ZoixYXN0k2DF5swtFo5P6RRqJmzHi5i3gyoAcyyS8LWC1wXNORTwmzdRr hAtEB4SHz3LR0GSLoHrSuZbuvbdiV1z1au2CMe/qebLGAUsvLOD5W3hc1Eq0i/1M CVvg70bX6AlUio9HJXvTFTt0BWNUtntwKvZozySn3EAXowrFBV92iykbigrBFbBU SM41UKdIt2i/ee679D2Pka6xVbwfv6AjVtI/0haS4gimr8GjOch2y8iyRN04YZ0k SopnOXcHyGPcdRzmDE8c3Mq3pujmYMY7zFyPDiiBx+dHrT92yhH9VezUQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdeiuddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefrrghvvghlucgkhhhukhhovhcuoehprghvvghlseiihhhu khhofhhfrdhnvghtqeenucggtffrrghtthgvrhhnpeejgfelvdejhfefgfeffffgudelud ffhedtleefueegkedtjedvleevtdeuieeiudenucffohhmrghinhepshgvlhhfthgvshht rdgtrghsvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehprghvvghlseiihhhukhhofhhfrdhnvght X-ME-Proxy: Feedback-ID: ib94946c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Aug 2022 05:21:16 -0400 (EDT) From: Pavel Zhukov To: openembedded-core@lists.openembedded.org Cc: pavel@zhukoff.net, Pavel Zhukov Subject: [PATCH 2/2] selftest: Add regression test for rpm filenames Date: Fri, 19 Aug 2022 11:20:04 +0200 Message-Id: <20220819092002.31294-2-pavel@zhukoff.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220819092002.31294-1-pavel@zhukoff.net> References: <20220819092002.31294-1-pavel@zhukoff.net> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 19 Aug 2022 09:21:19 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/169617 Escaping globs and quoting in rpm spec files is tricky and requires a bit of dancing. In addition to that it changes from time to time. Adding (simple) regression test for different types of filename patterns. Cover bracket in first iteration [Yocto #13746] Signed-off-by: Pavel Zhukov --- .../recipes-test/testrpm/files/testfile.txt | 6 ++++++ .../recipes-test/testrpm/testrpm_0.0.1.bb | 17 +++++++++++++++++ meta/lib/oeqa/selftest/cases/rpmtests.py | 16 ++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 meta-selftest/recipes-test/testrpm/files/testfile.txt create mode 100644 meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb create mode 100644 meta/lib/oeqa/selftest/cases/rpmtests.py diff --git a/meta-selftest/recipes-test/testrpm/files/testfile.txt b/meta-selftest/recipes-test/testrpm/files/testfile.txt new file mode 100644 index 00000000000..d1e50ff79a2 --- /dev/null +++ b/meta-selftest/recipes-test/testrpm/files/testfile.txt @@ -0,0 +1,6 @@ + /mnt/builds/yocto/sources/meta-selftest/recipes-test/testrpm: + total used in directory 16 available 76.4 GiB + drwxr-xr-x 2 pavel pavel 4096 Aug 19 08:59 . + drwxr-xr-x 34 pavel pavel 4096 Aug 18 17:59 .. + -rw-r--r-- 1 pavel pavel 408 Aug 19 08:59 testrpm_0.0.1.bb + -rw-r--r-- 1 pavel pavel 355 Aug 18 21:54 testrpm_0.0.1.bb~ diff --git a/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb new file mode 100644 index 00000000000..e42c7db3b39 --- /dev/null +++ b/meta-selftest/recipes-test/testrpm/testrpm_0.0.1.bb @@ -0,0 +1,17 @@ +SUMMARY = "Test recipe for testing rpm generated by oe-core" +LICENSE = "CLOSED" + +SRC_URI = "file://testfile.txt" + +INHIBIT_DEFAULT_DEPS = "1" + +do_compile(){ + echo "testdata" > ${B}/"file with [quotes].txt" + echo "testdata" > ${B}/"file with (quites).txt" +} + +do_install(){ + install ${B}/* ${D}/ +} + +FILES:${PN} = "*" diff --git a/meta/lib/oeqa/selftest/cases/rpmtests.py b/meta/lib/oeqa/selftest/cases/rpmtests.py new file mode 100644 index 00000000000..dafbbc21360 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/rpmtests.py @@ -0,0 +1,16 @@ +# +# Copyright OpenEmbedded Contributors +# +# SPDX-License-Identifier: MIT +# + + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import bitbake + +class BitbakeTests(OESelftestTestCase): + + def test_rpm_filenames(self): + test_recipe = "testrpm" + bitbake(test_recipe) +