man make.conf states for FEATURES="mirror" the following: mirror Fetch everything in SRC_URI regardless of USE settings, except do not fetch anything when mirror is in RESTRICT. FEATURES="mirror" does not know how to handle REQUIRED_USE . Trying to fetch an ebuild without the correct REQUIRED_USE set will result in failure. The features="mirror" code is older than EAPI 5. Reproducible: Always Steps to Reproduce: 1. Find an ebuild that you don't have the necessary required_use flags for. A good example is app-office/unoconv-0.7 from https://github.com/antematherian/portage-regression-overlay 2. add FEATURES="mirror" to /etc/portage/make.conf 3. run: ebuild <ebuildname>.ebuild fetch Actual Results: ebuild unoconv-0.7.ebuild fetch Appending /var/gentoo/portage-regression-overlay to PORTDIR_OVERLAY... The following REQUIRED_USE flag constraints are unsatisfied: ^^ ( python_single_target_python2_7 python_single_target_python3_4 python_single_target_python3_5 ) The above constraints are a subset of the following complete expression: exactly-one-of ( python_single_target_python2_7 python_single_target_python3_4 python_single_target_python3_5 ) python_single_target_python2_7? ( python_targets_python2_7 ) python_single_target_python3_4? ( python_targets_python3_4 ) python_single_target_python3_5? ( python_targets_python3_5 ) Expected Results: When you patch around the behavior, unoconv-0.7 downloads correctly. To fix this and only this problem with FEATURES="mirror" patch the following if block: https://github.com/gentoo/portage/blob/master/pym/portage/package/ebuild/doebuild.py#L1426-L1431 Method a) This method completely skips required_use checks for the ebuild fetch phase. --- doebuild.py.orig 2017-07-11 19:43:00.029334308 +0000 +++ doebuild.py 2017-07-11 19:43:14.133404246 +0000 @@ -1424,7 +1424,7 @@ return 1 if not pkg.built and \ - mydo not in ("digest", "help", "manifest") and \ + mydo not in ("digest", "help", "manifest", "fetch") and \ pkg._metadata["REQUIRED_USE"] and \ eapi_has_required_use(pkg.eapi): result = check_required_use(pkg._metadata["REQUIRED_USE"], Method b) Check for features=mirror and add the "fetch" phase to the above set of phase functions which skip the required_use check. --- doebuild.py.orig 2017-07-11 19:43:00.029334308 +0000 +++ doebuild.py 2017-07-11 19:58:20.533898844 +0000 @@ -1422,9 +1422,11 @@ level=logging.ERROR, noiselevel=-1) if mydo not in invalid_dep_exempt_phases: return 1 - + phase_func_skip_required_use = ["digest", "help", "manifest"] + if "mirror" in mysettings.features: + phase_func_skip_required_use.append("fetch") if not pkg.built and \ - mydo not in ("digest", "help", "manifest") and \ + mydo not in phase_func_skip_required_use and \ pkg._metadata["REQUIRED_USE"] and \ eapi_has_required_use(pkg.eapi): result = check_required_use(pkg._metadata["REQUIRED_USE"], Method b) does not cover the fetchall case, you'll probably have to modify the function definition to do that. And you'll probably have to rebase the patches.
Thanks to [Arfrever] for providing me with info on the history of EAPI 5 and FEATURES="mirror"
A simple way to trigger the bug is to delete the /etc/portage/make.profile symlink and try to emerge any ebuild with REQUIRED_USE.