From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E7918138010 for ; Fri, 2 Nov 2012 01:13:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 593FC21C060; Fri, 2 Nov 2012 01:12:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B53D721C056 for ; Fri, 2 Nov 2012 01:12:46 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0188933D856 for ; Fri, 2 Nov 2012 01:12:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3BA48E5447 for ; Fri, 2 Nov 2012 01:12:44 +0000 (UTC) From: "Richard Farina" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Richard Farina" Message-ID: <1351817864.dade88d142906122e485794664e5892504f45fc2.zerochaos@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: zerochaos X-VCS-Committer-Name: Richard Farina X-VCS-Revision: dade88d142906122e485794664e5892504f45fc2 X-VCS-Branch: master Date: Fri, 2 Nov 2012 01:12:44 +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-Archives-Salt: d9eb3bfb-ad4b-47bf-8cf4-65b412a0ed02 X-Archives-Hash: 38411abd0da34f2860f7a697fff711da commit: dade88d142906122e485794664e5892504f45fc2 Author: Rick Farina (Zero_Chaos) gentoo org> AuthorDate: Fri Nov 2 00:57:44 2012 +0000 Commit: Richard Farina gentoo org> CommitDate: Fri Nov 2 00:57:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=dade88d1 re-apply "Make sure we have ${destdir} on copy_to_chroot and simplify exec_in_chroot."" --- targets/support/functions.sh | 42 ++++++++++++++---------------------------- 1 files changed, 14 insertions(+), 28 deletions(-) diff --git a/targets/support/functions.sh b/targets/support/functions.sh index a0eaae2..af57c10 100644 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -1,6 +1,7 @@ copy_to_chroot() { local src_file=$1 local dest_dir=${clst_chroot_path}${2:-/tmp} + mkdir -p ${dest_dir} echo "copying ${src_file##*/} to ${dest_dir}" cp -pPR "${src_file}" "${dest_dir}"/ } @@ -18,34 +19,19 @@ exec_in_chroot(){ # copies the file to the /tmp directory of the chroot # and executes it. local file_name=$(basename ${1}) - local subdir=${2#/} - - if [ "${subdir}" != "" ] - then - copy_to_chroot ${1} ${subdir}/tmp/ - chroot_path=${clst_chroot_path}${subdir} - copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \ - ${subdir}/tmp/ - echo "Running ${file_name} in chroot ${chroot_path}" - ${clst_CHROOT} ${chroot_path} /tmp/${file_name} || exit 1 - else - copy_to_chroot ${1} tmp/ - chroot_path=${clst_chroot_path} - copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \ - tmp/ - echo "Running ${file_name} in chroot ${chroot_path}" - ${clst_CHROOT} ${chroot_path}/ /tmp/${file_name} || exit 1 - fi - - rm -f ${chroot_path}/tmp/${file_name} - if [ "${subdir}" != "" ] - then - delete_from_chroot ${subdir}/tmp/${file_name} - delete_from_chroot ${subdir}/tmp/chroot-functions.sh - else - delete_from_chroot tmp/chroot-functions.sh - delete_from_chroot tmp/${file_name} - fi + local subdir=${2} + local destdir=${subdir}/tmp + destdir=${destdir#/} + + copy_to_chroot ${1} ${destdir} + chroot_path=${clst_chroot_path}${subdir} + copy_to_chroot ${clst_sharedir}/targets/support/chroot-functions.sh \ + ${destdir} + echo "Running ${file_name} in chroot ${chroot_path}" + ${clst_CHROOT} ${chroot_path} ${destdir}/${file_name} || exit 1 + + delete_from_chroot ${destdir}/${file_name} + delete_from_chroot ${destdir}/chroot-functions.sh } #return codes