From 99b29a1a153fbdfb552ddadafc610fb0a741dff3 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 11 Jan 2022 15:23:38 +0100 Subject: #1062 tiptorrent stores whole file instead of chunks Tiptorrent now stores the whole file instead of the split chunks. Removes any chunk related code from cloning engine scripts. Requires newer version of tiptorrent installed (tiptorrent-static >= 1.0.0-6). --- client/engine/Image.lib | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/engine/Image.lib b/client/engine/Image.lib index d45ece45..98d3d19b 100755 --- a/client/engine/Image.lib +++ b/client/engine/Image.lib @@ -131,7 +131,7 @@ if ! wget -qO "$1".full.sum "$ogrepo:9999/$2.full.sum"; then fi MD5FILE=$(cat "$1".full.sum) ogTiptorrentGet "$2" -MD5IMG=$(cat "$IMGPATH"*[0-3] | md5sum | cut -f1 -d " ") +MD5IMG=$(md5sum "$IMGPATH" | cut -f1 -d " ") if [ "$MD5IMG" != "$MD5FILE" ]; then ogRaiseError "$OG_ERR_NOTFOUND" "Error downloading $2, checksum mismatch" return $? @@ -158,7 +158,7 @@ return 0 function ogRestoreImageSyntax () { local TOOL COMPRESSOR LEVEL PART IMGFILE FILEHEAD INFOIMG IMGPATH IMGCACHEDIR -local MD5FILE MD5WGET IMGPATHPART1 +local MD5FILE MD5WGET # Si se solicita, mostrar ayuda. @@ -239,10 +239,9 @@ if [ "$#" -eq 4 ] || [ "$#" -eq 5 ]; then if ogFindCache &>/dev/null; then IMGCACHEDIR=$(ogGetMountPoint $(ogFindCache))/opt/opengnsys/images IMGPATH="$IMGCACHEDIR/$IMGFILE" - IMGPATHPART1="$IMGPATH.1" - if [ -f "$IMGPATHPART1" ]; then + if [ -f "$IMGPATH" ]; then if [ ! -f "$IMGPATH".full.sum ]; then - cat "$IMGPATH"*[0-3] | md5sum | cut -f1 -d " " > "$IMGPATH".full.sum + md5sum "$IMGPATH" | cut -f1 -d " " > "$IMGPATH".full.sum fi MD5FILE=$(cat "$IMGPATH".full.sum) MD5WGET=$(wget -qO - "$ogrepo:9999/$IMGFILE.full.sum") @@ -257,7 +256,7 @@ if [ "$#" -eq 4 ] || [ "$#" -eq 5 ]; then ogRaiseError "$OG_ERR_NOTFOUND" "Failed tiptorrent to cache $TOOL" return $? fi - CAT="cat $IMGPATH*[0-3] |" + CAT="cat $IMGPATH |" COMPRESSOR="$COMPRESSOR -" echo "$CAT $COMPRESSOR $MBUFFER $TOOL" else -- cgit v1.2.3-18-g5258