#
#
# CopyAll {Src}  {Dest}
#
# Copies the object files to a disk image.
#
#
##########################################################################

#
# Find out where this script is running from
# This must be first in the file.
#
set myparent `files -f {Command}`
(evaluate "{myparent}" =~ /(([:]*:)+)1[:]*/ ) > Dev:Null
set myparent "{1}"
IF "{myparent}" == ""
  echo "*** ERROR:  Cannot determine script home directory."
  exit
END

unset exit

# Save the current directory
Set ThisDir `Directory`

########################################
#
# Set the source
#
########################################
IF "{1}" == ""
	set Src "bugs:GS.OS:SystemDisk:"
ELSE
	# First we make sure the directory name ends in a colon.
	IF "{1}" !~ /[:]/
		set 1 {1}:
	END
	SET Src {1}
END


########################################
#
# Set the dest
#
########################################
IF "{2}" == ""
	set Src "bugs:GS.OS:SystemDisk:"
ELSE
	# First we make sure the directory name ends in a colon.
	IF "{2}" !~ /[:]/
		set 2 "{2}":
	END
	SET Src "{2}"
END


Directory {MyParent}

FoldersOnDiskImage "{2}"
GSOSToDiskImage {1}gs.os:systemdisk "{2}" {3}
ToolboxToDiskImage {1}gstoolbox "{2}" {3}
TBoxMiscToDiskImage {1}toolboxmisc "{2}" {3}
a.u.g.ToDiskImage {1}a.u.g. "{2}" {3}
ONEToDiskImage {1}sd.odds.n.ends "{2}" {3}
FontsToDiskImage {1}Fonts "{2}" {3}
synthLABToDiskImage "{1}"synthLab: "{2}" {3}

begin   
	setprivilege -r -d O -f O -m O "{2}"
end     Dev:Null

Directory {ThisDir}

set exit 1