gofish

package module
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 18 Imported by: 6

README

GoFish, The Package Manager

Build Status

Features, usage and installation instructions can be found on the homepage.

What does GoFish do?

GoFish is a cross-platform systems package manager, bringing the ease of use of Homebrew to Linux and Windows.

$ gofish install go
==> Installing go...
🐠  go 1.10.1: installed in 2.307602197s

GoFish works across all three major operating systems (Windows, MacOS, and Linux). It installs packages into its own directory and symlinks their files into /usr/local (or C:\ProgramData for Windows). You can think of it as the cross-platform Homebrew.

Want to add your project to the list of installable thingies?

Make a PR at fishworks/fish-food! Just make sure to follow the Contributing Guide first.

Troubleshooting

For troubleshooting, see the Troubleshooting Guide.

Security

Please email security issues to Matt Fisher.

License

GoFish is licensed under the Apache v2 License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCouldNotLink struct {
	Err error
}

ErrCouldNotLink is returned when the 'link' operation does not succeed

func (ErrCouldNotLink) Error added in v0.14.0

func (e ErrCouldNotLink) Error() string
type ErrCouldNotUnlink struct {
	Err error
}

ErrCouldNotUnlink is returned when the 'unlink' operation does not succeed

func (ErrCouldNotUnlink) Error added in v0.14.0

func (e ErrCouldNotUnlink) Error() string

type Food

type Food struct {
	// The canonical name of the software.
	Name string
	// The repository where this food resides.
	Rig string
	// A (short) description of the software.
	Description string
	// The license identifier for the software.
	License string
	// The homepage URL for the software.
	Homepage string
	// Caveats inform the user about any Draft-specific caveats regarding this fish food.
	Caveats string
	// The version of the software.
	Version string
	// The list of binary distributions available for this fish food.
	Packages []*Package
	// The script to run before installation
	PreInstallScript string
	// The script to run after a successful installation
	PostInstallScript string
}

Food provides metadata to install a piece of software.

func (*Food) DownloadTo added in v0.7.0

func (f *Food) DownloadTo(pkg *Package, filePath string) error

DownloadTo downloads a particular package to filePath, returning any errors if encountered.

func (*Food) GetPackage

func (f *Food) GetPackage(os, arch string) *Package

GetPackage does a lookup for a package supporting the given os/arch. If none were found, this returns nil.

func (*Food) Install

func (f *Food) Install() error

Install attempts to install the package, returning errors if it fails.

func (f *Food) Link(pkg *Package) error

Link creates links to any linked resources owned by the package.

func (*Food) Linked

func (f *Food) Linked() bool

Linked checks to see if a particular package owned by this fish food is linked to /usr/local/bin. This is just a check if the binaries symlinked in /usr/local/bin link back to the barrel.

func (*Food) Lint added in v0.7.0

func (f *Food) Lint() (errs []error)

Lint analyses a given fish food for potential errors, returning a list of errors.

func (*Food) Uninstall

func (f *Food) Uninstall() error

Uninstall attempts to uninstall the package, returning errors if it fails.

func (f *Food) Unlink(pkg *Package) error

Unlink removes any linked resources owned by the package.

type Package

type Package struct {
	// the running program's operating system target. One of darwin, linux, windows, and so on.
	OS string
	// the running program's architecture target. One of 386, amd64, arm, s390x, and so on.
	Arch      string
	Resources []*Resource
	// The URL used to download the binary distribution for this version of the fish food. The file must be a gzipped tarball (.tar.gz) or a zipfile (.zip) for unpacking.
	URL string
	// Additional URLs for this version of the fish food.
	Mirrors []string
	// To verify the cached download's integrity and security, we verify the SHA-256 hash matches what we've declared in the fish food.
	SHA256 string
}

Package provides metadata to install a piece of software on a given operating system and architecture.

type Resource

type Resource struct {
	// Path is the path relative from the root of the unpacked archive to the resource. The resource is symlinked into the InstallPath and, if Executable is set, made executable (chmod +x).
	Path string
	// InstallPath is the destination path relative from /usr/local. The resource is symlinked from Path to the InstallPath and, if Executable is set, made executable (chmod +x).
	InstallPath string
	// Executable defines whether or not this resource should be made executable (chmod +x). This only applies for MacOS/Linux and can be ignored on Windows.
	Executable bool
}

Resource is a installable thingy that should be moved into /usr/local from the install path, such as an executable, manpages, libraries, etc.

Directories

Path Synopsis
cmd
pkg
rig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL