diff --git a/Makefile b/Makefile index 4106d3a..c9eda6a 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +1,50 @@ PROJS = scribe scribecmd evrtest ubuntu-cve-tracker parse-nasltokens \ scribevulnpolicy -GO = GOPATH=$(shell pwd):$(shell go env GOROOT)/bin go -export SCRIBECMD = $(shell pwd)/bin/scribecmd -export EVRTESTCMD = $(shell pwd)/bin/evrtest +GO = GO15VENDOREXPERIMENT=1 go +GOGETTER = GOPATH=$(shell pwd)/.tmpdeps go get -d +GOLINT = golint -all: $(PROJS) +all: $(PROJS) runtests ubuntu-cve-tracker: - $(GO) install ubuntu-cve-tracker + $(GO) install github.com/mozilla/scribe/ubuntu-cve-tracker parse-nasltokens: - $(GO) install parse-nasltokens + $(GO) install github.com/mozilla/scribe/parse-nasltokens evrtest: - $(GO) install evrtest + $(GO) install github.com/mozilla/scribe/evrtest scribe: - $(GO) build scribe - $(GO) install scribe - $(GO) build scribe/vulnpolicy - $(GO) install scribe/vulnpolicy + $(GO) install github.com/mozilla/scribe + $(GO) install github.com/mozilla/scribe/vulnpolicy scribecmd: - $(GO) install scribecmd + $(GO) install github.com/mozilla/scribe/scribecmd scribevulnpolicy: - $(GO) install scribevulnpolicy + $(GO) install github.com/mozilla/scribe/scribevulnpolicy runtests: scribetests gotests gotests: - $(GO) test -v scribe + $(GO) test -v -covermode=count -coverprofile=coverage.out github.com/mozilla/scribe + +showcoverage: gotests + $(GO) tool cover -html=coverage.out scribetests: $(PROJS) - cd test && $(MAKE) runtests + cd test && SCRIBECMD=$$(which scribecmd) EVRTESTCMD=$$(which evrtest) $(MAKE) runtests + +lint: + $(GOLINT) $(PROJECT) + +vet: + $(GO) vet $(PROJECT) clean: rm -rf pkg rm -f bin/* cd test && $(MAKE) clean + +.PHONY: $(PROJS) runtests gotests showcoverage scribetests lint vet clean diff --git a/src/scribe/chain.go b/chain.go similarity index 100% rename from src/scribe/chain.go rename to chain.go diff --git a/src/scribe/concat.go b/concat.go similarity index 100% rename from src/scribe/concat.go rename to concat.go diff --git a/src/scribe/document.go b/document.go similarity index 100% rename from src/scribe/document.go rename to document.go diff --git a/src/scribe/evr.go b/evr.go similarity index 100% rename from src/scribe/evr.go rename to evr.go diff --git a/src/scribe/evrops.go b/evrops.go similarity index 100% rename from src/scribe/evrops.go rename to evrops.go diff --git a/src/evrtest/main.go b/evrtest/main.go similarity index 98% rename from src/evrtest/main.go rename to evrtest/main.go index b7ffed5..d5ea008 100644 --- a/src/evrtest/main.go +++ b/evrtest/main.go @@ -10,7 +10,7 @@ import ( "bufio" "fmt" "os" - "scribe" + "github.com/mozilla/scribe" "strings" ) diff --git a/src/scribe/exactmatch.go b/exactmatch.go similarity index 100% rename from src/scribe/exactmatch.go rename to exactmatch.go diff --git a/src/scribe/filecontent.go b/filecontent.go similarity index 100% rename from src/scribe/filecontent.go rename to filecontent.go diff --git a/src/scribe/filename.go b/filename.go similarity index 100% rename from src/scribe/filename.go rename to filename.go diff --git a/src/scribe/hasline.go b/hasline.go similarity index 100% rename from src/scribe/hasline.go rename to hasline.go diff --git a/src/scribe/noop.go b/noop.go similarity index 100% rename from src/scribe/noop.go rename to noop.go diff --git a/src/scribe/object.go b/object.go similarity index 100% rename from src/scribe/object.go rename to object.go diff --git a/src/scribe/package.go b/package.go similarity index 100% rename from src/scribe/package.go rename to package.go diff --git a/src/scribe/package_test.go b/package_test.go similarity index 94% rename from src/scribe/package_test.go rename to package_test.go index 5a79698..fce6696 100644 --- a/src/scribe/package_test.go +++ b/package_test.go @@ -9,7 +9,7 @@ package scribe_test import ( "fmt" - "scribe" + "github.com/mozilla/scribe" "testing" ) diff --git a/src/parse-nasltokens/main.go b/parse-nasltokens/main.go similarity index 99% rename from src/parse-nasltokens/main.go rename to parse-nasltokens/main.go index 8d7e800..59ff2a8 100644 --- a/src/parse-nasltokens/main.go +++ b/parse-nasltokens/main.go @@ -14,7 +14,7 @@ import ( "flag" "fmt" "os" - "scribe" + "github.com/mozilla/scribe" "strings" ) diff --git a/src/scribe/parser.go b/parser.go similarity index 100% rename from src/scribe/parser.go rename to parser.go diff --git a/src/scribe/pkgmgr.go b/pkgmgr.go similarity index 100% rename from src/scribe/pkgmgr.go rename to pkgmgr.go diff --git a/src/scribe/raw.go b/raw.go similarity index 100% rename from src/scribe/raw.go rename to raw.go diff --git a/src/scribe/regexp.go b/regexp.go similarity index 100% rename from src/scribe/regexp.go rename to regexp.go diff --git a/src/scribe/result.go b/result.go similarity index 100% rename from src/scribe/result.go rename to result.go diff --git a/src/scribe/scribe.go b/scribe.go similarity index 100% rename from src/scribe/scribe.go rename to scribe.go diff --git a/src/scribe/scribe_test.go b/scribe_test.go similarity index 98% rename from src/scribe/scribe_test.go rename to scribe_test.go index 361b8f9..6ad745a 100644 --- a/src/scribe/scribe_test.go +++ b/scribe_test.go @@ -9,7 +9,7 @@ package scribe_test import ( "fmt" - "scribe" + "github.com/mozilla/scribe" "strings" ) diff --git a/src/scribecmd/main.go b/scribecmd/main.go similarity index 98% rename from src/scribecmd/main.go rename to scribecmd/main.go index c55b987..5dea43c 100644 --- a/src/scribecmd/main.go +++ b/scribecmd/main.go @@ -10,7 +10,7 @@ import ( "flag" "fmt" "os" - "scribe" + "github.com/mozilla/scribe" ) var flagDebug bool diff --git a/src/scribevulnpolicy/main.go b/scribevulnpolicy/main.go similarity index 96% rename from src/scribevulnpolicy/main.go rename to scribevulnpolicy/main.go index 13c1836..24abb3b 100644 --- a/src/scribevulnpolicy/main.go +++ b/scribevulnpolicy/main.go @@ -15,7 +15,8 @@ import ( "fmt" "io/ioutil" "os" - "scribe/vulnpolicy" + + "github.com/mozilla/scribe/vulnpolicy" ) func errExit(s string, args ...interface{}) { diff --git a/src/scribe/test.go b/test.go similarity index 100% rename from src/scribe/test.go rename to test.go diff --git a/src/ubuntu-cve-tracker/main.go b/ubuntu-cve-tracker/main.go similarity index 99% rename from src/ubuntu-cve-tracker/main.go rename to ubuntu-cve-tracker/main.go index 1a0cbcb..82b96dd 100644 --- a/src/ubuntu-cve-tracker/main.go +++ b/ubuntu-cve-tracker/main.go @@ -18,7 +18,7 @@ import ( "os" "path" "regexp" - "scribe" + "github.com/mozilla/scribe" "strings" "unicode" ) diff --git a/src/scribe/variable.go b/variable.go similarity index 100% rename from src/scribe/variable.go rename to variable.go diff --git a/src/scribe/vulnpolicy/amazon.go b/vulnpolicy/amazon.go similarity index 97% rename from src/scribe/vulnpolicy/amazon.go rename to vulnpolicy/amazon.go index 1171e87..6de493b 100644 --- a/src/scribe/vulnpolicy/amazon.go +++ b/vulnpolicy/amazon.go @@ -9,7 +9,7 @@ package vulnpolicy import ( "fmt" - "scribe" + "github.com/mozilla/scribe" ) const amazon_expression = "^(Amazon Linux AMI.*)$" diff --git a/src/scribe/vulnpolicy/os.go b/vulnpolicy/os.go similarity index 100% rename from src/scribe/vulnpolicy/os.go rename to vulnpolicy/os.go diff --git a/src/scribe/vulnpolicy/redhat.go b/vulnpolicy/redhat.go similarity index 98% rename from src/scribe/vulnpolicy/redhat.go rename to vulnpolicy/redhat.go index 8fc07d6..b4535c1 100644 --- a/src/scribe/vulnpolicy/redhat.go +++ b/vulnpolicy/redhat.go @@ -9,7 +9,7 @@ package vulnpolicy import ( "fmt" - "scribe" + "github.com/mozilla/scribe" ) type RedHatRelease struct { diff --git a/src/scribe/vulnpolicy/ubuntu.go b/vulnpolicy/ubuntu.go similarity index 98% rename from src/scribe/vulnpolicy/ubuntu.go rename to vulnpolicy/ubuntu.go index 945c61f..a6691c3 100644 --- a/src/scribe/vulnpolicy/ubuntu.go +++ b/vulnpolicy/ubuntu.go @@ -10,7 +10,7 @@ package vulnpolicy import ( "fmt" "regexp" - "scribe" + "github.com/mozilla/scribe" ) type UbuntuRelease struct { diff --git a/src/scribe/vulnpolicy/vulnpolicy.go b/vulnpolicy/vulnpolicy.go similarity index 99% rename from src/scribe/vulnpolicy/vulnpolicy.go rename to vulnpolicy/vulnpolicy.go index 5dd2435..97c8fc1 100644 --- a/src/scribe/vulnpolicy/vulnpolicy.go +++ b/vulnpolicy/vulnpolicy.go @@ -11,7 +11,7 @@ import ( "crypto/md5" "encoding/json" "fmt" - "scribe" + "github.com/mozilla/scribe" ) type Policy struct {