From 5c2ae0928827c6e5a77418752ba52455df202c6b Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Feb 14 2020 06:37:51 +0000 Subject: Initial import (#1801527) --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..90159d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/redis-5.2.9.tar.gz diff --git a/golang-gopkg-redis-5.spec b/golang-gopkg-redis-5.spec new file mode 100644 index 0000000..903fbe0 --- /dev/null +++ b/golang-gopkg-redis-5.spec @@ -0,0 +1,67 @@ +# Generated by go2rpm 1 +%bcond_without check + +# https://github.com/go-redis/redis +%global goipath gopkg.in/redis.v5 +%global forgeurl https://github.com/go-redis/redis +Version: 5.2.9 + +%gometa + +%global common_description %{expand: +Type-safe Redis client for Golang.} + +%global golicenses LICENSE +%global godocs README.md + +Name: %{goname} +Release: 1%{?dist} +Summary: Type-safe Redis client for Golang + +# Upstream license specification: BSD-2-Clause +License: BSD +URL: %{gourl} +Source0: %{gosource} + +# back-ported from master, for latest redis-server responses +Patch0: redis-5-testing.patch + +%if %{with check} +# Tests +BuildRequires: redis +BuildRequires: golang(github.com/onsi/ginkgo) +BuildRequires: golang(github.com/onsi/gomega) +%endif + +%description +%{common_description} + +%gopkg + +%prep +%goprep +%patch0 -p1 + +%install +%gopkginstall +%global _testdata_redis_src %{_builddir}/redis-%{version}/testdata/redis/src +mkdir -p %{_testdata_redis_src} +ln -s %{_bindir}/redis-server %{_testdata_redis_src}/redis-server + +%if %{with check} +%check +# Run a test Redis server rather than assuming the system +# is running one already (see patch0) - non-default port. +redis-server --port 18126 & +sleep 0.2 # time to startup +redis-cli -p 18126 PING || exit 1 +%gocheck +redis-cli -p 18126 SHUTDOWN || exit 1 +%endif + +%gopkgfiles + +%changelog +* Tue Feb 11 14:41:10 AEDT 2020 Nathan Scott - 5.2.9-1 +- Initial package + diff --git a/redis-5-testing.patch b/redis-5-testing.patch new file mode 100644 index 0000000..6d92012 --- /dev/null +++ b/redis-5-testing.patch @@ -0,0 +1,76 @@ +diff --git a/bench_test.go b/bench_test.go +index 2b4d45c..5820f80 100644 +--- a/bench_test.go ++++ b/bench_test.go +@@ -10,7 +10,7 @@ import ( + + func benchmarkRedisClient(poolSize int) *redis.Client { + client := redis.NewClient(&redis.Options{ +- Addr: ":6379", ++ Addr: ":18126", + DialTimeout: time.Second, + ReadTimeout: time.Second, + WriteTimeout: time.Second, +diff --git a/commands_test.go b/commands_test.go +index 7e4182e..835c07b 100644 +--- a/commands_test.go ++++ b/commands_test.go +@@ -2888,12 +2888,12 @@ var _ = Describe("Commands", func() { + It("returns map of commands", func() { + cmds, err := client.Command().Result() + Expect(err).NotTo(HaveOccurred()) +- Expect(len(cmds)).To(BeNumerically("~", 173, 5)) ++ Expect(len(cmds)).To(BeNumerically("~", 200, 20)) + + cmd := cmds["mget"] + Expect(cmd.Name).To(Equal("mget")) + Expect(cmd.Arity).To(Equal(int8(-2))) +- Expect(cmd.Flags).To(Equal([]string{"readonly"})) ++ Expect(cmd.Flags).To(ContainElement("readonly")) + Expect(cmd.FirstKeyPos).To(Equal(int8(1))) + Expect(cmd.LastKeyPos).To(Equal(int8(-1))) + Expect(cmd.StepCount).To(Equal(int8(1))) +diff --git a/example_instrumentation_test.go b/example_instrumentation_test.go +index 009138e..88ab96a 100644 +--- a/example_instrumentation_test.go ++++ b/example_instrumentation_test.go +@@ -11,7 +11,7 @@ import ( + func Example_instrumentation() { + ring := redis.NewRing(&redis.RingOptions{ + Addrs: map[string]string{ +- "shard1": ":6379", ++ "shard1": ":18126", + }, + }) + ring.ForEachShard(func(client *redis.Client) error { +diff --git a/example_test.go b/example_test.go +index 45be043..4b2a939 100644 +--- a/example_test.go ++++ b/example_test.go +@@ -13,7 +13,7 @@ var client *redis.Client + + func init() { + client = redis.NewClient(&redis.Options{ +- Addr: ":6379", ++ Addr: ":18126", + DialTimeout: 10 * time.Second, + ReadTimeout: 30 * time.Second, + WriteTimeout: 30 * time.Second, +@@ -25,7 +25,7 @@ func init() { + + func ExampleNewClient() { + client := redis.NewClient(&redis.Options{ +- Addr: "localhost:6379", ++ Addr: "localhost:18126", + Password: "", // no password set + DB: 0, // use default DB + }) +@@ -40,7 +40,7 @@ func ExampleNewFailoverClient() { + // setup Redis Sentinel. + client := redis.NewFailoverClient(&redis.FailoverOptions{ + MasterName: "master", +- SentinelAddrs: []string{":26379"}, ++ SentinelAddrs: []string{":28126"}, + }) + client.Ping() + } diff --git a/sources b/sources new file mode 100644 index 0000000..9187017 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (redis-5.2.9.tar.gz) = 201d74edfb1f775c71de1bbb5a8f21037d033125b87fda8b24bc137b32cdf43243f3fb1ca1f7959d956dd3bb70ea6848363609b27d63dbdaf6f8f5db526a3b52