bfs

package
v10.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BustGhosts

func BustGhosts(params *BustGhostsParams) error

*

  • A ghost busting is performed after performing an install using a method
  • that lets us know exactly what was written to disk. *
  • In this case, we:
  • - Install in-place, directly into the destination
  • - Compare the previous list of installed files with the list
  • of files we just wrote to disk
  • - Remove all the ghosts *
  • Ghosts are files that were in the previous install and aren't present
  • in the new install. Since we don't want to keep old, unnecessary files
  • (that aren't angels) around, we just remove them. *
  • See also: save angels.

func ContainerPaths

func ContainerPaths(container *tlc.Container) []string

ContainerPaths returns a list of all paths in a container, for all files and symlinks. Folders are excluded

func Difference

func Difference(a []string, b []string) []string

Return elements in b that aren't in a

func DotItchFilter

func DotItchFilter() tlc.FilterFunc

func Exists

func Exists(path string) bool

func Mkdir

func Mkdir(path string) error

func SliceToLength

func SliceToLength(a []string, length int) []string

func StartAsymptoticProgress

func StartAsymptoticProgress(consumer *state.Consumer, cancel chan struct{})

func Walk

func Walk(path string) (*tlc.Container, error)

Types

type BustGhostsParams

type BustGhostsParams struct {
	Consumer *state.Consumer
	Folder   string
	NewFiles []string
	Receipt  *Receipt
}

type DirTree

type DirTree struct {
	// contains filtered or unexported fields
}

func NewDirTree

func NewDirTree(basePath string) *DirTree

func (*DirTree) CommitFiles

func (dt *DirTree) CommitFiles(filePaths []string)

func (*DirTree) EnsureParents

func (dt *DirTree) EnsureParents(filePath string) error

EnsureParents makes sure that all the parent directories of a given path exist

func (*DirTree) ListRelativeDirs

func (dt *DirTree) ListRelativeDirs() []string

ListRelativeDirs returns a list of directories in this tree, relative to the tree's base path, depth first

type Receipt

type Receipt struct {
	Game   *itchio.Game   `json:"game"`
	Upload *itchio.Upload `json:"upload"`
	Build  *itchio.Build  `json:"build"`

	Files         []string `json:"files"`
	InstallerName string   `json:"installerName"`

	// optional, installer-specific fields
	MSIProductCode string `json:"msiProductCode,omitempty"`
}

func ReadReceipt

func ReadReceipt(InstallFolder string) (*Receipt, error)

func (*Receipt) HasFiles

func (r *Receipt) HasFiles() bool

func (*Receipt) WriteReceipt

func (r *Receipt) WriteReceipt(InstallFolder string) error

type SaveAngelsFunc

type SaveAngelsFunc func() error

type SaveAngelsParams

type SaveAngelsParams struct {
	Consumer *state.Consumer
	Folder   string
	Receipt  *Receipt
}

type SaveAngelsResult

type SaveAngelsResult struct {
	Files []string
}

func SaveAngels

func SaveAngels(params *SaveAngelsParams, innerTask SaveAngelsFunc) (*SaveAngelsResult, error)

*

  • An angel redemption is performed when we need to run arbitrary installers
  • that do not report which files they wrote. *
  • Conceptually:
  • - We rename the existing folder to a temporary folder
  • - We install to a fresh folder
  • - We merge angels with the fresh folder
  • - We clean up the temporary folder *
  • Angels are files that have been written by the game (like configurations
  • or save files) or the user (by applying a mod manually, for example)
  • They're not part of a fresh installation of the previous version,
  • but we do want to keep them around. *
  • See also: bust ghosts.

type WalkFunc

type WalkFunc func(name string, node dirnode)

Jump to

Keyboard shortcuts

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