Skip to content

Commit a6edf86

Browse files
author
Pablo Astigarraga
committed
Merge pull request #43 from pote/fix/package_subfolder
Resolves the install path based only on :host/:user/:pkg basis
2 parents 8ef7b68 + 5477595 commit a6edf86

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
@@ -9,4 +9,12 @@ assert "go run go_code.go" "v6.1"
99
assert_raises "$GPM install <(echo 'github.com/pote/gpm-testing-package v6.2')"
1010
assert "go run go_code.go" "v6.2"
1111

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

0 commit comments

Comments
 (0)