Skip to content

Commit

Permalink
Resolves the install path based only on :host/:user/:pkg basis
Browse files Browse the repository at this point in the history
  • Loading branch information
elcuervo committed Jun 25, 2014
1 parent f77a9ef commit 89d2373
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/gpm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/installs_correct_versions_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 89d2373

Please sign in to comment.