mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 09:04:52 +01:00
selfupdate: dont detect FUSE if build is static
Before this patch selfupdate detected ANY build with cmount tag as a build having libFUSE capabilities. However, only dynamic builds really have it. The official linux builds are static and have the cmount tag as of the time of this writing. This results in inability to update official linux binaries. This patch fixes that. The build can be fixed independently.
This commit is contained in:
parent
886dfd23e2
commit
93353c431b
@ -21,6 +21,7 @@ import (
|
|||||||
"github.com/rclone/rclone/cmd/mountlib"
|
"github.com/rclone/rclone/cmd/mountlib"
|
||||||
"github.com/rclone/rclone/fs"
|
"github.com/rclone/rclone/fs"
|
||||||
"github.com/rclone/rclone/lib/atexit"
|
"github.com/rclone/rclone/lib/atexit"
|
||||||
|
"github.com/rclone/rclone/lib/buildinfo"
|
||||||
"github.com/rclone/rclone/vfs"
|
"github.com/rclone/rclone/vfs"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -35,6 +36,7 @@ func init() {
|
|||||||
cmd.Aliases = append(cmd.Aliases, "cmount")
|
cmd.Aliases = append(cmd.Aliases, "cmount")
|
||||||
}
|
}
|
||||||
mountlib.AddRc("cmount", mount)
|
mountlib.AddRc("cmount", mount)
|
||||||
|
buildinfo.Tags = append(buildinfo.Tags, "cmount")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the option string in the current options
|
// Find the option string in the current options
|
||||||
|
@ -27,7 +27,7 @@ If the old version contains only dots and digits (for example |v1.54.0|)
|
|||||||
then it's a stable release so you won't need the |--beta| flag. Beta releases
|
then it's a stable release so you won't need the |--beta| flag. Beta releases
|
||||||
have an additional information similar to |v1.54.0-beta.5111.06f1c0c61|.
|
have an additional information similar to |v1.54.0-beta.5111.06f1c0c61|.
|
||||||
(if you are a developer and use a locally built rclone, the version number
|
(if you are a developer and use a locally built rclone, the version number
|
||||||
will end with |-DEV|, you will have to rebuild it as it obvisously can't
|
will end with |-DEV|, you will have to rebuild it as it obviously can't
|
||||||
be distributed).
|
be distributed).
|
||||||
|
|
||||||
If you previously installed rclone via a package manager, the package may
|
If you previously installed rclone via a package manager, the package may
|
||||||
|
@ -143,14 +143,9 @@ func InstallUpdate(ctx context.Context, opt *Options) error {
|
|||||||
return errors.New("--stable and --beta are mutually exclusive")
|
return errors.New("--stable and --beta are mutually exclusive")
|
||||||
}
|
}
|
||||||
|
|
||||||
gotCmount := false
|
// The `cmount` tag is added by cmd/cmount/mount.go only if build is static.
|
||||||
for _, tag := range buildinfo.Tags {
|
_, tags := buildinfo.GetLinkingAndTags()
|
||||||
if tag == "cmount" {
|
if strings.Contains(" "+tags+" ", " cmount ") && !cmount.ProvidedBy(runtime.GOOS) {
|
||||||
gotCmount = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if gotCmount && !cmount.ProvidedBy(runtime.GOOS) {
|
|
||||||
return errors.New("updating would discard the mount FUSE capability, aborting")
|
return errors.New("updating would discard the mount FUSE capability, aborting")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
// +build cmount
|
|
||||||
|
|
||||||
package buildinfo
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
Tags = append(Tags, "cmount")
|
|
||||||
}
|
|
@ -6,6 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Tags contains slice of build tags
|
// Tags contains slice of build tags
|
||||||
|
// The `cmount` tag is added by cmd/cmount/mount.go only if build is static.
|
||||||
|
// Other tags including `cgo` are detected in this package.
|
||||||
var Tags []string
|
var Tags []string
|
||||||
|
|
||||||
// GetLinkingAndTags tells how the rclone executable was linked
|
// GetLinkingAndTags tells how the rclone executable was linked
|
||||||
|
Loading…
Reference in New Issue
Block a user