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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1A759138350 for ; Fri, 3 Apr 2020 07:48:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D37E9E0C20; Fri, 3 Apr 2020 07:48:24 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BB2BAE0C20 for ; Fri, 3 Apr 2020 07:48:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8D4F334EFAC for ; Fri, 3 Apr 2020 07:48:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 56C551BE for ; Fri, 3 Apr 2020 07:48:19 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1585900065.3b8a53d497f26160a27c3288b89f0ae0a770e6df.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/functions.sh X-VCS-Directories: targets/support/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 3b8a53d497f26160a27c3288b89f0ae0a770e6df X-VCS-Branch: master Date: Fri, 3 Apr 2020 07:48:19 +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: a36055eb-cfba-4b58-b083-5f9bf66ffa85 X-Archives-Hash: 248ce3acd879af845be4f2fd8d5b19a9 commit: 3b8a53d497f26160a27c3288b89f0ae0a770e6df Author: Matt Turner gentoo org> AuthorDate: Fri Apr 3 04:12:15 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Fri Apr 3 07:47:45 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3b8a53d4 targets: Simplify copy_to_chroot() Move the mkdir outside of the function, when it's actually needed. This allows the destination argument to be a file rather than a directory. Signed-off-by: Matt Turner gentoo.org> targets/support/functions.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/targets/support/functions.sh b/targets/support/functions.sh index 5ab64726..5cbecb40 100755 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -1,10 +1,9 @@ #!/bin/bash copy_to_chroot() { - local src_file=$1 - local dest_dir=${clst_chroot_path}${2:-/tmp} - mkdir -p ${dest_dir} - cp -pPR "${src_file}" "${dest_dir}"/ + local src="${1}" + local dst="${clst_chroot_path}/${2:-/tmp}" + cp -pPR "${src}" "${dst}" } delete_from_chroot() {