From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Wed, 24 Apr 2024 16:31:33 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rzden-00Ez49-0N for lore@lore.pengutronix.de; Wed, 24 Apr 2024 16:31:33 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rzdem-0005nx-L4; Wed, 24 Apr 2024 16:31:32 +0200 Received: from mail.thorsis.com ([2003:a:e28:26e4::10]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rzdeV-0005BB-Tr for ptxdist@pengutronix.de; Wed, 24 Apr 2024 16:31:17 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6FC4114874D7; Wed, 24 Apr 2024 16:31:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1713969075; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=g2GOTqVAhu580M54jtXVdfUEjHbdJ2CF5QSnqjpuBwQ=; b=AuBnt+byBOx6fKc9GbTzaj1VdqPYjbWNjT68bzbs3Lylp4gKVtgo/2SxTGHiRWnIjVsguS 7QtxhOx7x5GNvZI05fPAh2bn8ZAUVdTGUHmGtTyloD25ulLrsJp/ktjG0yxOMeO3uWzlrm jQOna/3l5dDXTnQ9D08tlmsOXNXSsw/i+w+eBCydAG/2Nqpz+05G7Y6kD/zmxZWJLNtkKI XTheutibQ3VyJRs3Ln+LLmwF5G4MH0yIQ6NDhNwzUyWo4fwjlYlq/wV6H1b5tQ8glUIgAr 8Veu0mrQFusbeYpaGK1j70WO7NbCNe2OivfQ9v+PKRP1eLSYaKKmSjVQ39sgWQ== From: Alexander Dahl To: ptxdist@pengutronix.de Date: Wed, 24 Apr 2024 16:31:07 +0200 Message-Id: <20240424143109.277373-3-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424143109.277373-1-ada@thorsis.com> References: <20240424143109.277373-1-ada@thorsis.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.1 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH 2/4] ptxd_make_world_inject: Use _DIR directly X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Michael Riesch Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false pkg_source was defined as "$($(1)_DIR)" which is the same as pkg_dir in ptxd_make_world_common. We can use pkg_dir directly. Add a safe-guard to bail out early if that var is empty. Signed-off-by: Alexander Dahl --- rules/post/ptxd_make_world_inject.make | 3 +-- scripts/lib/ptxd_make_world_inject.sh | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rules/post/ptxd_make_world_inject.make b/rules/post/ptxd_make_world_inject.make index b7d28e92f..3506ee114 100644 --- a/rules/post/ptxd_make_world_inject.make +++ b/rules/post/ptxd_make_world_inject.make @@ -9,8 +9,7 @@ world/inject/env = \ $(call world/env, $(1)) \ pkg_inject_path="$($(1)_INJECT_PATH)" \ - pkg_inject_files="$($(1)_INJECT_FILES)" \ - pkg_source="$($(1)_DIR)" + pkg_inject_files="$($(1)_INJECT_FILES)" world/inject = \ $(call world/inject/env,$(strip $(1))) \ diff --git a/scripts/lib/ptxd_make_world_inject.sh b/scripts/lib/ptxd_make_world_inject.sh index 5c2d0dc5f..b74e464c6 100644 --- a/scripts/lib/ptxd_make_world_inject.sh +++ b/scripts/lib/ptxd_make_world_inject.sh @@ -10,7 +10,7 @@ ptxd_make_inject() { local source target source="$(echo ${inject_file} | cut -d ":" -f 1)" - target="${pkg_source}/$(echo ${inject_file} | cut -d ":" -f 2)" + target="${pkg_dir}/$(echo ${inject_file} | cut -d ":" -f 2)" if [[ "${source}" =~ ^/.* ]]; then ptxd_bailout "'${source}' must not be an absolute path!" \ @@ -32,6 +32,10 @@ export -f ptxd_make_inject ptxd_make_world_inject() { ptxd_make_world_init || return + if [ -z "${pkg_dir}" ]; then + ptxd_bailout "_DIR empty, no destination to inject to." + fi + for inject_file in ${pkg_inject_files}; do ptxd_make_inject || return done -- 2.39.2