This repository has been archived on 2025-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
Files
home-assistant-yellow/setup-local-repo.sh
Dustin C. Hatch 6abf1de348 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.
2023-03-21 19:42:35 -05:00

44 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# vim: set sw=4 ts=4 sts=4 et :
set -e
. "${CONFIGDIR:=${PWD}}"/config
mkdir -p "${CONFIGDIR}"/portage/target/etc/portage/repos.conf
cat > "${CONFIGDIR}"/portage/target/etc/portage/repos.conf/aimee-os.conf <<EOF
[aimee-os]
location = ${PWD}/repos/aimee-os
auto-sync = no
EOF
cat > "${CONFIGDIR}"/portage/target/etc/portage/repos.conf/x-portage.conf <<EOF
[x-portage]
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}"
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
done
done