diff --git a/clientupdate/clientupdate.go b/clientupdate/clientupdate.go index f313dc0dd..ccd67246b 100644 --- a/clientupdate/clientupdate.go +++ b/clientupdate/clientupdate.go @@ -30,6 +30,7 @@ "github.com/google/uuid" "tailscale.com/clientupdate/distsign" "tailscale.com/types/logger" + "tailscale.com/util/cmpver" "tailscale.com/util/winutil" "tailscale.com/version" "tailscale.com/version/distro" @@ -211,9 +212,13 @@ func Update(args Arguments) error { } func (up *Updater) confirm(ver string) bool { - if version.Short() == ver { + switch cmpver.Compare(version.Short(), ver) { + case 0: up.Logf("already running %v; no update needed", ver) return false + case 1: + up.Logf("installed version %v is newer than the latest available version %v; no update needed", version.Short(), ver) + return false } if up.Confirm != nil { return up.Confirm(ver) diff --git a/cmd/tailscale/cli/update.go b/cmd/tailscale/cli/update.go index 212615169..84742a7d6 100644 --- a/cmd/tailscale/cli/update.go +++ b/cmd/tailscale/cli/update.go @@ -63,7 +63,7 @@ func runUpdate(ctx context.Context, args []string) error { err := clientupdate.Update(clientupdate.Arguments{ Version: ver, AppStore: updateArgs.appStore, - Logf: printf, + Logf: func(f string, a ...any) { printf(f+"\n", a...) }, Stdout: Stdout, Stderr: Stderr, Confirm: confirmUpdate, diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt index 5a5b5b62e..715596c43 100644 --- a/cmd/tailscale/depaware.txt +++ b/cmd/tailscale/depaware.txt @@ -158,7 +158,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/types/views from tailscale.com/tailcfg+ tailscale.com/util/clientmetric from tailscale.com/net/netcheck+ tailscale.com/util/cloudenv from tailscale.com/net/dnscache+ - W tailscale.com/util/cmpver from tailscale.com/net/tshttpproxy + tailscale.com/util/cmpver from tailscale.com/net/tshttpproxy+ tailscale.com/util/cmpx from tailscale.com/cmd/tailscale/cli+ L 💣 tailscale.com/util/dirwalk from tailscale.com/metrics tailscale.com/util/dnsname from tailscale.com/cmd/tailscale/cli+ diff --git a/cmd/tailscaled/depaware.txt b/cmd/tailscaled/depaware.txt index 414cfb1c3..b1cb0d295 100644 --- a/cmd/tailscaled/depaware.txt +++ b/cmd/tailscaled/depaware.txt @@ -331,7 +331,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de tailscale.com/types/views from tailscale.com/ipn/ipnlocal+ tailscale.com/util/clientmetric from tailscale.com/control/controlclient+ tailscale.com/util/cloudenv from tailscale.com/net/dns/resolver+ - LW tailscale.com/util/cmpver from tailscale.com/net/dns+ + tailscale.com/util/cmpver from tailscale.com/net/dns+ tailscale.com/util/cmpx from tailscale.com/derp/derphttp+ 💣 tailscale.com/util/deephash from tailscale.com/ipn/ipnlocal+ L 💣 tailscale.com/util/dirwalk from tailscale.com/metrics+