summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-18 09:57:14 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-18 09:57:14 +0000
commit5b53584930078ac423a10f38d1ff99273986ad56 (patch)
treede3c4a159081f55a8227907904ef5ac86c2d021f
parentAdd COPYING with GPL-2 license. (diff)
downloadautoepatch-5b53584930078ac423a10f38d1ff99273986ad56.tar.gz
autoepatch-5b53584930078ac423a10f38d1ff99273986ad56.tar.bz2
autoepatch-5b53584930078ac423a10f38d1ff99273986ad56.zip
Add ability for a patchset to tell if the patch is required, and to give a specific error message in case it failed to apply.
svn path=/trunk/; revision=7
-rwxr-xr-xautoepatch.sh21
-rw-r--r--patches/kde-autoconf/kde-autoconf.sh5
2 files changed, 24 insertions, 2 deletions
diff --git a/autoepatch.sh b/autoepatch.sh
index 3b43d87..0f666e2 100755
--- a/autoepatch.sh
+++ b/autoepatch.sh
@@ -48,9 +48,26 @@ main() {
while read target; do
for patch in "${patchset}"/*.patch; do
- echo $patch
- try_patch "${target}" "${patch}" && break;
+ if try_patch "${target}" "${patch}"; then
+ PATCH_APPLIED="yes"
+ break
+ fi
done
+
+ # Check if the patchset requires us to fail if the
+ # patch is not applied, if there's no patch_required
+ # function, just skip over
+ type patch_required &>/dev/null || continue
+
+ if ! type patch_failed_msg &>/dev/null; then
+ patch_failed_msg() {
+ eerror "Failed patch ${patchset##*/}"
+ }
+ fi
+
+ if [[ -z ${PATCH_APPLIED} ]]; then
+ patch_required && patch_failed_msg && exit 1
+ fi
done <<<"${targets}"
exit 0
diff --git a/patches/kde-autoconf/kde-autoconf.sh b/patches/kde-autoconf/kde-autoconf.sh
index af582fe..9ea9d53 100644
--- a/patches/kde-autoconf/kde-autoconf.sh
+++ b/patches/kde-autoconf/kde-autoconf.sh
@@ -10,3 +10,8 @@ patch_targets() {
# Find the admindir, wherever it is.
find "${WORKDIR}" -path '*/admin/cvs.sh' -type f
}
+
+# This patch is always required
+patch_required() {
+ return 0
+}