diff --git a/.gitignore b/.gitignore index 6ef0611..08d9b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /compress-1.2.1.tar.gz +/compress-1.5.0.tar.gz +/compress-1.7.0.tar.gz diff --git a/0001-Change-back-to-official-crc32.patch b/0001-Change-back-to-official-crc32.patch deleted file mode 100644 index fe73abe..0000000 --- a/0001-Change-back-to-official-crc32.patch +++ /dev/null @@ -1,136 +0,0 @@ -From e80ca55b53e5e6f53deed5c7842e7b7da95e1dc7 Mon Sep 17 00:00:00 2001 -From: Klaus Post -Date: Sun, 2 Apr 2017 16:06:18 +0200 -Subject: [PATCH] Change back to official crc32 - -All changed are merged in Go 1.7. ---- - README.md | 1 + - gzip/gunzip.go | 2 +- - gzip/gunzip_test.go | 34 ++++++++++++++++++++++++++++++++++ - gzip/gzip.go | 2 +- - zip/reader.go | 3 +-- - zip/writer.go | 3 +-- - 6 files changed, 39 insertions(+), 6 deletions(-) - -diff --git a/README.md b/README.md -index 176d51c..4834c96 100644 ---- a/README.md -+++ b/README.md -@@ -12,6 +12,7 @@ It offers slightly better compression at - [![Build Status](https://travis-ci.org/klauspost/compress.svg?branch=master)](https://travis-ci.org/klauspost/compress) - - # changelog -+* Apr 02, 2017: Change back to official crc32, since changes were merged in Go 1.7. - * Jan 14, 2017: Reduce stack pressure due to array copies. See [Issue #18625(https://github.com/golang/go/issues/18625). - * Oct 25, 2016: Level 2-4 have been rewritten and now offers significantly better performance than before. - * Oct 20, 2016: Port zlib changes from Go 1.7 to fix zlib writer issue. Please update. -diff --git a/gzip/gunzip.go b/gzip/gunzip.go -index e73fab3..568b5d4 100644 ---- a/gzip/gunzip.go -+++ b/gzip/gunzip.go -@@ -10,11 +10,11 @@ import ( - "bufio" - "encoding/binary" - "errors" -+ "hash/crc32" - "io" - "time" - - "github.com/klauspost/compress/flate" -- "github.com/klauspost/crc32" - ) - - const ( -diff --git a/gzip/gunzip_test.go b/gzip/gunzip_test.go -index c200ab1..bc7ca92 100644 ---- a/gzip/gunzip_test.go -+++ b/gzip/gunzip_test.go -@@ -680,3 +680,37 @@ func BenchmarkGunzipStdlib(b *testing.B) { - } - } - } -+func TestTruncatedGunzip(t *testing.T) { -+ in := []byte(strings.Repeat("ASDFASDFASDFASDFASDF", 1000)) -+ var buf bytes.Buffer -+ enc := NewWriter(&buf) -+ _, err := enc.Write(in) -+ if err != nil { -+ t.Fatal(err) -+ } -+ enc.Close() -+ testdata := buf.Bytes() -+ for i := 5; i < len(testdata); i += 10 { -+ timer := time.NewTimer(time.Second) -+ done := make(chan struct{}) -+ fail := make(chan struct{}) -+ go func() { -+ r, err := NewReader(bytes.NewBuffer(testdata[:i])) -+ if err == nil { -+ b, err := ioutil.ReadAll(r) -+ if err == nil && !bytes.Equal(testdata[:i], b) { -+ close(fail) -+ } -+ } -+ close(done) -+ }() -+ select { -+ case <-timer.C: -+ t.Fatal("Timeout decoding") -+ case <-fail: -+ t.Fatal("No error, but mismatch") -+ case <-done: -+ timer.Stop() -+ } -+ } -+} -diff --git a/gzip/gzip.go b/gzip/gzip.go -index a0f3ed0..7da7ee7 100644 ---- a/gzip/gzip.go -+++ b/gzip/gzip.go -@@ -7,10 +7,10 @@ package gzip - import ( - "errors" - "fmt" -+ "hash/crc32" - "io" - - "github.com/klauspost/compress/flate" -- "github.com/klauspost/crc32" - ) - - // These constants are copied from the flate package, so that code that imports -diff --git a/zip/reader.go b/zip/reader.go -index 27199dd..9a0e20d 100644 ---- a/zip/reader.go -+++ b/zip/reader.go -@@ -10,10 +10,9 @@ import ( - "errors" - "fmt" - "hash" -+ "hash/crc32" - "io" - "os" -- -- "github.com/klauspost/crc32" - ) - - var ( -diff --git a/zip/writer.go b/zip/writer.go -index 5843958..5ce66e6 100644 ---- a/zip/writer.go -+++ b/zip/writer.go -@@ -9,9 +9,8 @@ import ( - "encoding/binary" - "errors" - "hash" -+ "hash/crc32" - "io" -- -- "github.com/klauspost/crc32" - ) - - // TODO(adg): support zip file comments --- -2.14.3 - diff --git a/0001-Fix-Println-arg-list-ends-with-redundant-newline-83.patch b/0001-Fix-Println-arg-list-ends-with-redundant-newline-83.patch deleted file mode 100644 index 2ae8445..0000000 --- a/0001-Fix-Println-arg-list-ends-with-redundant-newline-83.patch +++ /dev/null @@ -1,26 +0,0 @@ -From b88785bfd699aa994985ea91b90ee8a1721c3fe1 Mon Sep 17 00:00:00 2001 -From: Klaus Post -Date: Wed, 10 Jan 2018 21:30:47 +0100 -Subject: [PATCH] Fix "Println arg list ends with redundant newline" (#83) - -Even though this is still being debated in https://github.com/golang/go/issues/18085 we might as well change it. ---- - gzip/example_test.go | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gzip/example_test.go b/gzip/example_test.go -index e32346b..ce29e9b 100644 ---- a/gzip/example_test.go -+++ b/gzip/example_test.go -@@ -98,7 +98,7 @@ func ExampleReader_Multistream() { - log.Fatal(err) - } - -- fmt.Println("\n") -+ fmt.Print("\n\n") - - err = zr.Reset(&buf) - if err == io.EOF { --- -2.14.3 - diff --git a/golang-github-klauspost-compress.spec b/golang-github-klauspost-compress.spec index 05f51cb..c7a4706 100644 --- a/golang-github-klauspost-compress.spec +++ b/golang-github-klauspost-compress.spec @@ -1,5 +1,11 @@ -%global goipath github.com/klauspost/compress -Version: 1.2.1 +# Generated by go2rpm +%bcond_without check + +# https://github.com/klauspost/compress +%global goipath github.com/klauspost/compress +Version: 1.7.0 + +%gometa %global common_description %{expand: This package is based on an optimized Deflate function, which is used by @@ -8,55 +14,53 @@ gzip/zip/zlib packages. It offers slightly better compression at lower compression settings, and up to 3x faster encoding at highest compression level.} -%gometa +%global golicenses LICENSE +%global godocs README.md Name: %{goname} -Release: 5%{?dist} +Release: 1%{?dist} Summary: Optimized compression packages + +# Upstream license specification: BSD-3-Clause License: BSD URL: %{gourl} Source0: %{gosource} -# https://github.com/klauspost/compress/commit/b88785bfd699aa994985ea91b90ee8a1721c3fe1 -Patch0: 0001-Fix-Println-arg-list-ends-with-redundant-newline-83.patch -# https://github.com/klauspost/compress/commit/e80ca55b53e5e6f53deed5c7842e7b7da95e1dc7 -Patch1: 0001-Change-back-to-official-crc32.patch -BuildRequires: dos2unix -BuildRequires: golang(github.com/klauspost/cpuid) -%description -%{common_description} +BuildRequires: golang(github.com/cespare/xxhash) +BuildRequires: golang(github.com/klauspost/cpuid) -%package devel -Summary: %{summary} +%if %{with check} +# Tests +BuildRequires: golang(github.com/DataDog/zstd) +BuildRequires: golang(github.com/google/go-cmp/cmp) +%endif -%description devel +%description %{common_description} -This package contains the source code needed for building packages that import -the %{goipath} Go namespace. +%gopkg %prep -%forgesetup -%patch0 -p1 -%patch1 -p1 -b .crc32 -dos2unix -k README.md +%goprep %install -%goinstall +%gopkginstall +%if %{with check} %check -%gochecks +%gocheck +%endif -%files devel -f devel.file-list -%license LICENSE -%doc README.md +%gopkgfiles %changelog +* Mon Apr 29 01:02:13 CEST 2019 Robert-André Mauchin - 1.7.0-1 +- Release 1.7.0 + * Fri Feb 01 2019 Fedora Release Engineering - 1.2.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild -* Tue Oct 23 2018 Nicolas Mailhot -- 1.2.1-4 +* Tue Oct 23 2018 Nicolas Mailhot - 1.2.1-4 - redhat-rpm-config-123 triggers bugs in gosetup, remove it from Go spec files as it’s just an alias - https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/RWD5YATAYAFWKIDZBB7EB6N5DAO4ZKFM/ diff --git a/sources b/sources index 16823c6..68f1861 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (compress-1.2.1.tar.gz) = e3e01501de595cc40788d5014e2144595bafafa34f37ffbd3c62583c146929190df8b4911c01c069dd68046d59d62a611e187a3534a2915ae9e351efc0a5ffa9 +SHA512 (compress-1.7.0.tar.gz) = a3e7fa26c735b71ba49d5f0cc8f6847dbcc5214f648b078ae9a5f42ef838a5bcd048de12b92e3bf9e3cc952b3e1a2f45304e938d9fe8f3c3ff6d361837368b5e