POL_Download_retry
Informations
| Creator | Mensajes |
|---|---|
petch
|
InformationThis installer has been approved by the team. InformationsPlatforms: Feedbacks0 0 DescriptionDownload with retry and resume:
Source code# 1: URL
# 2: filename
# 3: MD5 hash
# 4: Title
# Failed piece from previous download, maybe reference MD5 was corrected?
local FAILEDPIECE="$2.failed"
if [ -n "$3" -a ! -e "$2" -a -e "$FAILEDPIECE" ]; then
POL_Debug_Message "Failed download found, trying to recover"
POL_SetupWindow_wait "$(eval_gettext 'Checking piece integrity...')" "$4"
if [ "$(POL_MD5_file $FAILEDPIECE)" = "$3" ]; then
POL_Debug_Message "Download recovery successful"
mv "$FAILEDPIECE" "$2"
fi
fi
[ -e "$2" ] && return
local TMPPIECE="$2.part"
while true; do
POL_System_wget "$1" "$4" --no-check-certificate --continue -O "$TMPPIECE"
POL_Debug_Message "POL_System_wget exit code: $?"
POL_SetupWindow_wait "$(eval_gettext 'Checking download integrity...')" "$4"
if [ ! -e "$TMPPIECE" ]; then
POL_Debug_Message "No downloaded file"
DLMSG="$(eval_gettext 'Download failed')"
elif [ -n "$3" ] && [ "$(POL_MD5_file $TMPPIECE)" != "$3" ]; then
POL_Debug_Message "Downloaded file incomplete or corrupted"
DLMSG="$(eval_gettext 'Download seems to be corrupted')"
mv "$TMPPIECE" "$FAILEDPIECE"
else
POL_Debug_Message "Download completed successfully"
mv "$TMPPIECE" "$2"
[ -e "$FAILEDPIECE" ] && rm "$FAILEDPIECE"
break
fi
local OLD_APP_ANSWER="$APP_ANSWER"
POL_SetupWindow_question "$DLMSG\n$(eval_gettext 'Retry?')" "$TITLE"
[ "$APP_ANSWER" = "TRUE" ] || POL_Debug_Fatal "$DLMSG"
APP_ANSWER="$OLD_APP_ANSWER"
done
|
Contributions
Filters:
Contribute| Member | Mensajes |
| petch | Tuesday 11 August 2015 at 18:06 |
petch
|
InformationThis update has been approved by the team. MensajesFix minor typo (POL_Debug_message => POL_Debug_Message) Differences@@ -6,10 +6,10 @@
# Failed piece from previous download, maybe reference MD5 was corrected?
local FAILEDPIECE="$2.failed"
if [ -n "$3" -a ! -e "$2" -a -e "$FAILEDPIECE" ]; then
- POL_Debug_message "Failed download found, trying to recover"
+ POL_Debug_Message "Failed download found, trying to recover"
POL_SetupWindow_wait "$(eval_gettext 'Checking piece integrity...')" "$4"
if [ "$(POL_MD5_file $FAILEDPIECE)" = "$3" ]; then
- POL_Debug_message "Download recovery successful"
+ POL_Debug_Message "Download recovery successful"
mv "$FAILEDPIECE" "$2"
fi
fi
@@ -19,18 +19,18 @@
local TMPPIECE="$2.part"
while true; do
POL_System_wget "$1" "$4" --no-check-certificate --continue -O "$TMPPIECE"
- POL_Debug_message "POL_System_wget exit code: $?"
+ POL_Debug_Message "POL_System_wget exit code: $?"
POL_SetupWindow_wait "$(eval_gettext 'Checking download integrity...')" "$4"
if [ ! -e "$TMPPIECE" ]; then
- POL_Debug_message "No downloaded file"
+ POL_Debug_Message "No downloaded file"
DLMSG="$(eval_gettext 'Download failed')"
elif [ -n "$3" ] && [ "$(POL_MD5_file $TMPPIECE)" != "$3" ]; then
- POL_Debug_message "Downloaded file incomplete or corrupted"
+ POL_Debug_Message "Downloaded file incomplete or corrupted"
DLMSG="$(eval_gettext 'Download seems to be corrupted')"
mv "$TMPPIECE" "$FAILEDPIECE"
else
- POL_Debug_message "Download completed successfully"
+ POL_Debug_Message "Download completed successfully"
mv "$TMPPIECE" "$2"
[ -e "$FAILEDPIECE" ] && rm "$FAILEDPIECE"
break
New source code# 1: URL
# 2: filename
# 3: MD5 hash
# 4: Title
# Failed piece from previous download, maybe reference MD5 was corrected?
local FAILEDPIECE="$2.failed"
if [ -n "$3" -a ! -e "$2" -a -e "$FAILEDPIECE" ]; then
POL_Debug_Message "Failed download found, trying to recover"
POL_SetupWindow_wait "$(eval_gettext 'Checking piece integrity...')" "$4"
if [ "$(POL_MD5_file $FAILEDPIECE)" = "$3" ]; then
POL_Debug_Message "Download recovery successful"
mv "$FAILEDPIECE" "$2"
fi
fi
[ -e "$2" ] && return
local TMPPIECE="$2.part"
while true; do
POL_System_wget "$1" "$4" --no-check-certificate --continue -O "$TMPPIECE"
POL_Debug_Message "POL_System_wget exit code: $?"
POL_SetupWindow_wait "$(eval_gettext 'Checking download integrity...')" "$4"
if [ ! -e "$TMPPIECE" ]; then
POL_Debug_Message "No downloaded file"
DLMSG="$(eval_gettext 'Download failed')"
elif [ -n "$3" ] && [ "$(POL_MD5_file $TMPPIECE)" != "$3" ]; then
POL_Debug_Message "Downloaded file incomplete or corrupted"
DLMSG="$(eval_gettext 'Download seems to be corrupted')"
mv "$TMPPIECE" "$FAILEDPIECE"
else
POL_Debug_Message "Download completed successfully"
mv "$TMPPIECE" "$2"
[ -e "$FAILEDPIECE" ] && rm "$FAILEDPIECE"
break
fi
local OLD_APP_ANSWER="$APP_ANSWER"
POL_SetupWindow_question "$DLMSG\n$(eval_gettext 'Retry?')" "$TITLE"
[ "$APP_ANSWER" = "TRUE" ] || POL_Debug_Fatal "$DLMSG"
APP_ANSWER="$OLD_APP_ANSWER"
done
Respuestas |
This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com