In savedconfig.eclass, save_config() save user specified config at "${D}"/etc/portage/savedconfig/${CATEGORY}/${PF} or "${D}/${PORTAGE_CONFIGROOT}"/etc/portage/savedconfig/${CATEGORY}/${PF} and echo saved config in /etc/portage/savedconfig/${CATEGORY}/${PF} Where ${D} will merge to ${ROOT} and ${PORTAGE_CONFIGROOT} may not a sub-directory of ${ROOT}. In restore_config(), it always find config in ${PORTAGE_CONFIGROOT}/etc/portage/savedconfig/... Reproducible: Always Expected Results: save_config() and restore_config() should always find config relative to ${ROOT}, because it is where packages actually installed in.
Created attachment 273241 [details, diff] This patch let savedconfig check only directories relative to ${ROOT}
Comment on attachment 273241 [details, diff] This patch let savedconfig check only directories relative to ${ROOT} ROOT isnt valid in src_*
Created attachment 336730 [details, diff] savedconfig.patch IMHO the config files should be saved and retrieved from a directory relative to PORTAGE_CONFIGROOT. The reason for that is because they're kept inside /etc/portage, which is relative to the PORTAGE_CONFIGROOT path. Please find attached a patch that implements this.
Comment on attachment 336730 [details, diff] savedconfig.patch (In reply to comment #3) sorry, but this isn't really working for me either. packages should not be writing outside of $D.
i think the right thing might be to ignore PORTAGE_CONFIGROOT when saving. it sucks, but there isn't a good alternative.