From 1f9ae3b62e4620ba48272be006fa4bf27f444c79 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 4 May 2009 15:37:30 +0000 Subject: Check if shared objects actually copied, and copy them on next startup if they didn't. svn path=/trunk/netsurf/; revision=7390 --- amiga/dist/Install | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ amiga/dist/Install.info | Bin 8877 -> 8892 bytes 2 files changed, 65 insertions(+) diff --git a/amiga/dist/Install b/amiga/dist/Install index 88162cf18..5d0d64005 100755 --- a/amiga/dist/Install +++ b/amiga/dist/Install @@ -13,6 +13,56 @@ ) ) +(procedure p_failedsobjs + (message "The following shared objects failed to copy. These will be updated on next reboot.\n\n" #failedsobjs) +) + +(procedure p_schedulesobj #sobj + (transcript "Scheduling update of " #sobj " for next reboot") + + (set #failedsobjs (cat #failedsobjs "\n" #sobj)) + + (makedir "SObjs:so-installer") + + (copyfiles + (source (tackon "SObjs" #sobj)) + (dest "SObjs:so-installer") + ) + + (startup "Shared object installer" + (prompt "Adding commands to user-startup to schedule copy of " #sobj " on next reboot") + (help @startup-help) + (command "if EXISTS SObjs:so-installer\n") + (command " copy SObjs:so-installer SObjs: CLONE FORCE QUIET\n") + (command " delete SObjs:so-installer ALL FORCE QUIET\n") + (command "endif\n") + ) +) + +(procedure p_comparesobj #sobj + (set #same 0) + (set #sobj-version (getversion (tackon "SObjs/" #sobj))) + (if (= #sobj-version 0) + ( + (if (exists (tackon "SObjs:" #sobj)) + ( + (set #file-newer (earlier (tackon "SObjs:" #sobj) (tackon "SObjs/" #sobj))) + (set #old-size (getsize (tackon "SObjs:" #sobj))) + (set #new-size (getsize (tackon "SObjs/" #sobj))) + + (if (AND (= #old-size #new-size) (= #file-newer 0)) (set #same 1)) + ) + ) + ) + ; else if version info is available + ( + (set #sobj-oldversion (getversion (tackon "SObjs:" #sobj))) + + (if (= #sobj-version #sobj-oldversion) (set #same 1)) + ) + ) +) + (procedure p_copysobj #sobj (set #sobj-version (getversion (tackon "SObjs/" #sobj))) @@ -94,6 +144,13 @@ (run "CopyStore SObjs/" #sobj " SObjs:") ) ) + + (p_comparesobj #sobj) + (if (= #same 0) + ( + (p_schedulesobj #sobj) + ) + ) ) ) ) @@ -115,6 +172,13 @@ (run "CopyStore SObjs/" #sobj " SObjs:") ) ) + + (p_comparesobj #sobj) + (if (= #same 0) + ( + (p_schedulesobj #sobj) + ) + ) ) ) ) @@ -333,6 +397,7 @@ (exit (quiet)) ) ( + (p_failedsobjs) (exit) ) ) diff --git a/amiga/dist/Install.info b/amiga/dist/Install.info index a469e30ba..e4d297254 100644 Binary files a/amiga/dist/Install.info and b/amiga/dist/Install.info differ -- cgit v1.2.3