Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root] ~ # cat /etc/portage/bashrc
- #PATCHES
- pre_src_configure() {
- src_autopatcher
- }
- src_autopatcher() {
- PATCH_DIR="/var/lib/portage/hardpatches"
- PATCH_OPTS="-g0 -E --no-backup-if-mismatch"
- local count=0
- if [ -d "${PATCH_DIR}/${CATEGORY}/${PN}" ]; then
- for PATCH in $(find "${PATCH_DIR}/${CATEGORY}/${PN}" "${PATCH_DIR}/${CATEGORY}/${PN}/${PV}/" -maxdepth 1 -type f -name "*.patch"|sort)
- do
- einfo "Patching ${PATCH/*\//} ..."
- while [[ ${count} -lt 5 ]]; do
- if (patch -p${count} ${PATCH_OPTS} --dry-run -f < "${PATCH}") >/dev/null; then
- patch -p${count} ${PATCH_OPTS} < "${PATCH}" >/dev/null
- break
- fi
- (( count++ ))
- done
- if [[ ${count} -ge 5 ]] ; then
- eerror "Failed Patch: ${PATCH/*\//} !"
- die "Failed Patch: ${PATCH/*\//} !"
- fi
- done
- fi
- }
- #post_src_prepare() {
- # if type epatch_user &> /dev/null ; then
- # epatch_user
- # fi
- #}
- post_src_prepare() {
- #:
- epatch_user
- }
- [root] ~ # cat /etc/portage/env/
- dev-java/ net-im/ userpatch.sh www-client/
- [root] ~ # cat /etc/portage/env/userpatch.sh
- if [ "${EBUILD_PHASE}" == "prepare" ]; then
- cd work/*
- epatch_user
- cd -
- fi
Advertisement
Add Comment
Please, Sign In to add comment