diff --git a/Gopkg.lock b/Gopkg.lock index 3166c570..ad2cda3d 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,11 +3,11 @@ [[projects]] branch = "master" - digest = "1:055364e7afd5d53ddf82407296aa23c52b753e9ed014ce28456f4c16529f62ab" + digest = "1:02083a13eba76620ed7548af199aab0e7955ba059997aac578d6341582a3e065" name = "github.com/Sabayon/pkgs-checker" packages = ["pkg/gentoo"] pruneopts = "UT" - revision = "4fbbdaefc15bf6f16b7950481d8e92e2a19c79f7" + revision = "673f8f976791c3acca0af31769cffed3d0ac8c68" [[projects]] digest = "1:f7499626626215283473733b7428e3b26457a92cf9dbb1518262fbc4f7523423" diff --git a/Gopkg.toml b/Gopkg.toml new file mode 100644 index 00000000..ff87a8e8 --- /dev/null +++ b/Gopkg.toml @@ -0,0 +1,50 @@ +# Gopkg.toml example +# +# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html +# for detailed Gopkg.toml documentation. +# +# required = ["github.com/user/thing/cmd/thing"] +# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] +# +# [[constraint]] +# name = "github.com/user/project" +# version = "1.0.0" +# +# [[constraint]] +# name = "github.com/user/project2" +# branch = "dev" +# source = "github.com/myfork/project2" +# +# [[override]] +# name = "github.com/x/y" +# version = "2.4.0" +# +# [prune] +# non-go = false +# go-tests = true +# unused-packages = true + + +[[constraint]] + name = "github.com/crillab/gophersat" + version = "1.1.7" + +[[constraint]] + branch = "master" + name = "github.com/jinzhu/copier" + +[[constraint]] + name = "github.com/onsi/ginkgo" + version = "1.8.0" + +[[constraint]] + name = "github.com/onsi/gomega" + version = "1.5.0" + +[[constraint]] + name = "github.com/Sabayon/pkgs-checker" + branch = "master" + +[prune] + go-tests = true + unused-packages = true diff --git a/vendor/github.com/Sabayon/pkgs-checker/pkg/gentoo/pkg.go b/vendor/github.com/Sabayon/pkgs-checker/pkg/gentoo/pkg.go index 871d4577..b410dfaf 100644 --- a/vendor/github.com/Sabayon/pkgs-checker/pkg/gentoo/pkg.go +++ b/vendor/github.com/Sabayon/pkgs-checker/pkg/gentoo/pkg.go @@ -101,6 +101,31 @@ func (p *GentooPackage) GetPackageName() (ans string) { return } +func (p *GentooPackage) GetP() string { + return fmt.Sprintf("%s-%s", p.Name, p.GetPV()) +} + +func (p *GentooPackage) GetPN() string { + return p.Name +} + +func (p *GentooPackage) GetPV() string { + return fmt.Sprintf("%s", p.Version) +} + +func (p *GentooPackage) GetPVR() (ans string) { + if p.VersionSuffix != "" { + ans = fmt.Sprintf("%s%s", p.Version, p.VersionSuffix) + } else { + ans = p.GetPV() + } + return +} + +func (p *GentooPackage) GetPF() string { + return fmt.Sprintf("%s-%s", p.GetPN(), p.GetPVR()) +} + func (p *GentooPackage) Admit(i *GentooPackage) (bool, error) { var ans bool = false var v1 *version.Version = nil @@ -263,7 +288,7 @@ func ParsePackageStr(pkg string) (*GentooPackage, error) { } regexPkg := regexp.MustCompile( - fmt.Sprintf("[-](%s|%s|%s|%s|%s|%s)((%s|%s|%s|%s|%s|%s)+)*$", + fmt.Sprintf("[-](%s|%s|%s|%s|%s|%s)((%s|%s|%s|%s|%s|%s|%s)+)*$", // Version regex // 1.1 "[0-9]+[.][0-9]+[a-z]*", @@ -282,6 +307,8 @@ func ParsePackageStr(pkg string) (*GentooPackage, error) { "_p[0-9]+", "_pre[0-9]*", "_rc[0-9]+", + // handle also rc without number + "_rc", "_alpha", "_beta", ),