From b69e7bf14e8182912bfda2472ca7caffd60cef41 Mon Sep 17 00:00:00 2001 From: rabisg Date: Thu, 31 Jul 2014 18:40:25 +0530 Subject: [PATCH] Use portageq to determine portage distdir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rabi Shanker Guha Acked-by: Stéphane Graber --- templates/lxc-gentoo.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/templates/lxc-gentoo.in b/templates/lxc-gentoo.in index c6fa215c1..37895cf89 100644 --- a/templates/lxc-gentoo.in +++ b/templates/lxc-gentoo.in @@ -442,12 +442,18 @@ container_portage() fi fi + printf "trying to guess portage distfiles dir from host ...\n" + portage_distfiles_dir="$(portageq distdir 2>/dev/null)" + if [ ! -d "${portage_distfiles_dir}" ]; then + portage_distfiles_dir="${portage_dir}/distfiles" + fi + # if we are here, we have shared portage_dir #ensure dir exists chroot "${rootfs}" mkdir ${portage_container} portage_mount="#container set with shared portage lxc.mount.entry=${portage_dir} ${portage_container/\//} none ro,bind 0 0 -lxc.mount.entry=${portage_dir}/distfiles ${portage_container/\//}/distfiles none rw,bind 0 0 +lxc.mount.entry=${portage_distfiles_dir} ${portage_container/\//}/distfiles none rw,bind 0 0 #If you use eix, you should uncomment this #lxc.mount.entry=/var/cache/eix var/cache/eix none ro,bind 0 0" store_user_message "container has a shared portage from host's ${portage_dir} to ${portage_container/\//}"