Diff

Differences From Artifact [a0fc7f495f]:

To Artifact [d77e5eb40c]:


61
62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88



89
90
91
92
93
94
95
96

97
98
99
100

101
102
103
104
105
106
107
61
62
63
64
65
66
67

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85



86
87
88
89
90
91
92
93
94
95

96
97
98
99

100
101
102
103
104
105
106
107







-
+

















-
-
-
+
+
+







-
+



-
+







			workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
			rm -rf "${workdir}"

			mkdir "${workdir}" || exit 1
			cd "${workdir}" || exit 1

			# Handle Tcl first, since it will be used to base other packages on
			wget -O "tmp-tcl.tar.gz" "http://core.tcl.tk/tcl/tarball/tcl-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f 'tmp-tcl.tar.gz'
			download "http://core.tcl.tk/tcl/tarball/tcl-fossil.tar.gz?uuid=${FOSSILTAG}" "tmp-tcl.tar.gz" - || rm -f 'tmp-tcl.tar.gz'
			gzip -dc 'tmp-tcl.tar.gz' | tar -xf -
			mv "tcl-fossil" "tcl${TCLVERS}"

			# Determine date of this Tcl release and use that date for all other dependent packages
			## Unless the release we are talking about is "trunk", in which case we use that everywhere
			if [ "${FOSSILTAG}" = "trunk" ]; then
				FOSSILDATE="${FOSSILTAG}"
			else
				FOSSILDATE="$(echo 'cd "tcl'"${TCLVERS}"'"; set file [lindex [glob *] 0]; file stat $file finfo; set date $finfo(mtime); set date [expr {$date + 1}]; puts [clock format $date -format {%Y-%m-%dT%H:%M:%S}]' | TZ='UTC' "${TCLSH_NATIVE}")"
			fi

			## If we are unable to determine the modification date, fall-back to the tag and hope for the best
			if [ -z "${FOSSILDATE}" ]; then
				FOSSILDATE="${FOSSILTAG}"
			fi

			# Handle other packages
			wget -O "tmp-itcl.tar.gz" "http://core.tcl.tk/itcl/tarball/itcl-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f 'tmp-itcl.tar.gz'
			wget -O "tmp-thread.tar.gz" "http://core.tcl.tk/thread/tarball/thread-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f "tmp-thread.tar.gz"
			wget -O "tmp-tclconfig.tar.gz" "http://core.tcl.tk/tclconfig/tarball/tclconfig-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f "tmp-tclconfig.tar.gz"
			download "http://core.tcl.tk/itcl/tarball/itcl-fossil.tar.gz?uuid=${FOSSILDATE}" "tmp-itcl.tar.gz" - || rm -f 'tmp-itcl.tar.gz'
			download "http://core.tcl.tk/thread/tarball/thread-fossil.tar.gz?uuid=${FOSSILDATE}" "tmp-thread.tar.gz" - || rm -f "tmp-thread.tar.gz"
			download "http://core.tcl.tk/tclconfig/tarball/tclconfig-fossil.tar.gz?uuid=${FOSSILDATE}" "tmp-tclconfig.tar.gz" - || rm -f "tmp-tclconfig.tar.gz"
			if [ "${FOSSILDATE}" = "trunk" ] || [ "$(echo "${FOSSILDATE}" | cut -f 1 -d '-')" -ge '2012' ]; then
				_USE_TDBC='1'
				_USE_SQLITE='1'
				SQLITEVERS='3071401'
			fi

			if [ "${_USE_TDBC}" = '1' ]; then
				wget -O "tmp-tdbc.tar.gz" "http://core.tcl.tk/tdbc/tarball/tdbc-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f "tmp-tdbc.tar.gz"
				download "http://core.tcl.tk/tdbc/tarball/tdbc-fossil.tar.gz?uuid=${FOSSILDATE}" "tmp-tdbc.tar.gz" - || rm -f "tmp-tdbc.tar.gz"
			fi

			if [ "${_USE_SQLITE}" = '1' ]; then
				wget -O "tmp-sqlite3.tar.gz" "http://www.sqlite.org/sqlite-autoconf-${SQLITEVERS}.tar.gz" || rm -f "tmp-sqlite3.tar.gz"
				download "http://www.sqlite.org/sqlite-autoconf-${SQLITEVERS}.tar.gz" "tmp-sqlite3.tar.gz" - || rm -f "tmp-sqlite3.tar.gz"
			fi

			gzip -dc "tmp-itcl.tar.gz" | tar -xf -
			gzip -dc "tmp-thread.tar.gz" | tar -xf -
			gzip -dc "tmp-tclconfig.tar.gz" | tar -xf -

			mkdir -p "tcl${TCLVERS}/pkgs/" >/dev/null 2>/dev/null
147
148
149
150
151
152
153
154
155

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
147
148
149
150
151
152
153


154
155




156
157
158
159

160
161
162
163
164
165
166







-
-
+

-
-
-
-




-








			cd ..

			rm -rf "${workdir}"
		) || exit 1
	else
		if [ ! -d 'buildsrc' ]; then
			rm -f "${SRC}.tmp"
			wget -O "${SRC}.tmp" "${SRCURL}" || (
			download "${SRCURL}" "${SRC}" - || (
				echo '  Unable to download source code for Tcl.' >&4
				echo "  Attempted to run:  wget -O \"${SRC}.tmp\" \"${SRCURL}\"" >&4
				echo "  Got:"
				wget -O "${SRC}.tmp" "${SRCURL}" 2>&1 | sed 's@^@    @' >&4

				echo '  Aborting Tcl -- further packages will likely also fail.' >&4

				exit 1
			) || exit 1
			mv "${SRC}.tmp" "${SRC}"
		fi
	fi
fi

(
	cd 'build' || exit 1