Skip to content

Commit a3c4c88

Browse files
avargitster
authored andcommitted
tests: use shorter labels in chainlint.sed for AIX sed
Improve the portability of chainlint by using shorter labels. On AIX sed will complain about: sed: 0602-417 The label :hereslurp is greater than eight characters This, in combination with the previous fix to this file makes GIT_TEST_CHAIN_LINT=1 (which is the default) working again on AIX without issues, and the "gmake check-chainlint" test also passes. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Acked-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2d9ded8 commit a3c4c88

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

t/chainlint.sed

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@
9797
/<<[ ]*[-\\']*[A-Za-z0-9_]/ {
9898
s/^\(.*\)<<[ ]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
9999
s/[ ]*<<//
100-
:hereslurp
100+
:hered
101101
N
102102
/^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{
103103
s/\n.*$//
104-
bhereslurp
104+
bhered
105105
}
106106
s/^<[^>]*>//
107107
s/\n.*$//
@@ -149,7 +149,7 @@ s/.*\n//
149149

150150
:slurp
151151
# incomplete line "...\"
152-
/\\$/bincomplete
152+
/\\$/bicmplte
153153
# multi-line quoted string "...\n..."?
154154
/"/bdqstring
155155
# multi-line quoted string '...\n...'? (but not contraction in string "it's")
@@ -171,7 +171,7 @@ s/.*\n//
171171
/"[^"]*#[^"]*"/!s/[ ]#.*$//
172172
}
173173
# one-liner "case ... esac"
174-
/^[ ]*case[ ]*..*esac/bcheckchain
174+
/^[ ]*case[ ]*..*esac/bchkchn
175175
# multi-line "case ... esac"
176176
/^[ ]*case[ ]..*[ ]in/bcase
177177
# multi-line "for ... done" or "while ... done"
@@ -200,32 +200,32 @@ s/.*\n//
200200
/^[ ]*fi[ ]*[<>|]/bdone
201201
/^[ ]*fi[ ]*)/bdone
202202
# nested one-liner "(...) &&"
203-
/^[ ]*(.*)[ ]*&&[ ]*$/bcheckchain
203+
/^[ ]*(.*)[ ]*&&[ ]*$/bchkchn
204204
# nested one-liner "(...)"
205-
/^[ ]*(.*)[ ]*$/bcheckchain
205+
/^[ ]*(.*)[ ]*$/bchkchn
206206
# nested one-liner "(...) >x" (or "2>x" or "<x" or "|x")
207-
/^[ ]*(.*)[ ]*[0-9]*[<>|]/bcheckchain
207+
/^[ ]*(.*)[ ]*[0-9]*[<>|]/bchkchn
208208
# nested multi-line "(...\n...)"
209209
/^[ ]*(/bnest
210210
# multi-line "{...\n...}"
211211
/^[ ]*{/bblock
212212
# closing ")" on own line -- exit subshell
213-
/^[ ]*)/bclosesolo
213+
/^[ ]*)/bclssolo
214214
# "$((...))" -- arithmetic expansion; not closing ")"
215-
/\$(([^)][^)]*))[^)]*$/bcheckchain
215+
/\$(([^)][^)]*))[^)]*$/bchkchn
216216
# "$(...)" -- command substitution; not closing ")"
217-
/\$([^)][^)]*)[^)]*$/bcheckchain
217+
/\$([^)][^)]*)[^)]*$/bchkchn
218218
# multi-line "$(...\n...)" -- command substitution; treat as nested subshell
219219
/\$([^)]*$/bnest
220220
# "=(...)" -- Bash array assignment; not closing ")"
221-
/=(/bcheckchain
221+
/=(/bchkchn
222222
# closing "...) &&"
223223
/)[ ]*&&[ ]*$/bclose
224224
# closing "...)"
225225
/)[ ]*$/bclose
226226
# closing "...) >x" (or "2>x" or "<x" or "|x")
227227
/)[ ]*[<>|]/bclose
228-
:checkchain
228+
:chkchn
229229
# mark suspect if line uses ";" internally rather than "&&" (but not ";" in a
230230
# string and not ";;" in one-liner "case...esac")
231231
/;/{
@@ -244,7 +244,7 @@ n
244244
bslurp
245245

246246
# found incomplete line "...\" -- slurp up next line
247-
:incomplete
247+
:icmplte
248248
N
249249
s/\\\n//
250250
bslurp
@@ -282,11 +282,11 @@ bfolded
282282
:heredoc
283283
s/^\(.*\)<<[ ]*[-\\']*\([A-Za-z0-9_][A-Za-z0-9_]*\)'*/<\2>\1<</
284284
s/[ ]*<<//
285-
:hereslurpsub
285+
:heredsub
286286
N
287287
/^<\([^>]*\)>.*\n[ ]*\1[ ]*$/!{
288288
s/\n.*$//
289-
bhereslurpsub
289+
bheredsub
290290
}
291291
s/^<[^>]*>//
292292
s/\n.*$//
@@ -316,43 +316,43 @@ x
316316
# is 'done' or 'fi' cuddled with ")" to close subshell?
317317
/done.*)/bclose
318318
/fi.*)/bclose
319-
bcheckchain
319+
bchkchn
320320

321321
# found nested multi-line "(...\n...)" -- pass through untouched
322322
:nest
323323
x
324-
:nestslurp
324+
:nstslurp
325325
n
326326
# closing ")" on own line -- stop nested slurp
327-
/^[ ]*)/bnestclose
327+
/^[ ]*)/bnstclose
328328
# comment -- not closing ")" if in comment
329-
/^[ ]*#/bnestcontinue
329+
/^[ ]*#/bnstcnt
330330
# "$((...))" -- arithmetic expansion; not closing ")"
331-
/\$(([^)][^)]*))[^)]*$/bnestcontinue
331+
/\$(([^)][^)]*))[^)]*$/bnstcnt
332332
# "$(...)" -- command substitution; not closing ")"
333-
/\$([^)][^)]*)[^)]*$/bnestcontinue
333+
/\$([^)][^)]*)[^)]*$/bnstcnt
334334
# closing "...)" -- stop nested slurp
335-
/)/bnestclose
336-
:nestcontinue
335+
/)/bnstclose
336+
:nstcnt
337337
x
338-
bnestslurp
339-
:nestclose
338+
bnstslurp
339+
:nstclose
340340
s/^/>>/
341341
# is it "))" which closes nested and parent subshells?
342342
/)[ ]*)/bslurp
343-
bcheckchain
343+
bchkchn
344344

345345
# found multi-line "{...\n...}" block -- pass through untouched
346346
:block
347347
x
348348
n
349349
# closing "}" -- stop block slurp
350-
/}/bcheckchain
350+
/}/bchkchn
351351
bblock
352352

353353
# found closing ")" on own line -- drop "suspect" from final line of subshell
354354
# since that line legitimately lacks "&&" and exit subshell loop
355-
:closesolo
355+
:clssolo
356356
x
357357
s/?!AMP?!//
358358
p

0 commit comments

Comments
 (0)