Update to 7.6.1

This commit is contained in:
Sandro Mani 2020-11-13 19:15:41 +01:00
parent 30e7e1a53d
commit 68bcedcbd0
4 changed files with 7 additions and 210 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@
/mapserver-7fe9b2b9f74796731cba2f7f09c8f41875f020e4.tar.gz
/mapserver-7.4.3.tar.gz
/MapServer-7.4.3.tar.gz
/MapServer-7.6.1.tar.gz

View File

@ -1,204 +0,0 @@
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/csharp/swig_csharp_extensions.i mapserver-rel-7-4-3-new/mapscript/csharp/swig_csharp_extensions.i
--- mapserver-rel-7-4-3/mapscript/csharp/swig_csharp_extensions.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/csharp/swig_csharp_extensions.i 2020-03-03 18:55:31.278654827 +0100
@@ -224,17 +224,20 @@
}
%}
+#if SWIG_VERSION < 0x040000
%typemap(csfinalize) SWIGTYPE %{
/* %typemap(csfinalize) SWIGTYPE */
~$csclassname() {
Dispose();
}
%}
+#endif
%typemap(csconstruct, excode=SWIGEXCODE) SWIGTYPE %{: this($imcall, true, null) {$excode
}
%}
+#if SWIG_VERSION < 0x040000
%typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE {
lock(this) {
if(swigCPtr.Handle != System.IntPtr.Zero && swigCMemOwn) {
@@ -246,6 +249,7 @@
System.GC.SuppressFinalize(this);
}
}
+#endif
%typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
lock(this) {
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/pyextend.i mapserver-rel-7-4-3-new/mapscript/python/pyextend.i
--- mapserver-rel-7-4-3/mapscript/python/pyextend.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/pyextend.i 2020-03-03 18:55:31.277654829 +0100
@@ -13,6 +13,7 @@
*
*****************************************************************************/
+
/* fromstring: Factory for mapfile objects */
%pythoncode %{
@@ -222,15 +223,13 @@ def fromstring(data, mappath=None):
}
}
- def getItemDefinitions(self):
- return self._item_definitions
+ @property
+ def itemdefinitions(self):
+ return self._item_definitions
- def setItemDefinitions(self, item_definitions):
+ @itemdefinitions.setter
+ def itemdefinitions(self, item_definitions):
self._item_definitions = item_definitions
-
- __swig_getmethods__["itemdefinitions"] = getItemDefinitions
- __swig_setmethods__["itemdefinitions"] = setItemDefinitions
-
%}
}
@@ -426,25 +425,14 @@ def fromstring(data, mappath=None):
memcpy( *argout, self->pattern, sizeof(double) * *pnListSize);
}
- void patternlength_set2(int patternlength)
- {
- msSetError(MS_MISCERR, "pattern is read-only", "patternlength_set()");
- }
%pythoncode %{
- __swig_setmethods__["patternlength"] = _mapscript.styleObj_patternlength_set2
- __swig_getmethods__["patternlength"] = _mapscript.styleObj_patternlength_get
- if _newclass:patternlength = _swig_property(_mapscript.styleObj_patternlength_get, _mapscript.styleObj_patternlength_set2)
-
- __swig_setmethods__["pattern"] = _mapscript.styleObj_pattern_set
- __swig_getmethods__["pattern"] = _mapscript.styleObj_pattern_get
- if _newclass:pattern = _swig_property(_mapscript.styleObj_pattern_get, _mapscript.styleObj_pattern_set)
-%}
+pattern = property(pattern_get, pattern_set)
+%}
}
-
/******************************************************************************
* Extensions to hashTableObj - add dict methods
*****************************************************************************/
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/pymodule.i mapserver-rel-7-4-3-new/mapscript/python/pymodule.i
--- mapserver-rel-7-4-3/mapscript/python/pymodule.i 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/pymodule.i 2020-03-03 18:55:31.277654829 +0100
@@ -17,7 +17,7 @@
*****************************************************************************/
/* Translates Python None to C NULL for strings */
-%typemap(in,parse="z") char * "";
+//%typemap(in,parse="z") char * "";
/* To support imageObj::getBytes */
%typemap(out) gdBuffer {
@@ -210,33 +210,15 @@ MapServerError = _mapscript.MapServerErr
MapServerChildError = _mapscript.MapServerChildError
%}
-/* The bogus "if 1:" is to introduce a new scope to work around indentation
- handling with pythonappend in different versions. (#3180) */
-%feature("pythonappend") layerObj %{if 1:
- self.p_map=None
- try:
- # python 2.5
- if args and len(args)!=0:
- self.p_map=args[0]
- except NameError:
- # python 2.6
- if map:
- self.p_map=map
- %}
-
-/* The bogus "if 1:" is to introduce a new scope to work around indentation
- handling with pythonappend in different versions. (#3180) */
-%feature("pythonappend") classObj %{if 1:
- self.p_layer =None
- try:
- # python 2.5
- if args and len(args)!=0:
- self.p_layer=args[0]
- except NameError:
- # python 2.6
- if layer:
- self.p_layer=layer
- %}
+%feature("pythonappend") layerObj %{
+ self.p_map = None
+ if map:
+ self.p_map = map%}
+
+%feature("pythonappend") classObj %{
+ self.p_layer = None
+ if layer:
+ self.p_layer = layer%}
%feature("shadow") insertClass %{
def insertClass(*args):
diff -rupN --no-dereference mapserver-rel-7-4-3/mapscript/python/tests/cases/style_test.py mapserver-rel-7-4-3-new/mapscript/python/tests/cases/style_test.py
--- mapserver-rel-7-4-3/mapscript/python/tests/cases/style_test.py 2019-12-16 18:59:03.000000000 +0100
+++ mapserver-rel-7-4-3-new/mapscript/python/tests/cases/style_test.py 2020-03-03 18:55:31.278654827 +0100
@@ -175,6 +175,53 @@ class NewStylesTestCase(MapTestCase):
self.assertRaises(mapscript.MapServerChildError,
class0.insertStyle, None)
+ def testPattern(self):
+ """See https://github.com/mapserver/mapserver/issues/4943"""
+
+ si = mapscript.styleObj()
+ assert si.pattern == ()
+ assert si.patternlength == 0
+
+ def testPattern2(self):
+
+ si = mapscript.styleObj()
+ si.pattern = [2.0, 3, 4]
+ assert si.pattern == (2.0, 3.0, 4.0)
+ assert si.patternlength == 3
+
+ def testPattern3(self):
+ """a pattern must have at least 2 elements"""
+
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.pattern = [1.0]
+ except Exception:
+ exception = True
+ assert exception is True
+
+ def testPattern4(self):
+ """a pattern can have a max of 10 elements
+ This is set in mapsymbol.h with #define MS_MAXPATTERNLENGTH 10"""
+
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.pattern = [i for i in range(11)]
+ except Exception:
+ exception = True
+ assert exception is True
+
+ def testPattern5(self):
+ """pattern length is read-only"""
+ si = mapscript.styleObj()
+ exception = None
+ try:
+ si.patternlength = 0
+ except Exception:
+ exception = True
+ assert exception is True
+
class BrushCachingTestCase(MapTestCase):

View File

@ -10,8 +10,8 @@
Name: mapserver
Version: 7.4.3
Release: 11%{?dist}
Version: 7.6.1
Release: 1%{?dist}
Summary: Environment for building spatially-enabled internet applications
%global dashver %(echo %version | sed 's|\\.|-|g')
@ -19,9 +19,6 @@ License: BSD
URL: http://www.mapserver.org
Source0: https://github.com/%{project_owner}/%{project_name}/archive/rel-%{dashver}/%{project_name}-%{version}.tar.gz
# Fix build with swig-4.0.1
# https://github.com/mapserver/mapserver/pull/5983
Patch0: mapserver-swig-4.0.1.patch
Requires: httpd
Requires: dejavu-sans-fonts
@ -303,6 +300,9 @@ fi
%changelog
* Fri Nov 13 2020 Sandro Mani <manisandro@gmail.com> - 7.6.1-1
- Update to 7.6.1
* Wed Nov 11 12:47:11 CET 2020 Sandro Mani <manisandro@gmail.com> - 7.4.3-11
- Rebuild (proj, gdal)

View File

@ -1 +1 @@
SHA512 (MapServer-7.4.3.tar.gz) = a7b638cc58682adfb46f7af2306784b826e80bc4b2e1e998c93a429ff12ec7a04b44533dd648fa5fd6ecae6f131159eeaf6b4ea79fef175db77ea911a92ce0b7
SHA512 (MapServer-7.6.1.tar.gz) = 3c7df168e50ff929468e4f2b49647673e8de7c332ed35975f3b4b26d0a9727c3ce67b69c34ca2aef977ecaaca9dc5306a6a351c7f60619ed044885908914b2bd