diff --git a/setup-local-repo.sh b/setup-local-repo.sh index 6f3cd4e..f465c63 100755 --- a/setup-local-repo.sh +++ b/setup-local-repo.sh @@ -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