196 Commits
Author SHA1 Message Date
Joshua Bussdieker 00ca5e9ce1 Get the clean path to common posix tools used by GVM 2012-03-24 04:57:24 -07:00
Joshua Bussdieker e5d5641e31 Bump version 2012-03-22 22:10:54 -07:00
Joshua Bussdieker 52a6e4afc9 Merge branch 'master' of github.com:moovweb/gvm 2012-03-22 22:09:30 -07:00
Joshua Bussdieker 3a5813784e Find the system ls command and use it to fix issue #6 2012-03-22 22:09:05 -07:00
Hampton Catlin 12b1d1a254 adding in joshs credit 2012-03-22 13:18:00 -07:00
Joshua Bussdieker be751c7d69 Bump version 2012-03-20 05:43:25 -07:00
Joshua Bussdieker 68c0ffdf9e Don't know how this got deleted 2012-03-20 05:39:50 -07:00
Joshua Bussdieker 469bd7c81c Cleanup system package install 2012-03-20 05:36:27 -07:00
Joshua Bussdieker a9640b0bbc Better error messages 2012-03-20 03:16:32 -07:00
Joshua Bussdieker aec0080464 Check for git before install 2012-03-20 03:00:40 -07:00
Joshua Bussdieker 13ef2e1f19 Bump version 2012-03-20 01:03:26 -07:00
Joshua Bussdieker 03ae59f0ff Detect existing versions of Go 2012-03-20 01:01:00 -07:00
Joshua Bussdieker bc2ef7ba41 Fix bug in pb option 2012-03-19 22:05:49 -07:00
Joshua Bussdieker a28c8f220e Use display_warning function 2012-03-19 21:51:54 -07:00
Joshua Bussdieker 6bbf1f3bb5 Safer strings 2012-03-19 21:44:39 -07:00
Joshua Bussdieker 55ae6dd774 Make protocol buffer support optional 2012-03-19 21:44:14 -07:00
Joshua Bussdieker 4558bd0b53 That's a bug if I've ever seen one! 2012-03-19 21:09:25 -07:00
Joshua Bussdieker f0e3956030 Bump version 2012-03-19 20:37:52 -07:00
Joshua Bussdieker e3246cef0d Match gpkg help format 2012-03-19 20:36:05 -07:00
Joshua Bussdieker 4359f5252f Fix path bug and add back config 2012-03-18 11:13:41 -07:00
jbussdieker e8076a83fb Merge pull request #4 from hoisie/master
Use HTTPS instead of SSH when downloading the git repo
2012-03-17 16:49:47 -07:00
Michael Hoisie bc1fc149f3 Use HTTP instead of SSH to access the git repo. Some firewalls block port port 9418 (the defailt for git ssh) 2012-03-17 14:23:12 -07:00
Joshua Bussdieker 6e8720de05 Bumping version 2012-03-17 06:58:43 -07:00
Joshua Bussdieker 0cae267942 Update source 2012-03-17 06:56:41 -07:00
Joshua Bussdieker 578436bb4e Update help and remove more gvm pkg artifacts 2012-03-14 04:42:37 -07:00
Joshua Bussdieker 97ed989f6a Long term release 2012-03-14 03:39:09 -07:00
Joshua Bussdieker 413af34098 Fix output bug 2012-03-14 03:35:00 -07:00
Joshua Bussdieker 31403a1024 Leftover from gvm pkg 2012-03-14 03:33:05 -07:00
Joshua Bussdieker 36c74ada3f Display install location 2012-03-14 03:26:18 -07:00
Joshua Bussdieker 28e9e0cd8b Update install script 2012-03-14 03:25:13 -07:00
Joshua Bussdieker d10899c1a4 Install any branch 2012-03-14 02:43:50 -07:00
Joshua Bussdieker 60b04451a3 master will now be stable. dev will be done in unstable branch 2012-03-14 02:40:58 -07:00
jbussdieker 8a65c2d001 Update README.md 2012-03-14 01:29:58 -07:00
jbussdieker eabc181127 Update README.md 2012-03-07 23:18:39 -08:00
Joshua Bussdieker 79b475b3c4 Fix indentation. Prefer .profile over .bashrc 2012-03-07 02:24:57 -08:00
Joshua Bussdieker de99e332ac Merge branch 'master' of github.com:moovweb/gvm 2012-03-07 02:19:08 -08:00
Joshua Bussdieker 043e6a44f7 Fixed profile install issue 2012-03-07 02:18:55 -08:00
jbussdieker 2b3fb6da35 Update README.md 2012-03-07 02:11:24 -08:00
Joshua Bussdieker a3da2239c9 Merge branch 'master' of github.com:moovweb/gvm 2012-03-07 01:40:14 -08:00
Joshua Bussdieker e02f21ed01 Fix pkgset list bug 2012-03-07 01:38:54 -08:00
jbussdieker 7237f663fd Update README.md 2012-03-05 04:33:34 -08:00
jbussdieker 218d322710 Update README.md 2012-03-05 04:11:47 -08:00
Joshua Bussdieker 0b7eeb4a3d 0.0.9 now in dev 2012-03-05 03:57:55 -08:00
Joshua Bussdieker 595531b7fc Taken over by gpkg 2012-03-04 22:54:05 -08:00
Joshua Bussdieker 85db8304cc Safety feature 2012-03-04 22:09:41 -08:00
Joshua Bussdieker de9ceccb78 More message cleanup 2012-03-04 18:01:08 -08:00
Joshua Bussdieker 4933d13418 Fix tabs. Can now gvm pkgset use blah --default 2012-03-04 17:34:37 -08:00
Joshua Bussdieker 9e1c0b67de Use message function 2012-03-04 17:28:47 -08:00
Joshua Bussdieker 6e720f80c1 Fix tabs 2012-03-04 17:28:35 -08:00
Joshua Bussdieker 5ef8b40fa8 Better error handling in uninstall script 2012-03-04 17:24:11 -08:00
Joshua Bussdieker 3a45cde1aa Make template Mac compatible 2012-03-02 19:15:25 -08:00
Joshua Bussdieker bdc0eb2fda More pkg install improvements 2012-03-02 19:02:51 -08:00
Joshua Bussdieker 2f562e6d3c Template for installed binaries 2012-03-02 19:02:37 -08:00
Joshua Bussdieker 99f4c5035c Fix pkg install 2012-03-02 17:52:08 -08:00
Joshua Bussdieker 503ec01aaa Added gvm update to download updateds to the Go source 2012-03-02 01:31:00 -08:00
Joshua Bussdieker d4fa2d8bdb Cleanup Go install script. 2012-03-02 01:30:51 -08:00
Joshua Bussdieker 9711c445d8 Skip tests for now... 2012-03-02 01:30:43 -08:00
Joshua Bussdieker 6d5e3ec8d5 These will be replaced with gpkg 2012-03-01 23:27:41 -08:00
Joshua Bussdieker 1b5197c450 Bump again 2012-03-01 23:27:16 -08:00
Joshua Bussdieker c1e449309b New 0.0.7 stable 2012-03-01 23:23:40 -08:00
Joshua Bussdieker d46e351d9e Not in stable 2012-03-01 23:21:18 -08:00
Joshua Bussdieker 8fe98115fe Revert to stable on these 2012-03-01 23:20:46 -08:00
Joshua Bussdieker cc1715379c Remove debug line 2012-03-01 23:13:34 -08:00
Joshua Bussdieker 967104cad7 Add command line parameters 2012-03-01 23:08:51 -08:00
Joshua Bussdieker fc5db824bf Fix pkgset use bug 2012-03-01 23:08:08 -08:00
Joshua Bussdieker 562c90dee3 Remove test file 2012-03-01 22:46:24 -08:00
Joshua Bussdieker 1ad33a27b7 Fix path bug 2012-03-01 22:43:48 -08:00
Joshua Bussdieker 6cb227b098 Doh! 2012-03-01 22:18:56 -08:00
Joshua Bussdieker 6c677cf349 More detail 2012-03-01 22:17:00 -08:00
Joshua Bussdieker a846b2b613 Make executable 2012-03-01 22:14:55 -08:00
Joshua Bussdieker 8ec660e76c Add version test 2012-03-01 22:13:38 -08:00
Joshua Bussdieker d7f0b47e17 Fix test mode 2012-03-01 22:05:42 -08:00
Joshua Bussdieker 081f7ea235 Adding test mode 2012-03-01 22:00:47 -08:00
Joshua Bussdieker dd4d21df14 Moved gpkg to seperate repo 2012-03-01 21:36:27 -08:00
Joshua Bussdieker b4d148ed9a Now generates Makefiles! 2012-03-01 17:00:50 -08:00
Joshua Bussdieker 3102c3bab5 Read import info too 2012-03-01 14:23:09 -08:00
Joshua Bussdieker e80e9af547 Testing installer via goinstall 2012-03-01 00:33:55 -08:00
jbussdieker 9bdba4e258 Update README.md 2012-03-01 00:07:22 -08:00
Joshua Bussdieker c33216e4d3 Package install madness!!! 2012-02-29 23:48:19 -08:00
Joshua Bussdieker 2b731381b6 These errors are okay 2012-02-29 23:47:57 -08:00
Joshua Bussdieker 5c31a8e593 List goinstalled packages too 2012-02-29 21:46:28 -08:00
Joshua Bussdieker 62c9513954 Merge branch 'master' of github.com:moovweb/gvm 2012-02-29 21:36:35 -08:00
Joshua Bussdieker 8480e63c86 Update gitignores. Add gpkg/pkgs module. 2012-02-29 21:35:47 -08:00
Joshua Bussdieker 4f0d8e3c5e Updated gpkg main 2012-02-29 21:33:28 -08:00
Joshua Bussdieker e1c6da6bc9 Use display message for gvm pkg list 2012-02-29 21:32:15 -08:00
Joshua Bussdieker e3192d58c5 Fix tabs 2012-02-29 20:40:54 -08:00
Joshua Bussdieker b78b083fea Fuzzy match fix 2012-02-29 20:02:44 -08:00
Joshua Bussdieker 7a54ee48da Use new gpkg package 2012-02-29 19:38:37 -08:00
Joshua Bussdieker 5ff6561127 Testing 2012-02-29 19:33:40 -08:00
Joshua Bussdieker 9371c29ec9 Revert "Adding goinstall file"
This reverts commit e66d7aa38a.
2012-02-29 19:24:46 -08:00
Joshua Bussdieker e66d7aa38a Adding goinstall file 2012-02-29 19:16:59 -08:00
Joshua Bussdieker 44d8798493 Use display_message for diff 2012-02-29 14:56:06 -08:00
Joshua Bussdieker 991cc52dec Color the use 2012-02-29 13:45:13 -08:00
Joshua Bussdieker c335d8bd2b Better listall function 2012-02-29 13:44:56 -08:00
Joshua Bussdieker 178e1aaafd Indent listall 2012-02-29 13:25:43 -08:00
Joshua Bussdieker db46a27870 Use color for listall 2012-02-29 13:25:29 -08:00
Joshua Bussdieker 3bb6d28ea2 Use color for go version list 2012-02-29 13:25:01 -08:00
Joshua Bussdieker 5d025fe287 Use color for version 2012-02-29 13:24:45 -08:00
Joshua Bussdieker 1fe6466b6b Clean up default component installs 2012-02-29 12:38:09 -08:00
Joshua Bussdieker 0ff9744151 Better gvm env function 2012-02-29 12:19:34 -08:00
Joshua Bussdieker a3b18934d4 Merge branch 'master' of github.com:moovweb/gvm 2012-02-29 11:18:34 -08:00
Joshua Bussdieker ffa00686f2 Fix Mac bug with find 2012-02-29 11:17:37 -08:00
Joshua Bussdieker 0bce362db2 Better prompt 2012-02-29 11:14:51 -08:00
Joshua Bussdieker 290ea30c04 Fix typo 2012-02-29 11:09:52 -08:00
Joshua Bussdieker 52535c35e9 Better version handling 2012-02-29 00:27:25 -08:00
Joshua Bussdieker 44e2b6566a Remove tmp debug line 2012-02-29 00:18:29 -08:00
Joshua Bussdieker aba5151be1 Major pkg install updates 2012-02-29 00:04:29 -08:00
Joshua Bussdieker d18366a0f4 Figure out build number 2012-02-28 22:36:07 -08:00
Joshua Bussdieker 24dd09f9f6 Fix tabs 2012-02-28 22:33:21 -08:00
Joshua Bussdieker c00d4ec5c2 Just lists sources for now 2012-02-28 21:58:17 -08:00
Joshua Bussdieker f550da8b0b List goinstalled packages too 2012-02-28 21:57:59 -08:00
Joshua Bussdieker 9af903c68e Fix default pkgset bug 2012-02-28 21:56:51 -08:00
Joshua Bussdieker eb7bdac833 It was doing this anyways 2012-02-28 21:56:04 -08:00
Joshua Bussdieker 57f47512f9 Diff bug 2012-02-28 21:55:51 -08:00
Joshua Bussdieker dc4b7fa427 Fix tabs 2012-02-28 21:55:39 -08:00
Joshua Bussdieker 569811ddfc Functions! 2012-02-28 21:55:24 -08:00
Joshua Bussdieker 749539ff07 Update CHANGELOG 2012-02-28 19:02:12 -08:00
Joshua Bussdieker 09f4d6688d Fix gvm use bug when using fuzzy match. 2012-02-28 18:59:08 -08:00
Joshua Bussdieker 169cc79622 Add gvm diff for checking the GOROOT 2012-02-28 18:58:49 -08:00
Joshua Bussdieker ef648d8f0f Use hg to copy the go source.
Create a manifest of the install.
2012-02-28 18:58:25 -08:00
Joshua Bussdieker ea776b237f Merge branch 'master' of github.com:moovweb/gvm 2012-02-20 12:08:02 -08:00
Joshua Bussdieker e450b60297 More error handling fixes 2012-02-20 12:07:51 -08:00
jbussdieker fdffbf538c Update README.md 2012-02-20 10:49:34 -08:00
Joshua Bussdieker 71dd4499a7 Work around for GOPATH limit 2012-02-18 20:00:28 -08:00
Joshua Bussdieker add7f55028 Dry up code 2012-02-18 15:58:34 -08:00
Joshua Bussdieker fc97b30ff2 Add version to bash completion 2012-02-18 15:37:46 -08:00
Joshua Bussdieker 0791e79c4c Bump dev branch 2012-02-18 15:30:52 -08:00
Joshua Bussdieker 57b7ba00a0 Version 0.0.7 is now stable! 2012-02-18 15:26:36 -08:00
Joshua Bussdieker ad6c550946 Print errors to stderr 2012-02-18 15:16:56 -08:00
Joshua Bussdieker 9f05842f7a Print errors to stderr 2012-02-18 15:15:11 -08:00
Joshua Bussdieker 8719621541 Use error handling function 2012-02-18 15:14:45 -08:00
Joshua Bussdieker d374fc3b28 Use error handling function 2012-02-18 15:13:01 -08:00
Joshua Bussdieker fecfebf011 Use the error function 2012-02-18 15:11:33 -08:00
Joshua Bussdieker e1a824d445 Don't output for these 2012-02-18 15:05:05 -08:00
Joshua Bussdieker b7015e00de Reset color 2012-02-17 11:26:32 -08:00
Joshua Bussdieker 96b9e48a8d Shouldn't create folder 2012-02-17 11:06:24 -08:00
Joshua Bussdieker 7c7483d2c2 Fix tabs 2012-02-17 10:54:26 -08:00
Joshua Bussdieker 01deadd125 stupid macs 2012-02-02 06:19:31 -08:00
Joshua Bussdieker 1f1e13d966 Another problem with mac 2012-02-02 06:15:05 -08:00
Joshua Bussdieker ca9c10ceee Mac compatability 2012-02-02 05:56:08 -08:00
Joshua Bussdieker b5ed8da6a9 No caching so no pulling 2012-02-02 04:33:12 -08:00
Joshua Bussdieker b555ffec08 Better error message 2012-02-02 04:27:53 -08:00
Joshua Bussdieker 4b58563d1b This makes way more sense 2012-02-02 04:17:39 -08:00
Joshua Bussdieker 2c3c173f2a Cleaner gvm-check 2012-02-02 04:07:17 -08:00
Joshua Bussdieker 4596dee4cc Backward logic 2012-02-02 03:22:24 -08:00
Joshua Bussdieker 980d00c70d Use the .git folder if it's already there 2012-02-02 03:19:46 -08:00
Joshua Bussdieker 86fea55f33 Fix truncation bug 2012-02-02 03:14:37 -08:00
Joshua Bussdieker 1141a465f1 Add GVM_ROOT to Go version container environments 2012-02-02 02:50:35 -08:00
Joshua Bussdieker 11b9916f26 Limit tab completion to release versions and tip 2012-02-02 02:50:06 -08:00
Joshua Bussdieker e1241a2298 this keeps su <user> from keeping the old env 2012-02-02 02:26:47 -08:00
Joshua Bussdieker bbfa06fa4b More package building work 2012-02-02 02:18:55 -08:00
Joshua Bussdieker cd3db339c8 Use gb -bi if there is no Makefile.gvm 2012-02-02 00:05:20 -08:00
Joshua Bussdieker 2d9f83d8c1 Added command line options and better version tracking 2012-02-02 00:04:42 -08:00
Joshua Bussdieker 017eb5cf33 Add sources list 2012-02-01 23:27:16 -08:00
Joshua Bussdieker d72f214e55 Added bash completion 2012-02-01 22:51:34 -08:00
Joshua Bussdieker b32fab8386 Another prompt fix 2012-02-01 21:58:28 -08:00
Joshua Bussdieker 46b989af95 More bugs when does it end 2012-02-01 21:41:02 -08:00
Joshua Bussdieker 1b65e28b1c These are all now handled in the parent function call 2012-02-01 20:44:50 -08:00
Joshua Bussdieker 4618ea462e Add pre checks to pkg and pkgset commands 2012-02-01 20:44:21 -08:00
Joshua Bussdieker 5a1e96411e Moved to gvm function 2012-02-01 20:43:49 -08:00
Joshua Bussdieker ce02e01827 make sure folders exist in the gvm function 2012-02-01 20:43:41 -08:00
Joshua Bussdieker 3709f07d0b Fix prompt display 2012-02-01 20:43:27 -08:00
Joshua Bussdieker 3a8f7c2936 Use error function 2012-02-01 20:28:44 -08:00
Joshua Bussdieker 21b72f0a5f Update pkg uninstall command 2012-02-01 20:26:30 -08:00
Joshua Bussdieker 194489b2b5 Don't use symlinks anymore 2012-02-01 20:26:13 -08:00
Joshua Bussdieker 88d2fc7226 gvm pkg install manhattan is working! 2012-02-01 20:22:06 -08:00
Joshua Bussdieker 912c27d8a0 Fix bug in pkgset path 2012-02-01 20:05:32 -08:00
Joshua Bussdieker 2099b8bb0e Fix pkgset use 2012-02-01 20:02:55 -08:00
Joshua Bussdieker bd5ee4481e Remove unused script 2012-02-01 19:54:43 -08:00
Joshua Bussdieker 77c2cc7664 Update install script 2012-02-01 19:46:45 -08:00
Joshua Bussdieker 67e1be09c2 Merge branch 'master' of github.com:moovweb/gvm 2012-02-01 19:26:15 -08:00
Joshua Bussdieker 5c0c7d3e64 Major revamp of install script 2012-02-01 19:25:39 -08:00
Joshua Bussdieker b0965e58e5 Make sure env folder exists 2012-02-01 19:25:24 -08:00
Joshua Bussdieker 8c53958cc8 Merge branch 'master' of github.com:moovweb/gvm 2012-02-02 01:40:05 +00:00
Joshua Bussdieker 0468a3cdef More env fixes 2012-02-01 17:20:15 -08:00
Joshua Bussdieker d67241f6f2 Fix env creation 2012-02-01 16:27:01 -08:00
Joshua Bussdieker a69645345b Make sure env folder exists and fixed gvm list 2012-02-01 16:10:17 -08:00
Joshua Bussdieker 0aae95fe1a Added env template for new installs 2012-02-01 03:26:04 -08:00
Joshua Bussdieker 263eabdebf Need bin prefix 2012-02-01 02:56:31 -08:00
Joshua Bussdieker 5e0dad7b9c With issue with gvm-prompt 2012-02-01 02:55:43 -08:00
Joshua Bussdieker f774c572b3 Fix installer 2012-02-01 02:46:50 -08:00
Joshua Bussdieker 50d521c28a Working on environments 2012-02-01 02:18:10 -08:00
Joshua Bussdieker f98e0148e8 Cleaning up install script 2012-02-01 02:17:26 -08:00
Joshua Bussdieker d9ae8960b7 Fix pkg set list 2012-01-31 22:45:18 -08:00
Joshua Bussdieker e5b9b8a89b Unused error handling 2012-01-31 22:26:47 -08:00
Joshua Bussdieker f2a296c740 More environment changes 2012-01-31 22:26:04 -08:00
Joshua Bussdieker 4e0cf27e22 Use enviroments 2012-01-31 21:49:16 -08:00
Joshua Bussdieker db34420d2b Update changelog 2012-01-31 21:13:01 -08:00
Joshua Bussdieker 077f9bfc67 Better error/state checking 2012-01-31 21:12:04 -08:00
Joshua Bussdieker 803f6c5e5a Not using these anymore 2012-01-31 20:57:50 -08:00
Joshua Bussdieker d1b84c4043 Update readme to use new shorthand versions 2012-01-31 20:52:59 -08:00
Joshua Bussdieker ff9b4e0642 Update changelog 2012-01-31 20:51:25 -08:00
Joshua Bussdieker 977483bead Use new scripts layout 2012-01-31 20:49:16 -08:00
Joshua Bussdieker f757d8307b Drop prefix 2012-01-31 20:27:49 -08:00
Joshua Bussdieker 45479afde9 Move scripts out of path 2012-01-31 20:21:48 -08:00
Joshua Bussdieker 9ce4041092 Added bash prompt tool. Updated CHANGELOG. 2012-01-31 00:33:15 -08:00
53 changed files with 915 additions and 807 deletions
+1 -1
View File
@@ -1,9 +1,9 @@
*~
go
gos/
pkgs
pkgsets/
archive/
environments/
tmp/
*.log
scripts/gvm
+25 -2
View File
@@ -1,7 +1,30 @@
Version: 0.0.7
State: Development
Version: 1.0.x
State: LTR
CHANGES:
* Minor bug fixes and cleanup. 1.0.x will always be a safe upgrade path.
Version: 0.0.8
State: Stable
CHANGES:
* Complete overhaul of the package system. Now uses
http://github.com/moovweb/gpkg
Version: 0.0.7
State: Stable
CHANGES:
* Fixed issue with gvm use where multiple versions matched.
* Added gvm diff for checking the state of a GOROOT.
* Install now uses hg clone to copy source.
* Fixed remaining error handling. Error now output to stderr.
* Fixed error/state checking in `gvm pkg list` and `gvm pkgset list`
* Removed all command's gvm- prefix
* Revamped the folder structure for scripts so they don't show up in the path
* Added gvm prompt for including Go version and/or package set info in the bash prompt
* Added ability to build from source when running `gvm pkg install <name>` in a folder
named <name>.
Version: 0.0.6
State: Stable
+30 -15
View File
@@ -1,26 +1,36 @@
# gvm
by Josh Bussdieker (jbuss, jaja, jbussdieker)
GVM provides an interface to manage Go versions.
Features
========
* Install/Uninstall Go versions with `gvm install [tag]` where tag is "60.3", "weekly.2011-11-08", or "tip"
* List added/removed files in GOROOT with `gvm diff`
* Manage GOPATHs with `gvm pkgset [create/use/delete] [name]`
* List latest release tags with `gvm listall`. Use `--all` to list weekly as well.
* Cache a clean copy of the latest Go source for multiple version installs.
Background
==========
When we started developing in Go mismatched dependencies and API changes plauged our build process and made it extremely difficult to merge with other peoples changes.
After nuking my entire GOROOT several times and rebuilding I decided to come up with a tool to oversee the process. It eventually evolved into what gvm is today.
Installing
==========
To install the stable release run:
bash -s stable < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer)
To install the development branch run:
To install:
bash < <(curl -s https://raw.github.com/moovweb/gvm/master/binscripts/gvm-installer)
Protect Your GO!
================
sudo chown -R root:root ~/.gvm/gos/
This will keep libraries from accidentally installing into the main Go soure tree
Installing Go
=============
gvm install release.r60.3
gvm use release.r60.3
Once this is done Go will be in the path and ready to use. $GOROOT is set automatically.
gvm install 60.3
gvm use 60.3
Once this is done Go will be in the path and ready to use. $GOROOT and $GOPATH are set automatically.
You are now ready to create and use packages built using gpkg. Instructions can be found at http://github.com/moovweb/gpkg
List Go Versions
================
@@ -34,6 +44,8 @@ To completely remove gvm and all installed Go versions and packages:
gvm implode
If that doesn't work see the troubleshooting steps at the bottom of this page.
Mac OSX Requirements
====================
Install mercurial from http://mercurial.berkwood.com/
@@ -48,3 +60,6 @@ Linux Requirements
sudo apt-get install bison
sudo apt-get install gcc
Troubleshooting
===============
Sometimes especially during upgrades the state of gvm's files can get mixed up. This is mostly true for upgrade from older version than 0.0.8. Changes are slowing down and a LTR is imminent. But for now `rm -rf ~/.gvm` will always remove gvm. Stay tuned!
+1 -1
View File
@@ -1 +1 @@
0.0.7-dev
1.0.15
+31 -32
View File
@@ -1,54 +1,53 @@
#!/bin/bash
if [ -z "$GVM_ROOT" ]; then
echo 'ERROR: $GVM_ROOT is not set! Please update your .bashrc or .profile to $
tput sgr0
tput setaf 1
echo 'ERROR: $GVM_ROOT is not set! Please add the following line to your .bashrc or .profile
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
'
exit 1
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
' >&2
tput sgr0
exit 1
fi
if [[ $1 == "implode" ]]; then
rm -rf $GVM_ROOT
exit 0
. $GVM_ROOT/scripts/functions
command=$1
if [[ $command == "implode" ]]; then
rm -rf $GVM_ROOT
exit 0
fi
$GVM_ROOT/bin/gvm-check
$GVM_ROOT/scripts/gvm-check
if [[ "$?" != "0" ]]; then
echo "ERROR: Missing requirements. Please see messages above"
exit 1
display_error "Missing requirements."
fi
if [[ $1 == "version" ]]; then
echo "Go Version Manager v$GVM_VERSION"
if [[ $command == "version" ]]; then
display_message "Go Version Manager v$GVM_VERSION installed at $GVM_ROOT"
else
if [ -f $GVM_ROOT/bin/gvm-$1 ]; then
$GVM_ROOT/bin/gvm-$1 $@
elif [[ -n $1 ]]; then
echo "ERROR: Unrecognized command line argument: '$1'"
else
echo "= gvm
if [ -f $GVM_ROOT/scripts/$command ]; then
shift
$GVM_ROOT/scripts/$command $@
elif [[ -n $command ]]; then
display_error "Unrecognized command line argument: '$command'"
else
echo "Usage: gvm [command]
* http://github.com/moovweb/gvm
== DESCRIPTION:
GVM is the Go Version Manager
== Usage
gvm Command
== Command
Description:
GVM is the Go Version Manager
Commands:
version - print the gvm version number
get - gets the latest code (for debugging)
use - select a go version to use
diff - view changes to Go root
implode - completely remove gvm
install - install go versions
uninstall - uninstall go versions
list - list installed go versions
listall - list available versions
pkgset - manage go packages sets
pkg - manage go packages"
fi
"
fi
fi
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
mkdir -p $GVM_ROOT/logs > /dev/null 2>&1
mkdir -p $GVM_ROOT/gos > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive/package > /dev/null 2>&1
if [ -z `which hg` ]; then
echo '* Could not find mercurial (try `sudo apt-get install mercurial`)'
exit 1
fi
if [ -z `which ar` ]; then
echo '* Could not find binutils (try `sudo apt-get install binutils (or binutils-multiarch)`)'
exit 1
fi
if [ -z `which bison` ]; then
echo '* Could not find bison (try `sudo apt-get install bison`)'
exit 1
fi
if [ -z `which gcc` ]; then
echo '* Could not find gcc (try `sudo apt-get install gcc`)'
exit 1
fi
if [ -z `which make` ]; then
echo '* Could not find make (try `sudo apt-get install make`)'
exit 1
fi
-29
View File
@@ -1,29 +0,0 @@
#!/bin/bash
if [[ $1 == "commit" ]]; then
mv $GVM_ROOT/git.bak $GVM_ROOT/.git
if [ $? -ne 0 ]; then
echo "Couldn't find git info"
exit 1
fi
if [[ -n $2 ]]; then
cd $GVM_ROOT && git add . && git commit -m "$2"
if [ $? -ne 0 ]; then
echo "Failed to commit"
exit 1
fi
fi
cd $GVM_ROOT && git push
if [ $? -ne 0 ]; then
echo "Failed to push"
exit 1
fi
mv $GVM_ROOT/.git $GVM_ROOT/git.bak
if [ $? -ne 0 ]; then
echo "Couldn't backup git info"
exit 1
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-34
View File
@@ -1,34 +0,0 @@
#!/bin/bash
if [[ $1 == "get" ]]; then
mv $GVM_ROOT/git.bak $GVM_ROOT/.git
if [ $? -ne 0 ]; then
echo "Couldn't find git info"
exit 1
fi
cd $GVM_ROOT && git checkout -f
if [ $? -ne 0 ]; then
echo "Failed to clean install"
exit 1
fi
if [[ -n $2 ]]; then
cd $GVM_ROOT && git checkout $2 -f
if [ $? -ne 0 ]; then
echo "Failed to checkout $2 branch"
exit 1
fi
fi
cd $GVM_ROOT && git pull
if [ $? -ne 0 ]; then
echo "Failed to update"
exit 1
fi
mv $GVM_ROOT/.git $GVM_ROOT/git.bak
if [ $? -ne 0 ]; then
echo "Couldn't backup git info"
exit 1
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-150
View File
@@ -1,150 +0,0 @@
#!/bin/bash
if [[ $1 != "install" ]]; then
echo "Please use gvm [action] to call this file"
exit 1
fi
if [[ "$2" == "" ]]; then
echo "ERROR: Please specifiy the version"
exit 1
else
REVISION=$2
fi
################################################################################
# Implementation
################################################################################
# find_revision(version)
get_source_tag() {
curl -s https://go.googlecode.com/hg/.hgtags | awk '{print $2;}' | grep "$1" > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
return 1
fi
SOURCE_TAG=`curl -s https://go.googlecode.com/hg/.hgtags | awk '{print $2;}' | grep "$1" | tail -n 1`
}
# download_revision(revision, destination)
download_revision() {
hg clone -u $1 https://go.googlecode.com/hg/ $2
if [[ $? -ne 0 ]]; then
return 1
fi
}
# compile_go(source)
compile_go() {
unset GOARCH
unset GOOS
unset GOPATH
export GOBIN=$1/bin
export PATH=$GOBIN:$PATH
export GOROOT=$1
cd $1/src && ./all.bash
if [[ $? -ne 0 ]]; then
return 1
fi
}
################################################################################
# Interface
################################################################################
download() {
echo " * Downloading..."
download_revision $SOURCE_TAG $SOURCE_ROOT > $GVM_ROOT/logs/$SOURCE_TAG-download.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to download version $SOURCE_TAG. See logs in $GVM_ROOT/logs/$SOURCE_TAG-download.log for details"
exit 1
fi
}
copy_source() {
cp -r $SOURCE_ROOT $INSTALL_ROOT
if [[ $? -ne 0 ]]; then
echo "Failed to copy from cache"
exit 1
fi
}
setup_install_env() {
get_source_tag $REVISION
if [[ $? -ne 0 ]]; then
echo "Failed to find go release version: '$1'"
exit 1
fi
SOURCE_ROOT=$GVM_ROOT/archive/$SOURCE_TAG
INSTALL_ROOT=$GVM_ROOT/gos/$SOURCE_TAG
if [[ -d $INSTALL_ROOT ]]; then
echo "Already installed!"
exit 1
else
echo "Installing version $SOURCE_TAG"
fi
if [[ ! -d $SOURCE_ROOT ]]; then
download
fi
trap 'rm -rf $INSTALL_ROOT' INT
copy_source
}
compile() {
echo " * Compiling..."
compile_go $INSTALL_ROOT > $GVM_ROOT/logs/$SOURCE_TAG-compile.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to install version $SOURCE_TAG. See logs in $GVM_ROOT/logs/$SOURCE_TAG-compile.log for details"
rm -rf $INSTALL_ROOT
exit 1
fi
}
create_default_pkgset() {
#gvm pkgset create default
mkdir -p $GVM_ROOT/pkgsets/$SOURCE_TAG/default
if [[ $? -ne 0 ]]; then
echo "Failed to create default pkgset folder"
exit 1
fi
}
install_gb() {
echo " * Installing gb..."
goinstall github.com/skelterjohn/go-gb/gb
if [[ $? -ne 0 ]]; then
echo "Failed to install gb"
exit 1
fi
}
install_goprotobuf() {
echo " * Installing goprotobuf..."
if [[ "$SOURCE_TAG" == "release.r60.3" ]]; then
goinstall goprotobuf.googlecode.com/hg/proto
if [[ $? -ne 0 ]]; then
echo "Failed to install goprotobuf"
exit 1
fi
cd $GOROOT/src/pkg/goprotobuf.googlecode.com/hg/compiler
make install > $GVM_ROOT/logs/$SOURCE_TAG-pb-compiler.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to install goprotobuf compiler"
exit 1
fi
else
echo " Don't know how to install goprotobuf for $SOURCE_TAG"
fi
}
main() {
setup_install_env
compile
install_gb
install_goprotobuf
create_default_pkgset
}
main
-21
View File
@@ -1,21 +0,0 @@
#!/bin/bash
if [[ $1 == "list" ]]; then
echo "
gvm gos
"
if [ -d $GVM_ROOT/gos ]; then
if [ -e $GVM_ROOT/go ]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
ls -1 $GVM_ROOT/gos | sed 's/^/ /g' | sed 's/^ '$CUR_VER'/=> '$CUR_VER'/g'
else
ls -1 $GVM_ROOT/gos | sed 's/^/ /g'
fi
else
echo "No installed Go versions. \`gvm install [version]\` to install Go."
fi
echo
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-16
View File
@@ -1,16 +0,0 @@
#!/bin/bash
if [[ $1 == "listall" ]]; then
echo "
gvm gos (available)
"
curl -s https://go.googlecode.com/hg/.hgtags | awk '{ print $2 }'
if [[ $? -ne 0 ]]; then
echo "Failed to get list from Google"
exit 1
fi
echo
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
if [[ $1 == "pkg" ]]; then
if [ -f $GVM_ROOT/bin/gvm-$1-$2 ]; then
$GVM_ROOT/bin/gvm-$1-$2 $@
elif [[ -n $2 ]]; then
echo "ERROR: Unrecognized command line argument: '$2'"
else
echo "= gvm pkg
* http://github.com/moovweb/gvm
== DESCRIPTION:
GVM Package is used to manage various Go packages
== Usage
gvm pkg Command
== Command
install - install go packages
uninstall - uninstall go packages
list - list installed go packages"
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-116
View File
@@ -1,116 +0,0 @@
#!/bin/bash
if [ "$3" == "" ]; then
echo "Please specify package name"
exit 1
fi
cur_dir=`pwd`
cur_dirname=`pwd | awk '{ n=split($1,path,"/"); print path[n] }'`
cache_dir=$GVM_ROOT/archive/package/$3
source_dir=$GVM_ROOT/tmp/$3/src
build_dir=$GVM_ROOT/tmp/$3/build
package_name=$3
version=$4
function download_package() {
if [ ! -d "$cache_dir" ]; then
echo "Downloading $package_name..."
mkdir -p $cache_dir
git clone git@github.com:moovweb/$package_name $cache_dir > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "ERROR: Could not find $package_name in any sources"
exit 1
fi
fi
}
function select_version() {
if [ "$version" != "" ]; then
cd $source_dir && git pull &&
git checkout $version > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Invalid version $version"
exit 1
fi
fi
}
function setup_build_env() {
rm -rf $build_dir && mkdir -p $build_dir
rm -rf $source_dir
cp -r $cache_dir/ $source_dir/
select_version
}
function check_deps() {
export GOPATH=$build_dir
if [ -f "$source_dir/Package.gvm" ]; then
for line in `cat $source_dir/Package.gvm | grep ^pkg | awk '{ print $2 }'`; do
CUR_PKG=$GVM_ROOT/pkgs/pkg.gvm/$line/current
if [ -e "$CUR_PKG/BUILD_VERSION" ]; then
echo "$line: `cat $CUR_PKG/BUILD_VERSION`" >> $build_dir/manifest
else
#gvm pkg install $line
#if [ $? -ne 0 ]; then
# echo "Failed to install dependency $line"
# exit 1
#fi
echo "ERROR: Couldnt find package: $line"
exit 1
fi
export GOPATH=$GOPATH:$CUR_PKG
done
fi
echo ":complete" >> $build_dir/manifest
}
function build_package() {
echo "Installing $package_name..."
if [[ -n $BUILD_NUMBER ]]; then
export BUILD_NUMBER="`cat VERSION`.$BUILD_NUMBER"
else
export BUILD_NUMBER="`cat $source_dir/VERSION`.dev"
fi
echo "$BUILD_NUMBER" > $build_dir/BUILD_VERSION
cd $source_dir && gvmake > $build_dir/build.log 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: Failed to build"
cat "$build_dir/build.log"
exit 1
fi
}
function install_package() {
mkdir -p $GVM_ROOT/pkgs/pkg.gvm/$package_name/$BUILD_NUMBER &&
cp -r $build_dir/* $GVM_ROOT/pkgs/pkg.gvm/$package_name/$BUILD_NUMBER &&
rm -f $GVM_ROOT/pkgs/pkg.gvm/$package_name/current &&
ln -s $GVM_ROOT/pkgs/pkg.gvm/$package_name/$BUILD_NUMBER $GVM_ROOT/pkgs/pkg.gvm/$package_name/current &&
if [ $? -ne 0 ]; then
echo "ERROR: Failed to install"
exit 1
fi
if [ -d $build_dir/bin ]; then
mkdir -p $GVM_ROOT/pkgs/bin &&
cp -f $build_dir/bin/* $GVM_ROOT/pkgs/bin/
fi
}
function cleanup() {
rm -rf $build_dir
rm -rf $source_dir
}
#if [ "$cur_dirname" == "$package_name" ]; then
# cache_dir=$cur_dir
# BUILD_NUMBER=src
# echo "Using local source"
#else
download_package
#fi
setup_build_env
check_deps
build_package
install_package
cleanup
-36
View File
@@ -1,36 +0,0 @@
#!/bin/bash
if [[ $1 == "pkg" ]] && [[ $2 == "list" ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
CUR_PKGSET=`readlink $GVM_ROOT/pkgs | awk '{ n=split($1,path,"/"); print path[n] }'`
echo "
gvm packages $CUR_PKGSET@$CUR_VER"
echo
for package in $GVM_ROOT/pkgs/pkg.gvm/*; do
if [ $package == "$GVM_ROOT/pkgs/pkg.gvm/*" ]; then
break
fi
package_name=`echo $package | awk '{ n=split($1,path,"/"); print path[n] }'`
output=$package_name" ("
first=true
for version in $package/*; do
version=`echo $version | awk '{ n=split($1,path,"/"); print path[n] }'`
if [ "$version" != "current" ]; then
if [ $first == true ]; then
first=false
else
output=$output", "
fi
version=`echo $version | awk '{ n=split($1,path,"/"); print path[n] }'`
output=$output$version
fi
done
output=$output")"
echo $output
done
echo
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-34
View File
@@ -1,34 +0,0 @@
#!/bin/bash
if [[ $1 == "pkg" ]] && [[ $2 == "uninstall" ]]; then
if [[ "$3" == "" ]]; then
echo "ERROR: Please specify the package name"
exit 1
fi
UNINSTALL_ROOT=$GVM_ROOT/pkgs/pkg.gvm/$3
if [[ ! -d $UNINSTALL_ROOT ]]; then
echo "ERROR: Invalid package name"
exit 1
fi
if [[ "$4" != "" ]]; then
UNINSTALL_ROOT=$UNINSTALL_ROOT/$4
fi
if [[ -d $UNINSTALL_ROOT ]]; then
rm -rf $UNINSTALL_ROOT
else
echo "ERROR: Invalid package version"
exit 1
fi
if [[ "$4" != "" ]]; then
echo "Uninstalled $3 version $4"
else
echo "Uninstalled $3"
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-32
View File
@@ -1,32 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]]; then
if [ -f $GVM_ROOT/bin/gvm-$1-$2 ]; then
$GVM_ROOT/bin/gvm-$1-$2 $@
elif [[ -n $2 ]]; then
echo "ERROR: Unrecognized command line argument: '$2'"
else
echo "= gvm pkgset
* http://github.com/moovweb/gvm
== DESCRIPTION:
GVM pkgset is used to manage various Go packages
== Usage
gvm pkgset Command
== Command
create - create a new package set
delete - delete a package set
use - select where gb and goinstall target and link
empty - remove all code and compiled binaries from package set
list - list installed go packages"
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-23
View File
@@ -1,23 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]] && [[ $2 == "create" ]]; then
if [[ -n $3 ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
if [[ $CUR_VER == "" ]]; then
echo "ERROR: No Go version selected"
exit 1
else
mkdir -p $GVM_ROOT/pkgsets/$CUR_VER/$3
if [[ $? -ne 0 ]]; then
echo "ERROR: Could not create folder"
exit 1
fi
fi
else
echo "ERROR: Please specifiy the name"
exit 1
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-23
View File
@@ -1,23 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]] && [[ $2 == "delete" ]]; then
if [[ -n $3 ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
if [[ $CUR_VER == "" ]]; then
echo "ERROR: No Go version selected"
exit 1
else
rm -rf $GVM_ROOT/pkgsets/$CUR_VER/$3
if [[ $? -ne 0 ]]; then
echo "ERROR: Could not delete package set"
exit 1
fi
fi
else
echo "ERROR: Please specifiy the name"
exit 1
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]] && [[ $2 == "empty" ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
if [[ $CUR_VER == "" ]]; then
echo "ERROR: No Go version selected"
exit 1
else
rm -rf $GVM_ROOT/pkgs/*
if [[ $? -ne 0 ]]; then
echo "ERROR: Could not delete package set files"
exit 1
fi
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-27
View File
@@ -1,27 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]] && [[ $2 == "list" ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
if [[ $CUR_VER == "" ]]; then
echo "ERROR: No Go version selected"
exit 1
else
echo "
gvm go package sets ($CUR_VER)
"
if [ -d $GVM_ROOT/pkgsets ]; then
if [ -e $GVM_ROOT/pkgs ]; then
CUR_PKGSET=`readlink $GVM_ROOT/pkgs | awk '{ n=split($1,path,"/"); print path[n] }'`
ls -1 $GVM_ROOT/pkgsets/$CUR_VER | sed 's/^/ /g' | sed 's/^ '$CUR_PKGSET'/=> '$CUR_PKGSET'/g'
else
ls -1 $GVM_ROOT/pkgsets/$CUR_VER | sed 's/^/ /g'
fi
else
echo "No installed Go versions. \`gvm install [version]\` to install Go."
fi
echo
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-20
View File
@@ -1,20 +0,0 @@
#!/bin/bash
if [[ $1 == "pkgset" ]] && [[ $2 == "use" ]]; then
CUR_VER=`readlink $GVM_ROOT/go | awk '{ n=split($1,path,"/"); print path[n] }'`
if [[ $CUR_VER == "" ]]; then
echo "ERROR: No Go version selected"
exit 1
else
if [ -e $GVM_ROOT/pkgsets/$CUR_VER/$3 ]; then
rm -f $GVM_ROOT/pkgs
ln -s $GVM_ROOT/pkgsets/$CUR_VER/$3 $GVM_ROOT/pkgs
else
echo "ERROR: Invalid package set name"
exit 1
fi
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
Executable
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
function gvm_prompt() {
if [[ "$1" == "g" ]]; then
echo $gvm_go_name
elif [[ "$1" == "ps" ]]; then
echo $gvm_pkgset_name
else
if [[ $gvm_pkgset_name != "" ]]; then
if [[ $gvm_pkgset_name != "global" ]]; then
echo "$gvm_go_name@$gvm_pkgset_name"
return 0
fi
fi
echo $gvm_go_name
fi
}
gvm_prompt $@
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
if [[ $1 == "uninstall" ]]; then
if [[ -n $2 ]]; then
fuzzy_match=`ls $GVM_ROOT/gos | grep "$2"`
if [[ $? != 0 ]]; then
echo "Invalid version $2"
exit 1
fi
if [ -d $GVM_ROOT/gos/$fuzzy_match ]; then
rm -rf $GVM_ROOT/gos/$fuzzy_match
rm -rf $GVM_ROOT/pkgsets/$fuzzy_match
echo "Uninstalled version $fuzzy_match"
else
echo "Invalid version"
exit 1
fi
exit 0
else
echo "ERROR: Please specifiy the version"
exit 1
fi
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-28
View File
@@ -1,28 +0,0 @@
#!/bin/bash
if [[ $1 == "use" ]]; then
if [[ -n $2 ]]; then
fuzzy_match=`ls $GVM_ROOT/gos | grep "$2"`
if [[ $? != 0 ]]; then
echo "Invalid version $2"
exit 1
fi
if [ -d $GVM_ROOT/gos/$fuzzy_match ]; then
rm -f $GVM_ROOT/go
ln -s $GVM_ROOT/gos/$fuzzy_match $GVM_ROOT/go
rm -f $GVM_ROOT/pkgs
ln -s $GVM_ROOT/pkgsets/$fuzzy_match/default $GVM_ROOT/pkgs
else
echo "Invalid version $2"
exit 1
fi
else
echo "ERROR: Please specifiy the version"
exit 1
fi
echo "Now using version $fuzzy_match"
exit 0
else
echo "Please use gvm [action] to call this file"
exit 1
fi
-1
View File
@@ -1 +0,0 @@
make -f Makefile.gvm $@
Regular → Executable
+91 -43
View File
@@ -1,51 +1,99 @@
#!/bin/bash
display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1"
tput sgr0
exit 1
}
update_profile() {
[ -f $1 ] || return 1
cat $1 | grep "$source_line" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "$source_line" >> $1
fi
}
check_existing_go() {
if [ "$GOROOT" == "" ]; then
echo "No existing Go versions detected"
return
fi
echo "Created profile for existing install of Go at $GOROOT"
mkdir -p $GVM_DEST/$GVM_NAME/environments &> /dev/null || display_error "Failed to create environment directory"
mkdir -p $GVM_DEST/$GVM_NAME/pkgsets/system/global &> /dev/null || display_error "Failed to create new package set"
mkdir -p $GVM_DEST/$GVM_NAME/gos/system &> /dev/null || display_error "Failed to create new Go folder"
cat << EOF > $GVM_DEST/$GVM_NAME/environments/system
# Automatically generated file. DO NOT EDIT!
export GVM_ROOT; GVM_ROOT="$GVM_DEST/$GVM_NAME"
export gvm_go_name; gvm_go_name="system"
export gvm_pkgset_name; gvm_pkgset_name="global"
export GOROOT; GOROOT="$GOROOT"
export GOPATH; GOPATH="$GVM_DEST/$GVM_NAME/pkgsets/system/global"
export PATH; PATH="$GVM_DEST/$GVM_NAME/pkgsets/system/global:$GOROOT/bin:$GVM_ROOT/bin:\$PATH"
EOF
}
BRANCH=$1
if [ "$(whoami)" != "root" ]; then
GVM_DEST=~
GVM_NAME=.gvm
GVM_DEST=$2
if [ "$GVM_DEST" == "" ]; then
GVM_DEST="$HOME"
GVM_NAME=".gvm"
else
GVM_DEST=/usr/local
GVM_NAME=gvm
GVM_NAME="gvm"
fi
ENV_FILE=~/.bashrc
SRC_REPO=git://github.com/moovweb/gvm.git
SRC_REPO=https://github.com/moovweb/gvm.git
if [ -d $GVM_DEST/$GVM_NAME ]; then
echo "Already installed!"
else
cd $GVM_DEST && git clone $SRC_REPO $GVM_NAME > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to clone from $SRC_REPO into $GVM_DEST/$GVM_NAME"
exit 1
fi
if [ "$BRANCH" == "stable" ]; then
cd $GVM_DEST/$GVM_NAME && git checkout $BRANCH > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to checkout $BRANCH branch"
exit 1
fi
fi
mv $GVM_DEST/$GVM_NAME/.git $GVM_DEST/$GVM_NAME/git.bak
if [ "$(whoami)" != "root" ]; then
if [ -e ~/.bashrc ]; then
cat ~/.bashrc | grep "\[\[ -s \"\$HOME/.gvm/scripts/gvm\" ]] && source \"\$HOME/.gvm/scripts/gvm\"" > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo '[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"' >> $ENV_FILE
fi
else
echo 'This must be a Mac... put this line in you profile and source it!'
echo
echo ' [[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"'
echo
echo "Maybe send me the file name and I'll look for it next time :)"
echo
fi
fi
echo "export GVM_ROOT=$GVM_DEST/$GVM_NAME" > $GVM_DEST/$GVM_NAME/scripts/gvm
echo ". \$GVM_ROOT/scripts/gvm-default" >> $GVM_DEST/$GVM_NAME/scripts/gvm
[[ -s "$GVM_DEST/$GVM_NAME/scripts/gvm" ]] && source "$GVM_DEST/$GVM_NAME/scripts/gvm"
echo "Installed GVM v$GVM_VERSION"
echo "Please restart your terminal session"
[ "$GVM_DEST" == "" ] && display_error "No destination specified!"
[ -d $GVM_DEST/$GVM_NAME ] && display_error "Already installed!"
[ -d $GVM_DEST ] || mkdir -p $GVM_DEST > /dev/null 2>&1 || display_error "Failed to create $GVM_DEST"
[ -z `which git` ] && display_error "Could not find git
linux: apt-get install git
mac: brew install git
"
cd $GVM_DEST && git clone $SRC_REPO $GVM_NAME > /dev/null 2>&1 ||
display_error "Failed to clone from $SRC_REPO into $GVM_DEST/$GVM_NAME"
if [ "$BRANCH" != "" ]; then
cd $GVM_DEST/$GVM_NAME && git checkout $BRANCH > /dev/null 2>&1 ||
display_error "Failed to checkout $BRANCH branch"
fi
mv $GVM_DEST/$GVM_NAME/.git $GVM_DEST/$GVM_NAME/git.bak
if [ "$GVM_NAME" == ".gvm" ]; then
source_line="[[ -s \"\$HOME/.gvm/scripts/gvm\" ]] && source \"\$HOME/.gvm/scripts/gvm\""
source_file="\$HOME/.gvm/scripts/gvm"
else
source_line="[[ -s \"${GVM_DEST}/gvm/scripts/gvm\" ]] && source \"${GVM_DEST}/gvm/scripts/gvm\""
source_file="${GVM_DEST}/gvm/scripts/gvm"
fi
if [ "`uname`" == "Linux" ]; then
update_profile $HOME/.bashrc || update_profile $HOME/.bash_profile
elif [ "`uname`" == "Darwin" ]; then
update_profile $HOME/.profile || update_profile $HOME/.bash_profile
fi
if [ "$?" != "0" ]; then
echo 'Unable to locate profile settings file'
echo
echo " You will have to manually add the following line:"
echo
echo " $source_line"
echo
fi
echo "export GVM_ROOT=$GVM_DEST/$GVM_NAME" > $GVM_DEST/$GVM_NAME/scripts/gvm
echo ". \$GVM_ROOT/scripts/gvm-default" >> $GVM_DEST/$GVM_NAME/scripts/gvm
check_existing_go
[[ -s "$GVM_DEST/$GVM_NAME/scripts/gvm" ]] && source "$GVM_DEST/$GVM_NAME/scripts/gvm"
echo "Installed GVM v${GVM_VERSION}"
echo
echo "Please restart your terminal session or to get started right away run"
echo " \`source ${source_file}\`"
echo
+1
View File
@@ -0,0 +1 @@
git://github.com/moovweb
-16
View File
@@ -1,16 +0,0 @@
gvm:
echo `cat PackageFile`
#gvm: all
# echo $(pkgdir)
# echo _obj/$(TARG).a
# make $(GVM_ROOT)/scripts/Make.pkg all
#
#all: $(INSTALLFILES)
# echo $(INSTALLFILES)
#gvminstall: $(INSTALLFILES)
# ifdef GVM_PACKAGE_INSTALL
# include $(GOROOT)/src/Makeaaa.pkg
# endif
+83
View File
@@ -0,0 +1,83 @@
. $GVM_ROOT/scripts/functions/tools
_gvm()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
base="${COMP_WORDS[0]}"
cmd="${COMP_WORDS[1]}"
subcmd="${COMP_WORDS[2]}"
case "${cmd}" in
pkgset)
case "${subcmd}" in
use|delete|empty)
[[ "$gvm_go_name" == "" ]] && return 1
[[ $COMP_CWORD > 3 ]] && return 1
local version=$(for x in `$LS_PATH $GVM_ROOT/pkgsets/$gvm_go_name`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${version}" -- ${cur}) )
return 0
;;
create|list)
return 1
;;
*)
opts="create delete empty list use"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
esac
;;
pkg)
case "${subcmd}" in
uninstall)
[[ "$gvm_go_name" == "" ]] && return 1
[[ "$gvm_pkgset_name" == "" ]] && return 1
if [[ "$COMP_CWORD" == "3" ]]; then
local version=$(for x in `$LS_PATH $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${version}" -- ${cur}) )
return 0
elif [[ "$COMP_CWORD" == "4" ]]; then
local version=$(for x in `$LS_PATH $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/${COMP_WORDS[3]}`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${version}" -- ${cur}) )
return 0
fi
return 1
;;
install|list)
return 1
;;
*)
opts="install list uninstall"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
esac
;;
install)
[ ! -d $GVM_ROOT/archive/go ] && return 1
[[ $COMP_CWORD > 2 ]] && return 1
local version=$(for x in `hg tags -R $GVM_ROOT/archive/go | awk '{print $1}' | $GREP_PATH -E "release|tip"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${version}" -- ${cur}) )
return 0
;;
use|uninstall)
[ ! -d $GVM_ROOT/gos ] && return 1
[[ $COMP_CWORD > 2 ]] && return 1
local installed_versions=$(for x in `$LS_PATH $GVM_ROOT/gos`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${installed_versions}" -- ${cur}) )
return 0
;;
*)
[[ $COMP_CWORD > 1 ]] && return 1
opts="get install list listall uninstall use version"
[[ "$gvm_go_name" != "" ]] && opts="get install list listall pkgset uninstall use version"
[[ "$gvm_pkgset_name" != "" ]] && opts="get install list listall pkg pkgset uninstall use version"
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
;;
esac
}
complete -F _gvm gvm
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
version=$1
if [ "$version" != "" ]; then
fuzzy_match=`$LS_PATH $GVM_ROOT/gos | $SORT_PATH | $GREP_PATH "$version" | $HEAD_PATH -n 1 | $GREP_PATH "$version"` ||
display_error "Invalid version $version"
foldername=$GVM_ROOT/gos/$fuzzy_match
else
if [ "$gvm_go_name" != "" ]; then
foldername=$GVM_ROOT/gos/$gvm_go_name
else
display_error "No version selected"
fi
fi
if [ -d $foldername ]; then
cd $foldername
find . > /tmp/manifest.test
diff manifest /tmp/manifest.test
if [ "$?" == "0" ]; then
display_message "Clean $foldername"
else
display_message "*Dirty* $foldername"
fi
else
display_error "Invalid version"
fi
+45
View File
@@ -0,0 +1,45 @@
#!/bin/bash
function display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1" >&2
tput sgr0
return 1
}
function gvm() {
if [[ "$GVM_ROOT" == "" ]]; then
display_error "GVM_ROOT not set. Please source GVM_ROOT/scripts/gvm"
return $?
fi
if [[ -d $GVM_ROOT/.git ]]; then
mv $GVM_ROOT/.git $GVM_ROOT/git.bak ||
display_error "Failed to move git info out of the way"
fi
if [[ ! -d $GVM_ROOT ]]; then
display_error "GVM_ROOT does not exist. Please reinstall GVM"
return $?
fi
mkdir -p $GVM_ROOT/logs > /dev/null 2>&1
mkdir -p $GVM_ROOT/gos > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive/package > /dev/null 2>&1
mkdir -p $GVM_ROOT/environments > /dev/null 2>&1
if [ "$1" == "use" ]; then
. $GVM_ROOT/scripts/env/use
shift
gvm_use $@
elif [ "$1" == "implode" ]; then
rm -rf $GVM_ROOT
elif [ "$1" == "pkgset" ] && [ "$2" == "use" ]; then
. $GVM_ROOT/scripts/env/pkgset-use
shift
shift
gvm_pkgset_use $@
else
$GVM_ROOT/bin/gvm $@
fi
}
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
. $GVM_ROOT/scripts/function/errors
function display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1" >&2
tput sgr0
return 1
}
function display_message() {
# GREEN!
tput sgr0
tput setaf 2
echo "$1"
tput sgr0
}
function gvm_pkgset_use() {
[[ "$1" != "" ]] ||
display_error "Please specify a package set" || return 1
[[ "$gvm_go_name" != "" ]] ||
display_error "No Go version selected" || return 1
fuzzy_match=`$LS_PATH $GVM_ROOT/environments | $SORT_PATH | $GREP_PATH "$gvm_go_name@" | $GREP_PATH "$1" | $HEAD_PATH -n 1` ||
display_error "Invalid package set" || return 1
export PATH=$GVM_PATH_BACKUP
. "$GVM_ROOT/environments/$fuzzy_match" ||
display_error "Failed to source the package set environment" || return 1
if [[ "$2" == "--default" ]]; then
cp $GVM_ROOT/environments/$fuzzy_match $GVM_ROOT/environments/default
fi
echo "Now using version $fuzzy_match"
}
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
. $GVM_ROOT/scripts/function/tools
function display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1" >&2
tput sgr0
return 1
}
function display_message() {
# GREEN!
tput sgr0
tput setaf 2
echo "$1"
tput sgr0
}
function gvm_use() {
[[ "$1" != "" ]] ||
display_error "Please specifiy the version" || return 1
fuzzy_match=`$LS_PATH $GVM_ROOT/gos | $SORT_PATH | $GREP_PATH "$1" | $HEAD_PATH -n 1 | $GREP_PATH "$1"` ||
display_error "Invalid version $1" || return 1
export PATH=$GVM_PATH_BACKUP
. $GVM_ROOT/environments/$fuzzy_match &> /dev/null || display_error "Couldn't source environment" || return 1
if [[ "$2" == "--default" ]]; then
cp $GVM_ROOT/environments/$fuzzy_match $GVM_ROOT/environments/default || display_error "Couldn't make $fuzzy_match default"
fi
display_message "Now using version $fuzzy_match"
}
+8
View File
@@ -0,0 +1,8 @@
display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1" >&2
tput sgr0
exit 1
}
+7
View File
@@ -0,0 +1,7 @@
display_message() {
# GREEN!
tput sgr0
tput setaf 2
echo "$1"
tput sgr0
}
+7
View File
@@ -0,0 +1,7 @@
display_warning() {
# YELLOW!
tput sgr0
tput setaf 3
echo "$1"
tput sgr0
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
LS_ERROR="Couldn't find ls"
GREP_ERROR="Couldn't find grep"
SORT_ERROR="Couldn't find sort"
HEAD_ERROR="Couldn't find head"
LS_PATH=`unalias ls &> /dev/null; which ls` || display_error "$LS_ERROR" || return 1
GREP_PATH=`unalias grep &> /dev/null; which grep` || display_error "$GREP_ERROR" || return 1
SORT_PATH=`unalias sort &> /dev/null; which sort` || display_error "$SORT_ERROR" || return 1
HEAD_PATH=`unalias head &> /dev/null; which head` || display_error "$HEAD_ERROR" || return 1
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
for function in $GVM_ROOT/scripts/function/*; do
. $function
done
Executable
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ -d $GVM_ROOT/.git ]] || mv $GVM_ROOT/git.bak $GVM_ROOT/.git &> /dev/null ||
display_error "Couldn't find git info"
cd $GVM_ROOT && git checkout -f ||
display_error "Failed to clean install"
if [[ -n $1 ]]; then
cd $GVM_ROOT && git checkout $1 -f ||
display_error "Failed to checkout $1 branch"
fi
cd $GVM_ROOT && git pull ||
display_error "Failed to update"
mv $GVM_ROOT/.git $GVM_ROOT/git.bak ||
display_error "Couldn't backup git info"
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
# Check for hg
[ -z `which hg` ] &&
display_warning "Could not find mercurial
linux: apt-get install mercurial
mac: brew install mercurial
" && exit 1
# Check for ar
[ -z `which ar` ] &&
display_warning "Could not find binutils
linux: apt-get install binutils
" && exit 1
# Check for bison
[ -z `which bison` ] &&
display_warning "Could not find bison
linux: apt-get install bison
" && exit 1
# Check for gcc
[ -z `which gcc` ] &&
display_warning "Could not find gcc
linux: apt-get install gcc
" && exit 1
# Check for make
[ -z `which make` ] &&
display_warning "Could not find make
linux: apt-get install make
" && exit 1
# All good!
exit 0
+14 -3
View File
@@ -3,8 +3,19 @@ unset GOARCH
unset GOOS
unset GOPATH
unset GOBIN
unset gvm_go_name
unset gvm_pkgset_name
mkdir -p $GVM_ROOT/logs > /dev/null 2>&1
mkdir -p $GVM_ROOT/gos > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive > /dev/null 2>&1
mkdir -p $GVM_ROOT/archive/package > /dev/null 2>&1
mkdir -p $GVM_ROOT/environments > /dev/null 2>&1
export GVM_VERSION=`cat $GVM_ROOT/VERSION`
export GOROOT=$GVM_ROOT/go
export GOPATH=$GVM_ROOT/pkgs
export PATH=$GVM_ROOT/bin:$GVM_ROOT/pkgs/bin:$GVM_ROOT/go/bin:$PATH
export PATH=$GVM_ROOT/bin:$PATH
export GVM_PATH_BACKUP=$PATH
[ -f $GVM_ROOT/environments/default ] && . $GVM_ROOT/environments/default
. $GVM_ROOT/scripts/env/gvm
+165
View File
@@ -0,0 +1,165 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
function show_usage() {
echo "Usage: gvm install [version] [options]"
echo " -s, --source=SOURCE Install Go from specified source."
echo " -pb, --with-protobuf Install Go protocol buffers."
echo " -h, --help Display this message."
}
read_command_line() {
VERSION=$1
if [ "${VERSION:0:1}" != "-" ]; then
shift
else
display_warning "Invalid version: $1"
show_usage
exit 1
fi
GO_SOURCE_URL=https://go.googlecode.com/hg/
for i in $*; do
case $i in
-s=*|--source=*)
GO_SOURCE_URL=$i
;;
-pb|--with-protobuf)
INSTALL_PB="true"
;;
-h|--help)
show_usage
exit 0
;;
*)
display_warning "Invalid option $i"
show_usage
exit 65 # Bad arguments
;;
esac
done
}
download_source() {
GO_CACHE_PATH=$GVM_ROOT/archive/go
[ -d $GO_CACHE_PATH ] && return
display_message "Downloading Go source..."
hg clone $GO_SOURCE_URL $GO_CACHE_PATH >> $GVM_ROOT/logs/go-download.log 2>&1 ||
display_error "Couldn't download Go source"
}
check_tag() {
version=`hg tags -R $GO_CACHE_PATH | awk '{print $1}' | $SORT_PATH | $GREP_PATH "$VERSION" | $HEAD_PATH -n 1 | $GREP_PATH "$VERSION"`
}
update_source() {
display_message "Updating Go source..."
hg pull -R $GO_CACHE_PATH >> $GVM_ROOT/logs/go-download.log 2>&1 ||
display_error "Couldn't get latest Go version info"
}
copy_source() {
hg clone -u $version $GO_CACHE_PATH $GO_INSTALL_ROOT >> $GVM_ROOT/logs/go-$version-install.log 2>&1 ||
display_error "Couldn't copy source to target folder"
}
compile_go() {
display_message " * Compiling..."
unset GOARCH && unset GOOS && unset GOPATH && unset GOBIN && unset GOROOT &&
export GOBIN=$GO_INSTALL_ROOT/bin &&
export PATH=$GOBIN:$PATH &&
export GOROOT=$GO_INSTALL_ROOT &&
#cd $GO_INSTALL_ROOT/src && ./all.bash &> $GVM_ROOT/logs/go-$version-compile.log ||
cd $GO_INSTALL_ROOT/src && ./make.bash &> $GVM_ROOT/logs/go-$version-compile.log ||
(rm -rf $GO_INSTALL_ROOT && display_error "Failed to compile")
}
create_enviroment() {
new_env_file=$GVM_ROOT/environments/$version
echo "export GVM_ROOT; GVM_ROOT=\"$GVM_ROOT\"" > $new_env_file
echo "export gvm_go_name; gvm_go_name=\"$version\"" >> $new_env_file
echo "export gvm_pkgset_name; gvm_pkgset_name=\"global\"" >> $new_env_file
echo "export GOROOT; GOROOT=\"\$GVM_ROOT/gos/$version\"" >> $new_env_file
echo "export GOPATH; GOPATH=\"\$GVM_ROOT/pkgsets/$version/global\"" >> $new_env_file
echo "export PATH; PATH=\"\$GVM_ROOT/pkgsets/$version/global/bin:\$GVM_ROOT/gos/$version/bin:\$GVM_ROOT/bin:\$PATH\"" >> $new_env_file
. $GVM_ROOT/scripts/env/use
gvm_use $version &> /dev/null ||
display_error "Failed to use installed version"
gvm pkgset create global
unset GOPATH
}
install_go() {
GO_INSTALL_ROOT=$GVM_ROOT/gos/$version
trap 'rm -rf $GO_INSTALL_ROOT; display_error "Canceled!"' INT
# Check for existing install
if [ -d "$GO_INSTALL_ROOT" ]; then
[ -f "$GO_INSTALL_ROOT/manifest" ] &&
display_error "Already installed!"
display_warning "Removing corrupt install..."
gvm uninstall $version
fi
display_message "Installing $version..."
# Create the global package set folder
mkdir -p $GVM_ROOT/pkgsets/$version >> $GVM_ROOT/logs/go-$version-install.log 2>&1 ||
display_error "Couldn't create global package set folder"
copy_source
compile_go
create_enviroment
}
install_gpkg() {
display_message " * Installing gpkg..."
$GVM_GOINSTALL github.com/moovweb/gpkg > $GVM_ROOT/logs/$version-gpkg.log 2>&1 || return 1
}
install_gb() {
display_message " * Installing gb..."
$GVM_GOINSTALL github.com/jbussdieker/go-gb/gb > $GVM_ROOT/logs/$version-gb.log 2>&1 || return 1
}
install_goprotobuf() {
display_message " * Installing goprotobuf..."
$GVM_GOINSTALL goprotobuf.googlecode.com/hg/proto > $GVM_ROOT/logs/$version-pb-compiler.log 2>&1
if [[ $? -ne 0 ]]; then
display_warning "Failed to install goprotobuf"
return 1
fi
#if [[ $version == "release.r60.3" ]]; then
cd $GVM_ROOT/gos/$version/src/pkg/goprotobuf.googlecode.com/hg/compiler
make install >> $GVM_ROOT/logs/$version-pb-compiler.log 2>&1
if [[ $? -ne 0 ]]; then
display_warning "Failed to install goprotobuf compiler"
return 1
fi
#fi
}
main() {
trap 'display_error "Canceled!"' INT
read_command_line $@
[ "$VERSION" == "" ] && display_error "No version specified"
download_source
check_tag || (update_source && check_tag) || display_error "Unrecognized Go version"
install_go
GVM_GOINSTALL="goinstall"
which goinstall &> /dev/null ||
GVM_GOINSTALL="go get"
x="`hg tags -R ~/.gvm/archive/go`"; echo ${x#*b0819469a6df} | $GREP_PATH "$version " &> /dev/null
if [[ "$?" == "1" ]]; then
install_gb || display_warning "Failed to install gb"
install_gpkg || display_warning "Failed to install gpkg"
if [ "$INSTALL_PB" == "true" ]; then
install_goprotobuf
fi
fi
cd $GO_INSTALL_ROOT && find . > manifest
}
main $@
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
echo
display_message "gvm gos (installed)"
echo
if [ -d $GVM_ROOT/gos ]; then
if [[ "$gvm_go_name" != "" ]]; then
$LS_PATH -1 $GVM_ROOT/gos | sed 's/^/ /g' | sed 's/^ '$gvm_go_name'/=> '$gvm_go_name'/g'
else
$LS_PATH -1 $GVM_ROOT/gos | sed 's/^/ /g'
fi
fi
echo
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
function show_usage() {
echo "Usage: gvm listall [options]"
echo " -a, --all List all tags."
echo " -h, --help Display this message."
}
function read_command_line() {
tag_filter="release"
for i in $*; do
case $i in
-a|--all)
tag_filter=""
;;
-h|--help*)
show_usage
exit 0
;;
*)
echo "Invalid option $i"
show_usage
exit 65 # Bad arguments
;;
esac
done
}
read_command_line $@
echo
display_message "gvm gos (available)"
echo
versions=`curl -s https://go.googlecode.com/hg/.hgtags | awk '{ print $2 }' | $GREP_PATH "$tag_filter" | $SORT_PATH`
if [[ $? -ne 0 ]]; then
display_error "Failed to get version list from Google"
fi
for version in $versions; do
echo " $version"
done
echo
Executable
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ $gvm_go_name != "" ]] ||
display_error "No Go version selected"
[[ -d $GVM_ROOT/gos/$gvm_go_name ]] ||
display_error "Invalid or corrupt Go version"
[[ -d $GVM_ROOT/pkgsets/$gvm_go_name ]] ||
display_error "Missing package set folder for this Go version"
command=$1
if [ -f $GVM_ROOT/scripts/pkgset-$command ]; then
shift
$GVM_ROOT/scripts/pkgset-$command $@
elif [[ -n $command ]]; then
display_error "Unrecognized command line argument: '$command'"
else
echo "= gvm pkgset
* http://github.com/moovweb/gvm
== DESCRIPTION:
GVM pkgset is used to manage various Go packages
== Usage
gvm pkgset Command
== Command
create - create a new package set
delete - delete a package set
use - select where gb and goinstall target and link
empty - remove all code and compiled binaries from package set
list - list installed go packages"
fi
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ $1 != "" ]] ||
display_error "Please specifiy the name"
[[ ! -f "$GVM_ROOT/environments/$gvm_go_name@$1" ]] ||
display_error "Packageset already exists!"
mkdir -p $GVM_ROOT/pkgsets/$gvm_go_name/$1 ||
display_error "Could not create folder"
cp $GVM_ROOT/environments/$gvm_go_name $GVM_ROOT/environments/$gvm_go_name@$1 ||
display_error "Could copy environment"
echo "export gvm_pkgset_name=\"$1\"" >> $GVM_ROOT/environments/$gvm_go_name@$1 ||
display_error "Could not extend environment"
echo "export GOPATH; GOPATH=\"$GVM_ROOT/pkgsets/$gvm_go_name/$1:\$GOPATH\"" >> $GVM_ROOT/environments/$gvm_go_name@$1 ||
display_error "Could not extend environment"
echo "export PATH; PATH=\"$GVM_ROOT/pkgsets/$gvm_go_name/$1/bin:\$PATH\"" >> $GVM_ROOT/environments/$gvm_go_name@$1 ||
display_error "Could not extend environment"
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ $gvm_go_name != "" ]] ||
display_error "No Go version selected"
[[ $1 != "" ]] ||
display_error "Please specifiy the name"
[[ -d $GVM_ROOT/pkgsets/$gvm_go_name/$1 ]] ||
display_error "Packageset doesn't exist!"
rm -rf $GVM_ROOT/pkgsets/$gvm_go_name/$1 ||
display_error "Could not delete package set"
rm -rf $GVM_ROOT/environments/$gvm_go_name@$1 ||
display_error "Could not delete package set"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ $gvm_pkgset_name != "" ]] ||
display_error "No Package set selected"
rm -rf $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/* ||
display_error "Could not delete package set files"
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
echo
display_message "gvm go package sets ($gvm_go_name)"
echo
if [ -d $GVM_ROOT/pkgsets/$gvm_go_name ]; then
for cur_dir in $GVM_ROOT/pkgsets/$gvm_go_name/*; do
[[ "$cur_dir" == "$GVM_ROOT/pkgsets/$gvm_go_name/*" ]] && exit
pkgset=`basename $cur_dir`
if [[ "$gvm_pkgset_name" == "$pkgset" ]]; then
echo "=> $pkgset"
else
echo " $pkgset"
fi
done
fi
echo
+15
View File
@@ -0,0 +1,15 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions/tools
echo $1 | sed -n -e '/_.*_/ p' | $GREP_PATH "_" &> /dev/null
if [ "$?" == "0" ]; then
version=`echo $1 | sed 's/_\(.*\)_/\1/'`
if [ ! -f $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/$version/bin/{{binary_name}} ]; then
echo "GVM: Invalid version"
exit 1
fi
shift
$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/$version/bin/{{binary_name}} $@
else
$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/{{package_name}}/current/bin/{{binary_name}} $@
fi
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ "$1" == "" ]] &&
display_error "Please specifiy the version"
fuzzy_match=`$LS_PATH $GVM_ROOT/gos | $SORT_PATH | $GREP_PATH "$1" | $HEAD_PATH -n 1 | $GREP_PATH "$1"` ||
display_error "Invalid version $1"
if [ -d $GVM_ROOT/gos/$fuzzy_match ]; then
rm -rf $GVM_ROOT/pkgsets/$fuzzy_match &> /dev/null ||
display_error "Couldn't remove pkgsets"
rm -f $GVM_ROOT/environments/$fuzzy_match &> /dev/null ||
display_error "Couldn't remove environment files"
rm -f "$GVM_ROOT/environments/$fuzzy_match@"* &> /dev/null ||
display_error "Couldn't remove pkgset environment files"
rm -rf $GVM_ROOT/gos/$fuzzy_match &> /dev/null ||
display_error "Couldn't remove Go folder"
display_message "Uninstalled version $fuzzy_match"
else
display_error "Invalid version"
fi
Executable
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
cd $GVM_ROOT/archive/go &> /dev/null ||
display_error "Failed to find local Go source"
cd $GVM_ROOT/archive/go && hg pull ||
display_error "Failed to update"
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash -ex
TEST_OUTPUT=`gvm version`
[ "$TEST_OUTPUT" != "" ]
echo "Success!"