Files
gentoo-zh/scripts/needs-perl-update.sh
T
Zakk a8f4957b99 .github: update perl when the target pulls perl modules
The stage3 images can ship an older dev-lang/perl than the one the
binhost builds perl modules against. A target that pulls a new perl
module then schedules the newer perl while installed modules keep the
old one, and emerge stops on a dev-lang/perl:0 slot conflict.

When the target's dependencies would replace dev-lang/perl, update it
from the binhost first, then run `perl-cleaner --all` to reinstall the
modules built for the old perl, as the Gentoo perl upgrade news item
recommends.

Signed-off-by: Zakk <zakk@gentoozh.org>
2026-10-02 08:51:19 +10:00

9 lines
423 B
Bash
Executable File

#!/usr/bin/env bash
# usage: needs-perl-update.sh <atom>; exit 0 if the atom's binpkg dependencies would replace dev-lang/perl.
atom=${1:?atom}
# A masked package never reports its dependencies, so accept every keyword and license.
output=$(ACCEPT_KEYWORDS="~$(portageq envvar ARCH)" ACCEPT_LICENSE="*" FEATURES="getbinpkg" \
emerge --pretend --quiet --onlydeps "${atom}" 2>&1)
grep -q 'dev-lang/perl[-:]' <<<"${output}"