Skip to content

Commit b95d317

Browse files
authored
Merge branch 'main' into fix_array_type
2 parents 994f6a9 + 19b4a0b commit b95d317

File tree

67 files changed

+1840
-360
lines changed

Some content is hidden

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

67 files changed

+1840
-360
lines changed

.github/workflows/linux.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
apt-get update
6+
7+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
8+
gcc libxml2-dev libpq-dev libfcgi-dev \
9+
autoconf make flex libfl-dev \
10+
postgresql-12 postgresql-client postgis postgresql-12-postgis-3 postgresql-12-postgis-3-scripts \
11+
wget ca-certificates patch valgrind
12+
13+
cd "${WORK_DIR}"
14+
./autogen.sh
15+
CFLAGS="-Werror" ./configure
16+
make
17+
make install
18+
19+
cp /etc/postgresql/12/main/pg_hba.conf /etc/postgresql/12/main/pg_hba.conf.bak
20+
echo "local all postgres trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf
21+
echo "host all all 127.0.0.1/32 trust" | cat - /etc/postgresql/12/main/pg_hba.conf.bak > /etc/postgresql/12/main/pg_hba.conf
22+
/etc/init.d/postgresql start
23+
24+
rm -f /etc/tinyows.xml
25+
make install-demo
26+
cp -f demo/tinyows_no_checkschema.xml /etc/tinyows.xml
27+
make check
28+
29+
# wget https://github.com/MapServer/tinyows/commit/633ca487113d032e261a4a5c8b5f3b7850580f4f.patch
30+
# patch -p1 -R < 633ca487113d032e261a4a5c8b5f3b7850580f4f.patch
31+
32+
# rm -f /etc/tinyows.xml
33+
# make install-test100
34+
35+
# rm -f /etc/tinyows.xml
36+
# make install-test110

.github/workflows/linux.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Linux build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
linux_build:
8+
runs-on: ubuntu-latest
9+
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Build
15+
run: docker run --rm -e WORK_DIR=$PWD -v $PWD:$PWD ubuntu:20.04 $PWD/.github/workflows/linux.sh

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Makefile
2+
configure
3+
demo/install.sh
4+
demo/tinyows.xml
5+
src/ows_define.h
6+
test/wfs_100/config_wfs_100.xml
7+
test/wfs_100/install_wfs_100.sh
8+
test/wfs_110/config_wfs_110.xml
9+
test/wfs_110/install_wfs_110.sh
10+
tinyows

Makefile.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ install-demo:
5858
@demo/install.sh
5959
cp -i demo/tinyows.xml /etc/tinyows.xml
6060

61+
check:
62+
@demo/check.sh
63+
6164
install-test100:
6265
@chmod +x test/wfs_100/install_wfs_100.sh
6366
@test/wfs_100/install_wfs_100.sh

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ All code must meet the following rules :
1717

1818
Code dynamically linked with the following other librairies:
1919
- PostgreSQL 8.x and 9.x
20-
- libxml 2.8.x
20+
- libxml 2.9.x
2121
- flex

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.1.1

autogen.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
#
3+
# Autotools boostrapping script
4+
#
5+
giveup()
6+
{
7+
echo
8+
echo " Something went wrong, giving up!"
9+
echo
10+
exit 1
11+
}
12+
13+
echo "Running autoconf"
14+
autoconf || giveup
15+
16+
echo "======================================"
17+
echo "Now you are ready to run './configure'"
18+
echo "======================================"

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ XML2_VER=`$LIBXML2_CONFIG --version`
2929
AC_MSG_RESULT([checking for libxml2 version... $XML2_VER])
3030

3131
xml2_vers=`$LIBXML2_CONFIG --version | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
32-
if test "$xml2_vers" -lt 2008000 ; then
33-
AC_MSG_ERROR([You need at least libxml 2.8.0])
32+
if test "$xml2_vers" -lt 2009000 ; then
33+
AC_MSG_ERROR([You need at least libxml 2.9.0])
3434
fi
3535

3636

demo/check.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
RET=0
6+
7+
PGUSER=postgres
8+
DB=tinyows_demo
9+
10+
for i in demo/tests/input/*; do
11+
echo "Running $i"
12+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt
13+
if ! diff -u /tmp/output.txt demo/tests/expected/$(basename $i); then
14+
mkdir -p demo/tests/got
15+
mv /tmp/output.txt demo/tests/got/$(basename $i)
16+
echo "Result got put in demo/tests/got/$(basename $i)"
17+
RET=1
18+
fi
19+
done
20+
21+
if test "$RET" -eq "0"; then
22+
echo "Tests OK !"
23+
else
24+
echo "Tests failed !"
25+
exit $RET
26+
fi
27+
28+
i=demo/tests/transactions/input/wfst10_france_insert.xml
29+
echo "Running $i"
30+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
31+
cat /tmp/output.txt | grep SUCCESS || (cat /tmp/output.txt && /bin/false)
32+
echo "select st_astext(geom) from france where id_geofla = -1234;" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2171610 802820,2171611 802820,2171611 802821,2171610 802820)))"
33+
echo "delete from france where id_geofla = -1234" | su $PGUSER -c "psql $DB"
34+
35+
36+
i=demo/tests/transactions/input/wfst10_world_insert.xml
37+
echo "Running $i"
38+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
39+
cat /tmp/output.txt | grep SUCCESS || (cat /tmp/output.txt && /bin/false)
40+
echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))"
41+
echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB"
42+
43+
44+
i=demo/tests/transactions/input/wfst11_france_insert.xml
45+
echo "Running $i"
46+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
47+
cat /tmp/output.txt | grep "<wfs:totalInserted>1</wfs:totalInserted>" || (cat /tmp/output.txt && /bin/false)
48+
echo "select st_astext(geom) from france where id_geofla = -1234;" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2171610 802820,2171611 802820,2171611 802821,2171610 802820)))"
49+
echo "delete from france where id_geofla = -1234" | su $PGUSER -c "psql $DB"
50+
51+
52+
i=demo/tests/transactions/input/wfst11_world_insert.xml
53+
echo "Running $i"
54+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
55+
cat /tmp/output.txt | grep "<wfs:totalInserted>1</wfs:totalInserted>" || (cat /tmp/output.txt && /bin/false)
56+
echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))"
57+
echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB"
58+
59+
60+
i=demo/tests/transactions/input/wfst11_world_insert_srsname_in_wfsinsert.xml
61+
echo "Running $i"
62+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
63+
cat /tmp/output.txt | grep "<wfs:totalInserted>1</wfs:totalInserted>" || (cat /tmp/output.txt && /bin/false)
64+
echo "select st_astext(geom) from world where name = '-1234';" | su $PGUSER -c "psql -t $DB" | grep "MULTIPOLYGON(((2 49,2 50,3 50,2 49)))"
65+
echo "delete from world where name = '-1234'" | su $PGUSER -c "psql $DB"
66+
67+
68+
i=demo/tests/transactions/input/wfst11_geometry_less_insert.xml
69+
echo "Running $i"
70+
QUERY_STRING="$(cat $i)" ./tinyows > /tmp/output.txt || (cat /tmp/output.txt && /bin/false)
71+
cat /tmp/output.txt | grep "<wfs:totalInserted>1</wfs:totalInserted>" || (cat /tmp/output.txt && /bin/false)
72+
echo "select textcol from geometry_less where intcol = -1234;" | su $PGUSER -c "psql -t $DB" | grep "minus 1234"
73+
echo "delete from geometry_less where intcol = -1234" | su $PGUSER -c "psql $DB"

demo/install.sh.in

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,25 @@
33
# don't launch directly this script
44
# use 'make install-demo' to do so
55

6+
set -e
7+
68
PGBIN=@POSTGIS_BIN@
79
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-1.5
810
PGUSER=postgres
911
SHP2PGSQL=@SHP2PGSQL@
1012
DB=tinyows_demo
1113

12-
if [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then
14+
if [ -d @POSTGIS_SHARE@/contrib/postgis-3.0 ]; then
15+
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-3.0
16+
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.5 ]; then
17+
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.5
18+
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.4 ]; then
19+
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.4
20+
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.3 ]; then
21+
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.3
22+
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.2 ]; then
23+
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.2
24+
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.1 ]; then
1325
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.1
1426
elif [ -d @POSTGIS_SHARE@/contrib/postgis-2.0 ]; then
1527
PGSHARE=@POSTGIS_SHARE@/contrib/postgis-2.0
@@ -20,9 +32,11 @@ else
2032
fi
2133

2234
echo "Create Spatial Database: $DB"
23-
su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null"
35+
su $PGUSER -c "$PGBIN/dropdb $DB > /dev/null 2> /dev/null || /bin/true"
2436
su $PGUSER -c "$PGBIN/createdb $DB"
25-
su $PGUSER -c "$PGBIN/createlang plpgsql $DB"
37+
if test -f "$PGBIN/createlang"; then
38+
su $PGUSER -c "$PGBIN/createlang plpgsql $DB"
39+
fi
2640
su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/postgis.sql"
2741
su $PGUSER -c "$PGBIN/psql $DB < $PGSHARE/spatial_ref_sys.sql"
2842

@@ -34,4 +48,9 @@ echo "Import layer data: france_dept"
3448
$SHP2PGSQL -s 27582 -I -W latin1 demo/france.shp france > _france.sql
3549
su $PGUSER -c "$PGBIN/psql $DB < _france.sql"
3650

37-
rm _world.sql _france.sql
51+
echo "Import non spatial layer"
52+
echo "CREATE TABLE geometry_less(id SERIAL PRIMARY KEY, intcol INTEGER, textcol TEXT);" > _geometry_less.sql
53+
echo "INSERT INTO geometry_less (intcol, textcol) VALUES (123, 'foo');" >> _geometry_less.sql
54+
su $PGUSER -c "$PGBIN/psql $DB < _geometry_less.sql"
55+
56+
rm _world.sql _france.sql _geometry_less.sql

0 commit comments

Comments
 (0)