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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2C362158004 for ; Sat, 28 Oct 2023 01:59:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D8DCB2BC05F; Sat, 28 Oct 2023 01:59:04 +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 B9E842BC058 for ; Sat, 28 Oct 2023 01:59:04 +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 8D2D7335C11 for ; Sat, 28 Oct 2023 01:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DAFB312D8 for ; Sat, 28 Oct 2023 01:59:01 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1698458332.5bd81ee6cbbe582c60f0f9971dbb0b60b061b6a4.sam@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_moddeps.sh X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 5bd81ee6cbbe582c60f0f9971dbb0b60b061b6a4 X-VCS-Branch: master Date: Sat, 28 Oct 2023 01:59:01 +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: 94130468-6d1b-4836-8935-2e994723b27f X-Archives-Hash: fd23157ab249af082896bc6766c6116e commit: 5bd81ee6cbbe582c60f0f9971dbb0b60b061b6a4 Author: Dmitry Baranov gmail com> AuthorDate: Sat Sep 9 10:37:38 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Oct 28 01:58:52 2023 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5bd81ee6 gen_moddeps.sh: introduce xbasename() Introduce xbasename() wrapper to use it instead of xargs basename. It guards from two cases: - zero count of module names is passing from pipe - module name starting with "-" interprets as option Signed-off-by: Dmitry Baranov gmail.com> Signed-off-by: Sam James gentoo.org> gen_moddeps.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gen_moddeps.sh b/gen_moddeps.sh index 6915746..556751d 100755 --- a/gen_moddeps.sh +++ b/gen_moddeps.sh @@ -10,6 +10,17 @@ mod_dep_list() { cat "${TEMP}/moddeps" } +xbasename() { + local -a moddeplist=( $( 0 )) + then + # prepend slash to each moddeplist element + # to avoid passing elements as basename options + basename -s "${KEXT}" "${moddeplist[@]/#/\/}" + fi +} + gen_dep_list() { local moddir="${KERNEL_MODULES_PREFIX%/}/lib/modules/${KV}" @@ -60,5 +71,5 @@ gen_dep_list() { ) printf '%s\n' "${moddeplist[@]}" - fi | xargs basename -s "${KEXT}" | sort | uniq + fi | xbasename | sort | uniq }