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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user