From bebc82165334ba72ca2390fb8de6be7bae2eced5 Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sat, 17 Jun 2017 19:18:44 +0200 Subject: [PATCH 1/2] Fix TimeUpdate param usage TimeUpdate is `false` by default. We want to compare modification time only when user changes this parameter to `true`. The current code seems to have inverted logic at the moment. --- aur/aur.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aur/aur.go b/aur/aur.go index fbeabec8..969d31fa 100644 --- a/aur/aur.go +++ b/aur/aur.go @@ -167,7 +167,7 @@ func Upgrade(flags []string) error { if _, ok := foreign[res.Name]; ok { // Leaving this here for now, warn about downgrades later - if (!config.YayConf.TimeUpdate && (int64(res.LastModified) > foreign[res.Name].BuildDate().Unix())) || + if (config.YayConf.TimeUpdate && (int64(res.LastModified) > foreign[res.Name].BuildDate().Unix())) || alpm.VerCmp(foreign[res.Name].Version(), res.Version) < 0 { buffer.WriteString(fmt.Sprintf("\x1b[1m\x1b[32m==>\x1b[33;1m %s: \x1b[0m%s \x1b[33;1m-> \x1b[0m%s\n", res.Name, foreign[res.Name].Version(), res.Version)) From 72cfd64e3601db61a0b53b45bf2225030bd130da Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Wed, 21 Jun 2017 09:41:54 +0200 Subject: [PATCH 2/2] Fix config name in json --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index f6b914ad..42c35bec 100644 --- a/config/config.go +++ b/config/config.go @@ -38,7 +38,7 @@ type Configuration struct { SearchMode int `json:"-"` SortMode int `json:"sortmode"` TarBin string `json:"tarbin"` - TimeUpdate bool `json:"versionupdate"` + TimeUpdate bool `json:"timeupdate"` } // YayConf holds the current config values for yay.