Diff

Differences From Artifact [9efdfb74a1]:

To Artifact [b037ed5b3c]:


   191    191   
   192    192   	# Intall VFS onto kit
   193    193   	## Determine if we have a Tclkit to do this work
   194    194   	TCLKIT="${TCLKIT:-tclkit}"
   195    195   	if echo 'exit 0' | "${TCLKIT}" >/dev/null 2>/dev/null; then
   196    196   		## Install using existing Tclkit
   197    197   		### Call installer
   198         -		echo "Running: \"${TCLKIT}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\""
   199         -		"${TCLKIT}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" || exit 1
          198  +		echo "Running: \"${TCLKIT}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
          199  +		"${TCLKIT}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
   200    200   	else
   201         -		if [ ! -f ./kit.exe ]; then
   202         -			if echo 'exit 0' | ./kit >/dev/null 2>/dev/null; then
   203         -				## Bootstrap (cannot cross-compile)
   204         -				### Call installer
   205         -				cp kit runkit
   206         -				echo "set argv [list {${KITTARGET_NAME}} starpack.vfs {${ENABLECOMPRESSION}}]" > setup.tcl
   207         -				echo 'if {[catch { clock seconds }]} { proc clock args { return 0 } }' >> setup.tcl
   208         -				echo 'source installvfs.tcl' >> setup.tcl
          201  +		if echo 'exit 0' | ./kit >/dev/null 2>/dev/null; then
          202  +			## Bootstrap (cannot cross-compile)
          203  +			### Call installer
          204  +			echo "set argv [list {${KITTARGET_NAME}} starpack.vfs {${ENABLECOMPRESSION}} {${KITTARGET_NAME}.new}]" > setup.tcl
          205  +			echo 'if {[catch { clock seconds }]} { proc clock args { return 0 } }' >> setup.tcl
          206  +			echo 'source installvfs.tcl' >> setup.tcl
   209    207   
   210         -				echo 'Running: echo | ./runkit setup.tcl'
   211         -				echo | ./runkit setup.tcl || exit 1
   212         -			else
   213         -				## Install using Tclsh, which may work if we're not using Metakit
   214         -				### Call installer
   215         -				echo "Running: \"${TCLSH_NATIVE}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\""
   216         -				"${TCLSH_NATIVE}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" || exit 1
   217         -			fi
          208  +			echo 'Running: echo | ./kit setup.tcl'
          209  +			echo | ./kit setup.tcl || exit 1
   218    210   		else
   219    211   			## Install using Tclsh, which may work if we're not using Metakit
   220    212   			### Call installer
   221         -			echo "Running: \"${TCLSH_NATIVE}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\""
   222         -			"${TCLSH_NATIVE}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" || exit 1
          213  +			echo "Running: \"${TCLSH_NATIVE}\" installvfs.tcl \"${KITTARGET_NAME}\" starpack.vfs \"${ENABLECOMPRESSION}\" \"${KITTARGET_NAME}.new\""
          214  +			"${TCLSH_NATIVE}" installvfs.tcl "${KITTARGET_NAME}" starpack.vfs "${ENABLECOMPRESSION}" "${KITTARGET_NAME}.new" || exit 1
   223    215   		fi
   224    216   	fi
          217  +
          218  +	cat "${KITTARGET_NAME}.new" > "${KITTARGET_NAME}" || exit 1
          219  +	rm -f "${KITTARGET_NAME}.new"
   225    220   
   226    221   	# Cleanup
   227    222   	if [ "${KITTARGET}" = "kitdll" ]; then
   228    223   		## Remove built interpreters if we are building KitDLL --
   229    224   		## they're just tiny stubs anyway
   230         -		rm -f kit runkit
          225  +		rm -f kit
   231    226   	fi
   232    227   
   233    228   	exit 0
   234    229   ) || exit 1
   235    230   
   236    231   exit 0