Refactor epatch section for compressed patches. Bug #277230.
authorMarkos Chandras <hwoarang@gentoo.org>
Sun, 18 Jul 2010 16:58:14 +0000 (19:58 +0300)
committerMarkos Chandras <hwoarang@gentoo.org>
Sun, 18 Jul 2010 16:58:14 +0000 (19:58 +0300)
Thanks to Mounir Lamouri (volkmar) for the patch

ebuild-writing/functions/src_unpack/epatch/text.xml

index aa76412..b12a77b 100644 (file)
@@ -46,12 +46,19 @@ from <c>app-admin/showconsole</c>:
 
 <codesample lang="ebuild">
 src_unpack() {
-    unpack ${P}.tar.bz2
+    unpack ${A}
     cd "${S}"
-    epatch "${DISTDIR}/${P}-suse-update.patch.bz2"
+    epatch "${WORKDIR}/${P}-suse-update.patch.bz2"
     epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch"
 }
 </codesample>
+<p>As stated before, if you are using EAPI >=2, you should apply the patches in the <uri link="::ebuild-writing/functions/src_prepare">src_prepare</uri> function</p>
+<codesample lang="ebuild">
+src_prepare() {
+       epatch "${WORKDIR}/${P}-suse-update.patch.bz2"
+       epatch "${FILESDIR}/${PV}-no-TIOCGDEV.patch"
+}
+</codesample>
 
 <p>
 Remember to add the patch to <c>SRC_URI</c>.