[golang/f19: 3/3] Merge branch 'master' into f19
by Adam Miller
commit ba9665b0fe53e7b04285909c3e0a72ac837333b8
Merge: 583f94d 1318683
Author: Adam Miller <admiller(a)redhat.com>
Date: Wed Feb 19 10:35:09 2014 -0600
Merge branch 'master' into f19
* master:
pull in xattr archive/tar from upstream
Provide 'go'
.gitignore | 1 +
golang-1.2-archive_tar-xattr.patch | 197 ++++++++++++++++++++++++++++++++++++
golang-f21-hostname.patch | 13 ---
golang.spec | 25 +++++-
sources | 1 +
5 files changed, 223 insertions(+), 14 deletions(-)
---
10 years, 2 months
[golang/f19] (3 commits) ...Merge branch 'master' into f19
by Adam Miller
Summary of changes:
77cba21... Provide 'go' (*)
1318683... pull in xattr archive/tar from upstream (*)
ba9665b... Merge branch 'master' into f19
(*) This commit already existed in another branch; no separate mail sent
10 years, 2 months
[golang/f20: 3/3] Merge branch 'master' into f20
by Adam Miller
commit ea4af86ffb170ddbe2805e50a68e3ce2cd84c70b
Merge: 4604bf7 1318683
Author: Adam Miller <admiller(a)redhat.com>
Date: Wed Feb 19 10:33:23 2014 -0600
Merge branch 'master' into f20
* master:
pull in xattr archive/tar from upstream
Provide 'go'
.gitignore | 1 +
golang-1.2-archive_tar-xattr.patch | 197 ++++++++++++++++++++++++++++++++++++
golang-f21-hostname.patch | 13 ---
golang.spec | 25 +++++-
sources | 1 +
5 files changed, 223 insertions(+), 14 deletions(-)
---
10 years, 2 months
[golang/f20] (3 commits) ...Merge branch 'master' into f20
by Adam Miller
Summary of changes:
77cba21... Provide 'go' (*)
1318683... pull in xattr archive/tar from upstream (*)
ea4af86... Merge branch 'master' into f20
(*) This commit already existed in another branch; no separate mail sent
10 years, 2 months
[golang] pull in xattr archive/tar from upstream
by Adam Miller
commit 1318683961fedd00746cbe3146f7310b9a5ec024
Author: Adam Miller <admiller(a)redhat.com>
Date: Wed Feb 19 10:31:14 2014 -0600
pull in xattr archive/tar from upstream
.gitignore | 1 +
golang-1.2-archive_tar-xattr.patch | 197 ++++++++++++++++++++++++++++++++++++
golang-f21-hostname.patch | 13 ---
golang.spec | 20 ++++-
sources | 1 +
5 files changed, 218 insertions(+), 14 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b049d62..6caf296 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/go1.1.1.src.tar.gz
/go1.1.2.src.tar.gz
/go1.2.src.tar.gz
+/golang-19087:a15f344a9efa-xattrs.tar
diff --git a/golang-1.2-archive_tar-xattr.patch b/golang-1.2-archive_tar-xattr.patch
new file mode 100644
index 0000000..10c8f3d
--- /dev/null
+++ b/golang-1.2-archive_tar-xattr.patch
@@ -0,0 +1,197 @@
+# HG changeset patch
+# User Alexander Larsson <alexander.larsson(a)gmail.com>
+# Date 1392282510 -39600
+# Node ID a15f344a9efa35ef168c8feaa92a15a1cdc93db5
+# Parent 1a32fe60e0798d82bbff6c945001c7f0ba8de5ea
+archive/tar: support extended attributes
+
+This adds support for archives with the SCHILY.xattr field in the
+pax header. This is what gnu tar and star generate.
+Fixes issue 7154.
+
+LGTM=dsymonds
+R=golang-codereviews, gobot, dsymonds
+CC=golang-codereviews
+https://codereview.appspot.com/54570043
+
+Committer: David Symonds <dsymonds(a)golang.org>
+
+diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/common.go
+--- a/src/pkg/archive/tar/common.go Thu Feb 13 03:09:03 2014 -0500
++++ b/src/pkg/archive/tar/common.go Thu Feb 13 20:08:30 2014 +1100
+@@ -57,6 +57,7 @@
+ Devminor int64 // minor number of character or block device
+ AccessTime time.Time // access time
+ ChangeTime time.Time // status change time
++ Xattrs map[string]string
+ }
+
+ // File name constants from the tar spec.
+@@ -189,6 +190,7 @@
+ paxSize = "size"
+ paxUid = "uid"
+ paxUname = "uname"
++ paxXattr = "SCHILY.xattr."
+ paxNone = ""
+ )
+
+diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader.go
+--- a/src/pkg/archive/tar/reader.go Thu Feb 13 03:09:03 2014 -0500
++++ b/src/pkg/archive/tar/reader.go Thu Feb 13 20:08:30 2014 +1100
+@@ -139,8 +139,14 @@
+ return err
+ }
+ hdr.Size = int64(size)
++ default:
++ if strings.HasPrefix(k, paxXattr) {
++ if hdr.Xattrs == nil {
++ hdr.Xattrs = make(map[string]string)
++ }
++ hdr.Xattrs[k[len(paxXattr):]] = v
++ }
+ }
+-
+ }
+ return nil
+ }
+diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/reader_test.go
+--- a/src/pkg/archive/tar/reader_test.go Thu Feb 13 03:09:03 2014 -0500
++++ b/src/pkg/archive/tar/reader_test.go Thu Feb 13 20:08:30 2014 +1100
+@@ -161,6 +161,46 @@
+ },
+ },
+ },
++ {
++ file: "testdata/xattrs.tar",
++ headers: []*Header{
++ {
++ Name: "small.txt",
++ Mode: 0644,
++ Uid: 1000,
++ Gid: 10,
++ Size: 5,
++ ModTime: time.Unix(1386065770, 448252320),
++ Typeflag: '0',
++ Uname: "alex",
++ Gname: "wheel",
++ AccessTime: time.Unix(1389782991, 419875220),
++ ChangeTime: time.Unix(1389782956, 794414986),
++ Xattrs: map[string]string{
++ "user.key": "value",
++ "user.key2": "value2",
++ // Interestingly, selinux encodes the terminating null inside the xattr
++ "security.selinux": "unconfined_u:object_r:default_t:s0\x00",
++ },
++ },
++ {
++ Name: "small2.txt",
++ Mode: 0644,
++ Uid: 1000,
++ Gid: 10,
++ Size: 11,
++ ModTime: time.Unix(1386065770, 449252304),
++ Typeflag: '0',
++ Uname: "alex",
++ Gname: "wheel",
++ AccessTime: time.Unix(1389782991, 419875220),
++ ChangeTime: time.Unix(1386065770, 449252304),
++ Xattrs: map[string]string{
++ "security.selinux": "unconfined_u:object_r:default_t:s0\x00",
++ },
++ },
++ },
++ },
+ }
+
+ func TestReader(t *testing.T) {
+@@ -180,7 +220,7 @@
+ f.Close()
+ continue testLoop
+ }
+- if *hdr != *header {
++ if !reflect.DeepEqual(*hdr, *header) {
+ t.Errorf("test %d, entry %d: Incorrect header:\nhave %+v\nwant %+v",
+ i, j, *hdr, *header)
+ }
+@@ -253,7 +293,7 @@
+ }
+
+ // check the header
+- if *hdr != *headers[nread] {
++ if !reflect.DeepEqual(*hdr, *headers[nread]) {
+ t.Errorf("Incorrect header:\nhave %+v\nwant %+v",
+ *hdr, headers[nread])
+ }
+diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer.go
+--- a/src/pkg/archive/tar/writer.go Thu Feb 13 03:09:03 2014 -0500
++++ b/src/pkg/archive/tar/writer.go Thu Feb 13 20:08:30 2014 +1100
+@@ -236,6 +236,12 @@
+ return tw.err
+ }
+
++ if allowPax {
++ for k, v := range hdr.Xattrs {
++ paxHeaders[paxXattr+k] = v
++ }
++ }
++
+ if len(paxHeaders) > 0 {
+ if !allowPax {
+ return errInvalidHeader
+diff -r 1a32fe60e079 -r a15f344a9efa src/pkg/archive/tar/writer_test.go
+--- a/src/pkg/archive/tar/writer_test.go Thu Feb 13 03:09:03 2014 -0500
++++ b/src/pkg/archive/tar/writer_test.go Thu Feb 13 20:08:30 2014 +1100
+@@ -10,6 +10,7 @@
+ "io"
+ "io/ioutil"
+ "os"
++ "reflect"
+ "strings"
+ "testing"
+ "testing/iotest"
+@@ -338,6 +339,45 @@
+ }
+ }
+
++func TestPaxXattrs(t *testing.T) {
++ xattrs := map[string]string{
++ "user.key": "value",
++ }
++
++ // Create an archive with an xattr
++ fileinfo, err := os.Stat("testdata/small.txt")
++ if err != nil {
++ t.Fatal(err)
++ }
++ hdr, err := FileInfoHeader(fileinfo, "")
++ if err != nil {
++ t.Fatalf("os.Stat: %v", err)
++ }
++ contents := "Kilts"
++ hdr.Xattrs = xattrs
++ 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)
++ }
++ // Test that we can get the xattrs back out of the archive.
++ reader := NewReader(&buf)
++ hdr, err = reader.Next()
++ if err != nil {
++ t.Fatal(err)
++ }
++ if !reflect.DeepEqual(hdr.Xattrs, xattrs) {
++ t.Fatalf("xattrs did not survive round trip: got %+v, want %+v",
++ hdr.Xattrs, xattrs)
++ }
++}
++
+ func TestPAXHeader(t *testing.T) {
+ medName := strings.Repeat("CD", 50)
+ longName := strings.Repeat("AB", 100)
diff --git a/golang.spec b/golang.spec
index d9f4ca8..90b56be 100644
--- a/golang.spec
+++ b/golang.spec
@@ -25,7 +25,7 @@
Name: golang
Version: 1.2
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: The Go Programming Language
License: BSD
@@ -61,6 +61,11 @@ Patch2: golang-1.2-remove-ECC-p224.patch
# http://code.google.com/p/go/issues/detail?id=6522
Patch3: ./golang-1.2-skipCpuProfileTest.patch
+# Pull in new archive/tar upstream patch to support xattrs for
+# docker-0.8.1
+# https://code.google.com/p/go/source/detail?r=a15f344a9efa
+Patch4: golang-1.2-archive_tar-xattr.patch
+
# Having documentation separate was broken
Obsoletes: %{name}-docs < 1.1-4
@@ -72,6 +77,10 @@ ExclusiveArch: %{ix86} x86_64 %{arm}
Source100: golang-gdbinit
Source101: golang-prelink.conf
+# Patch4 - pull in new archive/tar upstream patch, this file is part
+# of the upstream merge and is used for test cases.
+Source400: golang-19087:a15f344a9efa-xattrs.tar
+
%description
%{summary}.
@@ -135,6 +144,8 @@ end
%prep
%setup -q -n go
+cp %SOURCE400 src/pkg/archive/tar/testdata/xattrs.tar
+
# increase verbosity of build
%patch0 -p1
@@ -144,6 +155,9 @@ end
# skip flaky test
%patch3 -p1
+# new archive/tar implementation from upstream
+%patch4 -p1
+
# create a [dirty] gcc wrapper to allow us to build with our own flags
# (dirty because it is spoofing 'gcc' since CC value is stored in the go tool)
# TODO: remove this and just set CFLAGS/LDFLAGS once upstream supports it
@@ -295,6 +309,10 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf
%changelog
+* Wed Feb 19 2014 Adam Miller <maxamillion(a)fedoraproject.org> 1.2-6
+- pull in upstream archive/tar implementation that supports xattr for
+ docker 0.8.1
+
* Tue Feb 18 2014 Vincent Batts <vbatts(a)redhat.com> 1.2-5
- provide 'go', so users can yum install 'go'
diff --git a/sources b/sources
index f14eee7..506d921 100644
--- a/sources
+++ b/sources
@@ -1 +1,2 @@
c2ace56f6b6413a5c6318b9527a8b763 go1.2.src.tar.gz
+d76dc07e475b2905b5fec1cf319b6356 golang-19087:a15f344a9efa-xattrs.tar
10 years, 2 months
[golang] Provide 'go'
by Vincent Batts
commit 77cba216ba54726cd0e60a92a465105620d2e23e
Author: Vincent Batts <vbatts(a)redhat.com>
Date: Tue Feb 18 16:56:24 2014 -0500
Provide 'go'
golang.spec | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/golang.spec b/golang.spec
index 21428aa..d9f4ca8 100644
--- a/golang.spec
+++ b/golang.spec
@@ -25,7 +25,7 @@
Name: golang
Version: 1.2
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: The Go Programming Language
License: BSD
@@ -40,6 +40,8 @@ Patch1: golang-f21-hostname.patch
BuildRequires: /bin/hostname
%endif
+Provides: go = %{version}-%{release}
+
BuildRequires: emacs
# xemacs on fedora only
%if 0%{?fedora}
@@ -293,6 +295,9 @@ cp -av %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/prelink.conf.d/golang.conf
%changelog
+* Tue Feb 18 2014 Vincent Batts <vbatts(a)redhat.com> 1.2-5
+- provide 'go', so users can yum install 'go'
+
* Thu Jan 24 2014 Vincent Batts <vbatts(a)redhat.com> 1.2-4
- skip a flaky test that is sporadically failing on the build server
10 years, 2 months