Skip to content

Commit 782ced8

Browse files
author
Michael Plass
committed
Merge remote-tracking branch 'origin/100987-bourne-local'
* origin/100987-bourne-local: Refs #100987 Remove non-portable uses of local keyword in Bourne shell scripts
2 parents 98622f5 + ed5f61b commit 782ced8

File tree

6 files changed

+23
-38
lines changed

6 files changed

+23
-38
lines changed

apps/examples/ccnb-Java/schema/validate.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
# schema/validate.sh
33

4-
# Copyright (C) 2011 Palo Alto Research Center, Inc.
4+
# Copyright (C) 2011-2013 Palo Alto Research Center, Inc.
55
#
66
# This work is free software; you can redistribute it and/or modify it under
77
# the terms of the GNU General Public License version 2 as published by the
@@ -35,7 +35,6 @@ echo == Validating $SCHEMA
3535
xmllint --schema XMLSchema.xsd --noout $SCHEMA
3636

3737
ValidateXML () {
38-
local X
3938
X="$1"
4039
echo == Normalizing ${X}.xml to use base64Binary
4140
# Note for this purpose it does not matter that ccn_ccnbtoxml is ignorant of

csrc/exttests/functions

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Part of the CCNx distribution.
66
#
7-
# Copyright (C) 2009-2011 Palo Alto Research Center, Inc.
7+
# Copyright (C) 2009-2013 Palo Alto Research Center, Inc.
88
#
99
# This work is free software; you can redistribute it and/or modify it under
1010
# the terms of the GNU General Public License version 2 as published by the
@@ -41,7 +41,6 @@ LongTest () {
4141
}
4242

4343
WithCCND () {
44-
local port;
4544
port=$((CCN_LOCAL_PORT_BASE+$1))
4645
shift
4746
CCN_LOCAL_PORT=$port "$@"
@@ -58,7 +57,6 @@ CCNDStatus () {
5857
}
5958

6059
Linkup () {
61-
local A B
6260
A=$((CCN_LOCAL_PORT_BASE+$1))
6361
B=$((CCN_LOCAL_PORT_BASE+$2))
6462
shift 2
@@ -68,7 +66,6 @@ Linkup () {
6866
}
6967

7068
ExpectLines () {
71-
local file lines minimum maximum
7269
lines=`wc -l < $1` || Fail
7370
file=$1
7471
minimum=$2

csrc/sync/functions

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Part of the CCNx distribution.
66
#
7-
# Copyright (C) 2009-2011 Palo Alto Research Center, Inc.
7+
# Copyright (C) 2009-2013 Palo Alto Research Center, Inc.
88
#
99
# This work is free software; you can redistribute it and/or modify it under
1010
# the terms of the GNU General Public License version 2 as published by the
@@ -41,7 +41,6 @@ LongTest () {
4141
}
4242

4343
WithCCND () {
44-
local port;
4544
port=$((CCN_LOCAL_PORT_BASE+$1))
4645
shift
4746
CCN_LOCAL_PORT=$port "$@"
@@ -58,7 +57,6 @@ CCNDStatus () {
5857
}
5958

6059
Linkup () {
61-
local A B
6260
A=$((CCN_LOCAL_PORT_BASE+$1))
6361
B=$((CCN_LOCAL_PORT_BASE+$2))
6462
shift 2
@@ -68,7 +66,6 @@ Linkup () {
6866
}
6967

7068
ExpectLines () {
71-
local file lines minimum maximum
7269
lines=`wc -l < $1` || Fail
7370
file=$1
7471
minimum=$2

csrc/sync/setup

+18-23
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ EndTest () {
8989
I=0
9090
while test $I -le $SyncTestRepos; do
9191
WithCCND $I ccndsmoketest kill
92-
I=`expr $I + 1`
92+
I=$((I + 1))
9393
done
9494
sleep 1
9595
}
@@ -104,13 +104,12 @@ AwkMax () {
104104
}
105105
ZeroPoint () {
106106
# create a non-participating slice to set the initial point
107-
local I
108107
I=1
109108
while test $I -le $SyncTestRepos; do
110109
WithCCND $I SyncTest -scope 1 -mark -slice $SyncTestTopo /zero/point >/dev/null
111110
WithCCND $I SyncTest $SyncPutFlags -put $SyncTestDir/small.data ccnx:/zero/point/data >$SyncTestDir/tfr0.$I.txt
112111
WithCCND $I GetStats $ZeroPointHash $SyncTestDir/zero.$I.txt
113-
I=`expr $I + 1`
112+
I=$((I + 1))
114113
done
115114
}
116115
GetCPU () {
@@ -136,7 +135,6 @@ IfInitDataAfter () {
136135
fi
137136
}
138137
AppendSummary () {
139-
local I
140138
etLine="Elapsed"
141139
etMax=0.0
142140
packetSum=0
@@ -158,7 +156,7 @@ AppendSummary () {
158156
packetSum=$(($packetSum + $packets))
159157
intLine="$intLine, P$I = $packets"
160158
echo Repo $I dCPU = $dCPU, maxrss = $maxrss, depth = $treeDepth, treeBytes = $treeBytes, nodesCreated = $nodesCreated, lastHashChange = $lastHashChange >>$SyncTestDir/res.txt
161-
I=`expr $I + 1`
159+
I=$((I + 1))
162160
done
163161
etLine="$etLine, max = $etMax"
164162
echo $etLine >>$SyncTestDir/res.txt
@@ -172,23 +170,20 @@ InitData () {
172170
WithCCND 1 SyncTest $SyncPutFlags -put $SyncTestDir/test.data ccnx:/root/beer/floatZ >>$SyncTestDir/tfr2.txt
173171
}
174172
WaitLim () {
175-
local I
176173
I=1
177174
while test $I -le $SyncTestRepos; do
178175
WaitRepoLeaves $I $LIM
179-
I=`expr $I + 1`
176+
I=$((I + 1))
180177
done
181178
}
182179
SetSlices () {
183-
local I
184180
I=1
185181
while test $I -le $SyncTestRepos; do {
186182
WithCCND $I DoSlice $I >$SyncTestDir/slice.$I.txt
187-
I=`expr $I + 1`
183+
I=$((I + 1))
188184
}; done
189185
}
190186
DoTest () {
191-
local I
192187
testOrder="after"
193188
if [ ${SyncTestInitBefore:=0} -gt 0 ]; then testOrder="before"; fi
194189
testLine="-- Testing, repos $SyncTestRepos, config $repoConfig, init $testOrder, $SyncTestExtra, names $SyncTestNames, `MyDate`"
@@ -198,29 +193,29 @@ DoTest () {
198193
while test $I -le $SyncTestRepos; do
199194
WithCCND $I ccnd 2>$SyncTestDir/ccnd.$I.$SyncTestNames.txt &
200195
sleep 0.2
201-
I=`expr $I + 1`
196+
I=$((I + 1))
202197
done
203198
sleep 1
204199
if [ ${SyncTestUseStar:=0} -eq 1 ] ; then
205200
I=2
206201
while test $I -le $SyncTestRepos; do {
207202
Linkup 1 $I
208203
Linkup $I 1
209-
I=`expr $I + 1`
204+
I=$((I + 1))
210205
}; done
211206
else
212207
I=1
213208
while test $I -lt $SyncTestRepos; do {
214-
II=`expr $I + 1`
209+
II=$((I + 1))
215210
Linkup $I $II
216211
Linkup $II $I
217-
I=`expr $I + 1`
212+
I=$((I + 1))
218213
}; done
219214
fi
220215
I=1
221216
while test $I -le $SyncTestRepos; do {
222217
WithCCND $I StartEmptyRepo $I &
223-
I=`expr $I + 1`
218+
I=$((I + 1))
224219
}; done
225220
sleep $(( $SyncTestRepos / 4 ))
226221

@@ -247,10 +242,10 @@ DoTest () {
247242
I=1
248243
while test $I -le $SyncTestRepos; do
249244
WithCCND $I GetStats $RootBeerHash $SyncTestDir/prev.$I.txt
250-
I=`expr $I + 1`
245+
I=$((I + 1))
251246
done
252247
WithCCND 1 SyncTest $SyncPutFlags -put $SyncTestDir/small.data ccnx:/root/beer/floatY >$SyncTestDir/tfr3.txt
253-
LIM=`expr $LIM + $stp`
248+
LIM=$((LIM + stp))
254249
ncLine="Added $stp name"
255250
ncMax=0
256251
etLine="Update time"
@@ -285,7 +280,7 @@ DoTest () {
285280
packets=`awk -f scan-sumint.awk $SyncTestDir/stats.$I.txt`
286281
packetSum=$(($packetSum + $packets))
287282
intLine="$intLine, P$I = $packets"
288-
I=`expr $I + 1`
283+
I=$((I + 1))
289284
done
290285
echo ----
291286
tail -1 $SyncTestDir/tfr3.txt >>$SyncTestDir/res.txt
@@ -310,7 +305,7 @@ DoTest () {
310305
StatsPause
311306
stuff=`jobs -p`
312307
if [ ! "$stuff" ] ; then break; fi ;
313-
x=`expr $x + 1`
308+
x=$((x + 1))
314309
} ; done
315310
}
316311
CheckDir () {
@@ -330,12 +325,12 @@ StartTest () {
330325
while test $I -le $SyncTestRepos; do
331326
WithCCND $I ccnd 2>$SyncTestDir/ccnd.$I.$SyncTestNames.txt &
332327
sleep 0.2
333-
I=`expr $I + 1`
328+
I=$((I + 1))
334329
done
335330
I=1
336331
while test $I -le $SyncTestRepos; do
337332
WithCCND $I StartEmptyRepo $I &
338-
I=`expr $I + 1`
333+
I=$((I + 1))
339334
done
340335
I=0
341336
while test $I -le $SyncTestRepos; do
@@ -345,9 +340,9 @@ StartTest () {
345340
echo Linkup $I $J
346341
Linkup $I $J
347342
fi
348-
J=`expr $J + 1`
343+
J=$((J + 1))
349344
done
350-
I=`expr $I + 1`
345+
I=$((I + 1))
351346
done
352347
SetSlices
353348
}

csrc/tests/functions

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Part of the CCNx distribution.
66
#
7-
# Copyright (C) 2009 Palo Alto Research Center, Inc.
7+
# Copyright (C) 2009-2013 Palo Alto Research Center, Inc.
88
#
99
# This work is free software; you can redistribute it and/or modify it under
1010
# the terms of the GNU General Public License version 2 as published by the
@@ -37,7 +37,6 @@ SkipTest () {
3737
}
3838

3939
WithCCND () {
40-
local port;
4140
port=$((CCN_LOCAL_PORT_BASE+$1))
4241
shift
4342
CCN_LOCAL_PORT=$port "$@"
@@ -54,7 +53,6 @@ CCNDStatus () {
5453
}
5554

5655
ExpectLines () {
57-
local file lines minimum maximum
5856
lines=`wc -l < $1` || Fail
5957
file=$1
6058
minimum=$2

csrc/tests/test_twohop_ccnd

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Part of the CCNx distribution.
44
#
5-
# Copyright (C) 2009, 2011 Palo Alto Research Center, Inc.
5+
# Copyright (C) 2009-2013 Palo Alto Research Center, Inc.
66
#
77
# This work is free software; you can redistribute it and/or modify it under
88
# the terms of the GNU General Public License version 2 as published by the
@@ -28,7 +28,6 @@ until CheckForCCND 0 && CheckForCCND 1 && CheckForCCND 2 && CheckForCCND 3; do
2828
done
2929

3030
Linkup () {
31-
local A B
3231
A=$((CCN_LOCAL_PORT_BASE+$1))
3332
B=$((CCN_LOCAL_PORT_BASE+$2))
3433
shift 2

0 commit comments

Comments
 (0)