[arch-commits] Commit in go/repos (6 files)

Bartłomiej Piotrowski bpiotrowski at archlinux.org
Wed Mar 15 13:33:23 UTC 2017


    Date: Wednesday, March 15, 2017 @ 13:33:23
  Author: bpiotrowski
Revision: 290874

archrelease: copy trunk to testing-i686, testing-x86_64

Added:
  go/repos/testing-i686/
  go/repos/testing-i686/0001-time-make-the-ParseInLocation-test-more-robust.patch
    (from rev 290873, go/trunk/0001-time-make-the-ParseInLocation-test-more-robust.patch)
  go/repos/testing-i686/PKGBUILD
    (from rev 290873, go/trunk/PKGBUILD)
  go/repos/testing-x86_64/
  go/repos/testing-x86_64/0001-time-make-the-ParseInLocation-test-more-robust.patch
    (from rev 290873, go/trunk/0001-time-make-the-ParseInLocation-test-more-robust.patch)
  go/repos/testing-x86_64/PKGBUILD
    (from rev 290873, go/trunk/PKGBUILD)

--------------------------------------------------------------------------+
 testing-i686/0001-time-make-the-ParseInLocation-test-more-robust.patch   |   93 ++++++++++
 testing-i686/PKGBUILD                                                    |   77 ++++++++
 testing-x86_64/0001-time-make-the-ParseInLocation-test-more-robust.patch |   93 ++++++++++
 testing-x86_64/PKGBUILD                                                  |   77 ++++++++
 4 files changed, 340 insertions(+)

Copied: go/repos/testing-i686/0001-time-make-the-ParseInLocation-test-more-robust.patch (from rev 290873, go/trunk/0001-time-make-the-ParseInLocation-test-more-robust.patch)
===================================================================
--- testing-i686/0001-time-make-the-ParseInLocation-test-more-robust.patch	                        (rev 0)
+++ testing-i686/0001-time-make-the-ParseInLocation-test-more-robust.patch	2017-03-15 13:33:23 UTC (rev 290874)
@@ -0,0 +1,93 @@
+From 91563ced5897faf729a34be7081568efcfedda31 Mon Sep 17 00:00:00 2001
+From: Alberto Donizetti <alb.donizetti at gmail.com>
+Date: Thu, 9 Mar 2017 13:20:54 +0100
+Subject: [PATCH] time: make the ParseInLocation test more robust
+
+The tzdata 2017a update (2017-02-28) changed the abbreviation of the
+Asia/Baghdad time zone (used in TestParseInLocation) from 'AST' to the
+numeric '+03'.
+
+Update the test so that it skips the checks if we're using a recent
+tzdata release.
+
+Fixes #19457
+
+Change-Id: I45d705a5520743a611bdd194dc8f8d618679980c
+Reviewed-on: https://go-review.googlesource.com/37964
+Reviewed-by: Ian Lance Taylor <iant at golang.org>
+Run-TryBot: Ian Lance Taylor <iant at golang.org>
+TryBot-Result: Gobot Gobot <gobot at golang.org>
+---
+ src/time/format_test.go | 41 +++++++++++++++++++++++++++++++----------
+ 1 file changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/src/time/format_test.go b/src/time/format_test.go
+index 219c2ca..d0013bc 100644
+--- a/src/time/format_test.go
++++ b/src/time/format_test.go
+@@ -245,27 +245,45 @@ func TestParseDayOutOfRange(t *testing.T) {
+ 	}
+ }
+ 
++// TestParseInLocation checks that the Parse and ParseInLocation
++// functions do not get confused by the fact that AST (Arabia Standard
++// Time) and AST (Atlantic Standard Time) are different time zones,
++// even though they have the same abbreviation.
++//
++// ICANN has been slowly phasing out invented abbreviation in favor of
++// numeric time zones (for example, the Asia/Baghdad time zone
++// abbreviation got changed from AST to +03 in the 2017a tzdata
++// release); but we still want to make sure that the time package does
++// not get confused on systems with slightly older tzdata packages.
+ func TestParseInLocation(t *testing.T) {
+-	// Check that Parse (and ParseInLocation) understand that
+-	// Feb 01 AST (Arabia Standard Time) and Feb 01 AST (Atlantic Standard Time)
+-	// are in different time zones even though both are called AST
+ 
+ 	baghdad, err := LoadLocation("Asia/Baghdad")
+ 	if err != nil {
+ 		t.Fatal(err)
+ 	}
+ 
+-	t1, err := ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad)
++	var t1, t2 Time
++
++	t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad)
+ 	if err != nil {
+ 		t.Fatal(err)
+ 	}
+-	t2 := Date(2013, February, 1, 00, 00, 00, 0, baghdad)
+-	if t1 != t2 {
+-		t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2)
+-	}
++
+ 	_, offset := t1.Zone()
+-	if offset != 3*60*60 {
+-		t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60)
++
++	// A zero offset means that ParseInLocation did not recognize the
++	// 'AST' abbreviation as matching the current location (Baghdad,
++	// where we'd expect a +03 hrs offset); likely because we're using
++	// a recent tzdata release (2017a or newer).
++	// If it happens, skip the Baghdad test.
++	if offset != 0 {
++		t2 = Date(2013, February, 1, 00, 00, 00, 0, baghdad)
++		if t1 != t2 {
++			t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2)
++		}
++		if offset != 3*60*60 {
++			t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60)
++		}
+ 	}
+ 
+ 	blancSablon, err := LoadLocation("America/Blanc-Sablon")
+@@ -273,6 +291,9 @@ func TestParseInLocation(t *testing.T) {
+ 		t.Fatal(err)
+ 	}
+ 
++	// In this case 'AST' means 'Atlantic Standard Time', and we
++	// expect the abbreviation to correctly match the american
++	// location.
+ 	t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", blancSablon)
+ 	if err != nil {
+ 		t.Fatal(err)

Copied: go/repos/testing-i686/PKGBUILD (from rev 290873, go/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD	                        (rev 0)
+++ testing-i686/PKGBUILD	2017-03-15 13:33:23 UTC (rev 290874)
@@ -0,0 +1,77 @@
+# $Id$
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+
+pkgname=go
+epoch=2
+pkgver=1.8
+pkgrel=2
+pkgdesc='Core compiler tools for the Go programming language'
+arch=(i686 x86_64)
+url='http://golang.org/'
+license=(BSD)
+makedepends=(git go)
+options=(!strip staticlibs)
+_commit=cd6b6202dd1559b3ac63179b45f1833fcfbe7eca # go1.8
+source=(git+https://go.googlesource.com/go#commit=$_commit
+        0001-time-make-the-ParseInLocation-test-more-robust.patch)
+md5sums=('SKIP'
+         'a9031d2fdd5d0951980db7ffe20afe41')
+
+export GOOS=linux
+case "$CARCH" in
+  x86_64) export GOARCH=amd64 ;;
+  i686) export GOARCH=386 GO386=387 ;;
+esac
+export GOROOT_FINAL=/usr/lib/go
+export GOROOT_BOOTSTRAP=/usr/lib/go
+
+prepare() {
+  cd $pkgname
+
+  # fixes time/format test with tzdata >=2017a
+  patch -p1 -i "$srcdir/0001-time-make-the-ParseInLocation-test-more-robust.patch"
+}
+
+build() {
+  export GOROOT="$srcdir/$pkgname"
+  export GOBIN="$GOROOT/bin"
+  export GOPATH="$srcdir/"
+
+  cd $pkgname/src
+  ./make.bash --no-clean
+}
+
+check() {
+  export GOROOT="$srcdir/$pkgname"
+  export GOBIN="$GOROOT/bin"
+  export PATH="$srcdir/$pkgname-$pkgver/bin:$PATH"
+  export GO_TEST_TIMEOUT_SCALE=2
+
+  # The cgo_test and race tests fail via run.bash but not if run manually.
+  # Assume that five "failed" messages are okay and just re-run failed tests.
+  cd $pkgname/src
+  ./run.bash --no-rebuild -v -v -v -k |& tee run.log
+  if (( $(grep -c Failed: run.log) > 5 )) && grep -q FAILED run.log; then
+    return 1
+  fi
+
+  go tool dist test -v -v -v -run=^cgo_test$
+  go tool dist test -v -v -v -run=^race$
+}
+
+package() {
+  cd $pkgbase
+
+  install -d "$pkgdir/usr/bin" "$pkgdir/usr/lib/go" "$pkgdir/usr/share/doc/go"
+  cp -a bin pkg src lib "$pkgdir/usr/lib/go"
+  cp -r doc/* "$pkgdir/usr/share/doc/go"
+
+  ln -sf /usr/lib/go/bin/go "$pkgdir/usr/bin/go"
+  ln -sf /usr/lib/go/bin/gofmt "$pkgdir/usr/bin/gofmt"
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/go/LICENSE"
+  install -Dm644 VERSION "$pkgdir/usr/lib/go/VERSION"
+
+  rm -rf "$pkgdir/usr/lib/go/pkg/bootstrap"
+  rm -rf "$pkgdir/usr/lib/go/pkg/tool/*/api"
+}

