
; A short AmigaDos script that does nothing more valuable that copy
; the binaries from the source tree into our binary tree.
; Note:  It copies everything without much regard to whether anything
; has changed or not.
;
;

assign bsolddir: ""
cd envoy:

echo "Rebuilding the Envoy:NewDisk directory from scratch . . ."
echo "<Be patient>"

bumprev >nil: 1 disk_rev

if EXISTS NewDisk
    delete >nil: NewDisk ALL QUIET
ENDIF
makedir >nil: NewDisk

makedir >nil: NewDisk/libs
makedir >nil: NewDisk/Services
makedir >nil: NewDisk/c
makedir >nil: NewDisk/Configuration
makedir >nil: NewDisk/Accounts
makedir >nil: NewDisk/prefs
makedir >nil: NewDisk/devs
makedir >nil: NewDisk/devs/Networks
makedir >nil: NewDisk/l
makedir >nil: NewDisk/Developer
makedir >nil: NewDisk/Developer/Examples
makedir >nil: NewDisk/Developer/include
makedir >nil: NewDisk/Developer/doc
makedir >nil: NewDisk/Developer/lib
makedir >nil: NewDisk/Developer/tools
makedir >nil: NewDisk/Developer/fd

; Install stuff
echo "Install stuff . . ."
copy >nil: install/guessenvoydev/guessenvoydev.ld.strip newdisk/guessenvoydev CLONE
copy >nil: "install/Install Floppy.info" newdisk CLONE
copy >nil: "install/Install Hard Disk.info" newdisk CLONE
copy >nil: install/utils/BuildNIPCPrefs newdisk/c/BuildNIPCPrefs CLONE
copy >nil: install/utils/BuildSMPrefs newdisk/c/BuildSMPrefs CLONE
copy >nil: install/utils/Reboot newdisk/c/Reboot CLONE
copy >nil: install/scripts/installer newdisk/installer CLONE
copy >nil: install/scripts/FloppyDisk "newdisk/FloppyInstall" CLONE
copy >nil: install/scripts/HardDisk "newdisk/HardDiskInstall" CLONE

; Libraries
echo "Libraries . . ."
copy >nil: src/nipc/nipc.ld.strip newdisk/libs/nipc.library CLONE
copy >nil: src/services/services.ld.strip newdisk/libs/services.library CLONE
copy >nil: src/envoy/envoy.ld.strip newdisk/libs/envoy.library CLONE
copy >nil: src/accounts/libs/accounts.ld.strip newdisk/libs/accounts.library CLONE

; SANA-II drivers
echo "SANA-II Drivers . . ."
copy >NIL: sana2:bin/devs/a2065.device newdisk/devs/Networks/a2065.device CLONE
copy >NIL: sana2:bin/devs/a2060.device newdisk/devs/Networks/a2060.device CLONE

; Services Manager
echo "Services Manager . . ."
copy >NIL: src/services/manager.ld.strip "newdisk/Services/Services Manager" CLONE
;copy >NIL: src/services/manager.ld.strip.info "newdisk/Services/Services Manager.info" CLONE

; Configuration tools
echo "Config . . ."
copy >nil: src/Config/NIPCConfig/nipcconfig.ld.strip "newdisk/Configuration/Network Configuration" CLONE
copy >nil: src/Config/SMConfig/smconfig.ld.strip "newdisk/Configuration/Services Configuration" CLONE
copy >nil: src/Config/FSConfig/fsconfig "newdisk/Configuration/Filesystem Exports" CLONE
Copy >nil: src/Config/FCConfig/fcconfig "newdisk/Configuration/Filesystem Imports" CLONE
copy >nil: src/printer/config/clientconfig "newdisk/Configuration/Printer Import" CLONE
copy >nil: src/printer/config/serverconfig "newdisk/Configuration/Printer Export" CLONE
copy >nil: src/accounts/prefs/users/userprefs.ld.strip "newdisk/Configuration/Users" CLONE
copy >nil: src/accounts/prefs/groups/groupprefs.ld.strip "newdisk/Configuration/Groups" CLONE
copy >nil: src/printer/update "newdisk/Configuration/Network Printing" CLONE
copy >nil: src/printer/pon "newdisk/Configuration/Envoy V37 PrintStart" CLONE

; Filesystem
echo "Filesystem . . ."
copy >nil: src/fs/client/EnvoyFileSystem newdisk/l/EnvoyFileSystem CLONE
copy >nil: src/fs/server/filesystem.service newdisk/Services/filesystem.service CLONE

; Printer
echo "Printer . . ."
copy >nil: V39:src/workbench/devs/parallel/parallel.ld newdisk/devs/parallel.device CLONE
copy >nil: src/printer/client/envoyprint.device newdisk/devs/envoyprint.device CLONE
copy >nil: src/printer/update "newdisk/Config/Network Printing" CLONE
copy >nil: src/printer/update.info "newdisk/Config/Network Printing.info" CLONE
copy >nil: src/printer/server/printspool.service newdisk/services/printspool.service CLONE

