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 D7F6213881D for ; Sat, 26 Sep 2015 08:08:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5621A21C0AC; Sat, 26 Sep 2015 08:08:30 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 26C9321C006 for ; Sat, 26 Sep 2015 08:08:28 +0000 (UTC) Received: from lira ([83.64.176.131]) by mrelayeu.kundenserver.de (mreue104) with ESMTPSA (Nemesis) id 0Lw1TZ-1alDi3173l-017obk for ; Sat, 26 Sep 2015 10:08:26 +0200 Date: Sat, 26 Sep 2015 10:08:24 +0200 From: Florian =?utf-8?Q?Gamb=C3=B6ck?= To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] Dynamically change PORTAGE_TMPDIR via bashrc? Message-ID: <20150926080824.GA4550@lira> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:3H04FjJidue9ES18DwIm7TX4A3oxqQRRDHZ1Zvf56crn9D1CvKw X5UkCfLrlSTnuqCE3Fi4I08l5Ur9PnKwKv2tzz1vYSaX30WJFWOra5RM4FP78OlZpDlhDIg dns+t9sYOeIhxbNRMqAe28HpAOtL905f/97XFdjb7AvI7uM3gXwPY5SU2/TA2x7vo7twO/M bZnksmEO7zHhg9iWTG2ig== X-UI-Out-Filterresults: notjunk:1;V01:K0:M6TVGTk/lfI=:58EMmWzc83ArHnI5iY33pK q+8Z09IhAMyztcZ88c+9B03vdAPNSRl+1AAwhbcnuYhkoGdlCQAKOep0vGqh/oWvRgOGNZgC0 O4ke1UDe3zPEU9kbaYZe4gkWCn8HsSAJxvGfGUKtABD++MirdR/ETFi1NYoMbMmMuL7XWqQfM dpdijzGqaHKvVgYj1PHzVuXYX/ZHQZeD1UK+lQDE+mcvdK3p+/XwFt7WFiIUY+cJJXta/6MfT Rs7aHEa4eO/zNDnJHbrzEEfu3vvkYuGTKcpVB0fw3E+3dm8l2ULEwtayQxg2a3pPIlwDM14uw rCEJcns+81BdxRRx16AI9CL3C2BGmQTBPILInNoyH+ku7ayx8nAoxJsKnJ6pQpUWaeoISRsor 7HHP6yL3isGXfdZQQ4HSM12CmbVckiiv7uhnyXksQSeb+/bGfNJKx2amfbfNnINEDms4yaPNE 5eiKl7iEXQHDYMn0lfz/JzMfKel9yfwlcLEZmM0tttGZtc7pk3yjpj4xavNvY1hWDTT4Tp4sw tJZWWo7XTcWCQlijOiFL7bMmRT37EqHTAGa/vJLzlK/iHaS7F9mmy2V6Vs1FJLZPS83747wXr AtaQFNtWRF8PBkKby15M5zlN1S2EgjsGWsc3vHNcItYHRLvVZysxuKA1Zp2D0e5wS+NiQvQuU 7SFVzladhjg2sy9R0FyFMOJuGmrWAWb/gmu7SA692c5/TvXKTrwdo0zFyEMBQRjlxy2c= X-Archives-Salt: 4b4b4bae-01d2-48db-8707-e144a3a1b78c X-Archives-Hash: 908a55d198d7cae729559ece4b230fdb (This is my third E-Mail and I hope this time it gets through. Sorry to the sysadmins if I caused you trouble with my rejected mails, I'm still trying to get used to Mutt.) Greetings, let me quickly explain my setup: I use BTRFS snapshots and chroot to create binaries of upgradeable packages with emerge. When I have some spare time, I just need to install these binaries on my "real" system. While compiling, I set PORTAGE_TMPDIR to a tmpfs mounted directory. When installing on my real system afterwards, I set PORTAGE_TMPDIR to a "normal" directory on my hard drive, since I won't gain anything from extracting a package to RAM, just to immediately copy the contents back to the hard drive. Now here is the tricky part: Since I do the compiling on temporary snapshots, I tend to kill emerge and delete the snapshot, when I'm in a hurry and have to shutdown my workstation. (PKGDIR of course is bind mounted to outside the snapshot, so I won't lose the already finished packages.) When I later "resume" my upgrade, there are several binary packages and several others that still need to be compiled. With PORTAGE_TMPDIR still set to tmpfs, my RAM gets cluttered with already compiled files from the binaries that may as well stay on the hard disk. Now, instead of simply changing my workflow (like for example not deleting the snapshot prematurely in the first place ...) I want to have some fun and wondered if there might be a possibility to change PORTAGE_TMPDIR dynamically, based on wether I want to install a tbz2 or compile sources. So far I've tried in package.env: "*/* merge_type.${MERGE_TYPE}.conf". But this just gives me errors like "merge_type..conf not found", so obviously I can't use such variables here. I guess, those tricks can just be played in /etc/portage/bashrc. But when I try to change PORTAGE_TMPDIR in bashrc (EBUILD_PHASE doesn't matter, problem occurs regardless), I always get errors like "PORTAGE_TMPDIR is a read-only variable". Now, before I try some crazy stunts like bind-mounting $D and $ED on "preinst" and cleaning up in "postinst", I wanted to know if some of you guys did similar experiments and/or have some advice that you could share with me. Regards, --Flo