summaryrefslogtreecommitdiffstats
path: root/client/shared/scripts/updateCache
diff options
context:
space:
mode:
authoririna <irinagomez@us.es>2014-03-13 13:44:51 +0000
committeririna <irinagomez@us.es>2014-03-13 13:44:51 +0000
commit64cf3d33de3b9f7b1cb8092a2f9fc8d20acd39bb (patch)
tree6c4195e1ce91fdea1d6c1b3ca8ef8729558e39f3 /client/shared/scripts/updateCache
parenta1039c0c43c90e1c0f47a5ba436496da648d6e4e (diff)
#640 algunos script adaptados al nuevo formato de la funcion {{{ogRaiseError}}}
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4184 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client/shared/scripts/updateCache')
-rwxr-xr-xclient/shared/scripts/updateCache16
1 files changed, 8 insertions, 8 deletions
diff --git a/client/shared/scripts/updateCache b/client/shared/scripts/updateCache
index 11cee1da..a75ff1e3 100755
--- a/client/shared/scripts/updateCache
+++ b/client/shared/scripts/updateCache
@@ -29,7 +29,7 @@
PROG="$(basename $0)"
if [ $# -lt 3 ]; then
- ogRaiseError $OG_ERR_FORMAT "$MSG_FORMAT: $PROG str_REPO _str_Relative_Path_OGIMG_with_/ PROTOCOLO OPCIONES_PROTOCOLO OPCIONES_UPDATECACHE"
+ ogRaiseError session $OG_ERR_FORMAT "$MSG_FORMAT: $PROG str_REPO _str_Relative_Path_OGIMG_with_/ PROTOCOLO OPCIONES_PROTOCOLO OPCIONES_UPDATECACHE"
exit $?
fi
@@ -45,16 +45,16 @@ REPOSITORIO="${1^^}"
PROTOCOLO="${3^^}"
OPTPROTOCOLO="$4"
REPOIP=$(ogGetRepoIp)
-echo $REPOSITORIO $REPOIP $PROTOCOLO $OPTPROTOCOLO
+ogEcho log session $REPOSITORIO $REPOIP $PROTOCOLO $OPTPROTOCOLO
# Si el repositorio local CACHE no existe error 15.
if ! $(ogFindCache >/dev/null); then
- ogRaiseError $OG_ERR_NOTCACHE "CACHE"
+ ogRaiseError session $OG_ERR_NOTCACHE "CACHE"
exit $0
fi
# comprobar si la imagen existe (.img, .img.diff o directorio)
-REPOFILE=$(ogGetPath "REPO" "/$2") || exit $(ogRaiseError $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
+REPOFILE=$(ogGetPath "REPO" "/$2") || exit $(ogRaiseError session $OG_ERR_NOTFOUND "REPO /$2"; echo $?)
ogEcho log session "$MSG_SCRIPTS_UPDATECACHE_DOUPDATE"
# Distingo si es monolitica o sincronizable
@@ -70,7 +70,7 @@ if [ $? == 0 ]; then
RETVAL=0
else
# Si la imagen es monolitica y ha elegido protocolo = RSYNC salimos con error.
- [ $PROTOCOLO == "RSYNC" ] && exit $(ogRaiseError $OG_ERR_DONTSYNC_IMAGE "REPO $2"; echo $?)
+ [ $PROTOCOLO == "RSYNC" ] && exit $(ogRaiseError session $OG_ERR_DONTSYNC_IMAGE "REPO $2"; echo $?)
IMGSYNC=FALSE
#TODO: ogUpdateCacheIsNecesary debe borrar la imagen que tenga igual nombre pero distinto sum-
ogUpdateCacheIsNecesary $1 $2
@@ -80,7 +80,7 @@ fi
[ "$RETVAL" == "1" ] && exit 0
[ "$RETVAL" -gt "1" ] && exit 1
-echo "$MSG_SCRIPTS_UPDATECACHE_CHECKSIZECACHE" | tee -a $OGLOGSESSION $OGLOGFILE
+ogEcho log session "$MSG_SCRIPTS_UPDATECACHE_CHECKSIZECACHE"
CACHESIZE=$(ogGetCacheSize)
CACHESIZEFREE=$(ogGetFreeSize `ogFindCache`)
FILESIZE=$(ls -sk $(ogGetPath $REPOSITORIO "$2") | cut -f1 -d" ")
@@ -116,7 +116,7 @@ fi
if [ "$SIZEREQUIRED" -ge "$CACHESIZE" ]
then
ogEcho log session "$MSG_WARNING: $MSG_ERR_CACHESIZE: $2 = $SIZEREQUIRED > CACHE = $CACHESIZE"
- ogRaiseError $OG_ERR_CACHESIZE "CACHE"
+ ogRaiseError session $OG_ERR_CACHESIZE "CACHE"
exit $?
fi
@@ -143,7 +143,7 @@ then
;;
*)
ogEcho log session "$MSG_WARNING: $MSG_ERR_CACHESIZE: $2 = $FILESIZE > CACHE = $CACHESIZEFREE"
- ogRaiseError $OG_ERR_CACHESIZE "CACHE"
+ ogRaiseError session $OG_ERR_CACHESIZE "CACHE"
exit $?
;;
esac