Skip to content

Commit 3bf3835

Browse files
committed
v2.3.56
- From the last wget upgrade output can't be catch to display download informations. Download progress has been convert to progress only.
1 parent 6a334e8 commit 3bf3835

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

zenvidia

+27-21
Original file line numberDiff line numberDiff line change
@@ -4228,13 +4228,16 @@ download_only(){ #
42284228
}
42294229
last_pack(){ #
42304230
track(){
4231-
# picked up & inspired by winetricks download progress commande:
4232-
# Parse a percentage, a size, and a time into $1, $2 and $3
4233-
# then use them to create the output line.
4234-
perl -p -e "$| = 1; s|^.* +([0-9]+%) +([0-9,.]+[GMKB]) +([0-9hms,.]+).*$|\1\n# $run_pack\t(\1): time left \3\t\2\/s|"
4231+
sleep 1
4232+
until [ $file_up = $file_down ]; do
4233+
file_down=$(du -h -BM $buildtmp/NVIDIA-Linux-x86_64-$LAST_PACK.run | awk '{print $1}'| grep -Eo "[0-9]+")
4234+
echo -e $"# Downloading $file_down of $file_up $file_ex."
4235+
echo "$(( $((100*$file_down))/$file_up ))"
4236+
sleep 0.5
4237+
done
42354238
}
42364239
download_cmd(){
4237-
$p_wget -c https://$nvidia_ftp-$ARCH/$LAST_PACK/$run_pack $buildtmp/ 2>&1
4240+
$p_wget -c -P $buildtmp/ https://$nvidia_ftp-$ARCH/$LAST_PACK/$run_pack
42384241
}
42394242
download_error(){
42404243
warn_log="$w_text"
@@ -4245,14 +4248,13 @@ last_pack(){ #
42454248
y_text=$"${v}Remote content control...${end}"
42464249
pulse=1; log=0; hold=0 ; hide_txt=1; [ $hold = 1 ] && win_log_options
42474250
{ timeout=30
4248-
{ $p_wget -q -O $nvtmp/bug_list https://$nvidia_ftp-$ARCH/$LAST_PACK/
4249-
cat $nvtmp/bug_list | grep -E -o "href='NVIDIA.*[0-9]+.*'"| perl -pe "s/^.*\'(.*)\'/\1/p" \
4250-
> $nvtmp/selector
4251+
{ $p_wget -q -O $nvtmp/dl_list https://$nvidia_ftp-$ARCH/$LAST_PACK/
4252+
cat $nvtmp/dl_list | grep -E -o "href='NVIDIA.*[0-9]+.*'"| sed -En "s/^.*'(.*)'/\1/p" > $nvtmp/dl_selector
42514253
} & eval lpid=$!; y_pulse; } | win_yad_progress
42524254
4253-
if [ -s $nvtmp/bug_list ]; then
4254-
if [ $(cat $nvtmp/selector | grep -c "$LAST_PACK") -gt 0 ] ; then
4255-
RUN_PACK=$(cat $nvtmp/selector)
4255+
if [ -s $nvtmp/dl_list ]; then
4256+
if [ $(cat $nvtmp/dl_selector | grep -c "$LAST_PACK") -gt 0 ] ; then
4257+
RUN_PACK=$(cat $nvtmp/dl_selector| grep -v "[0-9]sum")
42564258
fi
42574259
42584260
unset drv_list
@@ -4265,7 +4267,7 @@ last_pack(){ #
42654267
l_text=$"${v}Choose the version to install${end}"
42664268
[ $task_opt -gt 0 ] && cancel_lbl=$"Exit"'!zen-close' || cancel_lbl=$"Back to main"'!zen-back'
42674269
ok_lbl=$"Select"'!zen-ok'; l_tail=0; w_head=0
4268-
list_type='radiolist'; columns=2; sel_col=2; sep=''; hid_col=0; edit_col=0; col_tip=0; w_width='500'; w_height='300'
4270+
list_type='radiolist'; columns=2; sel_col=2; sep=''; hid_col=0; edit_col=0; col_tip=0; w_width='500'; w_height='100'
42694271
run_pack=$(win_yad_list "${drv_list[*]}")
42704272
_exit=$?
42714273
[ $_exit -eq 252 ] && exit 0
@@ -4274,16 +4276,20 @@ last_pack(){ #
42744276
[ $task_opt -gt 0 ] && exit 0 || base_menu
42754277
fi
42764278
## from there, look into 'selector' file for sha256sum file.
4277-
if [ -e $nvtmp/selector ]; then
4278-
if [ $(cat $nvtmp/selector| grep -c "sha256sum") -gt 0 ]; then
4279+
if [ -e $nvtmp/dl_selector ]; then
4280+
if [ $(cat $nvtmp/dl_selector| grep -c "sha256sum") -gt 0 ]; then
42794281
run_pack_sha=$run_pack.sha256sum
42804282
fi
42814283
fi
4282-
4284+
file_size=$(cat $nvtmp/dl_list | grep -A1 -E "NVIDIA-Linux-x86_64-$LAST_PACK.run" | sed -En "s/^.*>(.*)<.*$/\1/;s/^([0-9]+)([A-Z]*)$/\1;\2/p")
42834285
y_text=$"<b>Downlaoding ${j}$LAST_PACK${end} driver from ${y}$nvidia_ftp${end}</b>"
42844286
pulse=0; log=0; hold=0 ; hide_txt=0; [ $hold = 1 ] && win_log_options
4285-
{ test $run_pack_sha && $p_wget -c https://$nvidia_ftp-$ARCH/$LAST_PACK/$run_pack_sha $buildtmp/ &>/dev/null
4286-
download_cmd | track
4287+
{ test $run_pack_sha && $p_wget -c -P $buildtmp/ https://$nvidia_ftp-$ARCH/$LAST_PACK/$run_pack_sha &>/dev/null
4288+
file_down=0
4289+
file_up=$(cut -d';' -f1 <<< $file_size)
4290+
file_ex=$(cut -d';' -f2 <<< $file_size)
4291+
download_cmd &
4292+
track
42874293
} | win_yad_progress
42884294
err=$?
42894295
if test $err -gt 128; then
@@ -4294,15 +4300,16 @@ last_pack(){ #
42944300
fi
42954301
# get weight of the pack in ko.
42964302
_local=$(du -h $buildtmp/$run_pack | awk '{print $1}'| grep -o "[0-9]*")
4297-
_remote=$(cat $nvtmp/bug_list | grep -A1 "$run_pack<"|sed -En "s/^.*>(.*)<\/.*>.*$/\1/g;2p"| grep -o "[0-9]*")
4303+
_remote=$(cat $nvtmp/dl_list | grep -A1 "$run_pack<"|sed -En "s/^.*>(.*)<\/.*>.*$/\1/g;2p"| grep -o "[0-9]*")
42984304
if [ -f $buildtmp/$run_pack.sha256sum ]; then
4299-
local_sha=$buildtmp/$run_pack.sha256sum
4305+
pushd $buildtmp &>/dev/null
43004306
sha256sum $run_pack
4301-
sha256sum --status -c $local_sha
4307+
sha256sum --status -c $run_pack.sha256sum
43024308
if [ $? = 1 ]; then
43034309
w_text=$"${j}<b>Download check sum error</b>${end}.\nTransaction aborted\nTry to restart driver download from <b>Update menu</b>"
43044310
download_error
43054311
fi
4312+
popd &>/dev/null
43064313
fi
43074314
if [ $_remote -ne $_local ]; then
43084315
w_text=$"${j}<b>Download unexpected end</b>${end}.\nPlease restart driver download from <b>Update menu</b>"
@@ -4321,7 +4328,6 @@ last_pack(){ #
43214328
if [ $_exit -eq 1 ]; then [ $task_opt -gt 0 ] && exit 0 || base_menu; fi
43224329
fi
43234330
}
4324-
43254331
## TOOLS ###
43264332
43274333
## common windows.

0 commit comments

Comments
 (0)