repo

package
v0.0.0-...-77fbc5e Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2016 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

package Repo provides tools for working with VCS repositories.

Glide manages repositories in the vendor directory by using the native VCS systems of each repository upon which the code relies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcurrentUpdate

func ConcurrentUpdate(deps []*cfg.Dependency, cwd string, i *Installer) error

ConcurrentUpdate takes a list of dependencies and updates in parallel.

func SetReference

func SetReference(conf *cfg.Config) error

SetReference is a command to set the VCS reference (commit id, tag, etc) for a project.

func VcsGet

func VcsGet(dep *cfg.Dependency, dest, home string, cache, cacheGopath, useGopath bool) error

VcsGet figures out how to fetch a dependency, and then gets it.

VcsGet installs into the dest.

func VcsUpdate

func VcsUpdate(dep *cfg.Dependency, vend string, inst *Installer) error

VcsUpdate updates to a particular checkout based on the VCS setting.

func VcsVersion

func VcsVersion(dep *cfg.Dependency, vend string) error

VcsVersion set the VCS version for a checkout.

func VendoredCleanup

func VendoredCleanup(conf *cfg.Config) error

VendoredCleanUp cleans up vendored codebases after an update.

This should _only_ be run for installations that do not want VCS repos inside of the vendor/ directory.

Types

type Installer

type Installer struct {

	// Force the install when certain normally stopping conditions occur.
	Force bool

	// Home is the location of cache
	Home string

	// Vendor contains the path to put the vendor packages
	Vendor string

	// Use a cache
	UseCache bool
	// Use Gopath to cache
	UseCacheGopath bool
	// Use Gopath as a source to read from
	UseGopath bool

	// UpdateVendored instructs the environment to update in a way that is friendly
	// to packages that have been "vendored in" (e.g. are copies of source, not repos)
	UpdateVendored bool

	// DeleteUnused deletes packages that are unused, but found in the vendor dir.
	DeleteUnused bool

	// RootPackage is the top level package importing other packages. If an
	// imported pacakgage references this pacakage it does not need to be
	// downloaded and searched out again.
	RootPackage string
}

Installer provides facilities for installing the repos in a config file.

func (*Installer) Checkout

func (i *Installer) Checkout(conf *cfg.Config, useDev bool) error

Checkout reads the config file and checks out all dependencies mentioned there.

This is used when initializing an empty vendor directory, or when updating a vendor directory based on changed config.

func (*Installer) Install

func (i *Installer) Install(lock *cfg.Lockfile, conf *cfg.Config) (*cfg.Config, error)

Install installs the dependencies from a Lockfile.

func (*Installer) List

func (i *Installer) List(conf *cfg.Config) []*cfg.Dependency

func (*Installer) Update

func (i *Installer) Update(conf *cfg.Config) error

Update updates all dependencies.

It begins with the dependencies in the config file, but also resolves transitive dependencies. The returned lockfile has all of the dependencies listed, but the version reconciliation has not been done.

In other words, all versions in the Lockfile will be empty.

func (*Installer) VendorPath

func (i *Installer) VendorPath() string

VendorPath returns the path to the location to put vendor packages

type MissingPackageHandler

type MissingPackageHandler struct {
	RootPackage string
	Config      *cfg.Config
	Use         *importCache
	// contains filtered or unexported fields
}

MissingPackageHandler is a dependency.MissingPackageHandler.

When a package is not found, this attempts to resolve and fetch.

When a package is found on the GOPATH, this notifies the user.

func (*MissingPackageHandler) NotFound

func (m *MissingPackageHandler) NotFound(pkg string) (bool, error)

func (*MissingPackageHandler) OnGopath

func (m *MissingPackageHandler) OnGopath(pkg string) (bool, error)

type VersionHandler

type VersionHandler struct {

	// If Try to use the version here if we have one. This is a cache and will
	// change over the course of setting versions.
	Use *importCache

	// Cache if importing scan has already occured here.
	Imported map[string]bool

	// Where the packages exist to set the version on.
	Destination string

	RootPackage string
	Config      *cfg.Config

	// There's a problem where many sub-packages have been asked to set a version
	// and you can end up with numerous conflict messages that are exactly the
	// same. We are keeping track to only display them once.
	// the parent pac
	Conflicts map[string]bool
}

VersionHandler handles setting the proper version in the VCS.

func (*VersionHandler) Process

func (d *VersionHandler) Process(pkg string) (e error)

Process imports dependencies for a package

func (*VersionHandler) SetVersion

func (d *VersionHandler) SetVersion(pkg string) (e error)

SetVersion sets the version for a package. If that package version is already set it handles the case by: - keeping the already set version - proviting messaging about the version conflict TODO(mattfarina): The way version setting happens can be improved. Currently not optimal.

Jump to

Keyboard shortcuts

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