Automatic workflow to update yandex-music ebuild
Some checks failed
yandex-music / check-and-update (push) Failing after 29s

This commit was merged in pull request #1.
This commit is contained in:
Petr Polezhaev
2026-02-02 15:40:24 +03:00
committed by Petr Polezhaev
parent 6e6228033f
commit 32173db78b
17 changed files with 254 additions and 161 deletions

View File

@@ -0,0 +1,5 @@
FROM gentoo/portage:latest as portage
FROM gentoo/stage3:amd64-openrc
COPY --from=portage /var/db/repos/gentoo /var/db/repos/gentoo
RUN emerge -q app-portage/portage-utils && rm -Rf /var/db/repos/gentoo
ENTRYPOINT [ "/bin/bash" ]

View File

@@ -0,0 +1,36 @@
name: "Drop ebuilds matching the condition"
description: "Checks if any ebuild for the package matches the condition and if so - removes them"
inputs:
atom:
description: "category/name package atom"
required: true
condition:
description: "version condition used to match ebuilds to drop"
required: true
outputs:
message:
description: "space-separated list of removed ebuild versions"
runs:
using: docker
image: Dockerfile
args:
- -c
- |
set -euo pipefail
condition_atom=$(echo "${{inputs.condition}}" | sed -r 's:^(<|>)=?:\0${{inputs.atom}}-:')
existing_ebuilds=( "./${{inputs.atom}}"/*.ebuild )
category=$(dirname "${{inputs.atom}}")
message=""
for ebuild in ${existing_ebuilds[@]}; do
p="=${category}/$(basename "${ebuild%.*}")"
echo "Checking ${p} vs ${condition_atom}"
if qatom -qc "${p}" "${condition_atom}" | grep -cq '=='; then
echo "Removing ${ebuild}"
rm -f "${ebuild}"
if [[ -z "${message}" ]]; then
message="drop"
fi
message="${message} `qatom -F '%{PV}' "${p}"`"
fi;
done;
echo "message=${message}" >> "${GITHUB_OUTPUT}"