From 313cc6d3ffe602d94d425e4be2028866ce99bde0 Mon Sep 17 00:00:00 2001 From: Myles Horton Date: Fri, 4 Sep 2015 13:45:16 -0700 Subject: [PATCH] need to change config handling again because in iran old configs have old, bad masquerades --- src/github.com/getlantern/flashlight/config/config.go | 4 ++-- src/github.com/getlantern/flashlight/config/config_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/github.com/getlantern/flashlight/config/config.go b/src/github.com/getlantern/flashlight/config/config.go index 744d7d271e..600ba8ec32 100644 --- a/src/github.com/getlantern/flashlight/config/config.go +++ b/src/github.com/getlantern/flashlight/config/config.go @@ -43,7 +43,7 @@ var ( m *yamlconf.Manager lastCloudConfigETag = map[string]string{} httpClient atomic.Value - r = regexp.MustCompile("\\d+") + r = regexp.MustCompile("\\d+\\.\\d+") ) type Config struct { @@ -126,7 +126,7 @@ func copyNewest(file string, existsFunc func(file string) (string, bool)) string // Init initializes the configuration system. func Init(version string) (*Config, error) { file := "lantern-" + majorVersion(version) + ".yaml" - copyNewest(file, configExists) + //copyNewest(file, configExists) configPath, err := InConfigDir(file) if err != nil { log.Errorf("Could not get config path? %v", err) diff --git a/src/github.com/getlantern/flashlight/config/config_test.go b/src/github.com/getlantern/flashlight/config/config_test.go index ec872820f4..90661f8fe4 100644 --- a/src/github.com/getlantern/flashlight/config/config_test.go +++ b/src/github.com/getlantern/flashlight/config/config_test.go @@ -34,9 +34,9 @@ func TestCopyOldConfig(t *testing.T) { } func TestMajorVersion(t *testing.T) { - ver := "222.0.1" + ver := "222.00.1" maj := majorVersion(ver) - assert.Equal(t, "222", maj, "Unexpected major version") + assert.Equal(t, "222.00", maj, "Unexpected major version") } func TestDataCenter(t *testing.T) {