Documentation
¶
Index ¶
- Constants
- func CalculateElfSize(file string) int64
- func CheckMagicAtOffset(f *os.File, magic string, offset int64) bool
- func FindMostRecentFile(files []string) string
- func GetSectionData(filepath string, name string) ([]byte, error)
- func LogError(context string, e error)
- func PrintError(context string, e error)
- func RunCmdStringTransparently(command string) error
- func RunCmdTransparently(command []string) error
- func ValidateUpdateInformation(updateinformation string) error
- type UpdateInformation
Constants ¶
const ExecLocationKey = "X-ExecLocation"
This key in the desktop files written by appimaged describes where the AppImage is in the filesystem. We need this because we rewrite Exec= to include things like wrap and Firejail
Variables ¶
This section is empty.
Functions ¶
func CalculateElfSize ¶
CalculateElfSize returns the size of an ELF binary as an int64 based on the information in the ELF header
func CheckMagicAtOffset ¶
Return true if magic string (hex) is found at offset TODO: Instead of magic string, could probably use something like []byte{'\r', '\n'} or []byte("AI")
func FindMostRecentFile ¶
FindMostRecentFile returns the most recent file from a slice of files, (currently) based on its mtime based on https://stackoverflow.com/a/45579190 TODO: mtime may be fast, but is it "good enough" for our purposes?
func GetSectionData ¶
GetSectionData returns the contents of an ELF section and error
func PrintError ¶
PrintError prints error, prefixed by a string that explains the context
func RunCmdStringTransparently ¶
RunCmdStringTransparently works like RunCmdTransparently but accepts a string rather than a []string as its input. Why is this not part of the standard library?
func RunCmdTransparently ¶
RunCmdTransparently runs the command given in a []string and runs it transparently (stdin and stderr appear immediately while the command is running). Blocks until command has completed. Returns error. https://stackoverflow.com/a/31004293 https://stackoverflow.com/q/33452726 Why is this not part of the standard library?
func ValidateUpdateInformation ¶
ValidateUpdateInformation validates an updateinformation string, returns error. TODO: Build this into NewUpdateInformationFromString and get rid of it?
Types ¶
type UpdateInformation ¶
type UpdateInformation struct {
// contains filtered or unexported fields
}
Please note that pre-releases are not being considered when using "latest". You will have to explicitly provide the name of a release. When using e.g., uploadtool, the name of the release created will always be "continuous", hence, you can just specify that value instead of "latest".
func NewUpdateInformationFromString ¶
func NewUpdateInformationFromString(updateinformation string) (UpdateInformation, error)
NewUpdateInformationFromString returns an UpdateInformation struct for the given updateinformation string, and err TODO: Use UpdateInformation structs throughout the codebase