distribution/packages/network/syncthing/patches/002-no-automatic-upgrade.patch

58 lines
2 KiB
Diff

diff -rupN syncthing.orig/cmd/syncthing/main.go syncthing/cmd/syncthing/main.go
--- syncthing.orig/cmd/syncthing/main.go 2023-12-16 12:40:52.535043816 +0000
+++ syncthing/cmd/syncthing/main.go 2023-12-16 12:54:23.535684981 +0000
@@ -600,24 +600,24 @@ func syncthingMain(options serveOptions)
// upgrade immediately. The auto-upgrade routine can only be started
// later after App is initialised.
- autoUpgradePossible := autoUpgradePossible(options)
- if autoUpgradePossible && cfgWrapper.Options().AutoUpgradeEnabled() {
+ //autoUpgradePossible := autoUpgradePossible(options)
+ //if autoUpgradePossible && cfgWrapper.Options().AutoUpgradeEnabled() {
// try to do upgrade directly and log the error if relevant.
- release, err := initialAutoUpgradeCheck(db.NewMiscDataNamespace(ldb))
- if err == nil {
- err = upgrade.To(release)
- }
- if err != nil {
- if _, ok := err.(*errNoUpgrade); ok || err == errTooEarlyUpgradeCheck || err == errTooEarlyUpgrade {
- l.Debugln("Initial automatic upgrade:", err)
- } else {
- l.Infoln("Initial automatic upgrade:", err)
- }
- } else {
- l.Infof("Upgraded to %q, exiting now.", release.Tag)
- os.Exit(svcutil.ExitUpgrade.AsInt())
- }
- }
+ // release, err := initialAutoUpgradeCheck(db.NewMiscDataNamespace(ldb))
+ // if err == nil {
+ // err = upgrade.To(release)
+ // }
+ // if err != nil {
+ // if _, ok := err.(*errNoUpgrade); ok || err == errTooEarlyUpgradeCheck || err == errTooEarlyUpgrade {
+ // l.Debugln("Initial automatic upgrade:", err)
+ // } else {
+ // l.Infoln("Initial automatic upgrade:", err)
+ // }
+ // } else {
+ // l.Infof("Upgraded to %q, exiting now.", release.Tag)
+ // os.Exit(svcutil.ExitUpgrade.AsInt())
+ // }
+ //}
if options.Unpaused {
setPauseState(cfgWrapper, false)
@@ -654,9 +654,9 @@ func syncthingMain(options serveOptions)
os.Exit(svcutil.ExitError.AsInt())
}
- if autoUpgradePossible {
- go autoUpgrade(cfgWrapper, app, evLogger)
- }
+ //if autoUpgradePossible {
+ // go autoUpgrade(cfgWrapper, app, evLogger)
+ //}
setupSignalHandling(app)