Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !#/bin/env sh
- PORTDIR="/portage/tree/dir"
- OVERLAY="/nginx/overaly/dir"
- PATCHES="/nginx/patches/dir/"
- die () {
- echo "$1"
- exit "${2:-1}"
- }
- die "Path not set!"
- for e in "${PORTDIR}"/www-servers/nginx/*.ebuild; do
- name=$(basename "$e")
- target="${OVERLAY}/${name}"
- if [ "$e" -nt "$target" ]; then
- prefix=$(qatom "$name" | cut -d' ' -f3-4 | tr ' ' '/')
- while ! [ -d "${PATCHES}/$prefix" ]; do
- prefix=$(dirname "$prefix")
- done
- cp -f "$e" "$target"
- for p in "${PATCHES}/${prefix}"/*.patch; do
- patch "$target" "$p" || die "patch $p -- failed!"
- done
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement