Documentation ¶
Overview ¶
Package snapdtool exposes version and related information, supports re-execution and inter-tool lookup/execution across all snapd tools.
Index ¶
- Variables
- func CommandFromSystemSnap(name string, cmdArgs ...string) (*exec.Cmd, error)
- func ExecInSnapdOrCoreSnap()
- func InternalToolPath(tool string) (string, error)
- func IsReexecd() (bool, error)
- func MockOsReadlink(f func(string) (string, error)) func()
- func MockVersion(version string) (restore func())
- func SnapdVersionFromInfoFile(infoPath string) (string, error)
Constants ¶
This section is empty.
Variables ¶
var Version = "unknown"
Version will be overwritten at build-time via mkversion.sh
Functions ¶
func CommandFromSystemSnap ¶
CommandFromSystemSnap runs a command from the snapd/core snap using the proper interpreter and library paths.
At the moment it can only run ELF files, expects a standard ld.so interpreter, and can't handle RPATH.
func ExecInSnapdOrCoreSnap ¶
func ExecInSnapdOrCoreSnap()
ExecInSnapdOrCoreSnap makes sure you're executing the binary that ships in the snapd/core snap.
func InternalToolPath ¶
InternalToolPath returns the path of an internal snapd tool. The tool *must* be located inside the same tree as the current binary.
The return value is either the path of the tool in the current distribution or in the core/snapd snap (or the ubuntu-core snap) if the current binary is ran from that location.
func MockOsReadlink ¶
MockOsReadlink is for use in tests
func MockVersion ¶
func MockVersion(version string) (restore func())
func SnapdVersionFromInfoFile ¶
SnapdVersionFromInfoFile returns snapd version read for the given info" file, pointed by infoPath. The format of the "info" file is a single line with "VERSION=..." in it. The file is produced by mkversion.sh and normally installed along snapd binary in /usr/lib/snapd.
Types ¶
This section is empty.