--- aufs2-9999.ebuild.old 2009-10-06 12:58:13.000000000 +0200 +++ aufs2-9999.ebuild 2009-10-06 12:14:59.000000000 +0200 @@ -35,9 +35,7 @@ fi local branch=origin/aufs2-${KV_PATCH} - if [ $KV_PATCH -eq 31 ] ; then - branch=origin/aufs2 - fi + git checkout $branch || die "no patch exists for your kernel" use debug || sed -i "s:DEBUG = y:DEBUG =:g" config.mk @@ -49,12 +47,14 @@ cat aufs2-standalone.patch | \ sed -e "s/^+#ifdef CONFIG_AUFS_FS_MODULE/+#if 1/" \ -e "s/defined(CONFIG_AUFS_FS_MODULE)/1/" > $modified_patch - + if patch -p1 --dry-run --force -R -d ${KV_DIR} < $modified_patch >/dev/null; then einfo "aufs2 kernel patch has already been applied" elif use kernel-patch; then addwrite ${KV_DIR} ewarn "Patching your kernel..." + patch --no-backup-if-mismatch --force -p1 -d ${KV_DIR} < aufs2-base.patch >/dev/null || \ + die "could not apply the kernel patch aufs2-base.patch to your kernel" patch --no-backup-if-mismatch --force -p1 -d ${KV_DIR} < $modified_patch >/dev/null || \ die "could not apply the kernel patch $modified_patch to your kernel" einfo "You need to compile your kernel with the applied patch" @@ -91,6 +91,7 @@ docinto design dodoc design/*.txt || die mkdir -p "${D}"/usr/share/aufs2 + cp aufs2-base.patch "${D}"/usr/share/aufs2/aufs2-base.patch cp aufs2-standalone-modified.patch "${D}"/usr/share/aufs2/aufs2-kernel.patch cd "${S}"-utils emake DESTDIR="${D}" install || die