Skip to content

Commit 94eef80

Browse files
committed
Working to fix the difference between BSD and GNU versions of sed.
The genoatt file was applying sed to the files in test using -i, but without a new file ending. In BSD sed this was causing it to pick up the `-E` flag. I've fixed it to force a new file name and then clean up the changed files.
1 parent 989659e commit 94eef80

File tree

45 files changed

+4881
-12540
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4881
-12540
lines changed

genoatt.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ run_oatt() {
2929

3030
# oatts is a bit silly in picking its variables. We need to make sure that we're
3131
# getting the proper polygons, and making sure altmin/altmax are appropriate.
32-
find ./test -type f -exec sed -i -E "s/'loc':\ '\{.*?\}'/'loc': '{\"type\":\"Polygon\",\"coordinates\":[[[-104.053249,41.001406],[-104.675999,41.000957],[-104.855273,40.998048],[-105.277138,40.998173],[-105.730421,40.996886],[-106.217573,40.997734],[-106.453859,41.002057],[-106.857773,41.002663],[-107.625624,41.002124],[-108.250649,41.000114],[-108.884138,41.000094],[-109.050076,41.000659],[-109.048044,40.619231],[-109.050946,40.444368],[-109.050615,39.87497],[-109.051363,39.497674],[-109.051512,39.126095],[-109.054189,38.874984],[-109.059541,38.719888],[-109.060062,38.275489],[-109.041762,38.16469],[-109.041058,37.907236],[-109.041865,37.530726],[-109.04581,37.374993],[-109.045223,36.999084],[-108.620309,36.999287],[-108.249358,36.999015],[-108.000623,37.000001],[-107.420913,37.000005],[-106.877292,37.000139],[-106.869796,36.992426],[-106.201469,36.994122],[-105.62747,36.995679],[-105.1208,36.995428],[-105.000554,36.993264],[-104.338833,36.993535],[-103.733247,36.998016],[-103.002199,37.000104],[-102.814616,37.000783],[-102.698142,36.995149],[-102.04224,36.993083],[-102.041974,37.352613],[-102.041574,37.680436],[-102.044644,38.045532],[-102.045324,38.453647],[-102.045388,38.813392],[-102.048449,39.303138],[-102.050422,39.646048],[-102.051744,40.003078],[-102.051725,40.537839],[-102.051614,41.002377],[-102.556789,41.002219],[-102.865784,41.001988],[-103.497447,41.001635],[-104.053249,41.001406]]]}'/g" {} \;
33-
find ./test -type f -exec sed -i -E "s/'loc':\ \"\{.*?\}\"/'loc': '{\"type\":\"Polygon\",\"coordinates\":[[[-104.053249,41.001406],[-104.675999,41.000957],[-104.855273,40.998048],[-105.277138,40.998173],[-105.730421,40.996886],[-106.217573,40.997734],[-106.453859,41.002057],[-106.857773,41.002663],[-107.625624,41.002124],[-108.250649,41.000114],[-108.884138,41.000094],[-109.050076,41.000659],[-109.048044,40.619231],[-109.050946,40.444368],[-109.050615,39.87497],[-109.051363,39.497674],[-109.051512,39.126095],[-109.054189,38.874984],[-109.059541,38.719888],[-109.060062,38.275489],[-109.041762,38.16469],[-109.041058,37.907236],[-109.041865,37.530726],[-109.04581,37.374993],[-109.045223,36.999084],[-108.620309,36.999287],[-108.249358,36.999015],[-108.000623,37.000001],[-107.420913,37.000005],[-106.877292,37.000139],[-106.869796,36.992426],[-106.201469,36.994122],[-105.62747,36.995679],[-105.1208,36.995428],[-105.000554,36.993264],[-104.338833,36.993535],[-103.733247,36.998016],[-103.002199,37.000104],[-102.814616,37.000783],[-102.698142,36.995149],[-102.04224,36.993083],[-102.041974,37.352613],[-102.041574,37.680436],[-102.044644,38.045532],[-102.045324,38.453647],[-102.045388,38.813392],[-102.048449,39.303138],[-102.050422,39.646048],[-102.051744,40.003078],[-102.051725,40.537839],[-102.051614,41.002377],[-102.556789,41.002219],[-102.865784,41.001988],[-103.497447,41.001635],[-104.053249,41.001406]]]}'/g" {} \;
34-
find ./test -type f -exec sed -i -E "s/'altmin':\ -*[0-9]+/'altmin':\ 10/g" {} \;
35-
find ./test -type f -exec sed -i -E "s/'altmax':\ -*[0-9]+/'altmax':\ 100/g" {} \;
36-
find ./test -type f -exec sed -i -E "s/'ageold':\ -*[0-9]+/'ageold':\ 10000/g" {} \;
37-
find ./test -type f -exec sed -i -E "s/'ageyoung':\ -*[0-9]+/'ageyoung':\ 1000/g" {} \;
38-
find ./test -type f -exec sed -i -E "s/'start':\ -*[0-9]+/'start':\ 1/g" {} \;
39-
find ./test -type f -exec sed -i -E "s/'end':\ -*[0-9]+/'end':\ 10/g" {} \;
32+
find ./test/*.js -type f -exec sed -i.old -E "s/'loc':\ '\{.*?\}'/'loc': '{\"type\":\"Polygon\",\"coordinates\":[[[-104.053249,41.001406],[-104.675999,41.000957],[-104.855273,40.998048],[-105.277138,40.998173],[-105.730421,40.996886],[-106.217573,40.997734],[-106.453859,41.002057],[-106.857773,41.002663],[-107.625624,41.002124],[-108.250649,41.000114],[-108.884138,41.000094],[-109.050076,41.000659],[-109.048044,40.619231],[-109.050946,40.444368],[-109.050615,39.87497],[-109.051363,39.497674],[-109.051512,39.126095],[-109.054189,38.874984],[-109.059541,38.719888],[-109.060062,38.275489],[-109.041762,38.16469],[-109.041058,37.907236],[-109.041865,37.530726],[-109.04581,37.374993],[-109.045223,36.999084],[-108.620309,36.999287],[-108.249358,36.999015],[-108.000623,37.000001],[-107.420913,37.000005],[-106.877292,37.000139],[-106.869796,36.992426],[-106.201469,36.994122],[-105.62747,36.995679],[-105.1208,36.995428],[-105.000554,36.993264],[-104.338833,36.993535],[-103.733247,36.998016],[-103.002199,37.000104],[-102.814616,37.000783],[-102.698142,36.995149],[-102.04224,36.993083],[-102.041974,37.352613],[-102.041574,37.680436],[-102.044644,38.045532],[-102.045324,38.453647],[-102.045388,38.813392],[-102.048449,39.303138],[-102.050422,39.646048],[-102.051744,40.003078],[-102.051725,40.537839],[-102.051614,41.002377],[-102.556789,41.002219],[-102.865784,41.001988],[-103.497447,41.001635],[-104.053249,41.001406]]]}'/g" {} \;
33+
find ./test/*.js -type f -exec sed -i.old -E "s/'loc':\ \"\{.*?\}\"/'loc': '{\"type\":\"Polygon\",\"coordinates\":[[[-104.053249,41.001406],[-104.675999,41.000957],[-104.855273,40.998048],[-105.277138,40.998173],[-105.730421,40.996886],[-106.217573,40.997734],[-106.453859,41.002057],[-106.857773,41.002663],[-107.625624,41.002124],[-108.250649,41.000114],[-108.884138,41.000094],[-109.050076,41.000659],[-109.048044,40.619231],[-109.050946,40.444368],[-109.050615,39.87497],[-109.051363,39.497674],[-109.051512,39.126095],[-109.054189,38.874984],[-109.059541,38.719888],[-109.060062,38.275489],[-109.041762,38.16469],[-109.041058,37.907236],[-109.041865,37.530726],[-109.04581,37.374993],[-109.045223,36.999084],[-108.620309,36.999287],[-108.249358,36.999015],[-108.000623,37.000001],[-107.420913,37.000005],[-106.877292,37.000139],[-106.869796,36.992426],[-106.201469,36.994122],[-105.62747,36.995679],[-105.1208,36.995428],[-105.000554,36.993264],[-104.338833,36.993535],[-103.733247,36.998016],[-103.002199,37.000104],[-102.814616,37.000783],[-102.698142,36.995149],[-102.04224,36.993083],[-102.041974,37.352613],[-102.041574,37.680436],[-102.044644,38.045532],[-102.045324,38.453647],[-102.045388,38.813392],[-102.048449,39.303138],[-102.050422,39.646048],[-102.051744,40.003078],[-102.051725,40.537839],[-102.051614,41.002377],[-102.556789,41.002219],[-102.865784,41.001988],[-103.497447,41.001635],[-104.053249,41.001406]]]}'/g" {} \;
34+
find ./test/*.js -type f -exec sed -i.old -E "s/'altmin':\ -*[0-9]+/'altmin':\ 10/g" {} \;
35+
find ./test/*.js -type f -exec sed -i.old -E "s/'altmax':\ -*[0-9]+/'altmax':\ 100/g" {} \;
36+
find ./test/*.js -type f -exec sed -i.old -E "s/'ageold':\ -*[0-9]+/'ageold':\ 10000/g" {} \;
37+
find ./test/*.js -type f -exec sed -i.old -E "s/'ageyoung':\ -*[0-9]+/'ageyoung':\ 1000/g" {} \;
38+
find ./test/*.js -type f -exec sed -i.old -E "s/'start':\ -*[0-9]+/'start':\ 1/g" {} \;
39+
find ./test/*.js -type f -exec sed -i.old -E "s/'end':\ -*[0-9]+/'end':\ 10/g" {} \;
4040
# Cleaning up the limits & offset:
41-
find ./test -type f -exec sed -i -E "s/'limit':\ -*[0-9]+/'limit':\ 10/g" {} \;
42-
find ./test -type f -exec sed -i -E "s/'offset':\ -*[0-9]+/'offset':\ 0/g" {} \;
43-
find ./test -type f -exec sed -i "s/\/[0-9]\{5,\}/\/500/g" {} \;
44-
find ./test -type f -exec sed -i -E "s/'prec':\ [0-9\.]*?/'prec': 1000/g" {} \;
45-
find ./test -type f -exec sed -i -E "s/'proj':\ [0-9\.]*?/'proj': 4326/g" {} \;
41+
find ./test/*.js -type f -exec sed -i.old -E "s/'limit':\ -*[0-9]+/'limit':\ 10/g" {} \;
42+
find ./test/*.js -type f -exec sed -i.old -E "s/'offset':\ -*[0-9]+/'offset':\ 0/g" {} \;
43+
find ./test/*.js -type f -exec sed -i.old "s/\/[0-9]\{5,\}/\/500/g" {} \;
44+
find ./test/*.js -type f -exec sed -i.old -E "s/'prec':\ [0-9\.]*?/'prec': 1000/g" {} \;
45+
find ./test/*.js -type f -exec sed -i.old -E "s/'proj':\ [0-9\.]*?/'proj': 4326/g" {} \;
4646

4747
}
4848

public/tests.html

Lines changed: 1 addition & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)