Re: [PATCH 1/1] kernel-2.eclass: Support USE=vanilla

Mike Gilbert <[email protected]> Fri, 5 Jun 2026 14:34:33 -0400
Newsgroups gmane.linux.gentoo.devel
Message-ID <CAJ0EP43PN3k40JsHjawf_Mya=VTJLK1JbhkpP26jLaeZjSGixg@mail.gmail.com>
On Fri, Jun 5, 2026 at 1:56 PM Mike Pagano <[email protected]> wrote:
>
> The kernel teams have been discussing removing support for
> separate and distinct vanilla sources kernel packages.
>
> This change is an attempt to continue to provide a portage
> managed vanilla-sources option through a use flag.
>
> Gentoo Sources uses a numeric pattern with NNNN_DESCRIPTION.
> For NNNN, a number less than 1500, would be the upstream
> incremental patch versions. This change would keep anything
> < 1500 and not apply any other patch.
>
> Note: A small change will be done to 0000_README (already in
> master) to make upstream incremental patches stop at 1499
> instead of the current 1500.
>
> Signed-off-by: Mike Pagano <[email protected]>
> ---
>  eclass/kernel-2.eclass | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
> index 44b1bce50..30c0197dc 100644
> --- a/eclass/kernel-2.eclass
> +++ b/eclass/kernel-2.eclass
> @@ -1239,6 +1239,20 @@ unipatch() {
>                 eend $?
>         done
>
> +       # for USE=vanilla, remove non-upstream patches
> +       # which should be labeled as 1000_ through 1499_
> +       if use vanilla; then
> +               for patch in ${KPATCH_DIR}/*; do
> +                       patchname="${patch##*/}" # Extract filename without path
> +                       numericprefix="${patchname:0:4}" # Get first 4 characters
> +                       # Check if it's exactly 4 digits and greater than 1499
> +                       if [[ $numericprefix =~ ^[0-9]{4}$ ]] && (( numericprefix > 1499 )); then
> +                               echo "deleting ${patch} ?"
> +                               rm ${patch} 2>/dev/null
> +                       fi
> +               done
> +       fi
> +

You also need to declare IUSE=vanilla in the eclass, or check if the
ebuild has declared it by calling "in_iuse vanilla".