Imported Upstream version 5.20.1.12

Former-commit-id: a44e4f5d88f923f0c98bbc6104e8bf0f469c3ba3
This commit is contained in:
Xamarin Public Jenkins (auto-signing) 2019-04-04 08:25:22 +00:00
parent 6220b8eaaf
commit 397341fa61
48 changed files with 121 additions and 63 deletions

View File

@ -1 +1 @@
f37b55c4ca930ee190d14880bf8f52cb79b7363a
0a03c7f32bc7b65313fc17968337ec1275503bfd

View File

@ -1 +1 @@
0188040eff1202644780cfe32c361c58b7e4a9db
b0ebf6705b6f8103de8063eb5c429b681ee4c050

View File

@ -143,7 +143,8 @@ class DarwinProfile (UnixProfile):
elif arch == 'darwin-64':
package.local_ld_flags = ['-arch x86_64 -m64']
package.local_gcc_flags = ['-arch x86_64 -m64']
package.local_configure_flags = ['--disable-dependency-tracking']
package.local_configure_flags = [
'--build=x86_64-apple-darwin13.0.0', '--disable-dependency-tracking']
else:
error('Unknown arch %s' % arch)

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "5.20.1.10";
public const string MonoVersion = "5.20.1.12";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -769,7 +769,7 @@ namespace System
return GetUtcOffset (dateTimeOffset.UtcDateTime, out isDST);
}
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST)
private TimeSpan GetUtcOffset (DateTime dateTime, out bool isDST, bool forOffset = false)
{
isDST = false;
@ -781,7 +781,7 @@ namespace System
tz = TimeZoneInfo.Local;
bool isTzDst;
var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst);
var tzOffset = GetUtcOffsetHelper (dateTime, tz, out isTzDst, forOffset);
if (tz == this) {
isDST = isTzDst;
@ -792,11 +792,11 @@ namespace System
if (!TryAddTicks (dateTime, -tzOffset.Ticks, out utcDateTime, DateTimeKind.Utc))
return BaseUtcOffset;
return GetUtcOffsetHelper (utcDateTime, this, out isDST);
return GetUtcOffsetHelper (utcDateTime, this, out isDST, forOffset);
}
// This is an helper method used by the method above, do not use this on its own.
private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST)
private static TimeSpan GetUtcOffsetHelper (DateTime dateTime, TimeZoneInfo tz, out bool isDST, bool forOffset = false)
{
if (dateTime.Kind == DateTimeKind.Local && tz != TimeZoneInfo.Local)
throw new Exception ();
@ -807,7 +807,7 @@ namespace System
return TimeSpan.Zero;
TimeSpan offset;
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST))
if (tz.TryGetTransitionOffset(dateTime, out offset, out isDST, forOffset))
return offset;
if (dateTime.Kind == DateTimeKind.Utc) {
@ -834,10 +834,12 @@ namespace System
if (tzRule != null && tz.IsInDST (tzRule, dateTime)) {
// Replicate what .NET does when given a time which falls into the hour which is lost when
// DST starts. isDST should always be true but the offset should be BaseUtcOffset without the
// DST starts. isDST should be false and the offset should be BaseUtcOffset without the
// DST delta while in that hour.
isDST = true;
if (forOffset)
isDST = true;
if (tz.IsInDST (tzRule, dstUtcDateTime)) {
isDST = true;
return tz.BaseUtcOffset + tzRule.DaylightDelta;
} else {
return tz.BaseUtcOffset;
@ -946,7 +948,21 @@ namespace System
public bool IsDaylightSavingTime (DateTimeOffset dateTimeOffset)
{
return IsDaylightSavingTime (dateTimeOffset.DateTime);
var dateTime = dateTimeOffset.DateTime;
if (dateTime.Kind == DateTimeKind.Local && IsInvalidTime (dateTime))
throw new ArgumentException ("dateTime is invalid and Kind is Local");
if (this == TimeZoneInfo.Utc)
return false;
if (!SupportsDaylightSavingTime)
return false;
bool isDst;
GetUtcOffset (dateTime, out isDst, true);
return isDst;
}
internal DaylightTime GetDaylightChanges (int year)
@ -1183,7 +1199,7 @@ namespace System
return null;
}
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset,out bool isDst)
private bool TryGetTransitionOffset (DateTime dateTime, out TimeSpan offset, out bool isDst, bool forOffset = false)
{
offset = BaseUtcOffset;
isDst = false;
@ -1204,13 +1220,22 @@ namespace System
return false;
}
AdjustmentRule current = GetApplicableRule(date);
AdjustmentRule current = GetApplicableRule (date);
if (current != null) {
DateTime tStart = TransitionPoint(current.DaylightTransitionStart, date.Year);
DateTime tEnd = TransitionPoint(current.DaylightTransitionEnd, date.Year);
DateTime tStart = TransitionPoint (current.DaylightTransitionStart, date.Year);
DateTime tEnd = TransitionPoint (current.DaylightTransitionEnd, date.Year);
TryAddTicks (tStart, -BaseUtcOffset.Ticks, out tStart, DateTimeKind.Utc);
TryAddTicks (tEnd, -BaseUtcOffset.Ticks, out tEnd, DateTimeKind.Utc);
if ((date >= tStart) && (date <= tEnd)) {
offset = baseUtcOffset + current.DaylightDelta;
isDst = true;
if (forOffset)
isDst = true;
offset = baseUtcOffset;
if (date >= new DateTime (tStart.Ticks + current.DaylightDelta.Ticks, DateTimeKind.Utc))
{
offset += current.DaylightDelta;
isDst = true;
}
return true;
}
}

View File

@ -55,6 +55,8 @@ namespace MonoTests.System
return "GTB Standard Time";
case "US/Eastern":
return "Eastern Standard Time";
case "US/Central":
return "Central Standard Time";
case "US/Pacific":
return "Pacific Standard Time";
case "Australia/Sydney":
@ -385,23 +387,28 @@ namespace MonoTests.System
[Test]
public void TestAthensDST_InDSTDelta ()
{
// In .NET GetUtcOffset() returns the BaseUtcOffset for times within the hour
// lost when DST starts but IsDaylightSavingTime() returns true.
// In .NET/.Net Core GetUtcOffset() returns the BaseUtcOffset for times within the hour
// lost when DST starts and IsDaylightSavingTime() returns false for datetime and true for datetimeoffset
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("Europe/Athens"));
var date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
var date = new DateTime (2014, 3, 30 , 2, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 1, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 59, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
@ -429,17 +436,17 @@ namespace MonoTests.System
try {
var date = new DateTime (2014, 3, 30 , 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 1, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
date = new DateTime (2014, 3, 30 , 3, 59, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (2, 0, 0), tzi.GetUtcOffset (date));
Assert.IsTrue (tzi.IsDaylightSavingTime (new DateTimeOffset (date, tzi.GetUtcOffset (date))));
@ -467,6 +474,31 @@ namespace MonoTests.System
dateOffset = new DateTimeOffset (date, offset);
Assert.IsTrue (tzi.IsDaylightSavingTime (dateOffset));
}
// https://github.com/mono/mono/issues/9664
[Test]
public void Bug_9664 ()
{
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
var date = new DateTime (2019, 3, 9, 21, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 0, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 2, 30, 0);
Assert.IsFalse (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-6, 0, 0), tzi.GetUtcOffset (date));
tzi = TimeZoneInfo.FindSystemTimeZoneById (MapTimeZoneId ("US/Central"));
date = new DateTime (2019, 3, 10, 3, 0, 0);
Assert.IsTrue (tzi.IsDaylightSavingTime (date));
Assert.AreEqual (new TimeSpan (-5, 0, 0), tzi.GetUtcOffset (date));
}
}
[TestFixture]

View File

@ -1 +1 @@
c9bf2123d80bd46832de5936b38ef86882ab8ecb
3711e39b6d13c94f3b9cc285b2d3c0e2bd37ff1e

View File

@ -1 +1 @@
7669a591142de2a90f52d7b41fc5246c2901fc26
650c50111fe3755feef49c2ec78c2e74447e2ff3

View File

@ -1 +1 @@
f157e1a2f6a818ae5fe8491518c5a5ed4a160077
c067c825b0f2163660b695da9f588058056717f2

View File

@ -1 +1 @@
04743679835ed1ab8097e92fa6ed97778a6faf0f
70b00f1b73773eb56d9001c8d753e2eb49556f75

View File

@ -1 +1 @@
ba9f0cffe575150a23191bd5dde891cfc84394f2
4b461f4ce5df86d225abb084e56e6321b4a342d3

View File

@ -1 +1 @@
1a72aad9306481b2a8ede5628e85020be2ad8ac1
e8bb0f5d8e23280b2b9fc9151d4e0cc991d9e986

View File

@ -1 +1 @@
6dc1c687a93079069a0b0dad6791883ec779e842
27235349020b8dabfd41b50228d83ca35ad2f23b

View File

@ -1 +1 @@
c9bf2123d80bd46832de5936b38ef86882ab8ecb
3711e39b6d13c94f3b9cc285b2d3c0e2bd37ff1e

View File

@ -1 +1 @@
7669a591142de2a90f52d7b41fc5246c2901fc26
650c50111fe3755feef49c2ec78c2e74447e2ff3

View File

@ -1 +1 @@
f157e1a2f6a818ae5fe8491518c5a5ed4a160077
c067c825b0f2163660b695da9f588058056717f2

View File

@ -1 +1 @@
04743679835ed1ab8097e92fa6ed97778a6faf0f
70b00f1b73773eb56d9001c8d753e2eb49556f75

View File

@ -1 +1 @@
ba9f0cffe575150a23191bd5dde891cfc84394f2
4b461f4ce5df86d225abb084e56e6321b4a342d3

View File

@ -1 +1 @@
1a72aad9306481b2a8ede5628e85020be2ad8ac1
e8bb0f5d8e23280b2b9fc9151d4e0cc991d9e986

View File

@ -1 +1 @@
6dc1c687a93079069a0b0dad6791883ec779e842
27235349020b8dabfd41b50228d83ca35ad2f23b

View File

@ -1 +1 @@
c9bf2123d80bd46832de5936b38ef86882ab8ecb
3711e39b6d13c94f3b9cc285b2d3c0e2bd37ff1e

View File

@ -1 +1 @@
7669a591142de2a90f52d7b41fc5246c2901fc26
650c50111fe3755feef49c2ec78c2e74447e2ff3

View File

@ -1 +1 @@
f157e1a2f6a818ae5fe8491518c5a5ed4a160077
c067c825b0f2163660b695da9f588058056717f2

View File

@ -1 +1 @@
04743679835ed1ab8097e92fa6ed97778a6faf0f
70b00f1b73773eb56d9001c8d753e2eb49556f75

View File

@ -1 +1 @@
ba9f0cffe575150a23191bd5dde891cfc84394f2
4b461f4ce5df86d225abb084e56e6321b4a342d3

View File

@ -1 +1 @@
1a72aad9306481b2a8ede5628e85020be2ad8ac1
e8bb0f5d8e23280b2b9fc9151d4e0cc991d9e986

View File

@ -1 +1 @@
6dc1c687a93079069a0b0dad6791883ec779e842
27235349020b8dabfd41b50228d83ca35ad2f23b

View File

@ -1 +1 @@
c9bf2123d80bd46832de5936b38ef86882ab8ecb
3711e39b6d13c94f3b9cc285b2d3c0e2bd37ff1e

View File

@ -1 +1 @@
7669a591142de2a90f52d7b41fc5246c2901fc26
650c50111fe3755feef49c2ec78c2e74447e2ff3

View File

@ -1 +1 @@
f157e1a2f6a818ae5fe8491518c5a5ed4a160077
c067c825b0f2163660b695da9f588058056717f2

View File

@ -1 +1 @@
04743679835ed1ab8097e92fa6ed97778a6faf0f
70b00f1b73773eb56d9001c8d753e2eb49556f75

View File

@ -1 +1 @@
ba9f0cffe575150a23191bd5dde891cfc84394f2
4b461f4ce5df86d225abb084e56e6321b4a342d3

View File

@ -1 +1 @@
1a72aad9306481b2a8ede5628e85020be2ad8ac1
e8bb0f5d8e23280b2b9fc9151d4e0cc991d9e986

View File

@ -1 +1 @@
6dc1c687a93079069a0b0dad6791883ec779e842
27235349020b8dabfd41b50228d83ca35ad2f23b

View File

@ -1 +1 @@
#define FULL_VERSION "explicit/15d050a"
#define FULL_VERSION "explicit/9144241"

Binary file not shown.

View File

@ -1 +1 @@
9aab9015e0e282ff92e750ac0080a53e26832fe2
dfff17965f4e70dde6d8e097aae7002acd6fea03

Binary file not shown.

View File

@ -1 +1 @@
325a2a8910f2958305a3c9f7a81663a33738c0f1
b5e47f3ec2f95ae40ec8637b3a77553280a8d11d

Binary file not shown.

View File

@ -1 +1 @@
cc66c14b78ec2d82b07eaae6258fac0cd4312097
27ddfd616e8cec246f2b5ca8bbfafe92355d891d

View File

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mono 5.20.1.10\n"
"Project-Id-Version: mono 5.20.1.12\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2019-04-02 08:08+0000\n"
"POT-Creation-Date: 2019-04-04 08:07+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
5b95307c574aa27fe51483c58794723309171382
320b2261c661e8db03ea25644f06dc866da966df