Browse Source

add custom-patches module

master
belliash 7 years ago
parent
commit
d5625a87d1
2 changed files with 27 additions and 0 deletions
  1. 3
    0
      config/modules/custom-patches.conf
  2. 24
    0
      modules/custom-patches.ezmod

+ 3
- 0
config/modules/custom-patches.conf View File

@@ -0,0 +1,3 @@
1
+# Specifies a list of patches that will be applied on generated Portage tree by the
2
+# custom-patches module. Absolute paths to files are necessary!
3
+CUSTOM_PATCHES=""

+ 24
- 0
modules/custom-patches.ezmod View File

@@ -0,0 +1,24 @@
1
+# Copyright 2010-2012, Asio Software Technologies
2
+# Distributed under the terms of the GNU General Public License v3
3
+EZMOD_DESCRIPTION="Applies custom patches onto generated Portage tree"
4
+EZMOD_COMPATIBILITY="ezsync"
5
+EZMOD_AUTHOR="Rafal Kupiec"
6
+EZMOD_VERSION="1.0"
7
+
8
+ezsync_precommit() {
9
+	local PATCH PREFIX
10
+	if [ "${CUSTOM_PATCHES}" != "" ]; then
11
+		printInfo "Applying custom patches..."
12
+		for PATCH in ${CUSTOM_PATCHES}; do
13
+			for PREFIX in {0..4}; do
14
+				if run "patch -d \"${PORTAGESDIR}/${PORTAGE_BUILD[0]}\" --dry-run -p ${PREFIX} -i \"${PATCH}\" -s"; then
15
+					run "patch -d \"${PORTAGESDIR}/${PORTAGE_BUILD[0]}\" -p ${PREFIX} -i \"${PATCH}\"" || return 1
16
+				elif [ ${PREFIX} -ge 4 ]; then
17
+					printError "Patch ${PATCH} does not fit!"
18
+					return 1
19
+				fi
20
+			done
21
+		done
22
+	fi
23
+	return 0
24
+}

Loading…
Cancel
Save