mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-10 05:16:13 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be751c7d69 | ||
|
|
68c0ffdf9e | ||
|
|
469bd7c81c | ||
|
|
a9640b0bbc | ||
|
|
aec0080464 |
@@ -20,7 +20,7 @@ fi
|
||||
|
||||
$GVM_ROOT/scripts/gvm-check
|
||||
if [[ "$?" != "0" ]]; then
|
||||
display_error "Missing requirements. Please see messages above"
|
||||
display_error "Missing requirements."
|
||||
fi
|
||||
|
||||
if [[ $command == "version" ]]; then
|
||||
|
||||
@@ -50,6 +50,11 @@ SRC_REPO=https://github.com/moovweb/gvm.git
|
||||
[ "$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"
|
||||
|
||||
+31
-9
@@ -1,15 +1,37 @@
|
||||
#!/bin/bash
|
||||
. $GVM_ROOT/scripts/functions
|
||||
|
||||
# Check for hg
|
||||
[ -z `which hg` ] &&
|
||||
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)`)'
|
||||
[ -z `which 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`)'
|
||||
[ -z `which make` ] &&
|
||||
display_error '* Could not find make (try `sudo apt-get install make`)'
|
||||
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
|
||||
|
||||
+4
-12
@@ -114,20 +114,12 @@ install_go() {
|
||||
|
||||
install_gpkg() {
|
||||
display_message " * Installing gpkg..."
|
||||
$GVM_GOINSTALL github.com/moovweb/gpkg > $GVM_ROOT/logs/$version-gpkg.log 2>&1
|
||||
if [[ $? -ne 0 ]]; then
|
||||
display_warning "Failed to install gpkg"
|
||||
return 1
|
||||
fi
|
||||
$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
|
||||
if [[ $? -ne 0 ]]; then
|
||||
display_warning "Failed to install gb"
|
||||
return 1
|
||||
fi
|
||||
$GVM_GOINSTALL github.com/jbussdieker/go-gb/gb > $GVM_ROOT/logs/$version-gb.log 2>&1 || return 1
|
||||
}
|
||||
|
||||
install_goprotobuf() {
|
||||
@@ -160,8 +152,8 @@ main() {
|
||||
GVM_GOINSTALL="go get"
|
||||
x="`hg tags -R ~/.gvm/archive/go`"; echo ${x#*b0819469a6df} | grep "$version " &> /dev/null
|
||||
if [[ "$?" == "1" ]]; then
|
||||
install_gpkg
|
||||
install_gb
|
||||
install_gb || display_warning "Failed to install gb"
|
||||
install_gpkg || display_warning "Failed to install gpkg"
|
||||
if [ "$INSTALL_PB" == "true" ]; then
|
||||
install_goprotobuf
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user