Commit 2ee270d0 authored by wyrie's avatar wyrie
Browse files

Install: Bug fixes for gentoo set-up script:

- Fix handling of default syslog
- MySQL install_db and rc script only added/run if script emerged the server
parent 6647bed1
...@@ -44,12 +44,21 @@ function package_has_use_flag() ...@@ -44,12 +44,21 @@ function package_has_use_flag()
[ -n "$res" ] [ -n "$res" ]
} }
function package_is_emerged()
{
local package=$1
installed=`equery -C -N list -e -i $1 | grep $1 | grep "^\[I"`
[ -n "$installed" ]
}
function is_package_installed() function is_package_installed()
{ {
local usechange="no" local usechange="no"
local uselist="" local uselist=""
installed=`equery -C -N list -e -i $1 | grep $1 | grep "^\[I"` package_is_emerged "$1"
installed=$?
if [ -n "$2" ] # Use flags parsed if [ -n "$2" ] # Use flags parsed
then then
...@@ -64,7 +73,7 @@ function is_package_installed() ...@@ -64,7 +73,7 @@ function is_package_installed()
flagedit $1 $uselist flagedit $1 $uselist
fi fi
[ -n "$installed" ] && [ "$usechange" == "no" ] [ $installed -eq 0 ] && [ "$usechange" == "no" ]
} }
function install_progress() function install_progress()
...@@ -468,7 +477,7 @@ then ...@@ -468,7 +477,7 @@ then
for logger in $loggers for logger in $loggers
do do
if ! is_package_installed "app-admin/$logger" && [ -n "$(rc-config list default | grep $logger)" ] if is_package_installed "app-admin/$logger" && [ -n "$(rc-config list default | grep $logger)" ]
then then
clogger=$logger clogger=$logger
break break
...@@ -512,10 +521,17 @@ fi ...@@ -512,10 +521,17 @@ fi
if ! is_package_installed "dev-db/mysql" "extraengine big-tables" if ! is_package_installed "dev-db/mysql" "extraengine big-tables"
then then
package_is_emerged "$1"
installed=$?
exec_command "emerge dev-db/mysql" "Installing MySql" exec_command "emerge dev-db/mysql" "Installing MySql"
exec_command "mysql_install_db" "Set-up mysql grant tables"
exec_command "/etc/init.d/mysql start" "Starting MySql" if [ $installed -eq 1 ]
exec_command "rc-update add mysql default" "Add MySql to default runlevel" then
exec_command "mysql_install_db" "Set-up mysql grant tables"
exec_command "/etc/init.d/mysql start" "Starting MySql"
exec_command "rc-update add mysql default" "Add MySql to default runlevel"
fi
fi fi
which vim &> /dev/null which vim &> /dev/null
...@@ -588,6 +604,11 @@ else ...@@ -588,6 +604,11 @@ else
fi fi
fi fi
if [ "$install_web" = "no" ] && ! is_package_installed "dev-lang/php" "-apache2 gd mysql mysqli imap cli cgi pcre xml zlib crypt ctype session unicode mhash ftp"
then
exec_command "emerge dev-lang/php" "Installing PHP"
fi
echo -e "" echo -e ""
echo -e "\e[1;33mSetup script completed\e[0m" echo -e "\e[1;33mSetup script completed\e[0m"
echo -e "\e[1;32m========================================\e[0m" echo -e "\e[1;32m========================================\e[0m"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment