Fossil SCM

Merge the latest trunk changes into the symlinks branch.

drh 2011-08-26 14:59 symlinks merge
Commit 24c16584cc6825e3f4c40c7b098d70272276c963
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -1,11 +1,11 @@
11
#!/bin/sh
22
# Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/
33
# All rights reserved
44
# vim:se syntax=tcl:
55
# \
6
-dir=`dirname "$0"`; exec `"$dir/find-tclsh" || echo false` "$0" "$@"
6
+dir=`dirname "$0"`; exec "`$dir/find-tclsh`" "$0" "$@"
77
88
set autosetup(version) 0.6.2
99
1010
# Can be set to 1 to debug early-init problems
1111
set autosetup(debug) 0
@@ -182,11 +182,11 @@
182182
183183
# @opt-bool option ...
184184
#
185185
# Check each of the named, boolean options and return 1 if any of them have
186186
# been set by the user.
187
-#
187
+#
188188
proc opt-bool {args} {
189189
option-check-names {*}$args
190190
opt_bool ::useropts {*}$args
191191
}
192192
@@ -198,11 +198,11 @@
198198
# If only a single value is required, use something like:
199199
#
200200
## lindex [opt-val $names] end
201201
#
202202
# If no options were set, $default is returned (exactly, not as a list).
203
-#
203
+#
204204
proc opt-val {names {default ""}} {
205205
option-check-names {*}$names
206206
join [opt_val ::useropts $names $default]
207207
}
208208
@@ -396,11 +396,11 @@
396396
# These options are not displayed with --help and can be useful for internal options or as aliases.
397397
#
398398
# For example, --disable-lfs is an alias for --disable=largefile:
399399
#
400400
## lfs=1 largefile=1 => "Disable large file support"
401
-#
401
+#
402402
proc options {optlist} {
403403
# Allow options as a list or args
404404
options-add $optlist "Local Options:"
405405
406406
if {$::autosetup(showhelp)} {
@@ -434,11 +434,11 @@
434434
return $alias
435435
}
436436
}
437437
438438
# @define name ?value=1?
439
-#
439
+#
440440
# Defines the named variable to the given value.
441441
# These (name, value) pairs represent the results of the configuration check
442442
# and are available to be checked, modified and substituted.
443443
#
444444
proc define {name {value 1}} {
@@ -564,10 +564,40 @@
564564
foreach arg $argv {
565565
lappend args [quote-if-needed $arg]
566566
}
567567
join $args
568568
}
569
+
570
+# @suffix suf list
571
+#
572
+# Takes a list and returns a new list with $suf appended
573
+# to each element
574
+#
575
+## suffix .c {a b c} => {a.c b.c c.c}
576
+#
577
+proc suffix {suf list} {
578
+ set result {}
579
+ foreach p $list {
580
+ lappend result $p$suf
581
+ }
582
+ return $result
583
+}
584
+
585
+# @prefix pre list
586
+#
587
+# Takes a list and returns a new list with $pre prepended
588
+# to each element
589
+#
590
+## prefix jim- {a.c b.c} => {jim-a.c jim-b.c}
591
+#
592
+proc prefix {pre list} {
593
+ set result {}
594
+ foreach p $list {
595
+ lappend result $pre$p
596
+ }
597
+ return $result
598
+}
569599
570600
# @find-executable name
571601
#
572602
# Searches the path for an executable with the given name.
573603
# Note that the name may include some parameters, e.g. "cc -mbig-endian",
@@ -999,21 +1029,24 @@
9991029
10001030
# Simple getopt module
10011031
10021032
# Parse everything out of the argv list which looks like an option
10031033
# Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1
1034
+# Everything which doesn't look like an option, or is after --, is left unchanged
10041035
proc getopt {argvname} {
10051036
upvar $argvname argv
1037
+ set nargv {}
10061038
10071039
for {set i 0} {$i < [llength $argv]} {incr i} {
10081040
set arg [lindex $argv $i]
10091041
10101042
#dputs arg=$arg
10111043
10121044
if {$arg eq "--"} {
10131045
# End of options
10141046
incr i
1047
+ lappend nargv {*}[lrange $argv $i end]
10151048
break
10161049
}
10171050
10181051
if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} {
10191052
lappend opts($name) $value
@@ -1023,18 +1056,18 @@
10231056
} else {
10241057
set value 1
10251058
}
10261059
lappend opts($name) $value
10271060
} else {
1028
- break
1061
+ lappend nargv $arg
10291062
}
10301063
}
10311064
1032
- #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]"
1065
+ #puts "getopt: argv=[join $argv] => [join $nargv]"
10331066
#parray opts
10341067
1035
- set argv [lrange $argv $i end]
1068
+ set argv $nargv
10361069
10371070
return [array get opts]
10381071
}
10391072
10401073
proc opt_val {optarrayname options {default {}}} {
@@ -1264,11 +1297,11 @@
12641297
writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n"
12651298
} else {
12661299
writefile configure \
12671300
{#!/bin/sh
12681301
dir="`dirname "$0"`/autosetup"
1269
-WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
1302
+WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
12701303
}
12711304
}
12721305
catch {exec chmod 755 configure}
12731306
}
12741307
if {![file exists auto.def]} {
@@ -1279,11 +1312,11 @@
12791312
12801313
# Add any user options here
12811314
options {
12821315
}
12831316
1284
-make-autoconf-h config.h
1317
+make-config-header config.h
12851318
make-template Makefile.in
12861319
}
12871320
}
12881321
if {![file exists Makefile.in]} {
12891322
puts "Note: I don't see Makefile.in. You will probably need to create one."
@@ -1511,11 +1544,11 @@
15111544
string map {\\ /} [env $name {*}$args]
15121545
}
15131546
# Jim uses system() for exec under mingw, so
15141547
# we need to fetch the output ourselves
15151548
proc exec-with-stderr {args} {
1516
- set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp
1549
+ set tmpfile auto[format %04x [rand 10000]].tmp
15171550
set rc [catch [list exec {*}$args >$tmpfile 2>&1] result]
15181551
set result [readfile $tmpfile]
15191552
file delete $tmpfile
15201553
return -code $rc $result
15211554
}
15221555
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -1,11 +1,11 @@
1 #!/bin/sh
2 # Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/
3 # All rights reserved
4 # vim:se syntax=tcl:
5 # \
6 dir=`dirname "$0"`; exec `"$dir/find-tclsh" || echo false` "$0" "$@"
7
8 set autosetup(version) 0.6.2
9
10 # Can be set to 1 to debug early-init problems
11 set autosetup(debug) 0
@@ -182,11 +182,11 @@
182
183 # @opt-bool option ...
184 #
185 # Check each of the named, boolean options and return 1 if any of them have
186 # been set by the user.
187 #
188 proc opt-bool {args} {
189 option-check-names {*}$args
190 opt_bool ::useropts {*}$args
191 }
192
@@ -198,11 +198,11 @@
198 # If only a single value is required, use something like:
199 #
200 ## lindex [opt-val $names] end
201 #
202 # If no options were set, $default is returned (exactly, not as a list).
203 #
204 proc opt-val {names {default ""}} {
205 option-check-names {*}$names
206 join [opt_val ::useropts $names $default]
207 }
208
@@ -396,11 +396,11 @@
396 # These options are not displayed with --help and can be useful for internal options or as aliases.
397 #
398 # For example, --disable-lfs is an alias for --disable=largefile:
399 #
400 ## lfs=1 largefile=1 => "Disable large file support"
401 #
402 proc options {optlist} {
403 # Allow options as a list or args
404 options-add $optlist "Local Options:"
405
406 if {$::autosetup(showhelp)} {
@@ -434,11 +434,11 @@
434 return $alias
435 }
436 }
437
438 # @define name ?value=1?
439 #
440 # Defines the named variable to the given value.
441 # These (name, value) pairs represent the results of the configuration check
442 # and are available to be checked, modified and substituted.
443 #
444 proc define {name {value 1}} {
@@ -564,10 +564,40 @@
564 foreach arg $argv {
565 lappend args [quote-if-needed $arg]
566 }
567 join $args
568 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
570 # @find-executable name
571 #
572 # Searches the path for an executable with the given name.
573 # Note that the name may include some parameters, e.g. "cc -mbig-endian",
@@ -999,21 +1029,24 @@
999
1000 # Simple getopt module
1001
1002 # Parse everything out of the argv list which looks like an option
1003 # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1
 
1004 proc getopt {argvname} {
1005 upvar $argvname argv
 
1006
1007 for {set i 0} {$i < [llength $argv]} {incr i} {
1008 set arg [lindex $argv $i]
1009
1010 #dputs arg=$arg
1011
1012 if {$arg eq "--"} {
1013 # End of options
1014 incr i
 
1015 break
1016 }
1017
1018 if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} {
1019 lappend opts($name) $value
@@ -1023,18 +1056,18 @@
1023 } else {
1024 set value 1
1025 }
1026 lappend opts($name) $value
1027 } else {
1028 break
1029 }
1030 }
1031
1032 #puts "getopt: argv=[join $argv] => [join [lrange $argv $i end]]"
1033 #parray opts
1034
1035 set argv [lrange $argv $i end]
1036
1037 return [array get opts]
1038 }
1039
1040 proc opt_val {optarrayname options {default {}}} {
@@ -1264,11 +1297,11 @@
1264 writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n"
1265 } else {
1266 writefile configure \
1267 {#!/bin/sh
1268 dir="`dirname "$0"`/autosetup"
1269 WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
1270 }
1271 }
1272 catch {exec chmod 755 configure}
1273 }
1274 if {![file exists auto.def]} {
@@ -1279,11 +1312,11 @@
1279
1280 # Add any user options here
1281 options {
1282 }
1283
1284 make-autoconf-h config.h
1285 make-template Makefile.in
1286 }
1287 }
1288 if {![file exists Makefile.in]} {
1289 puts "Note: I don't see Makefile.in. You will probably need to create one."
@@ -1511,11 +1544,11 @@
1511 string map {\\ /} [env $name {*}$args]
1512 }
1513 # Jim uses system() for exec under mingw, so
1514 # we need to fetch the output ourselves
1515 proc exec-with-stderr {args} {
1516 set tmpfile /tmp/autosetup.[format %05x [rand 10000]].tmp
1517 set rc [catch [list exec {*}$args >$tmpfile 2>&1] result]
1518 set result [readfile $tmpfile]
1519 file delete $tmpfile
1520 return -code $rc $result
1521 }
1522
--- autosetup/autosetup
+++ autosetup/autosetup
@@ -1,11 +1,11 @@
1 #!/bin/sh
2 # Copyright (c) 2006-2011 WorkWare Systems http://www.workware.net.au/
3 # All rights reserved
4 # vim:se syntax=tcl:
5 # \
6 dir=`dirname "$0"`; exec "`$dir/find-tclsh`" "$0" "$@"
7
8 set autosetup(version) 0.6.2
9
10 # Can be set to 1 to debug early-init problems
11 set autosetup(debug) 0
@@ -182,11 +182,11 @@
182
183 # @opt-bool option ...
184 #
185 # Check each of the named, boolean options and return 1 if any of them have
186 # been set by the user.
187 #
188 proc opt-bool {args} {
189 option-check-names {*}$args
190 opt_bool ::useropts {*}$args
191 }
192
@@ -198,11 +198,11 @@
198 # If only a single value is required, use something like:
199 #
200 ## lindex [opt-val $names] end
201 #
202 # If no options were set, $default is returned (exactly, not as a list).
203 #
204 proc opt-val {names {default ""}} {
205 option-check-names {*}$names
206 join [opt_val ::useropts $names $default]
207 }
208
@@ -396,11 +396,11 @@
396 # These options are not displayed with --help and can be useful for internal options or as aliases.
397 #
398 # For example, --disable-lfs is an alias for --disable=largefile:
399 #
400 ## lfs=1 largefile=1 => "Disable large file support"
401 #
402 proc options {optlist} {
403 # Allow options as a list or args
404 options-add $optlist "Local Options:"
405
406 if {$::autosetup(showhelp)} {
@@ -434,11 +434,11 @@
434 return $alias
435 }
436 }
437
438 # @define name ?value=1?
439 #
440 # Defines the named variable to the given value.
441 # These (name, value) pairs represent the results of the configuration check
442 # and are available to be checked, modified and substituted.
443 #
444 proc define {name {value 1}} {
@@ -564,10 +564,40 @@
564 foreach arg $argv {
565 lappend args [quote-if-needed $arg]
566 }
567 join $args
568 }
569
570 # @suffix suf list
571 #
572 # Takes a list and returns a new list with $suf appended
573 # to each element
574 #
575 ## suffix .c {a b c} => {a.c b.c c.c}
576 #
577 proc suffix {suf list} {
578 set result {}
579 foreach p $list {
580 lappend result $p$suf
581 }
582 return $result
583 }
584
585 # @prefix pre list
586 #
587 # Takes a list and returns a new list with $pre prepended
588 # to each element
589 #
590 ## prefix jim- {a.c b.c} => {jim-a.c jim-b.c}
591 #
592 proc prefix {pre list} {
593 set result {}
594 foreach p $list {
595 lappend result $pre$p
596 }
597 return $result
598 }
599
600 # @find-executable name
601 #
602 # Searches the path for an executable with the given name.
603 # Note that the name may include some parameters, e.g. "cc -mbig-endian",
@@ -999,21 +1029,24 @@
1029
1030 # Simple getopt module
1031
1032 # Parse everything out of the argv list which looks like an option
1033 # Knows about --enable-thing and --disable-thing as alternatives for --thing=0 or --thing=1
1034 # Everything which doesn't look like an option, or is after --, is left unchanged
1035 proc getopt {argvname} {
1036 upvar $argvname argv
1037 set nargv {}
1038
1039 for {set i 0} {$i < [llength $argv]} {incr i} {
1040 set arg [lindex $argv $i]
1041
1042 #dputs arg=$arg
1043
1044 if {$arg eq "--"} {
1045 # End of options
1046 incr i
1047 lappend nargv {*}[lrange $argv $i end]
1048 break
1049 }
1050
1051 if {[regexp {^--([^=][^=]+)=(.*)$} $arg -> name value]} {
1052 lappend opts($name) $value
@@ -1023,18 +1056,18 @@
1056 } else {
1057 set value 1
1058 }
1059 lappend opts($name) $value
1060 } else {
1061 lappend nargv $arg
1062 }
1063 }
1064
1065 #puts "getopt: argv=[join $argv] => [join $nargv]"
1066 #parray opts
1067
1068 set argv $nargv
1069
1070 return [array get opts]
1071 }
1072
1073 proc opt_val {optarrayname options {default {}}} {
@@ -1264,11 +1297,11 @@
1297 writefile configure "#!/bin/sh\nWRAPPER=\"\$0\" exec $::autosetup(dir)/autosetup \"\$@\"\n"
1298 } else {
1299 writefile configure \
1300 {#!/bin/sh
1301 dir="`dirname "$0"`/autosetup"
1302 WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
1303 }
1304 }
1305 catch {exec chmod 755 configure}
1306 }
1307 if {![file exists auto.def]} {
@@ -1279,11 +1312,11 @@
1312
1313 # Add any user options here
1314 options {
1315 }
1316
1317 make-config-header config.h
1318 make-template Makefile.in
1319 }
1320 }
1321 if {![file exists Makefile.in]} {
1322 puts "Note: I don't see Makefile.in. You will probably need to create one."
@@ -1511,11 +1544,11 @@
1544 string map {\\ /} [env $name {*}$args]
1545 }
1546 # Jim uses system() for exec under mingw, so
1547 # we need to fetch the output ourselves
1548 proc exec-with-stderr {args} {
1549 set tmpfile auto[format %04x [rand 10000]].tmp
1550 set rc [catch [list exec {*}$args >$tmpfile 2>&1] result]
1551 set result [readfile $tmpfile]
1552 file delete $tmpfile
1553 return -code $rc $result
1554 }
1555
--- autosetup/cc-lib.tcl
+++ autosetup/cc-lib.tcl
@@ -48,21 +48,21 @@
4848
cc-check-includes sys/types.h sys/param.h
4949
set rc 0
5050
msg-checking "Checking endian..."
5151
cc-with {-includes {sys/types.h sys/param.h}} {
5252
if {[cctest -code {
53
- #if! defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
53
+ #if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
5454
#error unknown
5555
#elif BYTE_ORDER != BIG_ENDIAN
5656
#error little
5757
#endif
5858
}]} {
5959
define-feature big-endian
6060
msg-result "big"
6161
set rc 1
6262
} elseif {[cctest -code {
63
- #if! defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
63
+ #if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
6464
#error unknown
6565
#elif BYTE_ORDER != LITTLE_ENDIAN
6666
#error big
6767
#endif
6868
}]} {
6969
--- autosetup/cc-lib.tcl
+++ autosetup/cc-lib.tcl
@@ -48,21 +48,21 @@
48 cc-check-includes sys/types.h sys/param.h
49 set rc 0
50 msg-checking "Checking endian..."
51 cc-with {-includes {sys/types.h sys/param.h}} {
52 if {[cctest -code {
53 #if! defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
54 #error unknown
55 #elif BYTE_ORDER != BIG_ENDIAN
56 #error little
57 #endif
58 }]} {
59 define-feature big-endian
60 msg-result "big"
61 set rc 1
62 } elseif {[cctest -code {
63 #if! defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
64 #error unknown
65 #elif BYTE_ORDER != LITTLE_ENDIAN
66 #error big
67 #endif
68 }]} {
69
--- autosetup/cc-lib.tcl
+++ autosetup/cc-lib.tcl
@@ -48,21 +48,21 @@
48 cc-check-includes sys/types.h sys/param.h
49 set rc 0
50 msg-checking "Checking endian..."
51 cc-with {-includes {sys/types.h sys/param.h}} {
52 if {[cctest -code {
53 #if !defined(BIG_ENDIAN) || !defined(BYTE_ORDER)
54 #error unknown
55 #elif BYTE_ORDER != BIG_ENDIAN
56 #error little
57 #endif
58 }]} {
59 define-feature big-endian
60 msg-result "big"
61 set rc 1
62 } elseif {[cctest -code {
63 #if !defined(LITTLE_ENDIAN) || !defined(BYTE_ORDER)
64 #error unknown
65 #elif BYTE_ORDER != LITTLE_ENDIAN
66 #error big
67 #endif
68 }]} {
69
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -35,14 +35,29 @@
3535
}
3636
*-*-cygwin {
3737
define SH_LDFLAGS -shared
3838
define SHOBJ_LDFLAGS -shared
3939
}
40
+ *-*-solaris* {
41
+ # XXX: These haven't been fully tested.
42
+ #define SH_LINKFLAGS -Wl,-export-dynamic
43
+ define SH_CFLAGS -Kpic
44
+ define SHOBJ_CFLAGS -Kpic
45
+ define SHOBJ_LDFLAGS "-G"
46
+ }
47
+ *-*-hpux {
48
+ # XXX: These haven't been tested
49
+ define SH_LINKFLAGS -Wl,+s
50
+ define SH_CFLAGS +z
51
+ define SHOBJ_CFLAGS "+O3 +z"
52
+ define SHOBJ_LDFLAGS -b
53
+ define LD_LIBRARY_PATH SHLIB_PATH
54
+ }
4055
* {
4156
# Generic Unix settings
4257
define SH_LINKFLAGS -rdynamic
43
- define SH_CFLAGS -fPIC
58
+ define SH_CFLAGS -fpic
4459
define SH_LDFLAGS -shared
45
- define SHOBJ_CFLAGS -fPIC
60
+ define SHOBJ_CFLAGS -fpic
4661
define SHOBJ_LDFLAGS "-shared -nostartfiles"
4762
}
4863
}
4964
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -35,14 +35,29 @@
35 }
36 *-*-cygwin {
37 define SH_LDFLAGS -shared
38 define SHOBJ_LDFLAGS -shared
39 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40 * {
41 # Generic Unix settings
42 define SH_LINKFLAGS -rdynamic
43 define SH_CFLAGS -fPIC
44 define SH_LDFLAGS -shared
45 define SHOBJ_CFLAGS -fPIC
46 define SHOBJ_LDFLAGS "-shared -nostartfiles"
47 }
48 }
49
--- autosetup/cc-shared.tcl
+++ autosetup/cc-shared.tcl
@@ -35,14 +35,29 @@
35 }
36 *-*-cygwin {
37 define SH_LDFLAGS -shared
38 define SHOBJ_LDFLAGS -shared
39 }
40 *-*-solaris* {
41 # XXX: These haven't been fully tested.
42 #define SH_LINKFLAGS -Wl,-export-dynamic
43 define SH_CFLAGS -Kpic
44 define SHOBJ_CFLAGS -Kpic
45 define SHOBJ_LDFLAGS "-G"
46 }
47 *-*-hpux {
48 # XXX: These haven't been tested
49 define SH_LINKFLAGS -Wl,+s
50 define SH_CFLAGS +z
51 define SHOBJ_CFLAGS "+O3 +z"
52 define SHOBJ_LDFLAGS -b
53 define LD_LIBRARY_PATH SHLIB_PATH
54 }
55 * {
56 # Generic Unix settings
57 define SH_LINKFLAGS -rdynamic
58 define SH_CFLAGS -fpic
59 define SH_LDFLAGS -shared
60 define SHOBJ_CFLAGS -fpic
61 define SHOBJ_LDFLAGS "-shared -nostartfiles"
62 }
63 }
64
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -416,11 +416,11 @@
416416
#
417417
# Any failures are recorded in 'config.log'
418418
#
419419
proc cctest {args} {
420420
set src conftest__.c
421
- set tmp conftest__.o
421
+ set tmp conftest__
422422
423423
# Easiest way to merge in the settings
424424
cc-with $args {
425425
array set opts [cc-get-settings]
426426
}
@@ -468,10 +468,11 @@
468468
autosetup-error "cctest called with unknown language: $opts(-lang)"
469469
}
470470
}
471471
472472
if {!$opts(-link)} {
473
+ set tmp conftest__.o
473474
lappend cmdline -c
474475
}
475476
lappend cmdline {*}$opts(-cflags)
476477
477478
switch -glob -- [get-define host] {
478479
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -416,11 +416,11 @@
416 #
417 # Any failures are recorded in 'config.log'
418 #
419 proc cctest {args} {
420 set src conftest__.c
421 set tmp conftest__.o
422
423 # Easiest way to merge in the settings
424 cc-with $args {
425 array set opts [cc-get-settings]
426 }
@@ -468,10 +468,11 @@
468 autosetup-error "cctest called with unknown language: $opts(-lang)"
469 }
470 }
471
472 if {!$opts(-link)} {
 
473 lappend cmdline -c
474 }
475 lappend cmdline {*}$opts(-cflags)
476
477 switch -glob -- [get-define host] {
478
--- autosetup/cc.tcl
+++ autosetup/cc.tcl
@@ -416,11 +416,11 @@
416 #
417 # Any failures are recorded in 'config.log'
418 #
419 proc cctest {args} {
420 set src conftest__.c
421 set tmp conftest__
422
423 # Easiest way to merge in the settings
424 cc-with $args {
425 array set opts [cc-get-settings]
426 }
@@ -468,10 +468,11 @@
468 autosetup-error "cctest called with unknown language: $opts(-lang)"
469 }
470 }
471
472 if {!$opts(-link)} {
473 set tmp conftest__.o
474 lappend cmdline -c
475 }
476 lappend cmdline {*}$opts(-cflags)
477
478 switch -glob -- [get-define host] {
479
--- autosetup/system.tcl
+++ autosetup/system.tcl
@@ -6,28 +6,32 @@
66
# This module supports common system interrogation and options
77
# such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT.
88
#
99
# It also support the 'feature' naming convention, where searching
1010
# for a feature such as sys/type.h defines HAVE_SYS_TYPES_H
11
-
12
-# Note that the hidden options are supported for autoconf compatibility
13
-
11
+#
1412
module-options {
1513
host:host-alias => {a complete or partial cpu-vendor-opsys for the system where
1614
the application will run (defaults to the same value as --build)}
1715
build:build-alias => {a complete or partial cpu-vendor-opsys for the system
1816
where the application will be built (defaults to the
1917
result of running config.guess)}
2018
prefix:dir => {the target directory for the build (defaults to /usr/local)}
2119
20
+ # These (hidden) options are supported for autoconf/automake compatibility
21
+ exec-prefix:
22
+ bindir:
23
+ sbindir:
2224
includedir:
2325
mandir:
2426
infodir:
2527
libexecdir:
28
+ datadir:
29
+ libdir:
2630
sysconfdir:
31
+ sharedstatedir:
2732
localstatedir:
28
-
2933
maintainer-mode=0
3034
dependency-tracking=0
3135
}
3236
3337
# Returns 1 if exists, or 0 if not
@@ -107,10 +111,28 @@
107111
#
108112
# The special value @srcdir@ is subsituted with the relative
109113
# path to the source directory from the directory where the output
110114
# file is created. Use @top_srcdir@ for the absolute path.
111115
#
116
+# Conditional sections may be specified as follows:
117
+## @if name == value
118
+## lines
119
+## @else
120
+## lines
121
+## @endif
122
+#
123
+# Where 'name' is a defined variable name and @else is optional.
124
+# If the expression does not match, all lines through '@endif' are ignored.
125
+#
126
+# The alternative forms may also be used:
127
+## @if name
128
+## @if name != value
129
+#
130
+# Where the first form is true if the variable is defined, but not empty or 0
131
+#
132
+# Currently these expressions can't be nested.
133
+#
112134
proc make-template {template {out {}}} {
113135
set infile [file join $::autosetup(srcdir) $template]
114136
115137
if {![file exists $infile]} {
116138
user-error "Template $template is missing"
@@ -136,11 +158,43 @@
136158
137159
set mapping {}
138160
foreach {n v} [array get ::define] {
139161
lappend mapping @$n@ $v
140162
}
141
- writefile $out [string map $mapping [readfile $infile]]\n
163
+ set result {}
164
+ foreach line [split [readfile $infile] \n] {
165
+ if {[info exists cond]} {
166
+ set l [string trimright $line]
167
+ if {$l eq "@endif"} {
168
+ unset cond
169
+ continue
170
+ }
171
+ if {$l eq "@else"} {
172
+ set cond [expr {!$cond}]
173
+ continue
174
+ }
175
+ if {$cond} {
176
+ lappend result $line
177
+ }
178
+ continue
179
+ }
180
+ if {[regexp {^@if\s+(\w+)(.*)} $line -> name expression]} {
181
+ lassign $expression equal value
182
+ set varval [get-define $name ""]
183
+ if {$equal eq ""} {
184
+ set cond [expr {$varval ni {"" 0}}]
185
+ } else {
186
+ set cond [expr {$varval eq $value}]
187
+ if {$equal ne "=="} {
188
+ set cond [expr {!$cond}]
189
+ }
190
+ }
191
+ continue
192
+ }
193
+ lappend result $line
194
+ }
195
+ writefile $out [string map $mapping [join $result \n]]\n
142196
143197
msg-result "Created [relative-path $out] from [relative-path $template]"
144198
}
145199
146200
# build/host tuples and cross-compilation prefix
@@ -171,23 +225,27 @@
171225
define builddir $autosetup(builddir)
172226
define srcdir $autosetup(srcdir)
173227
# Allow this to come from the environment
174228
define top_srcdir [get-env top_srcdir [get-define srcdir]]
175229
176
-# And less common ones too
177
-define exec_prefix \${prefix}
178
-define bindir \${exec_prefix}/bin
179
-define sbindir \${exec_prefix}/sbin
180
-define libexecdir [get-env libexecdir \${exec_prefix}/libexec]
181
-define datadir \${prefix}/share
182
-define sysconfdir [get-env sysconfdir \${prefix}/etc]
183
-define sharedstatedir \${prefix}/com
184
-define localstatedir [get-env localstatedir \${prefix}/var]
185
-define libdir \${exec_prefix}/lib
186
-define infodir [get-env infodir \${prefix}/share/info]
187
-define mandir [get-env mandir \${prefix}/share/man]
188
-define includedir [get-env includdir \${prefix}/include]
230
+# autoconf supports all of these
231
+define exec_prefix [opt-val exec-prefix [get-env exec-prefix \${prefix}]]
232
+foreach {name defpath} {
233
+ bindir \${exec_prefix}/bin
234
+ sbindir \${exec_prefix}/sbin
235
+ libexecdir \${exec_prefix}/libexec
236
+ libdir \${exec_prefix}/lib
237
+ datadir \${prefix}/share
238
+ sysconfdir \${prefix}/etc
239
+ sharedstatedir \${prefix}/com
240
+ localstatedir \${prefix}/var
241
+ infodir \${prefix}/share/info
242
+ mandir \${prefix}/share/man
243
+ includedir \${prefix}/include
244
+} {
245
+ define $name [opt-val $name [get-env $name $defpath]]
246
+}
189247
190248
define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
191249
192250
# Windows vs. non-Windows
193251
switch -glob -- [get-define host] {
194252
--- autosetup/system.tcl
+++ autosetup/system.tcl
@@ -6,28 +6,32 @@
6 # This module supports common system interrogation and options
7 # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT.
8 #
9 # It also support the 'feature' naming convention, where searching
10 # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H
11
12 # Note that the hidden options are supported for autoconf compatibility
13
14 module-options {
15 host:host-alias => {a complete or partial cpu-vendor-opsys for the system where
16 the application will run (defaults to the same value as --build)}
17 build:build-alias => {a complete or partial cpu-vendor-opsys for the system
18 where the application will be built (defaults to the
19 result of running config.guess)}
20 prefix:dir => {the target directory for the build (defaults to /usr/local)}
21
 
 
 
 
22 includedir:
23 mandir:
24 infodir:
25 libexecdir:
 
 
26 sysconfdir:
 
27 localstatedir:
28
29 maintainer-mode=0
30 dependency-tracking=0
31 }
32
33 # Returns 1 if exists, or 0 if not
@@ -107,10 +111,28 @@
107 #
108 # The special value @srcdir@ is subsituted with the relative
109 # path to the source directory from the directory where the output
110 # file is created. Use @top_srcdir@ for the absolute path.
111 #
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112 proc make-template {template {out {}}} {
113 set infile [file join $::autosetup(srcdir) $template]
114
115 if {![file exists $infile]} {
116 user-error "Template $template is missing"
@@ -136,11 +158,43 @@
136
137 set mapping {}
138 foreach {n v} [array get ::define] {
139 lappend mapping @$n@ $v
140 }
141 writefile $out [string map $mapping [readfile $infile]]\n
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
143 msg-result "Created [relative-path $out] from [relative-path $template]"
144 }
145
146 # build/host tuples and cross-compilation prefix
@@ -171,23 +225,27 @@
171 define builddir $autosetup(builddir)
172 define srcdir $autosetup(srcdir)
173 # Allow this to come from the environment
174 define top_srcdir [get-env top_srcdir [get-define srcdir]]
175
176 # And less common ones too
177 define exec_prefix \${prefix}
178 define bindir \${exec_prefix}/bin
179 define sbindir \${exec_prefix}/sbin
180 define libexecdir [get-env libexecdir \${exec_prefix}/libexec]
181 define datadir \${prefix}/share
182 define sysconfdir [get-env sysconfdir \${prefix}/etc]
183 define sharedstatedir \${prefix}/com
184 define localstatedir [get-env localstatedir \${prefix}/var]
185 define libdir \${exec_prefix}/lib
186 define infodir [get-env infodir \${prefix}/share/info]
187 define mandir [get-env mandir \${prefix}/share/man]
188 define includedir [get-env includdir \${prefix}/include]
 
 
 
 
189
190 define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
191
192 # Windows vs. non-Windows
193 switch -glob -- [get-define host] {
194
--- autosetup/system.tcl
+++ autosetup/system.tcl
@@ -6,28 +6,32 @@
6 # This module supports common system interrogation and options
7 # such as --host, --build, --prefix, and setting srcdir, builddir, and EXEXT.
8 #
9 # It also support the 'feature' naming convention, where searching
10 # for a feature such as sys/type.h defines HAVE_SYS_TYPES_H
11 #
 
 
12 module-options {
13 host:host-alias => {a complete or partial cpu-vendor-opsys for the system where
14 the application will run (defaults to the same value as --build)}
15 build:build-alias => {a complete or partial cpu-vendor-opsys for the system
16 where the application will be built (defaults to the
17 result of running config.guess)}
18 prefix:dir => {the target directory for the build (defaults to /usr/local)}
19
20 # These (hidden) options are supported for autoconf/automake compatibility
21 exec-prefix:
22 bindir:
23 sbindir:
24 includedir:
25 mandir:
26 infodir:
27 libexecdir:
28 datadir:
29 libdir:
30 sysconfdir:
31 sharedstatedir:
32 localstatedir:
 
33 maintainer-mode=0
34 dependency-tracking=0
35 }
36
37 # Returns 1 if exists, or 0 if not
@@ -107,10 +111,28 @@
111 #
112 # The special value @srcdir@ is subsituted with the relative
113 # path to the source directory from the directory where the output
114 # file is created. Use @top_srcdir@ for the absolute path.
115 #
116 # Conditional sections may be specified as follows:
117 ## @if name == value
118 ## lines
119 ## @else
120 ## lines
121 ## @endif
122 #
123 # Where 'name' is a defined variable name and @else is optional.
124 # If the expression does not match, all lines through '@endif' are ignored.
125 #
126 # The alternative forms may also be used:
127 ## @if name
128 ## @if name != value
129 #
130 # Where the first form is true if the variable is defined, but not empty or 0
131 #
132 # Currently these expressions can't be nested.
133 #
134 proc make-template {template {out {}}} {
135 set infile [file join $::autosetup(srcdir) $template]
136
137 if {![file exists $infile]} {
138 user-error "Template $template is missing"
@@ -136,11 +158,43 @@
158
159 set mapping {}
160 foreach {n v} [array get ::define] {
161 lappend mapping @$n@ $v
162 }
163 set result {}
164 foreach line [split [readfile $infile] \n] {
165 if {[info exists cond]} {
166 set l [string trimright $line]
167 if {$l eq "@endif"} {
168 unset cond
169 continue
170 }
171 if {$l eq "@else"} {
172 set cond [expr {!$cond}]
173 continue
174 }
175 if {$cond} {
176 lappend result $line
177 }
178 continue
179 }
180 if {[regexp {^@if\s+(\w+)(.*)} $line -> name expression]} {
181 lassign $expression equal value
182 set varval [get-define $name ""]
183 if {$equal eq ""} {
184 set cond [expr {$varval ni {"" 0}}]
185 } else {
186 set cond [expr {$varval eq $value}]
187 if {$equal ne "=="} {
188 set cond [expr {!$cond}]
189 }
190 }
191 continue
192 }
193 lappend result $line
194 }
195 writefile $out [string map $mapping [join $result \n]]\n
196
197 msg-result "Created [relative-path $out] from [relative-path $template]"
198 }
199
200 # build/host tuples and cross-compilation prefix
@@ -171,23 +225,27 @@
225 define builddir $autosetup(builddir)
226 define srcdir $autosetup(srcdir)
227 # Allow this to come from the environment
228 define top_srcdir [get-env top_srcdir [get-define srcdir]]
229
230 # autoconf supports all of these
231 define exec_prefix [opt-val exec-prefix [get-env exec-prefix \${prefix}]]
232 foreach {name defpath} {
233 bindir \${exec_prefix}/bin
234 sbindir \${exec_prefix}/sbin
235 libexecdir \${exec_prefix}/libexec
236 libdir \${exec_prefix}/lib
237 datadir \${prefix}/share
238 sysconfdir \${prefix}/etc
239 sharedstatedir \${prefix}/com
240 localstatedir \${prefix}/var
241 infodir \${prefix}/share/info
242 mandir \${prefix}/share/man
243 includedir \${prefix}/include
244 } {
245 define $name [opt-val $name [get-env $name $defpath]]
246 }
247
248 define SHELL [get-env SHELL [find-an-executable sh bash ksh]]
249
250 # Windows vs. non-Windows
251 switch -glob -- [get-define host] {
252
+1 -1
--- configure
+++ configure
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
dir="`dirname "$0"`/autosetup"
3
-WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
3
+WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
44
--- configure
+++ configure
@@ -1,3 +1,3 @@
1 #!/bin/sh
2 dir="`dirname "$0"`/autosetup"
3 WRAPPER="$0" exec `"$dir/find-tclsh" || echo false` "$dir/autosetup" "$@"
4
--- configure
+++ configure
@@ -1,3 +1,3 @@
1 #!/bin/sh
2 dir="`dirname "$0"`/autosetup"
3 WRAPPER="$0" exec "`$dir/find-tclsh`" "$dir/autosetup" "$@"
4
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120120
** This routine is called if a blob operation fails because we
121121
** have run out of memory.
122122
*/
123123
static void blob_panic(void){
124124
static const char zErrMsg[] = "out of memory\n";
125
- write(2, zErrMsg, sizeof(zErrMsg)-1);
125
+ fputs(zErrMsg, stderr);
126126
fossil_exit(1);
127127
}
128128
129129
/*
130130
** A reallocation function that assumes that aData came from malloc().
131131
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120 ** This routine is called if a blob operation fails because we
121 ** have run out of memory.
122 */
123 static void blob_panic(void){
124 static const char zErrMsg[] = "out of memory\n";
125 write(2, zErrMsg, sizeof(zErrMsg)-1);
126 fossil_exit(1);
127 }
128
129 /*
130 ** A reallocation function that assumes that aData came from malloc().
131
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120 ** This routine is called if a blob operation fails because we
121 ** have run out of memory.
122 */
123 static void blob_panic(void){
124 static const char zErrMsg[] = "out of memory\n";
125 fputs(zErrMsg, stderr);
126 fossil_exit(1);
127 }
128
129 /*
130 ** A reallocation function that assumes that aData came from malloc().
131
+1 -1
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120120
** This routine is called if a blob operation fails because we
121121
** have run out of memory.
122122
*/
123123
static void blob_panic(void){
124124
static const char zErrMsg[] = "out of memory\n";
125
- write(2, zErrMsg, sizeof(zErrMsg)-1);
125
+ fputs(zErrMsg, stderr);
126126
fossil_exit(1);
127127
}
128128
129129
/*
130130
** A reallocation function that assumes that aData came from malloc().
131131
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120 ** This routine is called if a blob operation fails because we
121 ** have run out of memory.
122 */
123 static void blob_panic(void){
124 static const char zErrMsg[] = "out of memory\n";
125 write(2, zErrMsg, sizeof(zErrMsg)-1);
126 fossil_exit(1);
127 }
128
129 /*
130 ** A reallocation function that assumes that aData came from malloc().
131
--- src/blob.c
+++ src/blob.c
@@ -120,11 +120,11 @@
120 ** This routine is called if a blob operation fails because we
121 ** have run out of memory.
122 */
123 static void blob_panic(void){
124 static const char zErrMsg[] = "out of memory\n";
125 fputs(zErrMsg, stderr);
126 fossil_exit(1);
127 }
128
129 /*
130 ** A reallocation function that assumes that aData came from malloc().
131
+21 -3
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281281
void brlist_page(void){
282282
Stmt q;
283283
int cnt;
284284
int showClosed = P("closed")!=0;
285285
int showAll = P("all")!=0;
286
+ int colorTest = P("colortest")!=0;
286287
287288
login_check_credentials();
288289
if( !g.okRead ){ login_needed(); return; }
290
+ if( colorTest ){
291
+ showClosed = 0;
292
+ showAll = 1;
293
+ }
289294
290295
style_header(showClosed ? "Closed Branches" :
291296
showAll ? "All Branches" : "Open Branches");
292297
style_submenu_element("Timeline", "Timeline", "brtimeline");
293298
if( showClosed ){
@@ -298,10 +303,15 @@
298303
style_submenu_element("Open","Open","brlist");
299304
}else{
300305
style_submenu_element("All", "All", "brlist?all");
301306
style_submenu_element("Closed","Closed","brlist?closed");
302307
}
308
+ if( !colorTest ){
309
+ style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
310
+ }else{
311
+ style_submenu_element("All", "All", "brlist?all");
312
+ }
303313
login_anonymous_available();
304314
style_sidebox_begin("Nomenclature:", "33%");
305315
@ <ol>
306316
@ <li> An <div class="sideboxDescribed"><a href="brlist">
307317
@ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
320330
prepareBranchQuery(&q, showAll, showClosed);
321331
cnt = 0;
322332
while( db_step(&q)==SQLITE_ROW ){
323333
const char *zBr = db_column_text(&q, 0);
324334
if( cnt==0 ){
325
- if( showClosed ){
335
+ if( colorTest ){
336
+ @ <h2>Default background colors for all branches:</h2>
337
+ }else if( showAll ){
338
+ @ <h2>All Branches:</h2>
339
+ }else if( showClosed ){
326340
@ <h2>Closed Branches:</h2>
327341
}else{
328342
@ <h2>Open Branches:</h2>
329343
}
330344
@ <ul>
331345
cnt++;
332346
}
333
- if( g.okHistory ){
334
- @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li>
347
+ if( colorTest ){
348
+ const char *zColor = hash_color(zBr);
349
+ @ <li><span style="background-color: %s(zColor)">
350
+ @ %h(zBr) &rarr; %s(zColor)</span></li>
351
+ }else if( g.okHistory ){
352
+ @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li>
335353
}else{
336354
@ <li><b>%h(zBr)</b></li>
337355
}
338356
}
339357
if( cnt ){
340358
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281 void brlist_page(void){
282 Stmt q;
283 int cnt;
284 int showClosed = P("closed")!=0;
285 int showAll = P("all")!=0;
 
286
287 login_check_credentials();
288 if( !g.okRead ){ login_needed(); return; }
 
 
 
 
289
290 style_header(showClosed ? "Closed Branches" :
291 showAll ? "All Branches" : "Open Branches");
292 style_submenu_element("Timeline", "Timeline", "brtimeline");
293 if( showClosed ){
@@ -298,10 +303,15 @@
298 style_submenu_element("Open","Open","brlist");
299 }else{
300 style_submenu_element("All", "All", "brlist?all");
301 style_submenu_element("Closed","Closed","brlist?closed");
302 }
 
 
 
 
 
303 login_anonymous_available();
304 style_sidebox_begin("Nomenclature:", "33%");
305 @ <ol>
306 @ <li> An <div class="sideboxDescribed"><a href="brlist">
307 @ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
320 prepareBranchQuery(&q, showAll, showClosed);
321 cnt = 0;
322 while( db_step(&q)==SQLITE_ROW ){
323 const char *zBr = db_column_text(&q, 0);
324 if( cnt==0 ){
325 if( showClosed ){
 
 
 
 
326 @ <h2>Closed Branches:</h2>
327 }else{
328 @ <h2>Open Branches:</h2>
329 }
330 @ <ul>
331 cnt++;
332 }
333 if( g.okHistory ){
334 @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)">%h(zBr)</a></li>
 
 
 
 
335 }else{
336 @ <li><b>%h(zBr)</b></li>
337 }
338 }
339 if( cnt ){
340
--- src/branch.c
+++ src/branch.c
@@ -281,13 +281,18 @@
281 void brlist_page(void){
282 Stmt q;
283 int cnt;
284 int showClosed = P("closed")!=0;
285 int showAll = P("all")!=0;
286 int colorTest = P("colortest")!=0;
287
288 login_check_credentials();
289 if( !g.okRead ){ login_needed(); return; }
290 if( colorTest ){
291 showClosed = 0;
292 showAll = 1;
293 }
294
295 style_header(showClosed ? "Closed Branches" :
296 showAll ? "All Branches" : "Open Branches");
297 style_submenu_element("Timeline", "Timeline", "brtimeline");
298 if( showClosed ){
@@ -298,10 +303,15 @@
303 style_submenu_element("Open","Open","brlist");
304 }else{
305 style_submenu_element("All", "All", "brlist?all");
306 style_submenu_element("Closed","Closed","brlist?closed");
307 }
308 if( !colorTest ){
309 style_submenu_element("Color-Test", "Color-Test", "brlist?colortest");
310 }else{
311 style_submenu_element("All", "All", "brlist?all");
312 }
313 login_anonymous_available();
314 style_sidebox_begin("Nomenclature:", "33%");
315 @ <ol>
316 @ <li> An <div class="sideboxDescribed"><a href="brlist">
317 @ open branch</a></div> is a branch that has one or
@@ -320,20 +330,28 @@
330 prepareBranchQuery(&q, showAll, showClosed);
331 cnt = 0;
332 while( db_step(&q)==SQLITE_ROW ){
333 const char *zBr = db_column_text(&q, 0);
334 if( cnt==0 ){
335 if( colorTest ){
336 @ <h2>Default background colors for all branches:</h2>
337 }else if( showAll ){
338 @ <h2>All Branches:</h2>
339 }else if( showClosed ){
340 @ <h2>Closed Branches:</h2>
341 }else{
342 @ <h2>Open Branches:</h2>
343 }
344 @ <ul>
345 cnt++;
346 }
347 if( colorTest ){
348 const char *zColor = hash_color(zBr);
349 @ <li><span style="background-color: %s(zColor)">
350 @ %h(zBr) &rarr; %s(zColor)</span></li>
351 }else if( g.okHistory ){
352 @ <li><a href="%s(g.zTop)/timeline?r=%T(zBr)")>%h(zBr)</a></li>
353 }else{
354 @ <li><b>%h(zBr)</b></li>
355 }
356 }
357 if( cnt ){
358
+11 -5
--- src/cgi.c
+++ src/cgi.c
@@ -1153,11 +1153,13 @@
11531153
fossil_print("Listening for HTTP requests on TCP port %d\n", iPort);
11541154
fflush(stdout);
11551155
}
11561156
if( zBrowser ){
11571157
zBrowser = mprintf(zBrowser, iPort);
1158
- system(zBrowser);
1158
+ if( system(zBrowser)<0 ){
1159
+ fossil_warning("cannot start browser: %s\n", zBrowser);
1160
+ }
11591161
}
11601162
while( 1 ){
11611163
if( nchildren>MAX_PARALLEL ){
11621164
/* Slow down if connections are arriving too fast */
11631165
sleep( nchildren-MAX_PARALLEL );
@@ -1174,20 +1176,24 @@
11741176
child = fork();
11751177
if( child!=0 ){
11761178
if( child>0 ) nchildren++;
11771179
close(connection);
11781180
}else{
1181
+ int nErr = 0, fd;
11791182
close(0);
1180
- dup(connection);
1183
+ fd = dup(connection);
1184
+ if( fd!=0 ) nErr++;
11811185
close(1);
1182
- dup(connection);
1186
+ fd = dup(connection);
1187
+ if( fd!=1 ) nErr++;
11831188
if( !g.fHttpTrace && !g.fSqlTrace ){
11841189
close(2);
1185
- dup(connection);
1190
+ fd = dup(connection);
1191
+ if( fd!=2 ) nErr++;
11861192
}
11871193
close(connection);
1188
- return 0;
1194
+ return nErr;
11891195
}
11901196
}
11911197
}
11921198
/* Bury dead children */
11931199
while( waitpid(0, 0, WNOHANG)>0 ){
11941200
--- src/cgi.c
+++ src/cgi.c
@@ -1153,11 +1153,13 @@
1153 fossil_print("Listening for HTTP requests on TCP port %d\n", iPort);
1154 fflush(stdout);
1155 }
1156 if( zBrowser ){
1157 zBrowser = mprintf(zBrowser, iPort);
1158 system(zBrowser);
 
 
1159 }
1160 while( 1 ){
1161 if( nchildren>MAX_PARALLEL ){
1162 /* Slow down if connections are arriving too fast */
1163 sleep( nchildren-MAX_PARALLEL );
@@ -1174,20 +1176,24 @@
1174 child = fork();
1175 if( child!=0 ){
1176 if( child>0 ) nchildren++;
1177 close(connection);
1178 }else{
 
1179 close(0);
1180 dup(connection);
 
1181 close(1);
1182 dup(connection);
 
1183 if( !g.fHttpTrace && !g.fSqlTrace ){
1184 close(2);
1185 dup(connection);
 
1186 }
1187 close(connection);
1188 return 0;
1189 }
1190 }
1191 }
1192 /* Bury dead children */
1193 while( waitpid(0, 0, WNOHANG)>0 ){
1194
--- src/cgi.c
+++ src/cgi.c
@@ -1153,11 +1153,13 @@
1153 fossil_print("Listening for HTTP requests on TCP port %d\n", iPort);
1154 fflush(stdout);
1155 }
1156 if( zBrowser ){
1157 zBrowser = mprintf(zBrowser, iPort);
1158 if( system(zBrowser)<0 ){
1159 fossil_warning("cannot start browser: %s\n", zBrowser);
1160 }
1161 }
1162 while( 1 ){
1163 if( nchildren>MAX_PARALLEL ){
1164 /* Slow down if connections are arriving too fast */
1165 sleep( nchildren-MAX_PARALLEL );
@@ -1174,20 +1176,24 @@
1176 child = fork();
1177 if( child!=0 ){
1178 if( child>0 ) nchildren++;
1179 close(connection);
1180 }else{
1181 int nErr = 0, fd;
1182 close(0);
1183 fd = dup(connection);
1184 if( fd!=0 ) nErr++;
1185 close(1);
1186 fd = dup(connection);
1187 if( fd!=1 ) nErr++;
1188 if( !g.fHttpTrace && !g.fSqlTrace ){
1189 close(2);
1190 fd = dup(connection);
1191 if( fd!=2 ) nErr++;
1192 }
1193 close(connection);
1194 return nErr;
1195 }
1196 }
1197 }
1198 /* Bury dead children */
1199 while( waitpid(0, 0, WNOHANG)>0 ){
1200
+6 -2
--- src/popen.c
+++ src/popen.c
@@ -172,17 +172,21 @@
172172
close(pout[1]);
173173
*pChildPid = 0;
174174
return 1;
175175
}
176176
if( *pChildPid==0 ){
177
+ int fd;
178
+ int nErr = 0;
177179
/* This is the child process */
178180
close(0);
179
- dup(pout[0]);
181
+ fd = dup(pout[0]);
182
+ if( fd!=0 ) nErr++;
180183
close(pout[0]);
181184
close(pout[1]);
182185
close(1);
183
- dup(pin[1]);
186
+ fd = dup(pin[1]);
187
+ if( fd!=1 ) nErr++;
184188
close(pin[0]);
185189
close(pin[1]);
186190
execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0);
187191
return 1;
188192
}else{
189193
--- src/popen.c
+++ src/popen.c
@@ -172,17 +172,21 @@
172 close(pout[1]);
173 *pChildPid = 0;
174 return 1;
175 }
176 if( *pChildPid==0 ){
 
 
177 /* This is the child process */
178 close(0);
179 dup(pout[0]);
 
180 close(pout[0]);
181 close(pout[1]);
182 close(1);
183 dup(pin[1]);
 
184 close(pin[0]);
185 close(pin[1]);
186 execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0);
187 return 1;
188 }else{
189
--- src/popen.c
+++ src/popen.c
@@ -172,17 +172,21 @@
172 close(pout[1]);
173 *pChildPid = 0;
174 return 1;
175 }
176 if( *pChildPid==0 ){
177 int fd;
178 int nErr = 0;
179 /* This is the child process */
180 close(0);
181 fd = dup(pout[0]);
182 if( fd!=0 ) nErr++;
183 close(pout[0]);
184 close(pout[1]);
185 close(1);
186 fd = dup(pin[1]);
187 if( fd!=1 ) nErr++;
188 close(pin[0]);
189 close(pin[1]);
190 execl("/bin/sh", "/bin/sh", "-c", zCmd, (char*)0);
191 return 1;
192 }else{
193
+3 -2
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327327
}
328328
db_finalize(&q);
329329
}
330330
331331
/*
332
-** Drop the indicates stash
332
+** Drop the indicated stash
333333
*/
334334
static void stash_drop(int stashid){
335335
db_multi_exec(
336336
"DELETE FROM stash WHERE stashid=%d;"
337337
"DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397397
** Update to the baseline checkout for STASHID then apply the
398398
** changes of STASHID. Keep STASHID so that it can be reused
399399
** This command is undoable.
400400
**
401401
** fossil stash drop ?STASHID? ?--all?
402
+** fossil stash rm ?STASHID? ?--all?
402403
**
403404
** Forget everything about STASHID. Forget the whole stash if the
404405
** --all flag is used. Individual drops are undoable but --all is not.
405406
**
406407
** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
480481
}
481482
}
482483
db_finalize(&q);
483484
if( n==0 ) fossil_print("empty stash\n");
484485
}else
485
- if( memcmp(zCmd, "drop", nCmd)==0 ){
486
+ if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
486487
int allFlag = find_option("all", 0, 0)!=0;
487488
if( g.argc>4 ) usage("stash apply STASHID");
488489
if( allFlag ){
489490
db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
490491
}else{
491492
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327 }
328 db_finalize(&q);
329 }
330
331 /*
332 ** Drop the indicates stash
333 */
334 static void stash_drop(int stashid){
335 db_multi_exec(
336 "DELETE FROM stash WHERE stashid=%d;"
337 "DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397 ** Update to the baseline checkout for STASHID then apply the
398 ** changes of STASHID. Keep STASHID so that it can be reused
399 ** This command is undoable.
400 **
401 ** fossil stash drop ?STASHID? ?--all?
 
402 **
403 ** Forget everything about STASHID. Forget the whole stash if the
404 ** --all flag is used. Individual drops are undoable but --all is not.
405 **
406 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
480 }
481 }
482 db_finalize(&q);
483 if( n==0 ) fossil_print("empty stash\n");
484 }else
485 if( memcmp(zCmd, "drop", nCmd)==0 ){
486 int allFlag = find_option("all", 0, 0)!=0;
487 if( g.argc>4 ) usage("stash apply STASHID");
488 if( allFlag ){
489 db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
490 }else{
491
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327 }
328 db_finalize(&q);
329 }
330
331 /*
332 ** Drop the indicated stash
333 */
334 static void stash_drop(int stashid){
335 db_multi_exec(
336 "DELETE FROM stash WHERE stashid=%d;"
337 "DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397 ** Update to the baseline checkout for STASHID then apply the
398 ** changes of STASHID. Keep STASHID so that it can be reused
399 ** This command is undoable.
400 **
401 ** fossil stash drop ?STASHID? ?--all?
402 ** fossil stash rm ?STASHID? ?--all?
403 **
404 ** Forget everything about STASHID. Forget the whole stash if the
405 ** --all flag is used. Individual drops are undoable but --all is not.
406 **
407 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
481 }
482 }
483 db_finalize(&q);
484 if( n==0 ) fossil_print("empty stash\n");
485 }else
486 if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
487 int allFlag = find_option("all", 0, 0)!=0;
488 if( g.argc>4 ) usage("stash apply STASHID");
489 if( allFlag ){
490 db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
491 }else{
492
+3 -2
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327327
}
328328
db_finalize(&q);
329329
}
330330
331331
/*
332
-** Drop the indicates stash
332
+** Drop the indicated stash
333333
*/
334334
static void stash_drop(int stashid){
335335
db_multi_exec(
336336
"DELETE FROM stash WHERE stashid=%d;"
337337
"DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397397
** Update to the baseline checkout for STASHID then apply the
398398
** changes of STASHID. Keep STASHID so that it can be reused
399399
** This command is undoable.
400400
**
401401
** fossil stash drop ?STASHID? ?--all?
402
+** fossil stash rm ?STASHID? ?--all?
402403
**
403404
** Forget everything about STASHID. Forget the whole stash if the
404405
** --all flag is used. Individual drops are undoable but --all is not.
405406
**
406407
** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
480481
}
481482
}
482483
db_finalize(&q);
483484
if( n==0 ) fossil_print("empty stash\n");
484485
}else
485
- if( memcmp(zCmd, "drop", nCmd)==0 ){
486
+ if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
486487
int allFlag = find_option("all", 0, 0)!=0;
487488
if( g.argc>4 ) usage("stash apply STASHID");
488489
if( allFlag ){
489490
db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
490491
}else{
491492
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327 }
328 db_finalize(&q);
329 }
330
331 /*
332 ** Drop the indicates stash
333 */
334 static void stash_drop(int stashid){
335 db_multi_exec(
336 "DELETE FROM stash WHERE stashid=%d;"
337 "DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397 ** Update to the baseline checkout for STASHID then apply the
398 ** changes of STASHID. Keep STASHID so that it can be reused
399 ** This command is undoable.
400 **
401 ** fossil stash drop ?STASHID? ?--all?
 
402 **
403 ** Forget everything about STASHID. Forget the whole stash if the
404 ** --all flag is used. Individual drops are undoable but --all is not.
405 **
406 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
480 }
481 }
482 db_finalize(&q);
483 if( n==0 ) fossil_print("empty stash\n");
484 }else
485 if( memcmp(zCmd, "drop", nCmd)==0 ){
486 int allFlag = find_option("all", 0, 0)!=0;
487 if( g.argc>4 ) usage("stash apply STASHID");
488 if( allFlag ){
489 db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
490 }else{
491
--- src/stash.c
+++ src/stash.c
@@ -327,11 +327,11 @@
327 }
328 db_finalize(&q);
329 }
330
331 /*
332 ** Drop the indicated stash
333 */
334 static void stash_drop(int stashid){
335 db_multi_exec(
336 "DELETE FROM stash WHERE stashid=%d;"
337 "DELETE FROM stashfile WHERE stashid=%d;",
@@ -397,10 +397,11 @@
397 ** Update to the baseline checkout for STASHID then apply the
398 ** changes of STASHID. Keep STASHID so that it can be reused
399 ** This command is undoable.
400 **
401 ** fossil stash drop ?STASHID? ?--all?
402 ** fossil stash rm ?STASHID? ?--all?
403 **
404 ** Forget everything about STASHID. Forget the whole stash if the
405 ** --all flag is used. Individual drops are undoable but --all is not.
406 **
407 ** fossil stash snapshot ?-m COMMENT? ?FILES...?
@@ -480,11 +481,11 @@
481 }
482 }
483 db_finalize(&q);
484 if( n==0 ) fossil_print("empty stash\n");
485 }else
486 if( memcmp(zCmd, "drop", nCmd)==0 || memcmp(zCmd, "rm", nCmd)==0 ){
487 int allFlag = find_option("all", 0, 0)!=0;
488 if( g.argc>4 ) usage("stash apply STASHID");
489 if( allFlag ){
490 db_multi_exec("DELETE FROM stash; DELETE FROM stashfile;");
491 }else{
492
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152152
default: r = mx; g = mn, b = h2; break;
153153
}
154154
sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155155
return zColor;
156156
}
157
+
158
+/*
159
+** COMMAND: test-hash-color
160
+**
161
+** Usage: %fossil test-hash-color TAG ...
162
+**
163
+** Print out the color names associated with each tag. Used for
164
+** testing the hash_color() function.
165
+*/
166
+void test_hash_color(void){
167
+ int i;
168
+ for(i=2; i<g.argc; i++){
169
+ fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i]));
170
+ }
171
+}
157172
158173
/*
159174
** Output a timeline in the web format given a query. The query
160175
** should return these columns:
161176
**
162177
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152 default: r = mx; g = mn, b = h2; break;
153 }
154 sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155 return zColor;
156 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
158 /*
159 ** Output a timeline in the web format given a query. The query
160 ** should return these columns:
161 **
162
--- src/timeline.c
+++ src/timeline.c
@@ -152,10 +152,25 @@
152 default: r = mx; g = mn, b = h2; break;
153 }
154 sqlite3_snprintf(8, zColor, "#%02x%02x%02x", r,g,b);
155 return zColor;
156 }
157
158 /*
159 ** COMMAND: test-hash-color
160 **
161 ** Usage: %fossil test-hash-color TAG ...
162 **
163 ** Print out the color names associated with each tag. Used for
164 ** testing the hash_color() function.
165 */
166 void test_hash_color(void){
167 int i;
168 for(i=2; i<g.argc; i++){
169 fossil_print("%20s: %s\n", g.argv[i], hash_color(g.argv[i]));
170 }
171 }
172
173 /*
174 ** Output a timeline in the web format given a query. The query
175 ** should return these columns:
176 **
177
--- www/checkin.wiki
+++ www/checkin.wiki
@@ -3,10 +3,12 @@
33
<h2><u>Always</u> run the following checklist prior to <u>every</u>
44
check-in or commit to the Fossil repository:</h2>
55
66
Before every check-in:
77
8
+ 0. <b>fossil user default</b> &rarr; your username is correct.
9
+
810
1. <b>fossil diff</b> &rarr;
911
<ol type="a">
1012
<li> No stray changes
1113
<li> All changes comply with the license
1214
<li> All inputs are scrubbed before use
@@ -31,10 +33,15 @@
3133
7. The fossil executable that results from a build actually works.
3234
3335
3436
<hr>
3537
<h2>Commentary</h2>
38
+
39
+Before you go ahead and push content back to the servers, make sure
40
+that the username you are using by default matches your username
41
+within the project. Also remember to enable the localauth setting
42
+if you intend to make changes via a locally served web UI.
3643
3744
Item 1 is the most important step. Consider using <b>gdiff</b>
3845
instead of <b>diff</b> if you have a graphical differ configured. Or,
3946
pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to
4047
get the diff output in a separate text window for easier viewing.
4148
--- www/checkin.wiki
+++ www/checkin.wiki
@@ -3,10 +3,12 @@
3 <h2><u>Always</u> run the following checklist prior to <u>every</u>
4 check-in or commit to the Fossil repository:</h2>
5
6 Before every check-in:
7
 
 
8 1. <b>fossil diff</b> &rarr;
9 <ol type="a">
10 <li> No stray changes
11 <li> All changes comply with the license
12 <li> All inputs are scrubbed before use
@@ -31,10 +33,15 @@
31 7. The fossil executable that results from a build actually works.
32
33
34 <hr>
35 <h2>Commentary</h2>
 
 
 
 
 
36
37 Item 1 is the most important step. Consider using <b>gdiff</b>
38 instead of <b>diff</b> if you have a graphical differ configured. Or,
39 pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to
40 get the diff output in a separate text window for easier viewing.
41
--- www/checkin.wiki
+++ www/checkin.wiki
@@ -3,10 +3,12 @@
3 <h2><u>Always</u> run the following checklist prior to <u>every</u>
4 check-in or commit to the Fossil repository:</h2>
5
6 Before every check-in:
7
8 0. <b>fossil user default</b> &rarr; your username is correct.
9
10 1. <b>fossil diff</b> &rarr;
11 <ol type="a">
12 <li> No stray changes
13 <li> All changes comply with the license
14 <li> All inputs are scrubbed before use
@@ -31,10 +33,15 @@
33 7. The fossil executable that results from a build actually works.
34
35
36 <hr>
37 <h2>Commentary</h2>
38
39 Before you go ahead and push content back to the servers, make sure
40 that the username you are using by default matches your username
41 within the project. Also remember to enable the localauth setting
42 if you intend to make changes via a locally served web UI.
43
44 Item 1 is the most important step. Consider using <b>gdiff</b>
45 instead of <b>diff</b> if you have a graphical differ configured. Or,
46 pipe the output of "<b>fossil diff</b>" into "<b>open -f</b>" (on a mac) to
47 get the diff output in a separate text window for easier viewing.
48

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button