public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Gamböck" <ml@floga.de>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] Dynamically change PORTAGE_TMPDIR via bashrc?
Date: Sat, 26 Sep 2015 10:08:24 +0200	[thread overview]
Message-ID: <20150926080824.GA4550@lira> (raw)

(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


             reply	other threads:[~2015-09-26  8:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26  8:08 Florian Gamböck [this message]
2015-09-26 14:08 ` [gentoo-user] Re: Dynamically change PORTAGE_TMPDIR via bashrc? James
2015-09-26 15:21   ` Rich Freeman
2015-09-26 16:35     ` James
2015-09-27 13:13   ` [gentoo-user] " Florian Gamböck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150926080824.GA4550@lira \
    --to=ml@floga.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox