Diff

Differences From Artifact [ad31dc7738]:

To Artifact [1edd04d78d]:


1
2
3
4

5
6
7
8
9
10
11
#! /usr/bin/env tclsh

set queue "/home/rkeene/devel/kitcreator/build/web/queue"
set outdir "/web/customers/kitcreator.rkeene.org/kits"


if {![file exists "${queue}.old"]} {
	if {![file exists $queue]} {
		exit 0
	}

	file rename "$queue" "${queue}.old"




>







1
2
3
4
5
6
7
8
9
10
11
12
#! /usr/bin/env tclsh

set queue "/home/rkeene/devel/kitcreator/build/web/queue"
set outdir "/web/customers/kitcreator.rkeene.org/kits"
set builddir "/tmp/kitcreator-web/builds"

if {![file exists "${queue}.old"]} {
	if {![file exists $queue]} {
		exit 0
	}

	file rename "$queue" "${queue}.old"
35
36
37
38
39
40
41
42
43

44
45
46



47
48
49
50
51


52
53
54



55
56
57
58
59
60
61
	}

	# Skip if build failed
	if {[file exists $outfile.buildfail]} {
		continue
	}

	set workdir [file join $outdir $buildinfo(key) build]
	file delete -force $workdir

	file mkdir $workdir
	cd $workdir




	set fd [open ../buildinfo w]
	puts $fd [array get buildinfo]
	close $fd

	set tarball kitcreator-${buildinfo(kitcreator_version)}.tar.gz


	exec wget -q -O $tarball http://kitcreator.rkeene.org/fossil/tarball/${tarball}?uuid=${buildinfo(kitcreator_version)}
	exec gzip -dc $tarball | tar -xf -
	cd kitcreator-${buildinfo(kitcreator_version)}




	set script "./build/make-kit-${buildinfo(platform)}"
	set args [list]

	set ::env(KITCREATOR_PKGS) " [join $buildinfo(packages) " "] "

	foreach {option value} $buildinfo(options) {







|
|
>



>
>
>
|




>
>
|
|
|
>
>
>







36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
	}

	# Skip if build failed
	if {[file exists $outfile.buildfail]} {
		continue
	}

	# Set the build directory
	file delete -force -- $builddir
	set workdir [file join $builddir $buildinfo(key) build]
	file mkdir $workdir
	cd $workdir

	# Find place to store build info
	set keydir [file join $outdir $buildinfo(key)]
	file mkdir $keydir
	set fd [open [file join $keydir buildinfo] w]
	puts $fd [array get buildinfo]
	close $fd

	set tarball kitcreator-${buildinfo(kitcreator_version)}.tar.gz

	if {[catch {
		exec wget -q -O $tarball http://kitcreator.rkeene.org/fossil/tarball/${tarball}?uuid=${buildinfo(kitcreator_version)}
		exec gzip -dc $tarball | tar -xf -
		cd kitcreator-${buildinfo(kitcreator_version)}
	}]} {
		continue
	}

	set script "./build/make-kit-${buildinfo(platform)}"
	set args [list]

	set ::env(KITCREATOR_PKGS) " [join $buildinfo(packages) " "] "

	foreach {option value} $buildinfo(options) {
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
					lappend args "--enable-symbols"
					set ::env(STRIP) true
				}
			}
			"storage" {
				lappend args "--enable-kit-storage=$value"
			}











			"staticmk4" {


			}

			"statictk" {
			}
		}
	}

	catch {
		exec ./build/pre.sh
	}

	catch {
		file delete "${outfile}.log"
	}

	catch {
		set cmd [list $script $buildinfo(tcl_version) {*}$args]
		set fd [open "${outfile}.log" w+]
		puts $fd "Running: export KITCREATOR_PKGS=\"$::env(KITCREATOR_PKGS)\""


		if {[info exists ::env(STRIP)]} {
			puts $fd "Running: export STRIP=\"$::env(STRIP)\""

		}

		puts $fd "Running: $cmd"
		close $fd
	}

	catch {
		exec {*}$cmd >> "${outfile}.log" 2>@1
	}

	catch {
		exec grep ^ {*}[glob */build.log] >> "${outfile}.log"
	}

	foreach file [list tclkit-$buildinfo(tcl_version) {*}[glob -nocomplain libtclkit*]] {
		switch -glob -- $file {
			"*.dylib" - "*.so" - "*.sl" - "*.dll" { }
			"tclkit-*" {}
			default {







>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
>
|

















>
|
|
>











|







87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
					lappend args "--enable-symbols"
					set ::env(STRIP) true
				}
			}
			"storage" {
				lappend args "--enable-kit-storage=$value"
			}
			"dynamictk" {
				if {[lsearch -exact $buildinfo(packages) "tk"] != -1} {
					set ::env(STATICTK) -1
				}
			}
			"minbuild" {
				if {$value} {
					set ::env(KITCREATOR_MINENCODINGS) 1
					set ::env(KITCREATOR_MINBUILD) 1
				}
			}
			"staticlibssl" {
				if {$value} {
					set ::env(KC_TLS_LINKSSLSTATIC) 1
				}
			}
			"staticmk4" {
			}
		}
	}

	catch {
		exec ./build/pre.sh
	}

	catch {
		file delete "${outfile}.log"
	}

	catch {
		set cmd [list $script $buildinfo(tcl_version) {*}$args]
		set fd [open "${outfile}.log" w+]
		puts $fd "Running: export KITCREATOR_PKGS=\"$::env(KITCREATOR_PKGS)\""

		foreach variable [list STRIP STATICTK KITCREATOR_MINENCODINGS KITCREATOR_MINBUILD KC_TLS_LINKSSLSTATIC] {
			if {[info exists ::env($variable)]} {
				puts $fd "Running: export $variable=\"$::env($variable)\""
			}
		}

		puts $fd "Running: $cmd"
		close $fd
	}

	catch {
		exec {*}$cmd >> "${outfile}.log" 2>@1
	}

	catch {
		exec grep ^ {*}[lsort -dictionary [glob */build.log]] >> "${outfile}.log"
	}

	foreach file [list tclkit-$buildinfo(tcl_version) {*}[glob -nocomplain libtclkit*]] {
		switch -glob -- $file {
			"*.dylib" - "*.so" - "*.sl" - "*.dll" { }
			"tclkit-*" {}
			default {