|
@@ -236,10 +236,6 @@ proc blacktools:update_backup {} {
|
|
|
set black(backup_update) 1
|
|
set black(backup_update) 1
|
|
|
set black(start_update) [unixtime]
|
|
set black(start_update) [unixtime]
|
|
|
set black(update_file_saved) [llength [glob -nocomplain -directory "$black(dirname)/BlackTools/FILES" "*.txt"]]
|
|
set black(update_file_saved) [llength [glob -nocomplain -directory "$black(dirname)/BlackTools/FILES" "*.txt"]]
|
|
|
-if {[file isdirectory "$black(dirname)/BlackTools/FILES/TOPWORDS"]} {
|
|
|
|
|
- set black(update_topwords_files) 1
|
|
|
|
|
- set black(update_file_saved) [expr [llength [glob -nocomplain -directory "$black(dirname)/BlackTools/FILES/TOPWORDS" "*.txt"]] + $black(update_file_saved)]
|
|
|
|
|
-}
|
|
|
|
|
blacktools:update_put "" "" 12 ""
|
|
blacktools:update_put "" "" 12 ""
|
|
|
blacktools:update_put "" "" 13 ""
|
|
blacktools:update_put "" "" 13 ""
|
|
|
blacktools:update_put "" "" 14 ""
|
|
blacktools:update_put "" "" 14 ""
|
|
@@ -354,9 +350,6 @@ if {$num_var > 0} {
|
|
|
set ::update_chan $::update_chan
|
|
set ::update_chan $::update_chan
|
|
|
every 1000 {
|
|
every 1000 {
|
|
|
set info_files_num [llength [glob -nocomplain -directory "$black(actdir)/BlackTools/FILES" "*.txt"]]
|
|
set info_files_num [llength [glob -nocomplain -directory "$black(actdir)/BlackTools/FILES" "*.txt"]]
|
|
|
-if {[file isdirectory "$black(actdir)/BlackTools/FILES/TOPWORDS"]} {
|
|
|
|
|
- set info_files_num [expr [llength [glob -nocomplain -directory "$black(actdir)/BlackTools/FILES/TOPWORDS" "*.txt"]] + $info_files_num]
|
|
|
|
|
-}
|
|
|
|
|
if {$info_files_num == $black(update_file_saved)} {
|
|
if {$info_files_num == $black(update_file_saved)} {
|
|
|
blacktools:update_end $info_files_num
|
|
blacktools:update_end $info_files_num
|
|
|
break
|
|
break
|
|
@@ -398,9 +391,6 @@ if {[info exists ::update_chan]} {
|
|
|
blacktools:update_put $hand $chan 25 [list $black(backup_dir) $black(log_file)]
|
|
blacktools:update_put $hand $chan 25 [list $black(backup_dir) $black(log_file)]
|
|
|
blacktools:update_put $hand $chan 26 ""
|
|
blacktools:update_put $hand $chan 26 ""
|
|
|
unset black(update_file_saved)
|
|
unset black(update_file_saved)
|
|
|
-if {[info exists black(update_topwords_files)]} {
|
|
|
|
|
- unset black(update_topwords_files)
|
|
|
|
|
-}
|
|
|
|
|
file delete -force "$black(actdir)/BlackTools.old.tcl"
|
|
file delete -force "$black(actdir)/BlackTools.old.tcl"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -409,21 +399,10 @@ proc blacktools:update_restore_files {} {
|
|
|
global black
|
|
global black
|
|
|
set files ""
|
|
set files ""
|
|
|
set files [glob -nocomplain -directory "$black(backup_dir)/BlackTools/FILES" "*.txt"]
|
|
set files [glob -nocomplain -directory "$black(backup_dir)/BlackTools/FILES" "*.txt"]
|
|
|
- set counter 0
|
|
|
|
|
if {![file isdirectory "$black(actdir)/BlackTools/FILES"]} {
|
|
if {![file isdirectory "$black(actdir)/BlackTools/FILES"]} {
|
|
|
file mkdir "$black(actdir)/BlackTools/FILES"
|
|
file mkdir "$black(actdir)/BlackTools/FILES"
|
|
|
}
|
|
}
|
|
|
-if {[info exists black(update_topwords_files)]} {
|
|
|
|
|
-if {![file isdirectory "$black(actdir)/BlackTools/FILES/TOPWORDS"]} {
|
|
|
|
|
- file mkdir "$black(actdir)/BlackTools/FILES/TOPWORDS"
|
|
|
|
|
-}
|
|
|
|
|
- set top_files [glob -nocomplain -directory "$black(backup_dir)/BlackTools/FILES/TOPWORDS" "*.txt"]
|
|
|
|
|
-foreach f $top_files {
|
|
|
|
|
- incr counter
|
|
|
|
|
- set filename [file tail $f]
|
|
|
|
|
- file copy -force $f "$black(actdir)/BlackTools/FILES/TOPWORDS/$filename"
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ set counter 0
|
|
|
foreach f $files {
|
|
foreach f $files {
|
|
|
incr counter
|
|
incr counter
|
|
|
set filename [file tail $f]
|
|
set filename [file tail $f]
|
|
@@ -555,6 +534,7 @@ if {$type == 0} {
|
|
|
proc blacktools:update_verify {} {
|
|
proc blacktools:update_verify {} {
|
|
|
global black
|
|
global black
|
|
|
set link "https://raw.githubusercontent.com/tclscripts/BlackTools-TCL/master/VERSION"
|
|
set link "https://raw.githubusercontent.com/tclscripts/BlackTools-TCL/master/VERSION"
|
|
|
|
|
+ http::register https 443 [list ::tls::socket -autoservername true]
|
|
|
set ipq [http::config -useragent "lynx"]
|
|
set ipq [http::config -useragent "lynx"]
|
|
|
set error [catch {set ipq [::http::geturl $link -timeout 10000]} eror]
|
|
set error [catch {set ipq [::http::geturl $link -timeout 10000]} eror]
|
|
|
set status [::http::status $ipq]
|
|
set status [::http::status $ipq]
|