public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Dynamically change PORTAGE_TMPDIR via bashrc?
@ 2015-09-26  8:08 Florian Gamböck
  2015-09-26 14:08 ` [gentoo-user] " James
  0 siblings, 1 reply; 5+ messages in thread
From: Florian Gamböck @ 2015-09-26  8:08 UTC (permalink / raw
  To: gentoo-user

(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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-27 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-26  8:08 [gentoo-user] Dynamically change PORTAGE_TMPDIR via bashrc? Florian Gamböck
2015-09-26 14:08 ` [gentoo-user] " James
2015-09-26 15:21   ` Rich Freeman
2015-09-26 16:35     ` James
2015-09-27 13:13   ` [gentoo-user] " Florian Gamböck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox