diff --git a/bin/gpm b/bin/gpm index fd9d810..4d45640 100755 --- a/bin/gpm +++ b/bin/gpm @@ -45,7 +45,8 @@ set_dependencies() { while read package version; do ( - local install_path="${GOPATH%%:*}/src/${package%%/...}" + local pkg_path=$(echo "$package" | awk -F/ '{print $1"\/"$2"\/"$3}') + local install_path="${GOPATH%%:*}/src/${pkg_path%%/...}" echo ">> Getting package "$package"" # Retries in case of possible race conditions when installing a package diff --git a/test/installs_correct_versions_test.sh b/test/installs_correct_versions_test.sh index 17297c5..a1433f1 100755 --- a/test/installs_correct_versions_test.sh +++ b/test/installs_correct_versions_test.sh @@ -12,4 +12,12 @@ assert_raises "$GPM" assert "go run go_code.go" "v6.2" rm Godeps +# Subpackage +version="a6a0a737c00caf4d4c2bb589941ace0d688168bb" +echo "github.com/garyburd/redigo/redis $version" > Godeps +assert_raises "$GPM" +rm Godeps +cd $GOPATH/src/github.com/garyburd/redigo +assert "git rev-parse HEAD" "$version" + assert_end examples