Skip to content

Commit 89d2373

Browse files
committed
Resolves the install path based only on :host/:user/:pkg basis
1 parent f77a9ef commit 89d2373

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

bin/gpm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ set_dependencies() {
4545

4646
while read package version; do
4747
(
48-
local install_path="${GOPATH%%:*}/src/${package%%/...}"
48+
local pkg_path=$(echo "$package" | awk -F/ '{print $1"\/"$2"\/"$3}')
49+
local install_path="${GOPATH%%:*}/src/${pkg_path%%/...}"
4950
echo ">> Getting package "$package""
5051

5152
# Retries in case of possible race conditions when installing a package

test/installs_correct_versions_test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,12 @@ assert_raises "$GPM"
1212
assert "go run go_code.go" "v6.2"
1313
rm Godeps
1414

15+
# Subpackage
16+
version="a6a0a737c00caf4d4c2bb589941ace0d688168bb"
17+
echo "github.com/garyburd/redigo/redis $version" > Godeps
18+
assert_raises "$GPM"
19+
rm Godeps
20+
cd $GOPATH/src/github.com/garyburd/redigo
21+
assert "git rev-parse HEAD" "$version"
22+
1523
assert_end examples

0 commit comments

Comments
 (0)