Don't install factor if a factor/ already exists
parent
be1e2961ef
commit
dc76d551e0
|
@ -26,7 +26,7 @@ check_ret() {
|
||||||
RET=$?
|
RET=$?
|
||||||
if [[ $RET -ne 0 ]] ; then
|
if [[ $RET -ne 0 ]] ; then
|
||||||
echo $1 failed
|
echo $1 failed
|
||||||
exit 5
|
exit 2
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ check_gcc_version() {
|
||||||
if [[ $GCC_VERSION == *3.3.* ]] ; then
|
if [[ $GCC_VERSION == *3.3.* ]] ; then
|
||||||
echo "You have a known buggy version of gcc (3.3)"
|
echo "You have a known buggy version of gcc (3.3)"
|
||||||
echo "Install gcc 3.4 or higher and try again."
|
echo "Install gcc 3.4 or higher and try again."
|
||||||
exit 1
|
exit 3
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,13 @@ check_installed_programs() {
|
||||||
check_gcc_version
|
check_gcc_version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_factor_exists() {
|
||||||
|
if [[ -d "factor" ]] ; then
|
||||||
|
echo "A directory called 'factor' already exists."
|
||||||
|
echo "Rename or delete it and try again."
|
||||||
|
exit 4
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
find_os() {
|
find_os() {
|
||||||
uname_s=`uname -s`
|
uname_s=`uname -s`
|
||||||
|
@ -107,7 +114,7 @@ echo_build_info() {
|
||||||
set_build_info() {
|
set_build_info() {
|
||||||
if ! [[ -n $OS && -n $ARCH && -n $WORD ]] ; then
|
if ! [[ -n $OS && -n $ARCH && -n $WORD ]] ; then
|
||||||
echo "OS, ARCH, or WORD is empty. Please report this"
|
echo "OS, ARCH, or WORD is empty. Please report this"
|
||||||
exit 4
|
exit 5
|
||||||
fi
|
fi
|
||||||
MAKE_TARGET=$OS-$ARCH-$WORD
|
MAKE_TARGET=$OS-$ARCH-$WORD
|
||||||
BOOT_IMAGE=boot.$ARCH.$WORD.image
|
BOOT_IMAGE=boot.$ARCH.$WORD.image
|
||||||
|
@ -122,8 +129,6 @@ find_build_info() {
|
||||||
echo_build_info
|
echo_build_info
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
git_clone() {
|
git_clone() {
|
||||||
echo "Downloading the git repository from factorcode.org..."
|
echo "Downloading the git repository from factorcode.org..."
|
||||||
git clone git://factorcode.org/git/factor.git
|
git clone git://factorcode.org/git/factor.git
|
||||||
|
@ -177,6 +182,7 @@ usage() {
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
install)
|
install)
|
||||||
|
check_factor_exists
|
||||||
check_installed_programs
|
check_installed_programs
|
||||||
find_build_info
|
find_build_info
|
||||||
git_clone
|
git_clone
|
||||||
|
|
Loading…
Reference in New Issue