For example (not necessarily factual), Gentoo has an ebuild git, which has the default branch name main hardcoded in the source code.

Alice, as a user of Gentoo, would like to change it to master before building, so that the original default branch name may be restored.

While Gentoo may not accept such a patch, Alice might still be able to apply a user-space patch before Portage makes the ebuild.

Is there such a way to achieve it?


A bad example, as git is already using master as the default branch, and selecting a different name as the default will be supported with 2.28.0.

However, to my knowledge there's no easy and straightforward way to achieve what you ask for. My approach would be to copy the current ebuild to a local custom repository (I use /usr/local/portage for this purpose), perhaps increase the revision number (you could start with *-r100 + x to be ahead of the Gentoo releases) and apply your patch there. It's up to you to keep this ebuild updated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.