From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B0DE515806E for ; Wed, 7 Jun 2023 07:00:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D55BDE0817; Wed, 7 Jun 2023 07:00:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B4CB9E0817 for ; Wed, 7 Jun 2023 07:00:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 97BC4335C65 for ; Wed, 7 Jun 2023 07:00:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 047F1990 for ; Wed, 7 Jun 2023 07:00:22 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1686121138.6010e062fbaf504c3f3d4c78f6e7fa506af8a49d.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/, eclass/tests/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/eapi8-dosym.eclass eclass/tests/eapi8-dosym.sh X-VCS-Directories: eclass/ eclass/tests/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 6010e062fbaf504c3f3d4c78f6e7fa506af8a49d X-VCS-Branch: master Date: Wed, 7 Jun 2023 07:00:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 943a5482-dad5-45df-8ffb-9916acdc67aa X-Archives-Hash: 18576e8d05137f6c03cc3b724ef9201c commit: 6010e062fbaf504c3f3d4c78f6e7fa506af8a49d Author: Ulrich Müller gentoo org> AuthorDate: Wed Jun 7 06:52:46 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Jun 7 06:58:58 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6010e062 eapi8-dosym.eclass: Don't add a spurious newline to the path Bash's <<< operator will append a newline to the string, therefore use echo -n instead. Add a couple of test cases that would have caught this. Fixes: d5638e49ee79c0f7e4672d5537e97a4ccc7f2eb2 Signed-off-by: Ulrich Müller gentoo.org> eclass/eapi8-dosym.eclass | 2 +- eclass/tests/eapi8-dosym.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eclass/eapi8-dosym.eclass b/eclass/eapi8-dosym.eclass index 93b11dda7fd6..e139b74cfea0 100644 --- a/eclass/eapi8-dosym.eclass +++ b/eclass/eapi8-dosym.eclass @@ -31,7 +31,7 @@ esac _dosym8_canonicalize() { local path slash i prev out IFS=/ - read -r -d '' -a path <<< "$1" + read -r -d '' -a path < <(echo -n "$1") [[ $1 == /* ]] && slash=/ while true; do diff --git a/eclass/tests/eapi8-dosym.sh b/eclass/tests/eapi8-dosym.sh index 9290026a26de..cae66e3bb2ee 100755 --- a/eclass/tests/eapi8-dosym.sh +++ b/eclass/tests/eapi8-dosym.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2020 Gentoo Authors +# Copyright 2020-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -50,8 +50,10 @@ done teq . _dosym8_canonicalize . teq foo _dosym8_canonicalize foo teq foo _dosym8_canonicalize ./foo +teq foo _dosym8_canonicalize foo/. teq ../foo _dosym8_canonicalize ../foo teq ../baz _dosym8_canonicalize foo/bar/../../../baz +teq '*' _dosym8_canonicalize '*' for f in ref_dosym_r "dosym8 -r"; do teq ../../bin/foo ${f} /bin/foo /usr/bin/foo