From 795d811cd5fb9a7f392caaab2e1aaac30bf965f6 Mon Sep 17 00:00:00 2001 From: Paul F. Johnson Date: Oct 02 2008 23:53:05 +0000 Subject: Bump to RC4 Added backported patches for binaryserialization, datatable and stringreplace --- diff --git a/import.log b/import.log index 579057a..a84157a 100644 --- a/import.log +++ b/import.log @@ -4,3 +4,4 @@ mono-2_0-5_fc10:HEAD:mono-2.0-5.fc10.src.rpm:1220047677 mono-2_0-6_fc10:HEAD:mono-2.0-6.fc10.src.rpm:1221073246 mono-2_0-7_fc10:HEAD:mono-2.0-7.fc10.src.rpm:1221685120 mono-2_0-8_fc10:HEAD:mono-2.0-8.fc10.src.rpm:1221814700 +mono-2_0-10_fc10:HEAD:mono-2.0-10.fc10.src.rpm:1222991530 diff --git a/mono-2.0-BinarySerialization.patch b/mono-2.0-BinarySerialization.patch new file mode 100644 index 0000000..60130ec --- /dev/null +++ b/mono-2.0-BinarySerialization.patch @@ -0,0 +1,62 @@ +--- trunk/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs 2008/09/16 12:52:47 113147 ++++ trunk/mcs/class/System.Data/Test/System.Data/BinarySerializationTest.cs 2008/09/16 12:53:08 113148 +@@ -172,6 +172,59 @@ + dt.Rows[0].RejectChanges(); + dt.Rows[1].RejectChanges(); + } ++ ++ [Test] ++ public void TestDefaultValues () ++ { ++ //Serialize Table ++ DataTable tb1 = new DataTable (); ++ tb1.Columns.Add ("id", typeof (int)); ++ tb1.Columns.Add ("Date", typeof (string)); ++ tb1.Columns["id"].DefaultValue = 10; ++ tb1.Columns["Date"].DefaultValue = "9/15/2008"; ++ tb1.Rows.Add (tb1.NewRow()); ++ ++ MemoryStream ms = new MemoryStream (); ++ BinaryFormatter bf = new BinaryFormatter (); ++ tb1.RemotingFormat = SerializationFormat.Binary; ++ bf.Serialize (ms,tb1); ++ byte [] serializedStream = ms.ToArray (); ++ ms.Close (); ++ //DserializeTable ++ ms = new MemoryStream (serializedStream); ++ DataTable dt = (DataTable)bf.Deserialize (ms); ++ ms.Close (); ++ ++ //Table Data ++ for (int i = 0; i < tb1.Rows.Count; i++) ++ for (int j = 0; j < tb1.Columns.Count; j++) { ++ Assert.AreEqual (tb1.Columns[j].DefaultValue, dt.Rows [i][j], "#1 Element differs from DefaultValue at Row :{0} Column :{1}", i, j); ++ Assert.AreEqual (tb1.Rows [i][j], dt.Rows [i][j], "#2 Elements differ at Row :{0} Column :{1}", i, j); ++ } ++ } ++ ++ [Test] ++ public void TestEmptyTable () ++ { ++ //Serialize Table ++ DataTable tb1 = new DataTable (); ++ tb1.Columns.Add ("id", typeof (int)); ++ tb1.Columns.Add ("Date", typeof (string)); ++ ++ MemoryStream ms = new MemoryStream (); ++ BinaryFormatter bf = new BinaryFormatter (); ++ tb1.RemotingFormat = SerializationFormat.Binary; ++ bf.Serialize (ms,tb1); ++ byte [] serializedStream = ms.ToArray (); ++ ms.Close (); ++ //DserializeTable ++ ms = new MemoryStream (serializedStream); ++ DataTable dt = (DataTable)bf.Deserialize (ms); ++ ms.Close (); ++ ++ Assert.AreEqual(tb1.Rows.Count, dt.Rows.Count); ++ } ++ + [Test] + public void Test_With_Null_Values1 () + { diff --git a/mono-2.0-DataTable.patch b/mono-2.0-DataTable.patch new file mode 100644 index 0000000..d54ef5b --- /dev/null +++ b/mono-2.0-DataTable.patch @@ -0,0 +1,40 @@ +--- trunk/mcs/class/System.Data/System.Data/DataTable.cs 2008/09/16 12:52:47 113147 ++++ trunk/mcs/class/System.Data/System.Data/DataTable.cs 2008/09/16 12:53:08 113148 +@@ -2497,6 +2497,8 @@ + internal void DeserializeRecords (ArrayList arrayList, ArrayList nullBits, BitArray rowStateBitArray) + { + BitArray nullBit = null; ++ if (arrayList == null || arrayList.Count < 1) ++ return; + int len = ((Array) arrayList [0]).Length; + object [] tmpArray = new object [arrayList.Count]; + int k = 0; +@@ -2566,8 +2568,8 @@ + Columns[i].Prefix = info.GetString (prefix + "Prefix"); + Columns[i].DataType = (Type) info.GetValue (prefix + "DataType", + typeof (Type)); +- Columns[i].DefaultValue = (DBNull) info.GetValue (prefix + "DefaultValue", +- typeof (DBNull)); ++ Columns[i].DefaultValue = info.GetValue (prefix + "DefaultValue", ++ typeof (Object)); + Columns[i].AllowDBNull = info.GetBoolean (prefix + "AllowDBNull"); + Columns[i].AutoIncrement = info.GetBoolean (prefix + "AutoIncrement"); + Columns[i].AutoIncrementStep = info.GetInt64 (prefix + "AutoIncrementStep"); +@@ -2752,6 +2754,8 @@ + } + SerializeConstraints (info, prefix + "Constraints"); + for (int j = 0; j < columnsCount; j++) { ++ if (rowsCount == 0) ++ continue; + BitArray nullBits = new BitArray (rowsCount); + Array recordArray = Array.CreateInstance (Rows[0][j].GetType (), recordsCount); + DataColumn column = Columns [j]; +@@ -2775,7 +2779,7 @@ + version = DataRowVersion.Default; + } + if (dr.IsNull (column, version) == false) { +- nullBits [l] = false; ++ nullBits [l] = false; + recordArray.SetValue (dr [j, version], l); + } else { + nullBits [l] = true; diff --git a/mono-2.0-StringReplace.patch b/mono-2.0-StringReplace.patch new file mode 100644 index 0000000..d55081f --- /dev/null +++ b/mono-2.0-StringReplace.patch @@ -0,0 +1,44 @@ +Index: corlib/System/String.cs +=================================================================== +--- mono-2.0/mcs/class/corlib/System/String.cs (revision 112532) ++++ mono-2.0/mcs/class/corlib/System/String.cs (working copy) +@@ -1689,6 +1689,8 @@ + } + i = found + oldValue.length; + } ++ if (count == 0) ++ return this; + int nlen = this.length + ((newValue.length - oldValue.length) * count); + String tmp = InternalAllocateStr (nlen); + +Index: corlib/System.Text/StringBuilder.cs +=================================================================== +--- mono-2.0/mcs/class/corlib/System.Text/StringBuilder.cs (revision 112532) ++++ mono-2.0/mcs/class/corlib/System.Text/StringBuilder.cs (working copy) +@@ -309,15 +309,22 @@ + if (oldValue.Length == 0) + throw new ArgumentException ("The old value cannot be zero length."); + +- // TODO: OPTIMIZE! +- string replace = _str.Substring(startIndex, count).Replace(oldValue, newValue); ++ string substr = _str.Substring(startIndex, count); ++ string replace = substr.Replace(oldValue, newValue); ++ // return early if no oldValue was found ++ if ((object) replace == (object) substr) ++ return this; + + InternalEnsureCapacity (replace.Length + (_length - count)); + +- string end = _str.Substring (startIndex + count, _length - startIndex - count ); ++ // shift end part ++ if (replace.Length < count) ++ String.CharCopy (_str, startIndex + replace.Length, _str, startIndex + count, _length - startIndex - count); ++ else if (replace.Length > count) ++ String.CharCopyReverse (_str, startIndex + replace.Length, _str, startIndex + count, _length - startIndex - count); + ++ // copy middle part back into _str + String.CharCopy (_str, startIndex, replace, 0, replace.Length); +- String.CharCopy (_str, startIndex + replace.Length, end, 0, end.Length); + + _length = replace.Length + (_length - count); + diff --git a/mono.spec b/mono.spec index 551d032..1ae267c 100644 --- a/mono.spec +++ b/mono.spec @@ -1,6 +1,6 @@ Name: mono Version: 2.0 -Release: 8%{?dist} +Release: 10%{?dist} Summary: A .NET runtime environment Group: Development/Languages @@ -46,6 +46,9 @@ Patch9:mono-2.0-monoservice.patch Patch10: mono-2.0-metadata-makefile.patch Patch11: mono-2.0-tablelayout.patch Patch12: mono-2.0-mimeicon.patch +Patch13: mono-2.0-BinarySerialization.patch +Patch14: mono-2.0-DataTable.patch +Patch15: mono-2.0-StringReplace.patch %description The Mono runtime implements a JIT engine for the ECMA CLI @@ -263,6 +266,9 @@ sed -i -e 's!%{_libdir}!@@LIBDIR@@!' %{PATCH8} %patch10 -p1 -b .metadata %patch11 -p1 -b .tablelayout %patch12 -p1 -b .mimeicon +%patch13 -p1 -b .serialisation +%patch14 -p1 -b .datatable +%patch15 -p1 -b .stringreplace autoreconf -f -i -s # Add undeclared Arg @@ -617,6 +623,14 @@ install monodir $RPM_BUILD_ROOT%{_bindir} %gac_dll IBM.Data.DB2 %changelog +* Fri Oct 03 2008 Paul F. Johnson 2.0-10 +- bump to RC4 + +* Sun Sep 28 2008 Paul F. Johnson 2.0-9 +- backported binaryserialisation and datatable patches +- backported stringreplace optimisation +- bump to RC3 + * Thu Sep 18 2008 Paul F. Johnson 2.0-8 - MimeIcon patch added diff --git a/sources b/sources index afdbf9d..10204b8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bdca04300dd35ca3916614d3bff40e3e mono-2.0.tar.bz2 +d8fb1b2bab0066b82289b8a5856b9705 mono-2.0.tar.bz2