# /etc/portage/bashrc # put patches and .tar.gz archives in /etc/portage/patches/cate-gory_package/ # no versioning, if the patch fails to apply with a newer version it should not continue # (the archive may fail to extract after an upgrade if the directory name changes :/) if [ "$EBUILD_PHASE" = "compile" ]; then if [ -d /etc/portage/patches/"$CATEGORY"_"$PN"/ ]; then for patch in /etc/portage/patches/"$CATEGORY"_"$PN"/*.patch; do if [ "$patch" != "/etc/portage/patches/""$CATEGORY""_""$PN""/*.patch" ]; then cd "$WORKDIR" PATH="/bin:/usr/bin/:$PATH" epatch "$patch" fi done for archive in /etc/portage/patches/"$CATEGORY"_"$PN"/*.tar.gz; do if [ "$archive" != "/etc/portage/patches/""$CATEGORY""_""$PN""/*.tar.gz" ]; then cd "$WORKDIR" ebegin Extracting "$archive" PATH="/bin:/usr/bin/:$PATH" tar xzf "$archive" RES=$? eend $RES [ "$RES" = "0" ] || die fi done cd "$PORTAGE_BUILDDIR" fi fi