1 -- $Id: 500_perform_upgrade.lua,v 1.1 2005/03/27 23:19:29 cpressey Exp $
4 -- Perform an upgrade by copying files from the root of the installation
5 -- medium to the target system.
8 name = "perform_upgrade",
9 title = "Perform Upgrade",
10 action = function(fsm)
13 assert(App.state.target)
15 cmds:set_replacements{
16 base = App.state.target:get_base()
20 -- First, we must record which files on the installed system have
21 -- the 'noschg' flag set.
23 App.register_tmpfile("schg.txt")
24 cmds:add("${root}${FIND} ${root}${base} -flags -schg, >${tmp}schg.txt")
27 -- Next, we take away the schg flag from these files, so that we
28 -- can overwrite them.
30 cmds:add("${root}${XARGS} -t ${root}${CHFLAGS} noschg <${tmp}schg.txt")
33 -- Add commands to copy sources (files and directories) now.
35 App.state.target:cmds_install_srcs(cmds, App.load_conf("sources"))
38 -- Before we are done, we must use chflags to restore the flags
39 -- of files which we 'noschg'ed so that we could upgrade them.
41 cmds:add("${root}${XARGS} -t ${root}${CHFLAGS} schg <${tmp}schg.txt")
46 if cmds:execute() then
48 _("Target system was successfully upgraded!")
52 _("Target system was not successfully upgraded.")