Prechádzať zdrojové kódy

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.
Maxim Baz 7 rokov pred
rodič
commit
bebc821653
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      aur/aur.go

+ 1 - 1
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))