summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2012-04-27 09:58:24 +0000
committerramon <ramongomez@us.es>2012-04-27 09:58:24 +0000
commit12e8e382a3d6182434be849980b10ba7e04d098b (patch)
tree312cc4f815ea848271e52b47e0304a274d60c841
parent62777700aaed829606baac38dc1e722beca89bb5 (diff)
Versión 1.0.4, #489: Integrar ticket:489 en rama de desarrollo.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@2993 a21b9725-9963-47de-94b9-378ad31fedc9
-rwxr-xr-xclient/engine/File.lib5
-rwxr-xr-xclient/engine/Protocol.lib15
-rw-r--r--doc/CHANGELOG.es.txt1
-rwxr-xr-xrepoman/bin/torrent-creator4
4 files changed, 10 insertions, 15 deletions
diff --git a/client/engine/File.lib b/client/engine/File.lib
index b04d2278..d36a1c96 100755
--- a/client/engine/File.lib
+++ b/client/engine/File.lib
@@ -20,6 +20,9 @@
#@version 0.9.2 - Primera versión para OpenGnSys.
#@author Ramon Gomez, ETSII Universidad de Sevilla
#@date 2010-07-24
+#@version 1.0.4 - Calcula solo el checksum del último MB del fichero.
+#@author Ramon Gomez, ETSII Universidad de Sevilla
+#@date 2012-03-16
#*/ ##
function ogCalculateChecksum ()
{
@@ -34,7 +37,7 @@ fi
# Comprobar que existe el fichero y devolver sus datos.
FILE=$(ogGetPath "$@")
[ -n "$FILE" ] || ogRaiseError $OG_ERR_NOTFOUND "$*" || return $?
-md5sum "$FILE" 2>&1 | cut -f1 -d" "
+tail -c1M "$FILE" | md5sum -b 2>&1 | cut -f1 -d" "
}
diff --git a/client/engine/Protocol.lib b/client/engine/Protocol.lib
index e81def55..597505c6 100755
--- a/client/engine/Protocol.lib
+++ b/client/engine/Protocol.lib
@@ -998,21 +998,12 @@ fi
#echo "paso 4. recuperamos o calculamos los md5 de los ficheros"
if [ -f $FILESOURCE.sum ]
then
- # echo "leyendo el sum del fichero sum del repo"
MD5SOURCE=$(cat $FILESOURCE.sum)
else
- # echo "calculando el sun del repo"
- MD5SOURCE=$(md5sum $FILESOURCE | cut -f1 -d" ")
-fi
-if [ -f $FILETARGET.sum ]
-then
- #echo "leyendo el sum de la cache"
- MD5TARGET=$(cat $FILETARGET.sum)
-else
- #echo "calculando el sum de la cache"
- md5sum $FILETARGET | cut -f1 -d" " > $FILETARGET.sum
- MD5TARGET=$(cat $FILETARGET.sum)
+ MD5SOURCE=$(ogCalculateChecksum $FILESOURCE)
fi
+[ ! -f $FILETARGET.sum ] && ogCalculateChecksum $FILETARGET > $FILETARGET.sum
+MD5TARGET=$(cat $FILETARGET.sum)
#echo "Paso 5. comparamos los md5"
#TODO: que hacer cuando los md5 son distintos. Por defecto borrar.
diff --git a/doc/CHANGELOG.es.txt b/doc/CHANGELOG.es.txt
index b25dc712..1f53eddf 100644
--- a/doc/CHANGELOG.es.txt
+++ b/doc/CHANGELOG.es.txt
@@ -7,6 +7,7 @@ Lista de cambios incluidos en OpenGnSys 1.0.4
Tickets resueltos en módulo OpenGnSys Cloning Engine:
#489 Suma de verificacion de la imagen más rápida
+#530 Función ogReduceFs sobre windows 7 no borra fichero hiberfil.sys
Tickets resueltos en módulo OpenGnSys Client:
#497 Clientes opengnsys para Windows y Linux (resuelto en #501)
diff --git a/repoman/bin/torrent-creator b/repoman/bin/torrent-creator
index fe5aebf3..61765ed5 100755
--- a/repoman/bin/torrent-creator
+++ b/repoman/bin/torrent-creator
@@ -44,9 +44,9 @@ for IMG in *.{img,pgz}; do
touch "$LOCKFILE"
trap "rm -f $LOCKFILE" 1 2 3 6 9
rm -f "$TORRENT" "$SUMFILE"
- DATASUM=`md5sum "$IMG" | cut -f1 -d" "`
+ DATASUM=$(tail -c1M "$IMG" | md5sum -b | cut -f1 -d" ")
echo $DATASUM > "$SUMFILE"
- nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM 2>/dev/null
+ nice -8 ctorrent -t "$IMG" -u $TRACKERURL -s "$TORRENT" -c $DATASUM 2>/dev/null
rm -f "$LOCKFILE"
if [ -f "$TORRENT" ]; then
echo "`date` : Fin creación de fichero $TORRENT" >> $LOGFILE