Commit d0fac451 authored by Eric Chiang's avatar Eric Chiang

hack: fix godep license parsing for gopkg.in packages

The script incorrectly thinks that `gopkg.in/square/go-jose.v2/cipher` doesn't have a license because it parses `gopkg.in/square` as the root of the repo, even though `gopkg.in/square/go-jose.v2` is the root. Add special handling for gopkg.in packages by grep'ing for the version that gopkg.in appends to the package name.
parent 6b1b6d50
......@@ -75,6 +75,14 @@ process_content () {
go4.org/*)
package_root=$(echo ${package} |awk -F/ '{ print $1 }')
;;
gopkg.in/*)
# Root of gopkg.in package always ends with '.v(number)' and my contain
# more than two path elements. For example:
# - gopkg.in/yaml.v2
# - gopkg.in/inf.v0
# - gopkg.in/square/go-jose.v2
package_root=$(echo ${package} |grep -oh '.*\.v[0-9]')
;;
*)
package_root=$(echo ${package} |awk -F/ '{ print $1"/"$2 }')
;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment