diff --git a/.gitignore b/.gitignore index 6a8e150..98cceea 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /viper-1.4.0.tar.gz /viper-1.6.2.tar.gz /viper-1.7.1.tar.gz +/viper-1.10.1.tar.gz diff --git a/0001-Remove-TestBindPFlagsStringSlice-and-TestBindPFlagsIntSlice.patch b/0001-Remove-TestBindPFlagsStringSlice-and-TestBindPFlagsIntSlice.patch deleted file mode 100644 index 14d2e95..0000000 --- a/0001-Remove-TestBindPFlagsStringSlice-and-TestBindPFlagsIntSlice.patch +++ /dev/null @@ -1,100 +0,0 @@ -diff -up viper-1.7.1/viper_test.go.orig viper-1.7.1/viper_test.go ---- viper-1.7.1/viper_test.go.orig 2020-07-31 23:39:06.000000000 +0200 -+++ viper-1.7.1/viper_test.go 2020-08-10 20:17:26.459993195 +0200 -@@ -859,96 +859,6 @@ func TestBindPFlags(t *testing.T) { - } - } - --func TestBindPFlagsStringSlice(t *testing.T) { -- tests := []struct { -- Expected []string -- Value string -- }{ -- {nil, ""}, -- {[]string{"jeden"}, "jeden"}, -- {[]string{"dwa", "trzy"}, "dwa,trzy"}, -- {[]string{"cztery", "piec , szesc"}, "cztery,\"piec , szesc\""}, -- } -- -- v := New() // create independent Viper object -- defaultVal := []string{"default"} -- v.SetDefault("stringslice", defaultVal) -- -- for _, testValue := range tests { -- flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) -- flagSet.StringSlice("stringslice", testValue.Expected, "test") -- -- for _, changed := range []bool{true, false} { -- flagSet.VisitAll(func(f *pflag.Flag) { -- f.Value.Set(testValue.Value) -- f.Changed = changed -- }) -- -- err := v.BindPFlags(flagSet) -- if err != nil { -- t.Fatalf("error binding flag set, %v", err) -- } -- -- type TestStr struct { -- StringSlice []string -- } -- val := &TestStr{} -- if err := v.Unmarshal(val); err != nil { -- t.Fatalf("%+#v cannot unmarshal: %s", testValue.Value, err) -- } -- if changed { -- assert.Equal(t, testValue.Expected, val.StringSlice) -- } else { -- assert.Equal(t, defaultVal, val.StringSlice) -- } -- } -- } --} -- --func TestBindPFlagsIntSlice(t *testing.T) { -- tests := []struct { -- Expected []int -- Value string -- }{ -- {nil, ""}, -- {[]int{1}, "1"}, -- {[]int{2, 3}, "2,3"}, -- } -- -- v := New() // create independent Viper object -- defaultVal := []int{0} -- v.SetDefault("intslice", defaultVal) -- -- for _, testValue := range tests { -- flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError) -- flagSet.IntSlice("intslice", testValue.Expected, "test") -- -- for _, changed := range []bool{true, false} { -- flagSet.VisitAll(func(f *pflag.Flag) { -- f.Value.Set(testValue.Value) -- f.Changed = changed -- }) -- -- err := v.BindPFlags(flagSet) -- if err != nil { -- t.Fatalf("error binding flag set, %v", err) -- } -- -- type TestInt struct { -- IntSlice []int -- } -- val := &TestInt{} -- if err := v.Unmarshal(val); err != nil { -- t.Fatalf("%+#v cannot unmarshal: %s", testValue.Value, err) -- } -- if changed { -- assert.Equal(t, testValue.Expected, val.IntSlice) -- } else { -- assert.Equal(t, defaultVal, val.IntSlice) -- } -- } -- } --} - - func TestBindPFlag(t *testing.T) { - var testString = "testing" diff --git a/golang-github-spf13-viper.spec b/golang-github-spf13-viper.spec index 401bc60..eb4fabf 100644 --- a/golang-github-spf13-viper.spec +++ b/golang-github-spf13-viper.spec @@ -1,10 +1,16 @@ # Generated by go2rpm -%bcond_without check %bcond_with bootstrap +%if %{with bootstrap} +# Do not run %%check when bootstrapping. +%bcond_with check +%else +%bcond_without check +%endif +%global debug_package %{nil} # https://github.com/spf13/viper %global goipath github.com/spf13/viper -Version: 1.7.1 +Version: 1.10.1 %gometa @@ -42,11 +48,9 @@ Summary: Go configuration with fangs License: MIT URL: %{gourl} Source0: %{gosource} -# https://github.com/spf13/viper/issues/947 -Patch0: 0001-Remove-TestBindPFlagsStringSlice-and-TestBindPFlagsIntSlice.patch %if %{without bootstrap} -BuildRequires: golang(github.com/bketelsen/crypt/config) +BuildRequires: golang(github.com/sagikazarmark/crypt/config) %endif BuildRequires: golang(github.com/fsnotify/fsnotify) BuildRequires: golang(github.com/hashicorp/hcl) @@ -75,19 +79,14 @@ BuildRequires: golang(github.com/stretchr/testify/require) %prep %goprep -%patch0 -p1 %install %gopkginstall %if %{with check} %check -%if %{with bootstrap} -%gocheck -d remote -%else %gocheck %endif -%endif %gopkgfiles diff --git a/sources b/sources index 685a082..e1d6eca 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (viper-1.7.1.tar.gz) = 209880f7a467f8a8bba1ecf6bf6e3ae7aff33edd99743e44a94fc33e2bc3fda8daf0af18798d7d895f3a9feee4ab5d9a6b8f6feb07f70542960417858a58c9d3 +SHA512 (viper-1.10.1.tar.gz) = 018bc168a7b00becd9d3621f402b7033725cca88f7efefae334c674075650f4227183055bd1bb154dba0a4ccffb18d6de2f8b91fe08e625185d4b261da85e69d