; Accounts
echo "Accounts . . ."
copy >nil: src/accounts/manager/manager.ld.strip "newdisk/Accounts/Accounts Manager" CLONE
;copy >nil: src/accounts/manager/manager.ld.strip.info "newdisk/Accounts/Accounts Manager.info" CLONE

; C: Commands
echo "C: commands . . ."
; Weird.  You can't get this from anywhere else!
copy >nil: v40:src/workbench/c/mount/mount.ld.strip newdisk/c/Mount CLONE
copy >nil: v40:src/workbench/c/copy/copy.ld.strip newdisk/c/Copy CLONE
copy >nil: v42:src/workbench/c/list/list.ld.strip newdisk/c/List CLONE
copy >nil: v42:src/workbench/c/protect/protect.ld.strip newdisk/c/Protect CLONE
copy >nil: v40:src/workbench/c/setpatch/setpatch.ld newdisk/c/SetPatch CLONE
copy >nil: v37:src/workbench/c/setpatch/setpatch.ld newdisk/c/SetPatch.V37 CLONE
copy >nil: src/c/owner/owner newdisk/c/Owner
copy >nil: src/c/group/group newdisk/c/Group
copy >nil: catbox:Amiga/Inhousetools/report newdisk/c/Report NOPRO

; L: Replacements
echo "L: Replacements . . ."
copy >nil: V39:src/workbench/l/port-handler/port-handler.ld.strip newdisk/l/port-handler CLONE

; V38 for V37 goodies
echo "V38 stuff that V37 doesn't have"
copy >nil: V38:disk/extras/prefs/printer newdisk/prefs/Printer CLONE
copy >nil: V38:disk/extras/prefs/Printer.info newdisk/prefs/Printer.info CLONE
copy >nil: V38:disk/workbench/devs/printer.device newdisk/devs/printer.device CLONE

; Include files
echo "Include files . . ."
copy >nil: include newdisk/Developer/include ALL CLONE

; LIB files
echo "lib files . . ."
copy >nil: lib newdisk/developer/lib ALL CLONE

; Documentation
echo "Autodocs . . ."
copy >nil: doc/#? newdisk/Developer/doc ALL CLONE
copy >nil: txt/changes newdisk/Changes CLONE

echo "dev overview . . ."
copy >nil: txt/envoy_overview/DEVOVERVIEW.TXT "newdisk/Developer/doc/Project Overview"
copy >nil: txt/concepts "newdisk/Developer/doc/Valuable Concepts"
;copy >nil: txt/ReadMe.BetaDisk newdisk/Developer/doc/ReadMe.BetaDisk
copy >nil: txt/Legal.README "newdisk/Legal.README"
copy >nil: txt/using.efs "newdisk/Developer/doc/Using EFS"
copy >nil: txt/ReadMe "newdisk/ReadMe"

; Examples
echo "Example Code . . ."
copy >nil: disk_examples newdisk/Developer/examples ALL CLONE

; dev tools
echo "developer tools . . ."
;copy >nil: src/tools/

; FD files
echo "FD files . . ."
copy >nil: FD newdisk/Developer/FD ALL CLONE

; icons
echo "Icons . . ."
copy >nil: icons newdisk ALL CLONE

protect newdisk/#? +rwd ALL QUIET

; non-dev disk
echo "Making subset of dev disk for releases . . ."

if EXISTS ReleaseDisk
    delete ReleaseDisk ALL QUIET FORCE >nil:
    delete ReleaseDisk >nil:
ENDIF

makedir ReleaseDisk >nil:
copy NewDisk ReleaseDisk ALL >nil:
delete >nil: releasedisk/Changes
delete >nil: ReleaseDisk/Developer ALL QUIET FORCE

echo "(This process keeps getting longer to pacify the locals.  Patience.)"
echo "Nuking SoftServe's archive . . ."
; because some moron might've rebooted while updating, and never touched SoftServe again,
; there're potential locks on the directory, keeping me from nuking any of them.
; therefore, I have to rename the directory, try to delete what I can, and
; leave the rest until SoftServe is rebooted.
if EXISTS SoftServe:Public/NewEnvoy
    envoy:t/unique >env:TimeNumber
    echo >t:ex "Failat 100"
    echo >>t:ex "rename SoftServe:Public/NewEnvoy SoftServe:public/OldEnvoy$TimeNumber"
    echo >>t:ex "delete SoftServe:public/OldEnvoy$TimeNumber all quiet"
    echo >>t:ex "Failat 10"
    execute t:ex
endif
; now make newdisk again, and copy stuff to it
makedir SoftServe:Public/NewEnvoy >nil:
echo "Doing a bulk copy to SoftServe . . ."
copy Envoy:NewDisk SoftServe:Public/NewEnvoy ALL CLONE >nil:
echo "Making sure all protection bits are set correctly on SoftServe: . . ."
protect SoftServe:Public/NewEnvoy +rwd ALL >nil:

cd bsolddir:
assign bsolddir: REMOVE


