setup-local-repo: Fix multiple patches per ebuild

If multiple patches are provided for the same package, we need to ensure
that they all applied.  Previously, only the last patch was applied,
because the ebuilds were copied from the main repository each time,
undoing all previous patches.
master
Dustin 2023-03-17 10:56:54 -05:00
parent ee408805e2
commit 6abf1de348
1 changed files with 12 additions and 2 deletions

View File

@ -19,13 +19,23 @@ location = ${PWD}/repos/x-portage
auto-sync = no
EOF
find repos/x-portage \
-mindepth 1 \
-maxdepth 1 \
-type d \
-not -name metadata \
-not -name profiles \
| xargs rm -rfv
for patch in patches/ebuilds/*/*/*.patch; do
[ -f "${patch}" ] || continue
cp=${patch#patches/ebuilds/}
cp=${cp%/*.patch}
printf 'Applying patch %s for %s ...\n' "${patch##*/}" "${cp}"
mkdir -p repos/x-portage/${cp}
cp -r /var/db/repos/gentoo/${cp}/. repos/x-portage/${cp}
if [ ! -d repos/x-portage/${cp} ]; then
mkdir -p repos/x-portage/${cp}
cp -r /var/db/repos/gentoo/${cp}/. repos/x-portage/${cp}
fi
for f in repos/x-portage/${cp}/*.ebuild; do
patch "${f}" "${patch}"
ebuild "${f}" digest