-
Notifications
You must be signed in to change notification settings - Fork 1
/
0076-gentpl-add-disable-support.patch
46 lines (43 loc) · 1.47 KB
/
0076-gentpl-add-disable-support.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <[email protected]>
Date: Wed, 11 Jul 2018 13:43:15 -0400
Subject: [PATCH] gentpl: add 'disable = ' support
Signed-off-by: Peter Jones <[email protected]>
---
gentpl.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/gentpl.py b/gentpl.py
index bfab2113a1d..6cad9b8231f 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -594,11 +594,21 @@ def platform_conditional(platform, closure):
# };
#
def foreach_enabled_platform(defn, closure):
+ enabled = False
+ disabled = False
if 'enable' in defn:
+ enabled = True
for platform in GRUB_PLATFORMS:
if platform_tagged(defn, platform, "enable"):
platform_conditional(platform, closure)
- else:
+
+ if 'disable' in defn:
+ disabled = True
+ for platform in GRUB_PLATFORMS:
+ if not platform_tagged(defn, platform, "disable"):
+ platform_conditional(platform, closure)
+
+ if not enabled and not disabled:
for platform in GRUB_PLATFORMS:
platform_conditional(platform, closure)
@@ -657,6 +667,8 @@ def first_time(defn, snippet):
def is_platform_independent(defn):
if 'enable' in defn:
return False
+ if 'disable' in defn:
+ return False
for suffix in [ "", "_nodist" ]:
template = platform_values(defn, GRUB_PLATFORMS[0], suffix)
for platform in GRUB_PLATFORMS[1:]: