cmd/pkg: Add 'extra-source' field to the pkg schema

And 'sources' to the Pkg structure

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2018-07-24 14:00:19 +01:00
parent ce6b15c0b6
commit 75149c56c2

View File

@ -17,6 +17,7 @@ type pkgInfo struct {
Image string `yaml:"image"`
Org string `yaml:"org"`
Arches []string `yaml:"arches"`
ExtraSources []string `yaml:"extra-sources"`
GitRepo string `yaml:"gitrepo"` // ??
Network bool `yaml:"network"`
DisableContentTrust bool `yaml:"disable-content-trust"`
@ -32,12 +33,19 @@ type pkgInfo struct {
} `yaml:"depends"`
}
// Specifies the source directory for a package and their destination in the build context.
type pkgSource struct {
src string
dst string
}
// Pkg encapsulates information about a package's source
type Pkg struct {
// These correspond to pkgInfo fields
image string
org string
arches []string
sources []pkgSource
gitRepo string
network bool
trust bool
@ -199,6 +207,7 @@ func NewFromCLI(fs *flag.FlagSet, args ...string) (Pkg, error) {
hash: hash,
commitHash: hashCommit,
arches: pi.Arches,
sources: pi.Sources,
gitRepo: pi.GitRepo,
network: pi.Network,
trust: !pi.DisableContentTrust,