From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 822B45A026F for ; Fri, 22 Mar 2024 03:27:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1711074461; bh=3WzRdnkbIj5xOCETpezznvf42R+WZldlYBpvxerIxsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BwOCbMlxnhZfFt+YWWROyYJ/AMuEhRr6XDHK7UQjF3OLu9hSanKj82OUrRsJykczh Kh/7vdqHdOE8qxtwSp7ateuxbOS35frDbRHUhmS2eKAWPdyhL0czfJ12Oso6nbTBQw YwOCWWdHtI41iz4ogKFTe508saINVoq3T66wQy5tiQZcYfD+XyI//ot9k1bWyCCeeG f0Pgo/hwBo1PaUJykxfM6SSvZt5BsrRvsSwGYfNVuQoxE+IuwfrstXN8bCcvICbdnS KovlAb+FzbgAEW6r9DR9uN7JAyeHA+t+X0tiD6kpX7CxeRyHphiGs4JJi5B55CnwbP t6dlcqFt95lPw== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4V15p53F0Bz4wxZ; Fri, 22 Mar 2024 13:27:41 +1100 (AEDT) From: David Gibson To: Stefano Brivio Subject: [PATCH 1/4] ${wd} is always set, no need to test for it Date: Fri, 22 Mar 2024 13:27:36 +1100 Message-ID: <20240322022739.2746102-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240322022739.2746102-1-david@gibson.dropbear.id.au> References: <20240322022739.2746102-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: DPS4KHQCXKMZPCX5YYHVWP6WNDI5CJ5H X-Message-ID-Hash: DPS4KHQCXKMZPCX5YYHVWP6WNDI5CJ5H X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: lvivier@redhat.com, passt-dev@passt.top, David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We unconditionally set ${wd} to a temporary directory, but there are some places where we test if it is empty. This appears to be stale code from some earlier version, so simply remove it. Signed-off-by: David Gibson --- mbuto | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mbuto b/mbuto index 0609e7e..a6f80ab 100755 --- a/mbuto +++ b/mbuto @@ -369,7 +369,7 @@ cmd_check() { # cleanup() - Remove left-overs on exit, used from trap cleanup() { [ -n "${ARCHIVEMOUNT}" ] && "${UMOUNT}" "${wd}" 2>/dev/null - [ -n "${wd}" ] && "${RM}" -rf "${wd}" + "${RM}" -rf "${wd}" [ -n "${pkg_tmp}" ] && "${RM}" -f "${pkg_tmp}" [ -n "${compress_test1}" ] && "${RM}" -f "${compress_test1}" [ -n "${compress_test2}" ] && "${RM}" -f "${compress_test2}" @@ -1044,7 +1044,6 @@ build() { # add() - Add contents to existing image # $1: Item to be added add() { - [ -z "${wd}" ] && cpio_init kmod_init [ -e "${1}" ] && __path="${1}" || __path=$(command -v "${1}") || : -- 2.44.0