Index: ebuild.sh =================================================================== RCS file: /home/cvsroot/gentoo-src/portage/bin/ebuild.sh,v retrieving revision 1.145 diff -u -b -B -w -p -r1.145 ebuild.sh --- ebuild.sh 10 Nov 2003 08:30:55 -0000 1.145 +++ ebuild.sh 18 Nov 2003 08:56:08 -0000 @@ -392,6 +392,10 @@ src_compile() { fi } +src_patch() { + use uclibc && dyn_patch uclibc +} + src_install() { return @@ -501,6 +505,7 @@ dyn_unpack() { [ -d "$WORKDIR" ] && cd "${WORKDIR}" echo ">>> Unpacking source..." src_unpack + src_patch touch ${BUILDDIR}/.unpacked || die "IO Failure -- Failed 'touch .unpacked' in BUILDIR" echo ">>> Source unpacked." cd $BUILDDIR @@ -527,6 +532,38 @@ dyn_clean() { find ${BUILDDIR} -type d ! -regex "^${WORKDIR}" | sort -r | tr "\n" "\0" | $XARGS -0 rmdir &>/dev/null fi true +} + +dyn_patch() { + local mypatch + local savecwd="${PWD}" + + name=$1 + [ "${name}" = "" ] && return 1 + + # change to ${S} directory so that patches don't have to be + # directory-name specific. So, we can use a generic (diff|patch) + # unless we want to be more specific with a versioned patch. + cd ${S} + + # Patches are found in the files/${name}/ subdir of the package, + # and should folow the naming convention of: + # [package]-[version]-[revision]-${name}.(diff|patch) + # [package]-[version]-${name}.(diff|patch) + # [package]-${name}.(diff|patch) + # The patches are searched for in that order. + # Once a patch is applied, no more patches are attempted. + echo ">>> Searching for ${name} patches..." + for mypatch in ${FILESDIR}/${name}/{${PN}-${PV}-${PR},${PN}-${PV},${PN}}-${name}.{diff,patch} ; do + if [ -f ${mypatch} ] ; then + epatch ${mypatch} + break + # else + # echo "# ${mypatch}" + fi + done + # return to old working directory + cd ${savecwd} } into() {