From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B09A1158074 for ; Sat, 28 Jun 2025 02:30:52 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9A2C4340EC3 for ; Sat, 28 Jun 2025 02:30:52 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 190AC110561; Sat, 28 Jun 2025 02:30:38 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 09A17110561 for ; Sat, 28 Jun 2025 02:30:38 +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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A2A9B340EA7 for ; Sat, 28 Jun 2025 02:30:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C3F12AA7 for ; Sat, 28 Jun 2025 02:30:35 +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: <1751077816.4f916561b12ad14c144367b98082c2964d08cf07.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ecompress-file bin/phase-functions.sh X-VCS-Directories: bin/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 4f916561b12ad14c144367b98082c2964d08cf07 X-VCS-Branch: master Date: Sat, 28 Jun 2025 02:30:35 +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: daab82fd-bd81-472e-8a92-7c2ac0d03a4e X-Archives-Hash: ef2c040851c06679e8aaadf9c42a7468 commit: 4f916561b12ad14c144367b98082c2964d08cf07 Author: Kerin Millar plushkava net> AuthorDate: Thu Jun 26 03:28:57 2025 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 28 02:30:16 2025 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4f916561 Abort where XARGS is required but is unset or empty Presently, the "compress-file" unit defines the compress_file() function, and the "phase-functions-sh" unit, the __dyn_clean() function. Both functions require for the 'XARGS' environment variable to have been set in order to behave correctly. Employ the ${param:?} form of expansion so as to abort if the variable is either unset or empty. Owing to a general lack of error checking, the principal benefit of this change is that the diagnostics are improved for the case that the code is not running in an appropriate operating environment. BEFORE ecompress-file: line 49: -0: command not found AFTER ecompress-file: line 49: XARGS: parameter null or not set Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> bin/ecompress-file | 2 +- bin/phase-functions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ecompress-file b/bin/ecompress-file index 2916ecf171..43436a15a0 100755 --- a/bin/ecompress-file +++ b/bin/ecompress-file @@ -46,7 +46,7 @@ compress_file() { # complain and skip, gzip will prompt for input) if [[ ${PORTAGE_COMPRESS_SUFFIX} ]]; then printf '%s\0' "${@/%/${PORTAGE_COMPRESS_SUFFIX}}" \ - | ${XARGS} -0 rm -f -- + | ${XARGS:?} -0 rm -f -- fi # forcibly break all hard links as some compressors whine about it diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index c3a051bb7b..4f865fdc87 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -324,7 +324,7 @@ __dyn_clean() { printf '%s\0' "${PORTAGE_BUILDDIR}" \ | find0 -depth -type d -empty -print0 \ | while read -rd ''; do [[ ${REPLY} != "${WORKDIR}"?(/*) ]] && printf '%s\0' "${REPLY}"; done \ - | ${XARGS} -0 rmdir -- + | ${XARGS:?} -0 rmdir -- fi # Do not bind this to doebuild defined DISTDIR; don't trust doebuild, and if mistakes are made it'll