📄 filecopy.tcl
字号:
} set ctrlVals(bbrdList) [bbrdListGet .BMP] if {"$ctrlVals(bbrdList)" == ""} { set ctrlVals(bbrdList) \ [dosToUnix [cdFileNameGet \ [file join RESOURCE BITMAPS SETUP.BMP]]] } set ctrlVals(numBbrd) [llength $ctrlVals(bbrdList)] set ctrlVals(displayInt) [expr 100 / $ctrlVals(numBbrd)] set ctrlVals(bbrdElapse) $ctrlVals(displayInt) # create the meter here, so it can be displayed in the # dialog window. meterCreate [strTableGet FILESCOPY_LABEL]}################################################################################ archListPut - save the object filename## This procedure checks the provided filename for a special pattent. If# matches, the filename will be saved in a global array for later archiving# step. The keys of this associated array are the object location, and product# index.## SYNOPSIS# archListPut <fileName> <index>## PARAMETERS:# fileName : a path filename# index : an index to a current product## RETURNS: N/A## ERRORS: N/A#proc archListPut {fileName index} { global setup_objects global setup_libraries global newArchive # toolset and typeset can be a set of strings "|" together # "gnu|gnucoff|..." #set toolset "gnu" set toolset "sfgnule|sfgnu|sfr3kgnu|gnule|gnu|diab|gnube" set typeset "vx" if {[regexp "^.*/lib/obj(.*)($toolset)($typeset)(.*)/(.*$)" $fileName \ junk cpu tool type typex tailFileName] == "1"} { set objDir "$index,obj,$cpu,$tool,$type,$typex" if [info exists setup_objects($objDir)] { if {[lsearch $setup_objects($objDir) $tailFileName] == "-1"} { lappend setup_objects($objDir) $tailFileName } } else { set setup_objects($objDir) [list $tailFileName] } } if {[regexp "^.*/lib/lib(.*)($toolset)($typeset)(.*).a" $fileName \ junk cpu tool type typex] == "1"} { set objLib "$index,obj,$cpu,$tool,$type,$typex" set setup_libraries($objLib) lib$cpu$tool$type$typex.a } # For archiving format target/lib/PPC/ppc604/gnu/objcplus/foo.o if {[regexp "^.*/lib/(.*)/(.*)/(.*)/obj(.*)/(.*$)" $fileName \ junk family cpu tool type tailFileName] == "1"} { set newArchive 1 set objDir "$index,obj,$family,$cpu,$tool,$type" if [info exists setup_objects($objDir)] { if {[lsearch $setup_objects($objDir) $tailFileName] == "-1"} { lappend setup_objects($objDir) $tailFileName } } else { set setup_objects($objDir) [list $tailFileName] } } if {[regexp "^.*/lib/(.*)/(.*)/(.*)/lib(.*).a" $fileName \ junk family cpu tool type] == "1"} { set objLib "$index,obj,$family,$cpu,$tool,$type" set setup_libraries($objLib) lib$type.a }}################################################################################ processInstall - process the return value from filesCopy routine## SYNOPSIS# processInstall <retVal>## PARAMETERS: The return value from call to setupFileExtract in filesCopy## RETURNS: string "break" if EOF encountered, else "NULL".## ERRORS: N/A#proc processInstall {retVal fileName prodIndex} { global ctrlVals setupVals global current_file multipleVersion global overwritePolicy donotOverwrite set f [destDirGet]/$fileName switch $retVal { OK { uninstLog file "wind_base\t$fileName" # Build archList for later updating the archirve. archListPut $fileName $prodIndex setupFileNext } EXIST_AND_SAME { # Workaround the problem that the base product is # reinstalled, and messup the libraries. archListPut $fileName $prodIndex setupFileNext } EXIST_AND_NEWER { if { [isGUImode] } { # do not overwrite if auto install if { $ctrlVals(useInputScript) } { archListPut $fileName $prodIndex; \ setupFileNext return NULL } } if { [info exists overwritePolicy(ALL)] && $overwritePolicy(ALL) } { backup $fileName; \ set newerFileArray($fileName) ""; \ set fileRm [fileRemove $f] if { $fileRm == "IGNORE"} { setupFileNext } elseif { $fileRm == 0 } { # for TEXT mode, if return value = 0, exit SETUP if { ![isGUImode] } { return 0 } } } elseif { [info exists donotOverwrite(ALL)] && $donotOverwrite(ALL) } { archListPut $fileName $prodIndex; \ setupFileNext } else { if { [isGUImode] } { messageBeep -exclamation set ret [dialog file_exists_newer_warn "Setup" \ [strTableGet FILESCOPY_FILE_EXISTS_NEWER_WARN] \ question 0] } else { puts "\n\n[strTableGet FILESCOPY_FILE_EXISTS_NEWER_WARN]\n\n\ Choose 0: overwrite the existing file.\n\ Choose 1: do not overwrite the existing file.\n\ Choose 2: overwrite ALL files, do not prompt about\ this again. Choose 3: do not overwrite ANY newer files, do not\ prompt about this again." set ret [prompt] } switch -regexp -- $ret { 0 {backup $fileName; \ set newerFileArray($fileName) ""; \ set fileRm [fileRemove $f] while { $fileRm == "RETRY" } { set fileRm [fileRemove $f] } if { $fileRm == "IGNORE" } { setupFileNext } elseif { $fileRm == 0 } { # for TEXT mode, if return value = 0, exit SETUP if { ![isGUImode] } { return 0 } } } 1 {archListPut $fileName $prodIndex; \ setupFileNext } 2 {set overwritePolicy(ALL) 1; \ backup $fileName; \ set newerFileArray($fileName) ""; \ set fileRm [fileRemove $f] if { $fileRm == "IGNORE"} { setupFileNext } elseif { $fileRm == 0 } { # for TEXT mode, if return value = 0, exit SETUP if { ![isGUImode] } { return 0 } } } 3 {set donotOverwrite(ALL) 1; \ archListPut $fileName $prodIndex; \ setupFileNext } "[eE][xX][iI][tT]" { return 0 } # TEXTmode exit } } } EXIST_AND_OLDER { backup $fileName; \ set fileRm [fileRemove $f] if { $fileRm == "IGNORE"} { setupFileNext } elseif { $fileRm == 0 } { # for TEXT mode, if return value = 0, exit SETUP if { ![isGUImode] } { return 0 } } } MULTIPLE_VERSION { # Setup detected that the file being install has more # than one versions on the CD-ROM. if ![file exists $f._${prodIndex}_] { uninstLog setup "\t$f._${prodIndex}_: does not exist" setupFileNext return NULL } if {![info exists multipleVersion($fileName)]} { set multipleVersion($fileName) $prodIndex } else { # Check to see if there is a duplicate prodIndex set indexLocate [lsearch -exact \ $multipleVersion($fileName) $prodIndex] if {$indexLocate == -1} { lappend multipleVersion($fileName) $prodIndex } } setupFileNext } NOT_FOUND { set msg [strTableGet FILESCOPY_DEFLATE_ERROR] set logMsg "\terror: cannot copy $fileName: not found" if { [isGUImode] } { if { $ctrlVals(useInputScript) } { autoSetupLog "$logMsg" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit return 0 } } if { [isGUImode] } { set ret [dialog re_ig_cancel "Setup" $msg question 0] } else { puts "\n\n$msg\n\nChoose 0: Retry\nChoose 1: Ignore\nChoose 2: Abort\n" set ret [prompt] } switch -- $ret { 0 { return NULL } 1 { lastErrorSet $logMsg uninstLog setup $logMsg setupFileNext } 2 { # if TEXT mode, exit if { ![isGUImode] } { return 0 } quitCallback } } } ZIP_ERROR { set logMsg "\terror: can not copy $fileName: zip error" lastErrorSet $logMsg uninstLog setup $logMsg setupFileNext } MEMORY_LOW { set msg [strTableGet FILESCOPY_MEMORY_LOW_WARN] if { [isGUImode] } { if { $ctrlVals(useInputScript) } { autoSetupLog "$msg" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit return 0 } } if { [isGUImode] } { set ret [dialog ok_cancel "Setup" $msg question 0] } else { puts "\n\n$msg\n\nChoose 0: Continue\nChoose 1: Exit SETUP\n" set ret [prompt] } switch -- $ret { 0 { return NULL } 1 { # if TEXT mode, exit if { ![isGUImode] } { return 0 } quitCallback } } } NO_ZIP_FILE { set msg [strTableGet FILESCOPY_CDROM_READ_ERROR] set logMsg "\terror: cannot copy $fileName : no zip file" if { [isGUImode] } { if { $ctrlVals(useInputScript) } { autoSetupLog "$logMsg" autoSetupLog "Application Exit\n" set setupVals(cancel) 1 applicationExit return 0 } } if { [isGUImode] } { set ret [dialog re_ig_cancel "Setup" $msg question 0] } else { puts "\n\n$msg\n\nChoose 0: Retry\nChoose 1: Ignore\nChoose 2: Abort\n" set ret [prompt] } switch -- $ret { 0 { return NULL } 1 { lastErrorSet $logMsg uninstLog setup $logMsg setupFileNext } 2 { # if TEXT mode, exit if { ![isGUImode] } { return 0 } quitCallback } } } BAD_PARAM { set logMsg "\terror: cannot copy $fileName: bad param" lastErrorSet $logMsg uninstLog setup $logMsg setupFileNext } DISK_FULL {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -