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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
From 562283ad34021bbf4fc540127ee7072d5152d34d Mon Sep 17 00:00:00 2001
From: Yuval Turgeman <yturgema@redhat.com>
Date: Wed, 24 Jul 2019 16:42:22 +0300
Subject: [PATCH 336/336] spec: check and return exit code in rpm scripts
lua's error() call expects a value as its second argument, and this is
taken from the `val` variable, while the `ok` is boolean. This causes
the rpm scripts to fail on:
bad argument #2 to 'error' (number expected, got boolean)
Label: DOWNSTREAM ONLY
BUG: 1768786
Change-Id: I9c6b1f62ebf15dbc93196d018bc1fd628b36fc33
>Signed-off-by: Yuval Turgeman <yturgema@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/186405
Reviewed-by: Mohit Agrawal <moagrawa@redhat.com>
Tested-by: RHGS Build Bot <nigelb@redhat.com>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
---
glusterfs.spec.in | 55 +++++++++++++++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index 91180db..1b975b2 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -1572,8 +1572,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1606,8 +1607,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1640,8 +1642,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1674,8 +1677,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1707,8 +1711,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1740,8 +1745,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1775,8 +1781,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
%endif
@@ -1810,8 +1817,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
@@ -1845,8 +1853,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
%endif
@@ -1881,8 +1890,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
%endif
@@ -1916,8 +1926,9 @@ fi
]]
ok, how, val = os.execute(script)
-if not (ok == 0) then
- error("Detected running glusterfs processes", ok)
+rc = val or ok
+if not (rc == 0) then
+ error("Detected running glusterfs processes", rc)
end
%posttrans server
--
1.8.3.1
|