Documentation ¶
Index ¶
- func BustGhosts(params *BustGhostsParams) error
- func ContainerPaths(container *tlc.Container) []string
- func Difference(a []string, b []string) []string
- func DotItchFilter() tlc.FilterFunc
- func Exists(path string) bool
- func Mkdir(path string) error
- func ReceiptPath(InstallFolder string) string
- func SliceToLength(a []string, length int) []string
- func StartAsymptoticProgress(consumer *state.Consumer, cancel chan struct{})
- func Walk(path string) (*tlc.Container, error)
- type BustGhostsParams
- type DirTree
- type Receipt
- type SaveAngelsFunc
- type SaveAngelsParams
- type SaveAngelsResult
- type WalkFunc
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 ¶
ContainerPaths returns a list of all paths in a container, for all files and symlinks. Folders are excluded
func Difference ¶
Return elements in b that aren't in a
func DotItchFilter ¶
func DotItchFilter() tlc.FilterFunc
func ReceiptPath ¶
func SliceToLength ¶
func StartAsymptoticProgress ¶
Types ¶
type BustGhostsParams ¶
type DirTree ¶
type DirTree struct {
// contains filtered or unexported fields
}
func NewDirTree ¶
func (*DirTree) CommitFiles ¶
func (*DirTree) EnsureParents ¶
EnsureParents makes sure that all the parent directories of a given path exist
func (*DirTree) ListRelativeDirs ¶
ListRelativeDirs returns a list of directories in this tree, relative to the tree's base path, depth first
type Receipt ¶
type Receipt struct { // The itch.io game installed at this location Game *itchio.Game `json:"game"` // The itch.io upload installed at this location Upload *itchio.Upload `json:"upload"` // The itch.io build installed at this location. Null for non-wharf upload. Build *itchio.Build `json:"build"` // A list of installed files (slash-separated paths, relative to install folder) Files []string `json:"files"` // The installer used to install at this location // @optional InstallerName string `json:"installerName"` // If this was installed from an MSI package, the product code, // used for a clean uninstall. // @optional MSIProductCode string `json:"msiProductCode,omitempty"` }
A Receipt describes what was installed to a specific folder.
It's compressed and written to `./.itch/receipt.json.gz` every time an install operation completes successfully, and is used in further install operations to make sure ghosts are busted and/or angels are saved.
func ReadReceipt ¶
func (*Receipt) WriteReceipt ¶
type SaveAngelsFunc ¶
type SaveAngelsFunc func() error
type SaveAngelsParams ¶
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.
Click to show internal directories.
Click to hide internal directories.