Copied: go/repos/testing-x86_64/0001-time-make-the-ParseInLocation-test-more-robust.patch (from rev 290873, go/trunk/0001-time-make-the-ParseInLocation-test-more-robust.patch)
===================================================================
--- testing-x86_64/0001-time-make-the-ParseInLocation-test-more-robust.patch	                        (rev 0)
+++ testing-x86_64/0001-time-make-the-ParseInLocation-test-more-robust.patch	2017-03-15 13:33:23 UTC (rev 290874)
@@ -0,0 +1,93 @@
+From 91563ced5897faf729a34be7081568efcfedda31 Mon Sep 17 00:00:00 2001
+From: Alberto Donizetti <alb.donizetti at gmail.com>
+Date: Thu, 9 Mar 2017 13:20:54 +0100
+Subject: [PATCH] time: make the ParseInLocation test more robust
+
+The tzdata 2017a update (2017-02-28) changed the abbreviation of the
+Asia/Baghdad time zone (used in TestParseInLocation) from 'AST' to the
+numeric '+03'.
+
+Update the test so that it skips the checks if we're using a recent
+tzdata release.
+
+Fixes #19457
+
+Change-Id: I45d705a5520743a611bdd194dc8f8d618679980c
+Reviewed-on: https://go-review.googlesource.com/37964
+Reviewed-by: Ian Lance Taylor <iant at golang.org>
+Run-TryBot: Ian Lance Taylor <iant at golang.org>
+TryBot-Result: Gobot Gobot <gobot at golang.org>
+---
+ src/time/format_test.go | 41 +++++++++++++++++++++++++++++++----------
+ 1 file changed, 31 insertions(+), 10 deletions(-)
+
+diff --git a/src/time/format_test.go b/src/time/format_test.go
+index 219c2ca..d0013bc 100644
+--- a/src/time/format_test.go
++++ b/src/time/format_test.go
+@@ -245,27 +245,45 @@ func TestParseDayOutOfRange(t *testing.T) {
+ 	}
+ }
+ 
++// TestParseInLocation checks that the Parse and ParseInLocation
++// functions do not get confused by the fact that AST (Arabia Standard
++// Time) and AST (Atlantic Standard Time) are different time zones,
++// even though they have the same abbreviation.
++//
++// ICANN has been slowly phasing out invented abbreviation in favor of
++// numeric time zones (for example, the Asia/Baghdad time zone
++// abbreviation got changed from AST to +03 in the 2017a tzdata
++// release); but we still want to make sure that the time package does
++// not get confused on systems with slightly older tzdata packages.
+ func TestParseInLocation(t *testing.T) {
+-	// Check that Parse (and ParseInLocation) understand that
+-	// Feb 01 AST (Arabia Standard Time) and Feb 01 AST (Atlantic Standard Time)
+-	// are in different time zones even though both are called AST
+ 
+ 	baghdad, err := LoadLocation("Asia/Baghdad")
+ 	if err != nil {
+ 		t.Fatal(err)
+ 	}
+ 
+-	t1, err := ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad)
++	var t1, t2 Time
++
++	t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", baghdad)
+ 	if err != nil {
+ 		t.Fatal(err)
+ 	}
+-	t2 := Date(2013, February, 1, 00, 00, 00, 0, baghdad)
+-	if t1 != t2 {
+-		t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2)
+-	}
++
+ 	_, offset := t1.Zone()
+-	if offset != 3*60*60 {
+-		t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60)
++
++	// A zero offset means that ParseInLocation did not recognize the
++	// 'AST' abbreviation as matching the current location (Baghdad,
++	// where we'd expect a +03 hrs offset); likely because we're using
++	// a recent tzdata release (2017a or newer).
++	// If it happens, skip the Baghdad test.
++	if offset != 0 {
++		t2 = Date(2013, February, 1, 00, 00, 00, 0, baghdad)
++		if t1 != t2 {
++			t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad) = %v, want %v", t1, t2)
++		}
++		if offset != 3*60*60 {
++			t.Fatalf("ParseInLocation(Feb 01 2013 AST, Baghdad).Zone = _, %d, want _, %d", offset, 3*60*60)
++		}
+ 	}
+ 
+ 	blancSablon, err := LoadLocation("America/Blanc-Sablon")
+@@ -273,6 +291,9 @@ func TestParseInLocation(t *testing.T) {
+ 		t.Fatal(err)
+ 	}
+ 
++	// In this case 'AST' means 'Atlantic Standard Time', and we
++	// expect the abbreviation to correctly match the american
++	// location.
+ 	t1, err = ParseInLocation("Jan 02 2006 MST", "Feb 01 2013 AST", blancSablon)
+ 	if err != nil {
+ 		t.Fatal(err)

Copied: go/repos/testing-x86_64/PKGBUILD (from rev 290873, go/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2017-03-15 13:33:23 UTC (rev 290874)
@@ -0,0 +1,77 @@
+# $Id$
+# Maintainer: Bartłomiej Piotrowski <bpiotrowski at archlinux.org>
+
+pkgname=go
+epoch=2
+pkgver=1.8
+pkgrel=2
+pkgdesc='Core compiler tools for the Go programming language'
+arch=(i686 x86_64)
+url='http://golang.org/'
+license=(BSD)
+makedepends=(git go)
+options=(!strip staticlibs)
+_commit=cd6b6202dd1559b3ac63179b45f1833fcfbe7eca # go1.8
+source=(git+https://go.googlesource.com/go#commit=$_commit
+        0001-time-make-the-ParseInLocation-test-more-robust.patch)
+md5sums=('SKIP'
+         'a9031d2fdd5d0951980db7ffe20afe41')
+
+export GOOS=linux
+case "$CARCH" in
+  x86_64) export GOARCH=amd64 ;;
+  i686) export GOARCH=386 GO386=387 ;;
+esac
+export GOROOT_FINAL=/usr/lib/go
+export GOROOT_BOOTSTRAP=/usr/lib/go
+
+prepare() {
+  cd $pkgname
+
+  # fixes time/format test with tzdata >=2017a
+  patch -p1 -i "$srcdir/0001-time-make-the-ParseInLocation-test-more-robust.patch"
+}
+
+build() {
+  export GOROOT="$srcdir/$pkgname"
+  export GOBIN="$GOROOT/bin"
+  export GOPATH="$srcdir/"
+
+  cd $pkgname/src
+  ./make.bash --no-clean
+}
+
+check() {
+  export GOROOT="$srcdir/$pkgname"
+  export GOBIN="$GOROOT/bin"
+  export PATH="$srcdir/$pkgname-$pkgver/bin:$PATH"
+  export GO_TEST_TIMEOUT_SCALE=2
+
+  # The cgo_test and race tests fail via run.bash but not if run manually.
+  # Assume that five "failed" messages are okay and just re-run failed tests.
+  cd $pkgname/src
+  ./run.bash --no-rebuild -v -v -v -k |& tee run.log
+  if (( $(grep -c Failed: run.log) > 5 )) && grep -q FAILED run.log; then
+    return 1
+  fi
+
+  go tool dist test -v -v -v -run=^cgo_test$
+  go tool dist test -v -v -v -run=^race$
+}
+
+package() {
+  cd $pkgbase
+
+  install -d "$pkgdir/usr/bin" "$pkgdir/usr/lib/go" "$pkgdir/usr/share/doc/go"
+  cp -a bin pkg src lib "$pkgdir/usr/lib/go"
+  cp -r doc/* "$pkgdir/usr/share/doc/go"
+
+  ln -sf /usr/lib/go/bin/go "$pkgdir/usr/bin/go"
+  ln -sf /usr/lib/go/bin/gofmt "$pkgdir/usr/bin/gofmt"
+
+  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/go/LICENSE"
+  install -Dm644 VERSION "$pkgdir/usr/lib/go/VERSION"
+
+  rm -rf "$pkgdir/usr/lib/go/pkg/bootstrap"
+  rm -rf "$pkgdir/usr/lib/go/pkg/tool/*/api"
+}



More information about the arch-commits mailing list