8 Commits
Author SHA1 Message Date
jenkins 19ae86559a Fix manifest file location 2012-03-10 22:31:47 +00:00
jenkins c6533ce424 Fix the jenkins hack 2012-03-08 20:48:55 +00:00
jenkins 018a9552df Fix to the hack :P 2012-03-07 11:51:26 +00:00
jenkins 045b88de76 Hack for Jenkins gvm_build script 2012-03-07 11:47:15 +00:00
jenkins d7179e0350 For new jenkins build system 2012-03-07 10:40:19 +00:00
jenkins 211491990c Run tests 2012-03-03 07:18:06 +00:00
jenkins b9e6b02e38 Jenkins needs this for now... 2012-03-03 05:02:04 +00:00
jenkins b1e504374a Hard code stuff for Jenkins 2012-03-03 05:00:51 +00:00
24 changed files with 443 additions and 153 deletions
+1
View File
@@ -1,3 +1,4 @@
pkgs/
*~
go
gos/
+1 -9
View File
@@ -1,15 +1,7 @@
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
State: Development
CHANGES:
* Complete overhaul of the package system. Now uses
http://github.com/moovweb/gpkg
Version: 0.0.7
State: Stable
+13 -23
View File
@@ -2,34 +2,29 @@
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:
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 (NOT USUALLY RECOMMENDED!) run:
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 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
Once this is done Go will be in the path and ready to use. $GOROOT is set automatically.
List Go Versions
================
@@ -43,8 +38,6 @@ 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/
@@ -59,6 +52,3 @@ 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 @@
1.0.9
0.0.8-dev
+1 -1
View File
@@ -24,7 +24,7 @@ if [[ "$?" != "0" ]]; then
fi
if [[ $command == "version" ]]; then
display_message "Go Version Manager v$GVM_VERSION installed at $GVM_ROOT"
display_message "Go Version Manager v$GVM_VERSION"
else
if [ -f $GVM_ROOT/scripts/$command ]; then
shift
+33 -45
View File
@@ -7,67 +7,55 @@ display_error() {
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
}
BRANCH=$1
GVM_DEST=$2
if [ "$GVM_DEST" == "" ]; then
GVM_DEST="$HOME"
GVM_NAME=".gvm"
if [ "$(whoami)" != "root" ]; then
GVM_DEST=~
GVM_NAME=.gvm
else
GVM_NAME="gvm"
GVM_DEST=/usr/local
GVM_NAME=gvm
fi
ENV_FILE=~/.bashrc
SRC_REPO=git://github.com/moovweb/gvm.git
#SRC_REPO=~/install.gvm
[ "$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"
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"
if [ "$BRANCH" == "stable" ]; 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
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
elif [ -e ~/.profile ]; 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 'Unable to location profile settings file'
echo
echo " You will have to manually add the following line:"
echo " [[ -s \"\$HOME/.gvm/scripts/gvm\" ]] && source \"\$HOME/.gvm/scripts/gvm\""
echo
echo "To get started right away run \`source ~/.gvm/scripts/gvm\`"
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
echo "Please restart your terminal session or to get started right away run"
echo " \`source ${source_file}\`"
echo
echo "Installed GVM v$GVM_VERSION"
echo "Please restart your terminal session"
+1
View File
@@ -0,0 +1 @@
git@github.com:moovweb
-4
View File
@@ -12,10 +12,6 @@ function gvm() {
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 $?
+1 -13
View File
@@ -1,4 +1,4 @@
function display_error() {
display_error() {
tput sgr0
tput setaf 1
echo "ERROR: $1" >&2
@@ -6,14 +6,6 @@ function display_error() {
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
@@ -27,10 +19,6 @@ function gvm_pkgset_use() {
. "$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"
}
+1 -1
View File
@@ -6,7 +6,7 @@ function display_error() {
return 1
}
function display_message() {
display_message() {
# GREEN!
tput sgr0
tput setaf 2
-7
View File
@@ -1,7 +0,0 @@
display_warning() {
# YELLOW!
tput sgr0
tput setaf 3
echo "$1"
tput sgr0
}
+1 -1
View File
@@ -8,7 +8,7 @@ cd $GVM_ROOT && git checkout -f ||
display_error "Failed to clean install"
if [[ -n $1 ]]; then
cd $GVM_ROOT && git checkout $1 -f ||
cd $GVM_ROOT && git checkout $1 -f ||
display_error "Failed to checkout $1 branch"
fi
+5 -5
View File
@@ -2,14 +2,14 @@
. $GVM_ROOT/scripts/functions
[ -z `which hg` ] &&
display_error '* Could not find mercurial (try `sudo apt-get install mercurial`)'
display_error '* Could not find mercurial (try `sudo apt-get install mercurial`)'
[ -z `which ar` ] &&
display_error '* Could not find binutils (try `sudo apt-get install binutils (or binutils-multiarch)`)'
display_error '* Could not find binutils (try `sudo apt-get install binutils (or binutils-multiarch)`)'
[ -z `which bison` ] &&
display_error '* Could not find bison (try `sudo apt-get install bison`)'
display_error '* Could not find bison (try `sudo apt-get install bison`)'
[ -z `which gcc` ] &&
display_error '* Could not find gcc (try `sudo apt-get install gcc`)'
display_error '* Could not find gcc (try `sudo apt-get install gcc`)'
[ -z `which make` ] &&
display_error '* Could not find make (try `sudo apt-get install make`)'
display_error '* Could not find make (try `sudo apt-get install make`)'
exit 0
+14 -14
View File
@@ -32,7 +32,7 @@ read_command_line() {
download_source() {
GO_CACHE_PATH=$GVM_ROOT/archive/go
[ -d $GO_CACHE_PATH ] && return
display_message "Downloading Go source..."
echo "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"
}
@@ -42,7 +42,7 @@ check_tag() {
}
update_source() {
display_message "Updating Go source..."
echo "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"
}
@@ -54,7 +54,7 @@ copy_source() {
compile_go() {
display_message " * Compiling..."
echo " * Compiling..."
unset GOARCH && unset GOOS && unset GOPATH && unset GOBIN && unset GOROOT &&
export GOBIN=$GO_INSTALL_ROOT/bin &&
export PATH=$GOBIN:$PATH &&
@@ -81,17 +81,13 @@ create_enviroment() {
install_go() {
GO_INSTALL_ROOT=$GVM_ROOT/gos/$version
#trap 'rm -rf $GO_INSTALL_ROOT; display_error "Canceled!"' INT
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
[ -d $GO_INSTALL_ROOT ] &&
display_error "Already installed!"
display_message "Installing $version..."
echo "Installing $version..."
# Create the global package set folder
mkdir -p $GVM_ROOT/pkgsets/$version >> $GVM_ROOT/logs/go-$version-install.log 2>&1 ||
@@ -103,7 +99,7 @@ install_go() {
}
install_gpkg() {
display_message " * Installing gpkg..."
echo " * Installing gpkg..."
$GVM_GOINSTALL github.com/moovweb/gpkg > $GVM_ROOT/logs/$version-gpkg.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to install gpkg"
@@ -112,7 +108,7 @@ install_gpkg() {
}
install_gb() {
display_message " * Installing gb..."
echo " * Installing gb..."
$GVM_GOINSTALL github.com/skelterjohn/go-gb/gb > $GVM_ROOT/logs/$version-gb.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to install gb"
@@ -121,7 +117,7 @@ install_gb() {
}
install_goprotobuf() {
display_message " * Installing goprotobuf..."
echo " * Installing goprotobuf..."
$GVM_GOINSTALL goprotobuf.googlecode.com/hg/proto > $GVM_ROOT/logs/$version-pb-compiler.log 2>&1
if [[ $? -ne 0 ]]; then
echo "Failed to install goprotobuf"
@@ -140,6 +136,9 @@ install_goprotobuf() {
main() {
trap 'display_error "Canceled!"' INT
read_command_line $@
# GREEN!
tput sgr0
tput setaf 2
[ -z $VERSION ] && display_error "No version specified"
download_source
check_tag || (update_source && check_tag) || display_error "Unrecognized Go version"
@@ -154,6 +153,7 @@ main() {
install_goprotobuf
fi
cd $GO_INSTALL_ROOT && find . > manifest
tput sgr0
}
main $@
Executable
+36
View File
@@ -0,0 +1,36 @@
#!/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/$gvm_pkgset_name ]] ||
display_error "Missing package set folder"
command=$1
if [ -f $GVM_ROOT/scripts/pkg-$command ]; then
shift
$GVM_ROOT/scripts/pkg-$command $@
elif [[ -n $command ]]; then
display_error "Unrecognized command line argument: '$command'"
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
+219
View File
@@ -0,0 +1,219 @@
#!/bin/bash
gpkg build $1 || exit 1
VERSION=`cat VERSION`
if [ "$VERSION" == "" ]; then
VERSION=0.0
fi
BUILD=$VERSION.$BUILD_NUMBER
mkdir -p $GVM_ROOT/pkgs/pkg.gvm/$1/current
cp $GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name/pkg.gvm/$1/$BUILD/manifest $GVM_ROOT/pkgs/pkg.gvm/$1/current/manifest
exit 0
. $GVM_ROOT/scripts/functions
show_usage() {
echo "Usage: gvm pkg install Package [options]"
echo " -v, --version=VERSION Set the package version to install."
echo " -s, --source=SORUCE Specify the source for this package."
echo " --strict Only use installed packages."
echo " -a, --all Update all dependencies."
echo " -h, --help Display this message."
}
function read_command_line() {
[[ "$1" == "" ]] &&
display_error "Please specify package name"
# Get package name
package_name=$1
sources=`cat $GVM_ROOT/config/sources`
shift
version=$1
strict="true"
gvm_go_path=$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name
cache_dir=$GVM_ROOT/archive/package/$package_name
tmp_dir=$GVM_ROOT/tmp/$$
source_dir=$tmp_dir/$package_name/src/$package_name
build_dir=$tmp_dir/$package_name/build
# TODO: Remove hack after change to gvm_build
mkdir -p $GVM_ROOT/pkgs/pkg.gvm/$package_name/current
}
function download_package() {
if [ -d $cache_dir ]; then
cd $cache_dir && git pull &> /dev/null
return
fi
echo "Downloading $package_name..."
for source in $sources; do
echo "Trying $source"
git clone $source/$package_name $cache_dir > /dev/null 2>&1
if [ "$?" == "0" ]; then
echo $source > $cache_dir/GVM_SOURCE
return
fi
done
display_error "Could not find $package_name in any sources"
}
function update_package_cache() {
cd $cache_dir && git pull > /dev/null 2>&1 ||
display_error "Failed to update source"
}
function copy_tmp_source() {
rm -rf $source_dir
if [ "$version" != "" ]; then
echo "Checking out $version"
git clone $cache_dir $source_dir > /dev/null 2>&1
cd $source_dir && git checkout $version > /dev/null 2>&1 ||
return 1
else
git clone $cache_dir $source_dir > /dev/null 2>&1
fi
cd $source_dir
git describe --exact-match > /dev/null 2>&1
if [ "$?" == "0" ]; then
git_tag=`git describe --exact-match`
git_version=`echo $git_tag | awk '{ n=split($1,path,"_"); print path[n] }'`
if [ "$BUILD_NUMBER" == "" ]; then
BUILD_NUMBER=$git_version
fi
fi
}
function setup_build_env() {
rm -rf $build_dir && mkdir -p $build_dir
copy_tmp_source
if [ "$?" != "0" ]; then
update_package_cache
copy_tmp_source ||
display_error "Invalid version"
fi
if [[ -f $source_dir/VERSION ]]; then
SOURCE_VERSION=`cat $source_dir/VERSION`
fi
if [[ -n $BUILD_NUMBER ]]; then
BUILD_NUMBER="$SOURCE_VERSION.$BUILD_NUMBER"
else
if [[ "$SOURCE_VERSION" != "" ]]; then
BUILD_NUMBER="$SOURCE_VERSION.src"
else
BUILD_NUMBER="src"
fi
fi
}
function install_dep() {
[[ "$strict" == "true" ]] && display_error "Missing dependancy ($1) and strict mode is set"
passthrough_options=""
[[ "$source" != "" ]] && passthrough_options="--source=$source "$passthrough_options
[[ "$all_deps" == "true" ]] && passthrough_options="--all "$passthrough_options
gvm pkg install $1 $passthrough_options ||
display_error "Failed to install dependency $1"
}
function load_dep() {
if [[ "$all_deps" == "true" ]]; then
install_dep $1
fi
CUR_PKG=$gvm_go_path/pkg.gvm/$1/current
if [ -e "$CUR_PKG/BUILD_VERSION" ]; then
echo "pkg $1 `cat $CUR_PKG/BUILD_VERSION`" >> $build_dir/manifest
else
install_dep $1
fi
cp -rf $CUR_PKG/pkg $build_dir
}
function check_deps() {
export GOPATH=$build_dir
echo ":source `cat $cache_dir/GVM_SOURCE`" >> $build_dir/manifest
if [ -f "$source_dir/Package.gvm" ]; then
for line in `cat $source_dir/Package.gvm | grep ^pkg | awk '{ print $2 }'`; do
load_dep $line
done
fi
echo ":complete" >> $build_dir/manifest
}
function copy_source() {
git clone $source_dir $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER/ &> /dev/null
#mkdir -p $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER
#cp -rf $source_dir $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER/
}
function build_package() {
echo "Installing $package_name-$BUILD_NUMBER..."
echo "$BUILD_NUMBER" > $build_dir/BUILD_VERSION
export BUILD_NUMBER
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
echo "Running tests..."
cd $source_dir && gvmake test >> $build_dir/build.log 2>&1
if [ $? -ne 0 ]; then
echo "ERROR: Failed tests"
cat "$build_dir/build.log"
exit 1
fi
}
function install_package() {
mkdir -p $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER ||
display_error "Failed to create $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER"
cp -r $build_dir/* $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER ||
display_error "Failed to copy from build folder to install destination"
rm -f $gvm_go_path/pkg.gvm/$package_name/current ||
display_error "Failed to remove symlink to 'current' before recreating it"
ln -s $gvm_go_path/pkg.gvm/$package_name/$BUILD_NUMBER $gvm_go_path/pkg.gvm/$package_name/current ||
display_error "Failed to create new symlink to 'current'"
if [ -d $build_dir/bin ]; then
echo " * Installing binaries"
mkdir -p $gvm_go_path/bin ||
display_error "Failed to create $gvm_go_path/bin"
for binary in $build_dir/bin/*; do
binary_name=`echo "$binary" | awk '{ n=split($1,path,"/"); print path[n] }'`
rm -f $gvm_go_path/bin/$binary_name ||
display_error "Failed to remove old binary"
IFS=$'\n'
lines=`cat $GVM_ROOT/scripts/templates/binary`
for line in $lines; do
echo "$line" | sed 's/{{package_name}}/'$package_name'/g' | sed 's/{{binary_name}}/'$binary_name'/g' >> $gvm_go_path/bin/$binary_name
done
chmod +x $gvm_go_path/bin/$binary_name ||
display_error "Failed to mark binary executable"
done
fi
}
function cleanup() {
rm -rf $tmp_dir ||
display_error "Failed to remove $tmp_dir in cleanup()"
}
read_command_line $@
download_package
setup_build_env
check_deps
copy_source
build_package
install_package
if [ "$GPKG_PUSH_TAG" == "true" ]; then
echo "Pushing tag $BUILD_NUMBER"
cd $WORKSPACE && git tag $BUILD_NUMBER && git push origin $BUILD_NUMBER ||
display_error "Failed to push version tag"
fi
# TODO: Remove after change to gvm_build
cp $build_dir/manifest $GVM_ROOT/pkgs/pkg.gvm/$package_name/current
cleanup
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
echo
display_message "gvm packages $gvm_go_name@$gvm_pkgset_name"
echo
package_folder=$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name
for package in $package_folder/pkg.gvm/*; do
if [ $package == "$package_folder/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
if [ -f $package_folder/goinstall.log ]; then
echo
display_message "Installing via goinstall"
echo
cat $package_folder/goinstall.log
fi
echo
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ "$1" == "" ]] &&
display_error "Please specify package name"
gvm_go_path=$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name
UNINSTALL_ROOT=$gvm_go_path/pkg.gvm/$1
if [[ ! -d $UNINSTALL_ROOT ]]; then
echo "ERROR: Invalid package name"
exit 1
fi
if [[ "$2" != "" ]]; then
UNINSTALL_ROOT=$UNINSTALL_ROOT/$2
fi
if [[ -d $UNINSTALL_ROOT ]]; then
rm -rf $UNINSTALL_ROOT
else
echo "ERROR: Invalid package version"
exit 1
fi
if [[ "$4" != "" ]]; then
echo "Uninstalled $1 version $2"
else
echo "Uninstalled $1"
fi
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ "$1" == "" ]] &&
display_error "Please specify package name"
[[ ! -d $GVM_ROOT/archive/package/$1 ]] &&
display_error "Invalid package"
cd $GVM_ROOT/archive/package/$1
git pull &> /dev/null
if [ "$?" == "1" ]; then
echo "Changes!"
else
echo "No changes"
fi
#cd git pull
#gvm_go_path=$GVM_ROOT/pkgsets/$gvm_go_name/$gvm_pkgset_name
+2 -2
View File
@@ -1,8 +1,8 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
[[ $gvm_pkgset_name != "" ]] ||
[[ $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"
display_error "Could not delete package set files"
+9 -16
View File
@@ -1,20 +1,13 @@
#!/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
echo "
gvm go package sets ($gvm_go_name)
"
if [ -d $GVM_ROOT/pkgsets ]; then
if [[ $gvm_pkgset_name == "" ]]; then
ls -1 $GVM_ROOT/pkgsets/$gvm_go_name | sed 's/^/ /g'
else
ls -1 $GVM_ROOT/pkgsets/$gvm_go_name | sed 's/^/ /g' | sed 's/^ '$gvm_pkgset_name'/=> '$gvm_pkgset_name'/g'
fi
fi
echo
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
display_message "*** CURRENT SOURCES ***"
echo
cat $GVM_ROOT/config/sources
+7 -10
View File
@@ -8,15 +8,12 @@ fuzzy_match=`ls $GVM_ROOT/gos | sort | grep "$1" | head -n 1 | grep "$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"
rm -rf $GVM_ROOT/gos/$fuzzy_match
rm -rf $GVM_ROOT/pkgsets/$fuzzy_match
rm -f $GVM_ROOT/environments/$fuzzy_match
rm -f "$GVM_ROOT/environments/$fuzzy_match@"*
echo "Uninstalled version $fuzzy_match"
else
display_error "Invalid version"
display_error "Invalid version"
fi
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash
. $GVM_ROOT/scripts/functions
cd $GVM_ROOT/archive/go &> /dev/null ||
cd $GVM_ROOT/archive/go ||
display_error "Failed to find local Go source"
cd $GVM_ROOT/archive/go && hg pull ||