Automatic workflow to update yandex-music ebuild
Some checks failed
yandex-music / check-and-update (push) Failing after 29s
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:
36
.gitea/actions/drop-ebuilds-matching/action.yml
Normal file
36
.gitea/actions/drop-ebuilds-matching/action.yml
Normal 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}"
|
||||
Reference in New Issue
Block a user