📄 filecopy.tcl
字号:
# FILECOPY.TCL - Setup procedures for implementing file-copying wizard page
#
# Copyright 1999-2003 Wind River Systems, Inc
#
# modification history
# --------------------
# 03i,29apr03,bjl use default toolset (spr 87803), text rewording.
# 03h,27feb03,bjl changed toolset to be extracted dynamically rather than
# using a hardcoded list.
# 03g,03oct02,bjl fixed skipping of slideshow bitmap (spr 82816).
# 03f,31may02,wmd Remove the fadebmp option from the slideshow, Spr #78088.
# 03e,23may02,bjl fixed postInstall to be executed per product rather than
# for all parts (spr 77976).
# 03d,19nov01,bwd Added checks to store a list of new archives
# 03c,30oct01,bwd SPR 70033: added option "DO NOT OVERWRITE ANY NEWER FILES"
# 03b,17sep01,bwd Fixed SPR 69435 and 69982
# 03a,12jun01,j_w Modified for Tornado 2.2
# 02y,07nov00,wmd Fix SPR # 35911, the retry command to remove a file doesn't
# work.
# 02x,25oct00,bwd Initialize setupFiles variable. Do not skip installing
# mainwin-related files if no mw source. Fixed setupFiles
# selection process.
# 02w,16oct00,bwd SPR 35262: fixed mw linking to first check if files exist
# 02v,25sep00,bwd Skip linking mainwin-related files if running SETUP on
# Windows
# 02u,19sep00,bwd Changed /usr/bin to /bin
# 02t,18sep00,j_w Added libUpdate back for FCS. Added product index back in
# archListPut{}
# 02s,18sep00,bwd LINUX: skip coping mainwin-related files under SETUP
# directory and creat links instead
# 02r,05sep00,bwd Skip coping mainwin-related files under SETUP directory
# and creat links instead
# 02q,26jun00,bwd Added cases to skip copying non-native-host files under
# SETUP directory
# 02p,26jun00,bwd Added CD description in setup.log
# 02o,22jun00,bwd SPR 31613: write to setup.log the list of licensed products
# on this page to avoid any duplicate logging
# 02n,22jun00,bwd SPR 32060: hide HELP button for this page
# 02m,09jun00,bwd Added another host type check for x86-linux2
# 02l,09may00,bwd Catch error when closing a file in procedure execute
# 02k,03feb00,bjl always pageRemove libExtract for EAR-2.
# 02j,01feb00,bwd Fixed error handling for test automation
# 02i,11jan00,bwd Removed test automations from command line SETUP
# 02h,23nov99,clc add text mode
# 02g,12nov99,bwd Corrected typo
# 02f,25oct99,bjl removed product index from object list so that related
# optional comp. objects are stored in one array.
# 02e,21oct99,bjl removed parisc-hpux support.
# 02d,18oct99,bjl added handling of library archives.
# 02c,18oct99,j_w removed debug message
# 02b,14oct99,bjl remove readonly attribute during setupCopy,
# set default bitmap for Unix if no billboard list.
# 02a,30Sep99,j_w Modified for T3
# 01n,11aug99,j_w Added messages
# 01m,26apr99,bjl do not resize or reposition window for KDE.
# 01l,23apr99,bjl check for KDE and FVWM.
# 01k,22apr99,wmd Added fix for window resizing problem.
# 01j,22mar99,bjl do not move window during resizing.
# 01i,19mar99,wmd Output to a file any debug messages.
# 01h,15mar99,wmd Need to make array multipleVersion global, spr #25678..
# 01g,15mar99,tcy use setupWinVerGetEx() to obtain os version info
# 01f,12mar99,wmd Add line indicating host os type to setup.log.
# 01e,04mar99,tcy fixed problem with last checkin
# 01d,03mar99,tcy save CD number in installCDnumber file for About-Box usage
# 01c,01feb99,tcy invoke setExecutePermissions in filesCopy()
# 01b,28jan99,tcy moved procs here from INSTALL.TCL
# 01a,26jan99,tcy extracted from INSTW32.TCL.
#
#############################################################################
#
# pageCreate(filesCopy) - display file installation progress with meter and
# install files onto user's destination directory and
# back up files if necessary
#
# This procedure will display file installation progress with meter, install
# files onto user's destination directory and back up files if necessary
#
# SYNOPSIS
# .tS
# pageCreate(filesCopy)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc pageCreate(filesCopy) {} {
global ctrlVals
global setupVals
global tornadoInstalled
if { [isGUImode] } {
if {[limitColors]} {
# create the meter here, so it can be displayed in the
# dialog window. Do not display the billboard.
set ctrlVals(numBbrd) 0
meterCreate [strTableGet FILESCOPY_LABEL]
} elseif {[removeBackground]} {
resizeBbrdDialog
}
set w [dlgFrmCreate [strTableGet FILESCOPY_TITLE]]
controlEnable $w.backButt 0
controlEnable $w.nextButt 0
set setupVals(cancel) 0
if {![removeBackground]} {
# create the billboards and meter to be placed in the background.
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)
meterCreate [strTableGet FILESCOPY_LABEL]
}
controlPropertySet $ctrlVals(meterWindow).$ctrlVals(meterWg) \
-background Blue -foreground Black
} else { # TEXT MODE
printPageTitle [strTableGet FILESCOPY_TITLE]
puts [strTableGet FILESCOPY_LABEL]
set setupVals(cancel) 0
}
setupCopy
if {!$setupVals(cancel)} {
# call filesCopy
# for TEXT mode, if return value = 0, exit SETUP
if { [filesCopy] == 0 } {
if { ![isGUImode] } { return 0 }
}
backupFileQueueFlush
lappend setupVals(commandQueue) [list backupFileQueueFlush]
}
if { [isGUImode] } {
controlEnable $w.backButt 1
controlEnable $w.nextButt 1
# test automation
if { $ctrlVals(useInputScript) } {
autoSetupLog "Files copy page:"
autoSetupLog "\tFiles copied onto $setupVals(destDir)"
}
nextCallback
} else { # TEXT mode
nextCallback
return 0
}
}
#############################################################################
#
# pageProcess(filesCopy) - process inputs from filesCopy page
#
# This procedure will process inputs from filesCopy page
#
# SYNOPSIS
# .tS
# pageProcess(filesCopy)
# .tE
#
# PARAMETERS: N/A
#
# RETURNS: 0 if successful
# 1 if cancel button is pushed
#
# ERRORS: N/A
#
proc pageProcess(filesCopy) {} {
global setup_objects
global ctrlVals
global setupVals
# This global variable is set in the tornado/postInstall.tcl
global tornadoInstalled
set retVal 0
if {"$setupVals(cancel)" != "1"} {
if {[array names setup_objects] == ""} {
dbgputs "Remove libUpdate"
pageRemove "libUpdate"
}
if { [isGUImode] } {
meterDestroy $ctrlVals(meterWindow)
}
set retVal 1
} else {
if { [isGUImode] } {
applicationExit
}
}
return $retVal
}
#############################################################################
#
# resizeBbrdDialog - resize the billboard dialog box
#
# This procedure will resize the billboard dialog box according to window size
#
# SYNOPSIS
# resizeBbrdDialog
#
# .tE
# PARAMETERS: N/A
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc resizeBbrdDialog {} {
global ctrlVals
global env
set ctrlVals(restoredDialog) 0
# calculate the billboard dimensions.
set bbrdW $ctrlVals(bbrdW)
set bbrdH $ctrlVals(bbrdH)
set dimension [pixelsToDialogUnits $ctrlVals(mainWindow) \
[list $bbrdW $bbrdH]]
set bbrdW [lindex $dimension 0]
set bbrdH [lindex $dimension 1]
# move and resize the dialog window so the billboards can fit.
# save the original values of the dialog window first.
set ctrlVals(dlg_orig_xpos) [lindex [windowPositionGet \
$ctrlVals(mainWindow)] 0]
set ctrlVals(dlg_orig_ypos) [lindex [windowPositionGet \
$ctrlVals(mainWindow)] 1]
set ctrlVals(dlg_orig_size) [windowSizeGet $ctrlVals(mainWindow)]
set ctrlVals(dlg_orig_frm2_size) [controlSizeGet \
$ctrlVals(mainWindow).frm2]
set ctrlVals(dlg_orig_frm2_pos) [controlPositionGet \
$ctrlVals(mainWindow).frm2]
set ctrlVals(dlg_orig_back_pos) [controlPositionGet \
$ctrlVals(mainWindow).backButt]
set ctrlVals(dlg_orig_next_pos) [controlPositionGet \
$ctrlVals(mainWindow).nextButt]
set ctrlVals(dlg_orig_next_size) [controlSizeGet \
$ctrlVals(mainWindow).nextButt]
set ctrlVals(dlg_orig_cancel_pos) [controlPositionGet \
$ctrlVals(mainWindow).cancelButt]
set dlg_orig_w [lindex $ctrlVals(dlg_orig_size) 0]
set right_border [expr $dlg_orig_w - 10]
set dlg_orig_h [lindex $ctrlVals(dlg_orig_size) 1]
set dlg_orig_cancel_w \
[lindex [controlSizeGet $ctrlVals(mainWindow).cancelButt] 0]
set dlg_orig_next_w \
[lindex [controlSizeGet $ctrlVals(mainWindow).nextButt] 0]
set dlg_orig_back_w \
[lindex [controlSizeGet $ctrlVals(mainWindow).backButt] 0]
# The dialog window will be reduced in width to just fit the billboard
# width, and increased in height to account for the billboard.
# subtract billboard width but add 20 for the edges
set width_reduction [expr $dlg_orig_w - $bbrdW + 20]
# now calculate the height increase
# based on the the billboard ypos
if {[info exists env(SETUP_USEKDE)]} {
set billboard_ypos 10
} else {
set billboard_ypos 40
}
set billboard_bottom [expr $billboard_ypos + $bbrdH]
set meterlabel_ypos [expr $billboard_bottom + 10]
set meter_ypos [expr $meterlabel_ypos + 12]
set frm2_ypos [expr $meter_ypos + 15]
set button_ypos [expr $frm2_ypos + 7]
# bottomedge is also the new dialog window height
set bottomedge [expr $button_ypos + 19]
set height_increase [expr $bottomedge - $dlg_orig_h]
# do not reposition the window for KDE to avoid window manager
# crash.
if {![info exists env(SETUP_USEKDE)]} {
windowPositionSet $ctrlVals(mainWindow) \
$ctrlVals(dlg_orig_xpos) \
$ctrlVals(dlg_orig_ypos)
}
# Hide the help button - no use during copying
controlHide $ctrlVals(mainWindow).helpButt 1
# Hide the Next button and substitute it with a "phony" button.
# The Next button is set to be the default button, which causes
# UITclSh to think that its size is larger due to the border.
# This causes problems with the button appearance when moving the
# button around and when restoring the original dialog window.
# Restore the Next button in the "restoreOriginalDialog" procedure.
controlHide $ctrlVals(mainWindow).nextButt 1
controlCreate $ctrlVals(mainWindow) \
[list button -name phonynextButt -title "&Next >" \
-callback nextCallback \
-x 197 -y 185 -w 50 -h 14]
controlEnable $ctrlVals(mainWindow).phonynextButt 0
controlFocusSet $ctrlVals(mainWindow).cancelButt
controlHide $ctrlVals(mainWindow).bitmap 1
# controls are specially set for KDE because we do not shrink
# the window.
if {[info exists env(SETUP_USEKDE)]} {
controlSizeSet $ctrlVals(mainWindow).frm2 [expr $right_border - 10] 2
} else {
controlSizeSet $ctrlVals(mainWindow).frm2 $bbrdW 2
}
controlPositionSet $ctrlVals(mainWindow).frm2 10 $frm2_ypos
if {[info exists env(SETUP_USEKDE)]} {
set cancel_xpos [expr $right_border - $dlg_orig_cancel_w]
} else {
set cancel_xpos [expr 10 + $bbrdW - $dlg_orig_cancel_w]
}
set next_xpos [expr $cancel_xpos - 8 - $dlg_orig_next_w ]
set back_xpos [expr $next_xpos - $dlg_orig_back_w]
controlPositionSet $ctrlVals(mainWindow).backButt $back_xpos \
$button_ypos
controlPositionSet $ctrlVals(mainWindow).phonynextButt $next_xpos \
$button_ypos
controlPositionSet $ctrlVals(mainWindow).cancelButt $cancel_xpos \
$button_ypos
# do not resize the window for KDE to avoid a window manager crash.
if {![info exists env(SETUP_USEKDE)]} {
set ctrlVals(mainWindowSize) [list [expr $bbrdW + 20] $bottomedge]
windowSizeSet $ctrlVals(mainWindow) \
[expr $bbrdW + 20] $bottomedge
}
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]
}
#############################################################################
#
# toolsetExtract - extracts the toolset list from the installed makefiles
#
# This procedure will extract the toolset list by searching for
# "TOOL = <tool>" lines in the make.*<tool>* files in target/h/tool/<tool>
# or target/h/make. The string returned is the list of tools found
# separated by |, for example "sfgnule|sfgnu|gnu|diab". Substrings must
# come later in the list, for example "gnu" must come after "sfgnule|sfgnu".
# This list is used as a pattern matcher during file copying and archiving.
#
# SYNOPSIS
# .tS
# toolSetExtract
# .tE
#
# PARAMETERS: N/A
#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -