summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authoradv <adv@uma.es>2015-01-27 12:56:55 +0000
committeradv <adv@uma.es>2015-01-27 12:56:55 +0000
commit5f5b18abda5b451a18fc431d2d575151b0eabe59 (patch)
tree28c4e0c76698d89965171e11f0123eeec1057c2d /client
parentd7f9b50a369243aa6b1469e570ddf75d73a38321 (diff)
#626 integrar modificaciones en file.lib. Nueva funcion ogCalculateFullChecksum()
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4491 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client')
-rwxr-xr-xclient/engine/File.lib33
1 files changed, 33 insertions, 0 deletions
diff --git a/client/engine/File.lib b/client/engine/File.lib
index a8536ea3..88e0af7e 100755
--- a/client/engine/File.lib
+++ b/client/engine/File.lib
@@ -80,6 +80,39 @@ test "$(cat "$SOURCE.sum" 2>/dev/null)" == "$(cat "$TARGET.sum" 2>/dev/null)"
#/**
+# ogCalculateFullChecksum [ str_repo | int_ndisk int_npart ] path_filepath
+#@brief Devuelve la suma COMPLETA de comprobación (checksum) de un fichero.
+#@param path_filepath camino del fichero (independiente de mayúsculas)
+#@param str_repo repositorio de ficheros
+#@param int_ndisk nº de orden del disco
+#@param int_npartition nº de orden de la partición
+#@return hex_checksum Checksum del fichero
+#@version 1.0.5 - Primera versión para OpenGnSys.
+#@author Antonio Doblas Viso, EVLT Universidad de Málaga
+#@date 2014-07-09
+#*/ ##
+function ogCalculateFullChecksum ()
+{
+# Variables locales.
+local FILE
+if [ "$*" == "help" ]; then
+ ogHelp "$FUNCNAME" "$FUNCNAME [ str_repo | int_ndisk int_npartition ] path_filepath" \
+ "$FUNCNAME REPO ubuntu.img ==> ef899299caf8b517ce36f1157a93d8bf"
+ return
+fi
+
+# Comprobar que existe el fichero y devolver sus datos.
+FILE=$(ogGetPath "$@")
+[ -n "$FILE" ] || ogRaiseError $OG_ERR_NOTFOUND "$*" || return $?
+#ADV
+md5sum "$FILE" -b 2>&1 | cut -f1 -d" "
+# tail -c1M "$FILE" | md5sum -b 2>&1 | cut -f1 -d" "
+}
+
+
+
+
+#/**
# ogCopyFile [ str_repo | int_ndisk int_npart ] path_source [ str_repo | int_ndisk int_npart ] path_target
#@brief Metafunción para copiar un fichero de sistema OpenGnSys a un directorio.
#@see ogGetPath