Compare commits
224 Commits
golang-1.1
...
master
Author | SHA1 | Date |
---|---|---|
Jakub Čajka | 27a8ad3859 | |
Jakub Čajka | c88a8dfff5 | |
Jakub Čajka | 61730a32f4 | |
Jakub Čajka | d7ab797463 | |
Jakub Čajka | fb39d90765 | |
Jakub Čajka | d3aa981e83 | |
Jakub Čajka | dac586c9c7 | |
Fedora Release Engineering | e8c1f5c4a2 | |
Jakub Čajka | 132cf34fe6 | |
Jakub Čajka | a3e201c572 | |
Jakub Čajka | 6db1c7a908 | |
Alejandro Sáez | 0cb15e561e | |
Jakub Čajka | 91d21a3bde | |
Jakub Čajka | ea99ebaff6 | |
Alejandro Sáez | ecf8f72447 | |
Jakub Čajka | fde02715d5 | |
Álex Sáez | 8716ef4de3 | |
Jakub Čajka | aa89c2b0f2 | |
Neal Gompa | 1f08860197 | |
Jakub Čajka | 4487a1b142 | |
Jakub Čajka | 9f5b8dce35 | |
Fedora Release Engineering | 4751ecad2f | |
Jakub Čajka | fd2a3fb06e | |
Jakub Čajka | fbfc80f071 | |
Jakub Čajka | 1524937377 | |
Neal Gompa | a522b09638 | |
Neal Gompa | 50defcc683 | |
Jakub Čajka | f445d76353 | |
Jakub Čajka | 069e0f1f5f | |
Jakub Čajka | 151fe9ed9a | |
Jakub Čajka | 25a05dd355 | |
Jakub Čajka | 8f7b389463 | |
Jakub Čajka | e45411af09 | |
Jakub Čajka | af8d391cb2 | |
Jakub Čajka | 081d5ff6f2 | |
Jakub Čajka | 0e633c63ed | |
Fedora Release Engineering | 140a7e1b44 | |
Jakub Čajka | 29d5602b19 | |
Jakub Čajka | f80e5ff991 | |
Jakub Čajka | a94ffe83e5 | |
Jakub Čajka | 6c0cf70db5 | |
Jakub Čajka | a562f38c65 | |
Jakub Čajka | f344d3da25 | |
Jakub Čajka | 9985c0a473 | |
Jakub Čajka | ef14b33215 | |
Tim Landscheidt | ff7ebd7613 | |
Jakub Čajka | c74b6b6cb8 | |
Jakub Čajka | 73766cf515 | |
Fedora Release Engineering | e3e1bdbf46 | |
Jakub Čajka | 8ae8c86871 | |
Jakub Čajka | bc69b83b00 | |
Jakub Čajka | 50b7643bf7 | |
Jakub Čajka | b86284b4f3 | |
Jakub Čajka | eb7ec5ddc1 | |
Jakub Čajka | 3014b94569 | |
Jakub Čajka | f1f6f5d515 | |
Jakub Čajka | a273a5236a | |
Jakub Čajka | c45c363337 | |
Jakub Čajka | 4043bb182d | |
Jakub Čajka | 62f2ae0511 | |
Jakub Čajka | 75f7f03cb6 | |
Fedora Release Engineering | 72a9f2e921 | |
Jakub Čajka | 19d1adeab4 | |
Jakub Čajka | c333e76e86 | |
Jakub Čajka | 6caa43c106 | |
Jakub Čajka | 66a92c4de7 | |
Jakub Čajka | 2389428bde | |
Jakub Čajka | e8abe4385f | |
Jakub Čajka | 639f9ab37f | |
Jakub Čajka | 5f45ed12c2 | |
Fedora Release Engineering | 13bb238b09 | |
Jakub Čajka | 63e3cb4201 | |
Jakub Čajka | 77baa559ba | |
Jakub Čajka | d37b3b5006 | |
Jakub Čajka | 4bc73c764a | |
Jakub Čajka | b65272222a | |
Jakub Čajka | 315b776905 | |
Jakub Čajka | 920ea39083 | |
Jakub Čajka | 387b897724 | |
Jakub Čajka | ceb83a748c | |
Jakub Čajka | 903219bc93 | |
Fedora Release Engineering | cb0891bb70 | |
Fedora Release Engineering | 494a6d19c3 | |
Jakub Čajka | 9941f71a57 | |
Jakub Čajka | c2d0ceffa4 | |
Jakub Čajka | 3cc854f423 | |
Petr Písař | c7375398e7 | |
Jakub Čajka | 5767354120 | |
Jakub Čajka | 45041c89fe | |
Jakub Čajka | 0a43a1cbaf | |
Jakub Čajka | 1344685ff3 | |
Jakub Čajka | 5706a3480e | |
Jakub Čajka | ab6ee497cb | |
Jakub Čajka | 29646808b3 | |
Vincent Batts | d83d5139a6 | |
Vincent Batts | 63fbc71112 | |
Jakub Čajka | 749ec62908 | |
Jakub Čajka | a1ca3c96e0 | |
Jakub Čajka | 1bf7308023 | |
Fedora Release Engineering | 7dabca5bf2 | |
Jakub Čajka | b881112930 | |
Jakub Čajka | 100fcef237 | |
Jakub Cajka | 0dbd49fdd7 | |
Jakub Čajka | 66c8bd8593 | |
Tom Callaway | 85dfe17917 | |
Jakub Čajka | 663103c2f1 | |
Jakub Čajka | d978616527 | |
Jakub Čajka | 8bda509c5f | |
Jakub Čajka | 1fe9869398 | |
Jakub Čajka | 6896a58aa3 | |
Jakub Čajka | cf2fb88587 | |
Fedora Release Engineering | 00c920284f | |
Jakub Čajka | d36359a723 | |
Jakub Čajka | 04b972ebf4 | |
Jakub Čajka | b2c2028475 | |
Jakub Čajka | 263126ff1b | |
Dennis Gilmore | 30a817d62b | |
Jakub Čajka | f031dfde9c | |
Jakub Čajka | d40cd88359 | |
Jakub Čajka | 672b8a1217 | |
Jakub Čajka | 85525165e1 | |
Jakub Čajka | 8b92652b24 | |
Jakub Čajka | c524af8454 | |
Vincent Batts | ee2b299486 | |
Vincent Batts | c127d6af98 | |
Vincent Batts | a68f1b0499 | |
Vincent Batts | 286f73c812 | |
Vincent Batts | 34fd651dfb | |
Vincent Batts | 418a760bf8 | |
Vincent Batts | 7782fc08ed | |
Vincent Batts | 12a31f1822 | |
Vincent Batts | 1a6adea6fb | |
Vincent Batts | 32abaed9de | |
Vincent Batts | baf0278ae3 | |
Vincent Batts | 3cb3b22c16 | |
Vincent Batts | 01341969cc | |
Vincent Batts | 9297305de1 | |
Peter Robinson | b869aad629 | |
Peter Robinson | 79fd860ddc | |
Peter Robinson | 19dca7ffd3 | |
Vincent Batts | 0d13e2d904 | |
Vincent Batts | 03b73e2ea5 | |
Vincent Batts | 831ba34f74 | |
Vincent Batts | f2f58b5244 | |
Vincent Batts | 9fc0bc41c8 | |
Vincent Batts | 78d9b3d3ac | |
Vincent Batts | c1bee09f56 | |
Vincent Batts | bb5db89cf5 | |
Vincent Batts | 6da96f9716 | |
Vincent Batts | 0eec149c76 | |
Vincent Batts | 2ecad653a5 | |
Vincent Batts | beda572475 | |
Vincent Batts | 8d165dfe19 | |
Dennis Gilmore | 7dc03d1101 | |
Vincent Batts | a8686d833c | |
Vincent Batts | b5c025475a | |
Vincent Batts | 4c424d4664 | |
Vincent Batts | 2ba9c52536 | |
Vincent Batts | 82982da132 | |
Vincent Batts | 5e609613fc | |
Vincent Batts | 0ad646d98d | |
Vincent Batts | 55020ead86 | |
Vincent Batts | 20cd634d14 | |
Vincent Batts | 84f93201d9 | |
Vincent Batts | c2c5dc1c66 | |
Vincent Batts | e0d801060b | |
Vincent Batts | 7c25ee88c6 | |
Vincent Batts | 94c0b3b623 | |
Vincent Batts | 8cfb9c493a | |
Vincent Batts | 999ceca490 | |
Peter Robinson | 726440c406 | |
Vincent Batts | ec1155188c | |
Vincent Batts | 81887c2abd | |
Vincent Batts | b025cc279b | |
Vincent Batts | ab9b26510d | |
Vincent Batts | dd6f77ac9a | |
Vincent Batts | 1afe7e2655 | |
Vincent Batts | 42cdf8daca | |
Vincent Batts | 59ec5bd186 | |
Vincent Batts | 374526de5b | |
Vincent Batts | 3a4853bd32 | |
Vincent Batts | fa7c581616 | |
Vincent Batts | 4086849026 | |
Vincent Batts | 207296f435 | |
Vincent Batts | ae7853072a | |
Dennis Gilmore | 472df199bf | |
Vincent Batts | ffa74e040a | |
Vincent Batts | dbf2661391 | |
Vincent Batts | f3f956d5ae | |
Vincent Batts | 2e3bac640a | |
Vincent Batts | 0b3722bb33 | |
Vincent Batts | 4620c4841b | |
Vincent Batts | 8bd3750385 | |
Vincent Batts | 7619d5057c | |
Vincent Batts | c849611c8a | |
Vincent Batts | 61096640f7 | |
Vincent Batts | 74686a282e | |
Vincent Batts | 789ff2e39d | |
Vincent Batts | e46d680a80 | |
Vincent Batts | 28979baa99 | |
Vincent Batts | 573d0baf6a | |
Vincent Batts | c8bd3b738f | |
Vincent Batts | 2911c49ac2 | |
Vincent Batts | 5f099a5852 | |
Vincent Batts | 6e4126fb01 | |
Vincent Batts | 9207febd2c | |
Vincent Batts | df7b191378 | |
Vincent Batts | d931512370 | |
Vincent Batts | 76f08f5dd7 | |
Vincent Batts | 8081f3309e | |
Vincent Batts | be393a2148 | |
Vincent Batts | fd00fb3b64 | |
Adam Miller | 01d4c2e64f | |
Adam Miller | 64f9c1459a | |
Adam Miller | a9aa1838b7 | |
Adam Miller | 969848f0f9 | |
Adam Miller | d0ddbae849 | |
Adam Miller | 40f74d4d72 | |
Adam Miller | 1318683961 | |
Vincent Batts | 77cba216ba | |
Vincent Batts | 25b1d04efe | |
Vincent Batts | b5cbd1ebb2 | |
Vincent Batts | 5152b3a3e6 | |
Vincent Batts | 5a84c902e7 |
|
@ -1,2 +1,97 @@
|
|||
*.rpm
|
||||
/go1.1.1.src.tar.gz
|
||||
/go1.1.2.src.tar.gz
|
||||
/go1.2.1.src.tar.gz
|
||||
/go1.2.2.src.tar.gz
|
||||
/go1.2.src.tar.gz
|
||||
/go1.3.1.src.tar.gz
|
||||
/go1.3.2.src.tar.gz
|
||||
/go1.3.3.src.tar.gz
|
||||
/go1.3.src.tar.gz
|
||||
/go1.3beta2.src.tar.gz
|
||||
/go1.3rc1.src.tar.gz
|
||||
/go1.3rc2.src.tar.gz
|
||||
/go1.4.1.src.tar.gz
|
||||
/go1.4.2.src.tar.gz
|
||||
/go1.4.src.tar.gz
|
||||
/go1.4beta1.src.tar.gz
|
||||
/go1.4rc1.src.tar.gz
|
||||
/go1.4rc2.src.tar.gz
|
||||
/go1.5beta1.src.tar.gz
|
||||
/golang-19087:a15f344a9efa-xattrs.tar
|
||||
/go1.5beta2.src.tar.gz
|
||||
/go1.5beta3.src.tar.gz
|
||||
/go1.5rc1.src.tar.gz
|
||||
/go1.5.src.tar.gz
|
||||
/go1.5.1.src.tar.gz
|
||||
/go1.5.2.src.tar.gz
|
||||
/Mark.Twain-Tom.Sawyer.txt.bz2
|
||||
/go1.5.3.src.tar.gz
|
||||
/go1.6rc1.src.tar.gz
|
||||
/go1.6.src.tar.gz
|
||||
/go1.6.1.src.tar.gz
|
||||
/go1.6.2.src.tar.gz
|
||||
/go1.7rc2.src.tar.gz
|
||||
/go1.7rc5.src.tar.gz
|
||||
/go1.7.src.tar.gz
|
||||
/go1.7.1.src.tar.gz
|
||||
/go1.7.3.src.tar.gz
|
||||
/go1.7.4.src.tar.gz
|
||||
/go1.8rc3.src.tar.gz
|
||||
/go1.8.src.tar.gz
|
||||
/go1.8.1.src.tar.gz
|
||||
/go1.8.3.src.tar.gz
|
||||
/go1.9beta2.src.tar.gz
|
||||
/go1.9.src.tar.gz
|
||||
/go1.9.1.src.tar.gz
|
||||
/go1.9.2.src.tar.gz
|
||||
/go1.10beta1.src.tar.gz
|
||||
/go1.10beta2.src.tar.gz
|
||||
/go1.10rc1.src.tar.gz
|
||||
/go1.10rc2.src.tar.gz
|
||||
/go1.10.src.tar.gz
|
||||
/go1.10.1.src.tar.gz
|
||||
/go1.10.2.src.tar.gz
|
||||
/go1.10.3.src.tar.gz
|
||||
/go1.11beta1.src.tar.gz
|
||||
/go1.11beta2.src.tar.gz
|
||||
/go1.11beta3.src.tar.gz
|
||||
/go1.11rc1.src.tar.gz
|
||||
/go1.11rc2.src.tar.gz
|
||||
/go1.11.src.tar.gz
|
||||
/go1.11.1.src.tar.gz
|
||||
/go1.11.2.src.tar.gz
|
||||
/go1.11.4.src.tar.gz
|
||||
/go1.12beta2.src.tar.gz
|
||||
/go1.12rc1.src.tar.gz
|
||||
/go1.12.src.tar.gz
|
||||
/go1.12.1.src.tar.gz
|
||||
/go1.12.2.src.tar.gz
|
||||
/go1.12.5.src.tar.gz
|
||||
/go1.12.6.src.tar.gz
|
||||
/go1.12.7.src.tar.gz
|
||||
/go1.13beta1.src.tar.gz
|
||||
/go1.13rc1.src.tar.gz
|
||||
/go1.13rc2.src.tar.gz
|
||||
/go1.13.src.tar.gz
|
||||
/go1.13.1.src.tar.gz
|
||||
/go1.13.3.src.tar.gz
|
||||
/go1.13.4.src.tar.gz
|
||||
/go1.13.5.src.tar.gz
|
||||
/go1.13.6.src.tar.gz
|
||||
/go1.14beta1.src.tar.gz
|
||||
/go1.14rc1.src.tar.gz
|
||||
/go1.14.src.tar.gz
|
||||
/go1.14.2.src.tar.gz
|
||||
/go1.14.3.src.tar.gz
|
||||
/go1.14.4.src.tar.gz
|
||||
/go1.14.6.src.tar.gz
|
||||
/go1.15beta1.src.tar.gz
|
||||
/go1.15rc1.src.tar.gz
|
||||
/go1.15rc2.src.tar.gz
|
||||
/go1.15.src.tar.gz
|
||||
/go1.15.1.src.tar.gz
|
||||
/go1.15.2.src.tar.gz
|
||||
/go1.15.3.src.tar.gz
|
||||
/go1.15.4.src.tar.gz
|
||||
/go1.15.5.src.tar.gz
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
From edce31a2904846ae74e3c011f2cf5fddc963459e Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
|
||||
Date: Thu, 22 Mar 2018 12:07:32 +0100
|
||||
Subject: [PATCH 1/3] Don't use the bundled tzdata at runtime, except for the
|
||||
internal test suite
|
||||
|
||||
---
|
||||
src/time/internal_test.go | 7 +++++--
|
||||
src/time/zoneinfo_test.go | 3 ++-
|
||||
src/time/zoneinfo_unix.go | 2 --
|
||||
3 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/time/internal_test.go b/src/time/internal_test.go
|
||||
index 76d5524124..e81ace5f64 100644
|
||||
--- a/src/time/internal_test.go
|
||||
+++ b/src/time/internal_test.go
|
||||
@@ -4,13 +4,15 @@
|
||||
|
||||
package time
|
||||
|
||||
+import "runtime"
|
||||
+
|
||||
func init() {
|
||||
// force US/Pacific for time zone tests
|
||||
ForceUSPacificForTesting()
|
||||
}
|
||||
|
||||
func initTestingZone() {
|
||||
- z, err := loadLocation("America/Los_Angeles", zoneSources[len(zoneSources)-1:])
|
||||
+ z, err := loadLocation("America/Los_Angeles", zoneSources)
|
||||
if err != nil {
|
||||
panic("cannot load America/Los_Angeles for testing: " + err.Error())
|
||||
}
|
||||
@@ -21,8 +23,9 @@ func initTestingZone() {
|
||||
var OrigZoneSources = zoneSources
|
||||
|
||||
func forceZipFileForTesting(zipOnly bool) {
|
||||
- zoneSources = make([]string, len(OrigZoneSources))
|
||||
+ zoneSources = make([]string, len(OrigZoneSources)+1)
|
||||
copy(zoneSources, OrigZoneSources)
|
||||
+ zoneSources = append(zoneSources, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
||||
if zipOnly {
|
||||
zoneSources = zoneSources[len(zoneSources)-1:]
|
||||
}
|
||||
diff --git a/src/time/zoneinfo_test.go b/src/time/zoneinfo_test.go
|
||||
index 7a55d4f618..6063ca1195 100644
|
||||
--- a/src/time/zoneinfo_test.go
|
||||
+++ b/src/time/zoneinfo_test.go
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
+ "runtime"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -128,7 +129,7 @@ func TestLoadLocationFromTZData(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
- tzinfo, err := time.LoadTzinfo(locationName, time.OrigZoneSources[len(time.OrigZoneSources)-1])
|
||||
+ tzinfo, err := time.LoadTzinfo(locationName, runtime.GOROOT()+"/lib/time/zoneinfo.zip")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
diff --git a/src/time/zoneinfo_unix.go b/src/time/zoneinfo_unix.go
|
||||
index 88313aa0ed..d9596115ef 100644
|
||||
--- a/src/time/zoneinfo_unix.go
|
||||
+++ b/src/time/zoneinfo_unix.go
|
||||
@@ -12,7 +12,6 @@
|
||||
package time
|
||||
|
||||
import (
|
||||
- "runtime"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
@@ -22,7 +21,6 @@ var zoneSources = []string{
|
||||
"/usr/share/zoneinfo/",
|
||||
"/usr/share/lib/zoneinfo/",
|
||||
"/usr/lib/locale/TZ/",
|
||||
- runtime.GOROOT() + "/lib/time/zoneinfo.zip",
|
||||
}
|
||||
|
||||
func initLocal() {
|
||||
--
|
||||
2.14.3
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
From 817407fc2d6a861e65086388766f58082d38bc0b Mon Sep 17 00:00:00 2001
|
||||
From: Michael Munday <munday@ca.ibm.com>
|
||||
Date: Tue, 17 Jan 2017 11:33:38 -0500
|
||||
Subject: [PATCH 2/3] syscall: expose IfInfomsg.X__ifi_pad on s390x
|
||||
|
||||
Exposing this field on s390x improves compatibility with the other
|
||||
linux architectures, all of which already expose it.
|
||||
|
||||
Fixes #18628 and updates #18632.
|
||||
|
||||
Change-Id: I08e8e1eb705f898cd8822f8bee0d61ce11d514b5
|
||||
---
|
||||
src/syscall/ztypes_linux_s390x.go | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
|
||||
index 63c4a83b19..b5894255df 100644
|
||||
--- a/src/syscall/ztypes_linux_s390x.go
|
||||
+++ b/src/syscall/ztypes_linux_s390x.go
|
||||
@@ -449,12 +449,12 @@ type RtAttr struct {
|
||||
}
|
||||
|
||||
type IfInfomsg struct {
|
||||
- Family uint8
|
||||
- _ uint8
|
||||
- Type uint16
|
||||
- Index int32
|
||||
- Flags uint32
|
||||
- Change uint32
|
||||
+ Family uint8
|
||||
+ X__ifi_pad uint8
|
||||
+ Type uint16
|
||||
+ Index int32
|
||||
+ Flags uint32
|
||||
+ Change uint32
|
||||
}
|
||||
|
||||
type IfAddrmsg struct {
|
||||
--
|
||||
2.14.3
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
From b38cd2374c2395f5a77802ef8ea3d7ac5b8a86ad Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jakub=20=C4=8Cajka?= <jcajka@redhat.com>
|
||||
Date: Mon, 27 May 2019 15:12:53 +0200
|
||||
Subject: [PATCH 3/3] cmd/go: disable Google's proxy and sumdb
|
||||
|
||||
---
|
||||
src/cmd/go/internal/cfg/cfg.go | 10 +++++-----
|
||||
src/cmd/go/testdata/script/mod_sumdb_golang.txt | 6 +++---
|
||||
2 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go
|
||||
index 61dc6bdda6..e8658dc56c 100644
|
||||
--- a/src/cmd/go/internal/cfg/cfg.go
|
||||
+++ b/src/cmd/go/internal/cfg/cfg.go
|
||||
@@ -245,11 +245,11 @@ var (
|
||||
GOPPC64 = envOr("GOPPC64", fmt.Sprintf("%s%d", "power", objabi.GOPPC64))
|
||||
GOWASM = envOr("GOWASM", fmt.Sprint(objabi.GOWASM))
|
||||
|
||||
- GOPROXY = envOr("GOPROXY", "https://proxy.golang.org,direct")
|
||||
- GOSUMDB = envOr("GOSUMDB", "sum.golang.org")
|
||||
- GOPRIVATE = Getenv("GOPRIVATE")
|
||||
- GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
|
||||
- GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
|
||||
+ GOPROXY = envOr("GOPROXY", "direct")
|
||||
+ GOSUMDB = envOr("GOSUMDB", "off")
|
||||
+ GOPRIVATE = Getenv("GOPRIVATE")
|
||||
+ GONOPROXY = envOr("GONOPROXY", GOPRIVATE)
|
||||
+ GONOSUMDB = envOr("GONOSUMDB", GOPRIVATE)
|
||||
GOINSECURE = Getenv("GOINSECURE")
|
||||
)
|
||||
|
||||
diff --git a/src/cmd/go/testdata/script/mod_sumdb_golang.txt b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
|
||||
index 40a07fc7e9..50436e32d7 100644
|
||||
--- a/src/cmd/go/testdata/script/mod_sumdb_golang.txt
|
||||
+++ b/src/cmd/go/testdata/script/mod_sumdb_golang.txt
|
||||
@@ -2,12 +2,12 @@
|
||||
env GOPROXY=
|
||||
env GOSUMDB=
|
||||
go env GOPROXY
|
||||
-stdout '^https://proxy.golang.org,direct$'
|
||||
+stdout '^direct$'
|
||||
go env GOSUMDB
|
||||
-stdout '^sum.golang.org$'
|
||||
+stdout '^off$'
|
||||
env GOPROXY=https://proxy.golang.org
|
||||
go env GOSUMDB
|
||||
-stdout '^sum.golang.org$'
|
||||
+stdout '^off$'
|
||||
|
||||
# download direct from github
|
||||
[!net] skip
|
||||
--
|
||||
2.21.0
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
// +build rpm_crashtraceback
|
||||
|
||||
package runtime
|
||||
|
||||
func init() {
|
||||
setTraceback("crash")
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
diff -ur go~/src/make.bash go/src/make.bash
|
||||
--- go~/src/make.bash 2013-05-13 16:07:18.000000000 -0400
|
||||
+++ go/src/make.bash 2013-05-23 21:20:56.804544307 -0400
|
||||
@@ -135,7 +135,7 @@
|
||||
if [ "$1" = "--no-clean" ]; then
|
||||
buildall=""
|
||||
fi
|
||||
-./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap
|
||||
+./cmd/dist/dist bootstrap $buildall -vv # builds go_bootstrap
|
||||
# Delay move of dist tool to now, because bootstrap may clear tool directory.
|
||||
mv cmd/dist/dist "$GOTOOLDIR"/dist
|
||||
"$GOTOOLDIR"/go_bootstrap clean -i std
|
||||
@@ -144,12 +144,12 @@
|
||||
if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
|
||||
echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
|
||||
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
|
||||
- "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
|
||||
+ "$GOTOOLDIR"/go_bootstrap install -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
|
||||
echo
|
||||
fi
|
||||
|
||||
echo "# Building packages and commands for $GOOS/$GOARCH."
|
||||
-"$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std
|
||||
+"$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -ccflags "$GO_CCFLAGS" -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v -x std
|
||||
echo
|
||||
|
||||
rm -f "$GOTOOLDIR"/go_bootstrap
|
|
@ -1,510 +0,0 @@
|
|||
Index: src/pkg/archive/tar/common.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/common.go
|
||||
+++ b/src/pkg/archive/tar/common.go
|
||||
@@ -13,6 +13,7 @@
|
||||
package tar
|
||||
|
||||
import (
|
||||
+ "bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
@@ -174,6 +175,23 @@
|
||||
c_ISSOCK = 0140000 // Socket
|
||||
)
|
||||
|
||||
+// Keywords for the PAX Extended Header
|
||||
+const (
|
||||
+ paxAtime = "atime"
|
||||
+ paxCharset = "charset"
|
||||
+ paxComment = "comment"
|
||||
+ paxCtime = "ctime" // please note that ctime is not a valid pax header.
|
||||
+ paxGid = "gid"
|
||||
+ paxGname = "gname"
|
||||
+ paxLinkpath = "linkpath"
|
||||
+ paxMtime = "mtime"
|
||||
+ paxPath = "path"
|
||||
+ paxSize = "size"
|
||||
+ paxUid = "uid"
|
||||
+ paxUname = "uname"
|
||||
+ paxNone = ""
|
||||
+)
|
||||
+
|
||||
// FileInfoHeader creates a partially-populated Header from fi.
|
||||
// If fi describes a symlink, FileInfoHeader records link as the link target.
|
||||
// If fi describes a directory, a slash is appended to the name.
|
||||
@@ -257,3 +275,25 @@
|
||||
b, *sp = s[0:n], s[n:]
|
||||
return
|
||||
}
|
||||
+
|
||||
+func isASCII(s string) bool {
|
||||
+ for _, c := range s {
|
||||
+ if c >= 0x80 {
|
||||
+ return false
|
||||
+ }
|
||||
+ }
|
||||
+ return true
|
||||
+}
|
||||
+
|
||||
+func toASCII(s string) string {
|
||||
+ if isASCII(s) {
|
||||
+ return s
|
||||
+ }
|
||||
+ var buf bytes.Buffer
|
||||
+ for _, c := range s {
|
||||
+ if c < 0x80 {
|
||||
+ buf.WriteByte(byte(c))
|
||||
+ }
|
||||
+ }
|
||||
+ return buf.String()
|
||||
+}
|
||||
Index: src/pkg/archive/tar/reader.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/reader.go
|
||||
+++ b/src/pkg/archive/tar/reader.go
|
||||
@@ -95,45 +95,45 @@
|
||||
func mergePAX(hdr *Header, headers map[string]string) error {
|
||||
for k, v := range headers {
|
||||
switch k {
|
||||
- case "path":
|
||||
+ case paxPath:
|
||||
hdr.Name = v
|
||||
- case "linkpath":
|
||||
+ case paxLinkpath:
|
||||
hdr.Linkname = v
|
||||
- case "gname":
|
||||
+ case paxGname:
|
||||
hdr.Gname = v
|
||||
- case "uname":
|
||||
+ case paxUname:
|
||||
hdr.Uname = v
|
||||
- case "uid":
|
||||
+ case paxUid:
|
||||
uid, err := strconv.ParseInt(v, 10, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.Uid = int(uid)
|
||||
- case "gid":
|
||||
+ case paxGid:
|
||||
gid, err := strconv.ParseInt(v, 10, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.Gid = int(gid)
|
||||
- case "atime":
|
||||
+ case paxAtime:
|
||||
t, err := parsePAXTime(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.AccessTime = t
|
||||
- case "mtime":
|
||||
+ case paxMtime:
|
||||
t, err := parsePAXTime(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.ModTime = t
|
||||
- case "ctime":
|
||||
+ case paxCtime:
|
||||
t, err := parsePAXTime(v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
hdr.ChangeTime = t
|
||||
- case "size":
|
||||
+ case paxSize:
|
||||
size, err := strconv.ParseInt(v, 10, 0)
|
||||
if err != nil {
|
||||
return err
|
||||
Index: src/pkg/archive/tar/writer.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/writer.go
|
||||
+++ b/src/pkg/archive/tar/writer.go
|
||||
@@ -24,6 +24,7 @@
|
||||
ErrFieldTooLong = errors.New("archive/tar: header field too long")
|
||||
ErrWriteAfterClose = errors.New("archive/tar: write after close")
|
||||
errNameTooLong = errors.New("archive/tar: name too long")
|
||||
+ errInvalidHeader = errors.New("archive/tar: header field too long or contains invalid values")
|
||||
)
|
||||
|
||||
// A Writer provides sequential writing of a tar archive in POSIX.1 format.
|
||||
@@ -37,6 +38,7 @@
|
||||
pad int64 // amount of padding to write after current file entry
|
||||
closed bool
|
||||
usedBinary bool // whether the binary numeric field extension was used
|
||||
+ preferPax bool // use pax header instead of binary numeric header
|
||||
}
|
||||
|
||||
// NewWriter creates a new Writer writing to w.
|
||||
@@ -65,16 +67,23 @@
|
||||
}
|
||||
|
||||
// Write s into b, terminating it with a NUL if there is room.
|
||||
-func (tw *Writer) cString(b []byte, s string) {
|
||||
+// If the value is too long for the field and allowPax is true add a paxheader record instead
|
||||
+func (tw *Writer) cString(b []byte, s string, allowPax bool, paxKeyword string, paxHeaders map[string]string) {
|
||||
+ needsPaxHeader := allowPax && len(s) > len(b) || !isASCII(s)
|
||||
+ if needsPaxHeader {
|
||||
+ paxHeaders[paxKeyword] = s
|
||||
+ return
|
||||
+ }
|
||||
if len(s) > len(b) {
|
||||
if tw.err == nil {
|
||||
tw.err = ErrFieldTooLong
|
||||
}
|
||||
return
|
||||
}
|
||||
- copy(b, s)
|
||||
- if len(s) < len(b) {
|
||||
- b[len(s)] = 0
|
||||
+ ascii := toASCII(s)
|
||||
+ copy(b, ascii)
|
||||
+ if len(ascii) < len(b) {
|
||||
+ b[len(ascii)] = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,17 +94,27 @@
|
||||
for len(s)+1 < len(b) {
|
||||
s = "0" + s
|
||||
}
|
||||
- tw.cString(b, s)
|
||||
+ tw.cString(b, s, false, paxNone, nil)
|
||||
}
|
||||
|
||||
// Write x into b, either as octal or as binary (GNUtar/star extension).
|
||||
-func (tw *Writer) numeric(b []byte, x int64) {
|
||||
+// If the value is too long for the field and writingPax is enabled both for the field and the add a paxheader record instead
|
||||
+func (tw *Writer) numeric(b []byte, x int64, allowPax bool, paxKeyword string, paxHeaders map[string]string) {
|
||||
// Try octal first.
|
||||
s := strconv.FormatInt(x, 8)
|
||||
if len(s) < len(b) {
|
||||
tw.octal(b, x)
|
||||
return
|
||||
}
|
||||
+
|
||||
+ // If it is too long for octal, and pax is preferred, use a pax header
|
||||
+ if allowPax && tw.preferPax {
|
||||
+ tw.octal(b, 0)
|
||||
+ s := strconv.FormatInt(x, 10)
|
||||
+ paxHeaders[paxKeyword] = s
|
||||
+ return
|
||||
+ }
|
||||
+
|
||||
// Too big: use binary (big-endian).
|
||||
tw.usedBinary = true
|
||||
for i := len(b) - 1; x > 0 && i >= 0; i-- {
|
||||
@@ -115,6 +134,15 @@
|
||||
// WriteHeader calls Flush if it is not the first header.
|
||||
// Calling after a Close will return ErrWriteAfterClose.
|
||||
func (tw *Writer) WriteHeader(hdr *Header) error {
|
||||
+ return tw.writeHeader(hdr, true)
|
||||
+}
|
||||
+
|
||||
+// WriteHeader writes hdr and prepares to accept the file's contents.
|
||||
+// WriteHeader calls Flush if it is not the first header.
|
||||
+// Calling after a Close will return ErrWriteAfterClose.
|
||||
+// As this method is called internally by writePax header to allow it to
|
||||
+// suppress writing the pax header.
|
||||
+func (tw *Writer) writeHeader(hdr *Header, allowPax bool) error {
|
||||
if tw.closed {
|
||||
return ErrWriteAfterClose
|
||||
}
|
||||
@@ -124,31 +152,21 @@
|
||||
if tw.err != nil {
|
||||
return tw.err
|
||||
}
|
||||
- // Decide whether or not to use PAX extensions
|
||||
+
|
||||
+ // a map to hold pax header records, if any are needed
|
||||
+ paxHeaders := make(map[string]string)
|
||||
+
|
||||
// TODO(shanemhansen): we might want to use PAX headers for
|
||||
// subsecond time resolution, but for now let's just capture
|
||||
- // the long name/long symlink use case.
|
||||
- suffix := hdr.Name
|
||||
- prefix := ""
|
||||
- if len(hdr.Name) > fileNameSize || len(hdr.Linkname) > fileNameSize {
|
||||
- var err error
|
||||
- prefix, suffix, err = tw.splitUSTARLongName(hdr.Name)
|
||||
- // Either we were unable to pack the long name into ustar format
|
||||
- // or the link name is too long; use PAX headers.
|
||||
- if err == errNameTooLong || len(hdr.Linkname) > fileNameSize {
|
||||
- if err := tw.writePAXHeader(hdr); err != nil {
|
||||
- return err
|
||||
- }
|
||||
- } else if err != nil {
|
||||
- return err
|
||||
- }
|
||||
- }
|
||||
- tw.nb = int64(hdr.Size)
|
||||
- tw.pad = -tw.nb & (blockSize - 1) // blockSize is a power of two
|
||||
+ // too long fields or non ascii characters
|
||||
|
||||
header := make([]byte, blockSize)
|
||||
s := slicer(header)
|
||||
- tw.cString(s.next(fileNameSize), suffix)
|
||||
+
|
||||
+ // keep a reference to the filename to allow to overwrite it later if we detect that we can use ustar longnames instead of pax
|
||||
+ pathHeaderBytes := s.next(fileNameSize)
|
||||
+
|
||||
+ tw.cString(pathHeaderBytes, hdr.Name, true, paxPath, paxHeaders)
|
||||
|
||||
// Handle out of range ModTime carefully.
|
||||
var modTime int64
|
||||
@@ -156,27 +174,55 @@
|
||||
modTime = hdr.ModTime.Unix()
|
||||
}
|
||||
|
||||
- tw.octal(s.next(8), hdr.Mode) // 100:108
|
||||
- tw.numeric(s.next(8), int64(hdr.Uid)) // 108:116
|
||||
- tw.numeric(s.next(8), int64(hdr.Gid)) // 116:124
|
||||
- tw.numeric(s.next(12), hdr.Size) // 124:136
|
||||
- tw.numeric(s.next(12), modTime) // 136:148
|
||||
- s.next(8) // chksum (148:156)
|
||||
- s.next(1)[0] = hdr.Typeflag // 156:157
|
||||
- tw.cString(s.next(100), hdr.Linkname) // linkname (157:257)
|
||||
- copy(s.next(8), []byte("ustar\x0000")) // 257:265
|
||||
- tw.cString(s.next(32), hdr.Uname) // 265:297
|
||||
- tw.cString(s.next(32), hdr.Gname) // 297:329
|
||||
- tw.numeric(s.next(8), hdr.Devmajor) // 329:337
|
||||
- tw.numeric(s.next(8), hdr.Devminor) // 337:345
|
||||
- tw.cString(s.next(155), prefix) // 345:500
|
||||
+ tw.octal(s.next(8), hdr.Mode) // 100:108
|
||||
+ tw.numeric(s.next(8), int64(hdr.Uid), true, paxUid, paxHeaders) // 108:116
|
||||
+ tw.numeric(s.next(8), int64(hdr.Gid), true, paxGid, paxHeaders) // 116:124
|
||||
+ tw.numeric(s.next(12), hdr.Size, true, paxSize, paxHeaders) // 124:136
|
||||
+ tw.numeric(s.next(12), modTime, false, paxNone, nil) // 136:148 --- consider using pax for finer granularity
|
||||
+ s.next(8) // chksum (148:156)
|
||||
+ s.next(1)[0] = hdr.Typeflag // 156:157
|
||||
+
|
||||
+ tw.cString(s.next(100), hdr.Linkname, true, paxLinkpath, paxHeaders)
|
||||
+
|
||||
+ copy(s.next(8), []byte("ustar\x0000")) // 257:265
|
||||
+ tw.cString(s.next(32), hdr.Uname, true, paxUname, paxHeaders) // 265:297
|
||||
+ tw.cString(s.next(32), hdr.Gname, true, paxGname, paxHeaders) // 297:329
|
||||
+ tw.numeric(s.next(8), hdr.Devmajor, false, paxNone, nil) // 329:337
|
||||
+ tw.numeric(s.next(8), hdr.Devminor, false, paxNone, nil) // 337:345
|
||||
+
|
||||
+ // keep a reference to the prefix to allow to overwrite it later if we detect that we can use ustar longnames instead of pax
|
||||
+ prefixHeaderBytes := s.next(155)
|
||||
+ tw.cString(prefixHeaderBytes, "", false, paxNone, nil) // 345:500 prefix
|
||||
+
|
||||
// Use the GNU magic instead of POSIX magic if we used any GNU extensions.
|
||||
if tw.usedBinary {
|
||||
copy(header[257:265], []byte("ustar \x00"))
|
||||
}
|
||||
- // Use the ustar magic if we used ustar long names.
|
||||
- if len(prefix) > 0 {
|
||||
- copy(header[257:265], []byte("ustar\000"))
|
||||
+
|
||||
+ _, paxPathUsed := paxHeaders[paxPath]
|
||||
+ // try to use a ustar header when only the name is too long
|
||||
+ if !tw.preferPax && len(paxHeaders) == 1 && paxPathUsed {
|
||||
+ suffix := hdr.Name
|
||||
+ prefix := ""
|
||||
+ if len(hdr.Name) > fileNameSize && isASCII(hdr.Name) {
|
||||
+ var err error
|
||||
+ prefix, suffix, err = tw.splitUSTARLongName(hdr.Name)
|
||||
+ if err == nil {
|
||||
+ // ok we can use a ustar long name instead of pax, now correct the fields
|
||||
+
|
||||
+ // remove the path field from the pax header. this will suppress the pax header
|
||||
+ delete(paxHeaders, paxPath)
|
||||
+
|
||||
+ // update the path fields
|
||||
+ tw.cString(pathHeaderBytes, suffix, false, paxNone, nil)
|
||||
+ tw.cString(prefixHeaderBytes, prefix, false, paxNone, nil)
|
||||
+
|
||||
+ // Use the ustar magic if we used ustar long names.
|
||||
+ if len(prefix) > 0 {
|
||||
+ copy(header[257:265], []byte("ustar\000"))
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
// The chksum field is terminated by a NUL and a space.
|
||||
@@ -190,8 +236,18 @@
|
||||
return tw.err
|
||||
}
|
||||
|
||||
+ if len(paxHeaders) > 0 {
|
||||
+ if !allowPax {
|
||||
+ return errInvalidHeader
|
||||
+ }
|
||||
+ if err := tw.writePAXHeader(hdr, paxHeaders); err != nil {
|
||||
+ return err
|
||||
+ }
|
||||
+ }
|
||||
+ tw.nb = int64(hdr.Size)
|
||||
+ tw.pad = (blockSize - (tw.nb % blockSize)) % blockSize
|
||||
+
|
||||
_, tw.err = tw.w.Write(header)
|
||||
-
|
||||
return tw.err
|
||||
}
|
||||
|
||||
@@ -218,7 +274,7 @@
|
||||
|
||||
// writePaxHeader writes an extended pax header to the
|
||||
// archive.
|
||||
-func (tw *Writer) writePAXHeader(hdr *Header) error {
|
||||
+func (tw *Writer) writePAXHeader(hdr *Header, paxHeaders map[string]string) error {
|
||||
// Prepare extended header
|
||||
ext := new(Header)
|
||||
ext.Typeflag = TypeXHeader
|
||||
@@ -229,18 +285,23 @@
|
||||
// with the current pid.
|
||||
pid := os.Getpid()
|
||||
dir, file := path.Split(hdr.Name)
|
||||
- ext.Name = path.Join(dir,
|
||||
- fmt.Sprintf("PaxHeaders.%d", pid), file)[0:100]
|
||||
+ fullName := path.Join(dir,
|
||||
+ fmt.Sprintf("PaxHeaders.%d", pid), file)
|
||||
+
|
||||
+ ascii := toASCII(fullName)
|
||||
+ if len(ascii) > 100 {
|
||||
+ ascii = ascii[:100]
|
||||
+ }
|
||||
+ ext.Name = ascii
|
||||
// Construct the body
|
||||
var buf bytes.Buffer
|
||||
- if len(hdr.Name) > fileNameSize {
|
||||
- fmt.Fprint(&buf, paxHeader("path="+hdr.Name))
|
||||
+
|
||||
+ for k, v := range paxHeaders {
|
||||
+ fmt.Fprint(&buf, paxHeader(k+"="+v))
|
||||
}
|
||||
- if len(hdr.Linkname) > fileNameSize {
|
||||
- fmt.Fprint(&buf, paxHeader("linkpath="+hdr.Linkname))
|
||||
- }
|
||||
+
|
||||
ext.Size = int64(len(buf.Bytes()))
|
||||
- if err := tw.WriteHeader(ext); err != nil {
|
||||
+ if err := tw.writeHeader(ext, false); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := tw.Write(buf.Bytes()); err != nil {
|
||||
Index: src/pkg/archive/tar/writer_test.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/writer_test.go
|
||||
+++ b/src/pkg/archive/tar/writer_test.go
|
||||
@@ -243,15 +243,110 @@
|
||||
}
|
||||
}
|
||||
|
||||
+func TestPaxSymlink(t *testing.T) {
|
||||
+ // Create an archive with a large linkname
|
||||
+ fileinfo, err := os.Stat("testdata/small.txt")
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ hdr, err := FileInfoHeader(fileinfo, "")
|
||||
+ hdr.Typeflag = TypeSymlink
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("os.Stat:1 %v", err)
|
||||
+ }
|
||||
+ // Force a PAX long linkname to be written
|
||||
+ longLinkname := strings.Repeat("1234567890/1234567890", 10)
|
||||
+ hdr.Linkname = longLinkname
|
||||
+
|
||||
+ hdr.Size = 0
|
||||
+ var buf bytes.Buffer
|
||||
+ writer := NewWriter(&buf)
|
||||
+ if err := writer.WriteHeader(hdr); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if err := writer.Close(); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ // Simple test to make sure PAX extensions are in effect
|
||||
+ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) {
|
||||
+ t.Fatal("Expected at least one PAX header to be written.")
|
||||
+ }
|
||||
+ // Test that we can get a long name back out of the archive.
|
||||
+ reader := NewReader(&buf)
|
||||
+ hdr, err = reader.Next()
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if hdr.Linkname != longLinkname {
|
||||
+ t.Fatal("Couldn't recover long link name")
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+func TestPaxNonAscii(t *testing.T) {
|
||||
+ // Create an archive with non ascii. These should trigger a pax header
|
||||
+ // because pax headers have a defined utf-8 encoding.
|
||||
+ fileinfo, err := os.Stat("testdata/small.txt")
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+
|
||||
+ hdr, err := FileInfoHeader(fileinfo, "")
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("os.Stat:1 %v", err)
|
||||
+ }
|
||||
+
|
||||
+ // some sample data
|
||||
+ chineseFilename := "文件名"
|
||||
+ chineseGroupname := "組"
|
||||
+ chineseUsername := "用戶名"
|
||||
+
|
||||
+ hdr.Name = chineseFilename
|
||||
+ hdr.Gname = chineseGroupname
|
||||
+ hdr.Uname = chineseUsername
|
||||
+
|
||||
+ contents := strings.Repeat(" ", int(hdr.Size))
|
||||
+
|
||||
+ var buf bytes.Buffer
|
||||
+ writer := NewWriter(&buf)
|
||||
+ if err := writer.WriteHeader(hdr); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if _, err = writer.Write([]byte(contents)); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if err := writer.Close(); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ // Simple test to make sure PAX extensions are in effect
|
||||
+ if !bytes.Contains(buf.Bytes(), []byte("PaxHeaders.")) {
|
||||
+ t.Fatal("Expected at least one PAX header to be written.")
|
||||
+ }
|
||||
+ // Test that we can get a long name back out of the archive.
|
||||
+ reader := NewReader(&buf)
|
||||
+ hdr, err = reader.Next()
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if hdr.Name != chineseFilename {
|
||||
+ t.Fatal("Couldn't recover unicode name")
|
||||
+ }
|
||||
+ if hdr.Gname != chineseGroupname {
|
||||
+ t.Fatal("Couldn't recover unicode group")
|
||||
+ }
|
||||
+ if hdr.Uname != chineseUsername {
|
||||
+ t.Fatal("Couldn't recover unicode user")
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
func TestPAXHeader(t *testing.T) {
|
||||
medName := strings.Repeat("CD", 50)
|
||||
longName := strings.Repeat("AB", 100)
|
||||
paxTests := [][2]string{
|
||||
- {"name=/etc/hosts", "19 name=/etc/hosts\n"},
|
||||
+ {paxPath + "=/etc/hosts", "19 path=/etc/hosts\n"},
|
||||
{"a=b", "6 a=b\n"}, // Single digit length
|
||||
{"a=names", "11 a=names\n"}, // Test case involving carries
|
||||
- {"name=" + longName, fmt.Sprintf("210 name=%s\n", longName)},
|
||||
- {"name=" + medName, fmt.Sprintf("110 name=%s\n", medName)}}
|
||||
+ {paxPath + "=" + longName, fmt.Sprintf("210 path=%s\n", longName)},
|
||||
+ {paxPath + "=" + medName, fmt.Sprintf("110 path=%s\n", medName)}}
|
||||
|
||||
for _, test := range paxTests {
|
||||
key, expected := test[0], test[1]
|
|
@ -1,62 +0,0 @@
|
|||
Index: src/pkg/archive/tar/writer.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/writer.go
|
||||
+++ b/src/pkg/archive/tar/writer.go
|
||||
@@ -263,8 +263,11 @@
|
||||
length--
|
||||
}
|
||||
i := strings.LastIndex(name[:length], "/")
|
||||
- nlen := length - i - 1
|
||||
- if i <= 0 || nlen > fileNameSize || nlen == 0 {
|
||||
+ // nlen contains the resulting length in the name field.
|
||||
+ // plen contains the resulting length in the prefix field.
|
||||
+ nlen := len(name) - i - 1
|
||||
+ plen := i
|
||||
+ if i <= 0 || nlen > fileNameSize || nlen == 0 || plen > fileNamePrefixSize {
|
||||
err = errNameTooLong
|
||||
return
|
||||
}
|
||||
Index: src/pkg/archive/tar/writer_test.go
|
||||
===================================================================
|
||||
--- a/src/pkg/archive/tar/writer_test.go
|
||||
+++ b/src/pkg/archive/tar/writer_test.go
|
||||
@@ -355,3 +355,39 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+func TestUSTARLongName(t *testing.T) {
|
||||
+ // Create an archive with a path that failed to split with USTAR extension in previous versions.
|
||||
+ fileinfo, err := os.Stat("testdata/small.txt")
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ hdr, err := FileInfoHeader(fileinfo, "")
|
||||
+ hdr.Typeflag = TypeDir
|
||||
+ if err != nil {
|
||||
+ t.Fatalf("os.Stat:1 %v", err)
|
||||
+ }
|
||||
+ // Force a PAX long name to be written. The name was taken from a practical example
|
||||
+ // that fails and replaced ever char through numbers to anonymize the sample.
|
||||
+ longName := "/0000_0000000/00000-000000000/0000_0000000/00000-0000000000000/0000_0000000/00000-0000000-00000000/0000_0000000/00000000/0000_0000000/000/0000_0000000/00000000v00/0000_0000000/000000/0000_0000000/0000000/0000_0000000/00000y-00/0000/0000/00000000/0x000000/"
|
||||
+ hdr.Name = longName
|
||||
+
|
||||
+ hdr.Size = 0
|
||||
+ var buf bytes.Buffer
|
||||
+ writer := NewWriter(&buf)
|
||||
+ if err := writer.WriteHeader(hdr); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if err := writer.Close(); err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ // Test that we can get a long name back out of the archive.
|
||||
+ reader := NewReader(&buf)
|
||||
+ hdr, err = reader.Next()
|
||||
+ if err != nil {
|
||||
+ t.Fatal(err)
|
||||
+ }
|
||||
+ if hdr.Name != longName {
|
||||
+ t.Fatal("Couldn't recover long name")
|
||||
+ }
|
||||
+}
|
|
@ -1,13 +0,0 @@
|
|||
Index: go/src/pkg/os/os_test.go
|
||||
===================================================================
|
||||
--- go.orig/src/pkg/os/os_test.go
|
||||
+++ go/src/pkg/os/os_test.go
|
||||
@@ -842,7 +842,7 @@ func run(t *testing.T, cmd []string) str
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
- p, err := StartProcess("/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}})
|
||||
+ p, err := StartProcess("/usr/bin/hostname", []string{"hostname"}, &ProcAttr{Files: []*File{nil, w, Stderr}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
|
@ -1,2 +1 @@
|
|||
add-auto-load-safe-path /usr/lib/golang/src/pkg/runtime/runtime-gdb.py
|
||||
add-auto-load-safe-path /usr/lib64/golang/src/pkg/runtime/runtime-gdb.py
|
||||
add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# there are ELF files in src which are testdata and shouldn't be modified
|
||||
-b /usr/lib/golang/src
|
||||
-b /usr/lib64/golang/src
|
1307
golang.spec
1307
golang.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue