summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2011-03-25 11:23:28 +0000
committerramon <ramongomez@us.es>2011-03-25 11:23:28 +0000
commitf43e6f49bdd1fdc709147b2f8ce0f929a94abdf7 (patch)
tree95c8fe1e93dd41fa85bfca7b12009df21976a2b1
parentd6a61e6ce61427d4ca3930057d74b9fa816df021 (diff)
Instalación automática de paquetes en script de actualización (versiones 0.10 y 1.0).
git-svn-id: https://opengnsys.es/svn/trunk@1629 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-xinstaller/opengnsys_update.sh34
1 files changed, 17 insertions, 17 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index adb880cd..2f5bdcd1 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -101,7 +101,7 @@ function restoreFile()
local fichero=$1
- echoAndLog "${FUNCNAME}(): restoring $fichero file"
+ echoAndLog "${FUNCNAME}(): restoring file $fichero"
if [ -f "${fichero}-LAST" ]; then
cp -p "$fichero-LAST" "$fichero"
fi
@@ -117,22 +117,22 @@ function installDependencies ()
{
if [ $# = 0 ]; then
echoAndLog "${FUNCNAME}(): no deps needed."
- else
- while [ $# -gt 0 ]; do
- dpkg -s $1 &>/dev/null | grep Status | grep -qw install
- if [ $? -ne 0 ]; then
- INSTALLDEPS="$INSTALLDEPS $1"
- fi
- shift
- done
- if [ -n "$INSTALLDEPS" ]; then
- apt-get update && apt-get install $INSTALLDEPS
- if [ $? -ne 0 ]; then
- errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS."
- return 1
- fi
- fi
- fi
+ else
+ while [ $# -gt 0 ]; do
+ dpkg -s $1 2>/dev/null | grep -q "Status: install ok"
+ if [ $? -ne 0 ]; then
+ INSTALLDEPS="$INSTALLDEPS $1"
+ fi
+ shift
+ done
+ if [ -n "$INSTALLDEPS" ]; then
+ apt-get update && apt-get -y install --force-yes $INSTALLDEPS
+ if [ $? -ne 0 ]; then
+ errorAndLog "${FUNCNAME}(): cannot install some dependencies: $INSTALLDEPS."
+ return 1
+ fi
+ fi
+ fi
}