A recent change to _emerge/actions.py added a check if $PKGDIR was writable before emerge would proceed. It has a few exceptions that will skip that test, like if --pretend was used. I propose/request that --usepkgonly also be an exception. The commit in question: https://github.com/gentoo/portage/commit/206efe5f6341bce99a5e9994a0458c304513b2c3 Posted & briefly discussed at: https://marc.info/?l=gentoo-portage-dev&m=141648797703113&w=2 The part relevant to my interests is: need_write_vardb = not Scheduler. \ _opts_no_self_update.intersection(myopts) need_write_bindb = not any(x in myopts for x in ("--fetchonly", "--fetch-all-uri", "--pretend")) and \ (any("buildpkg" in trees[eroot]["root_config"]. settings.features for eroot in trees) or any("buildsyspkg" in trees[eroot]["root_config"]. settings.features for eroot in trees)) if need_write_bindb or need_write_vardb: ... This broke a setup that has worked for me for many years: building new systems by untarring stage3, copying preconfigured files into /etc/portage/ over from a build system, bind-mounting /usr/portage/packages (ro, from an .iso), and emerge ... --usepkgonly world Note, I don't have a problem if I strip out 'buildpkg' from my FEATURES=, which I'm now doing to avoid hitting this. But I think it'd be reasonable for --usepkgonly to be an exception, because that means "we're not going to create new packages or update /usr/portage/packages/Packages" ... right? Reproducible: Always Steps to Reproduce: 1. add buildpkg to FEATURES 2. mount /usr/portage/packages readonly 3. emerge --usepkgonly something Actual Results: emerge aborts with a read-only error. Incidentally, the error message is messed up, I get a python Traceback ending in: _("Read-only file system: %s") % NameError: global name '_' is not defined (Perhaps that is an odd artifact of my hand-constructing a chroot setup to reproduce this, unknown.) Expected Results: since --usepkgonly should not require write access to /usr/portage/packages/ (right?) then there should be no reason for emerge not to complete successfully.
(In reply to Hank Leininger from comment #0) > A recent change to _emerge/actions.py added a check if $PKGDIR was writable > before emerge would proceed. It has a few exceptions that will skip that > test, like if --pretend was used. I propose/request that --usepkgonly also > be an exception. Makes sense. Thanks for the followup on bug #490732 (mine, triggering this change in the first place) letting me know about this. Yes, --usepkgonly/-K is another corner case obviously nobody thought of, but that doesn't mean people (like you) aren't running it somewhere. With the new larger group of devs working on portage now, and with your mention of the commit and specific code, it should be an easy fix, and therefore hopefully a fast fix. =:^) Duncan
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_541302 I've posted it for review here: http://thread.gmane.org/gmane.linux.gentoo.portage.devel/5274
This is in the master branch: https://github.com/gentoo/portage/commit/0b453300f4da44a8a32e05f6d75da18847806739
Released in portage-2.2.18