Fossil SCM
Merge trunk. Make it work on Windows too. Variable width output on more commands.
Commit
40710b7a05492679b6dd515afcb844a652852c20
Parent
c4891e24af9052d…
54 files changed
+23
+25
-8
+9
+9
-7
+53
-53
+195
+66
+1
-1
+1
-1
+1
-1
+19
-1
+19
-1
+1
-2
+1
+40
-11
+1
-7
+1
-7
+7
-3
+7
-3
+8
+1
-1
+1
-1
+135
-10
+11
-1
+34
-1
+22
-13
+2
-2
+2
-2
+29
-23
+29
-23
+1
-7
+1
-7
+1
-7
+1
-7
+10
-5
+506
-2
+1
-7
+1
-7
+1
-1
+1
-1
+1
-1
+1
-1
+3
+2
+59
+4
+88
+158
+10
-4
+32
-1
+32
-1
+23
+5
+7
~
auto.def
~
autosetup/autosetup
~
autosetup/cc-shared.tcl
~
autosetup/cc.tcl
~
autosetup/jimsh0.c
~
autosetup/local.tcl
~
setup/fossil.iss
~
src/bisect.c
~
src/bisect.c
~
src/branch.c
~
src/comformat.c
~
src/comformat.c
~
src/config.h
~
src/configure.c
~
src/db.c
~
src/descendants.c
~
src/descendants.c
~
src/finfo.c
~
src/finfo.c
~
src/fusefs.c
~
src/info.c
~
src/info.c
~
src/main.c
~
src/main.mk
~
src/makemake.tcl
~
src/manifest.c
~
src/merge.c
~
src/merge.c
~
src/name.c
~
src/name.c
~
src/search.c
~
src/search.c
~
src/stash.c
~
src/stash.c
~
src/sync.c
~
src/th_main.c
~
src/timeline.c
~
src/timeline.c
~
src/tkt.c
~
src/tkt.c
~
src/update.c
~
src/winhttp.c
~
test/subdir-b/readme.txt
~
test/subdir/one/two/three/four/five/six/readme.txt
~
test/tester.tcl
~
test/th1-hooks-input.txt
~
test/th1-hooks.test
~
test/th1.test
~
win/Makefile.dmc
~
win/Makefile.mingw
~
win/Makefile.mingw.mistachkin
~
win/Makefile.msc
~
win/fossil.rc
~
www/changes.wiki
M
auto.def
+23
| --- auto.def | ||
| +++ auto.def | ||
| @@ -4,17 +4,19 @@ | ||
| 4 | 4 | |
| 5 | 5 | options { |
| 6 | 6 | with-openssl:path|auto|none |
| 7 | 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | + with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages} | |
| 9 | 10 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 10 | 11 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 11 | 12 | with-tcl-private-stubs=0 |
| 12 | 13 | => {Enable Tcl integration via private stubs mechanism} |
| 13 | 14 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 14 | 15 | static=0 => {Link a static executable} |
| 15 | 16 | lineedit=1 => {Disable line editing} |
| 17 | + fusefs=1 => {Disable the Fuse Filesystem} | |
| 16 | 18 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 17 | 19 | json=0 => {Build with fossil JSON API enabled} |
| 18 | 20 | } |
| 19 | 21 | |
| 20 | 22 | # sqlite wants these types if possible |
| @@ -69,28 +71,38 @@ | ||
| 69 | 71 | define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500 |
| 70 | 72 | } |
| 71 | 73 | |
| 72 | 74 | if {[opt-bool fossil-debug]} { |
| 73 | 75 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 76 | + msg-result "Debugging support enabled" | |
| 74 | 77 | } |
| 75 | 78 | |
| 76 | 79 | if {[opt-bool json]} { |
| 77 | 80 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 78 | 81 | # is required in the CFLAGS because json*.c |
| 79 | 82 | # have #ifdef guards around the whole file without |
| 80 | 83 | # reading config.h first. |
| 81 | 84 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 82 | 85 | define FOSSIL_ENABLE_JSON |
| 86 | + msg-result "JSON support enabled" | |
| 87 | +} | |
| 88 | + | |
| 89 | +if {[opt-bool with-th1-hooks]} { | |
| 90 | + define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS | |
| 91 | + define FOSSIL_ENABLE_TH1_HOOKS | |
| 92 | + msg-result "TH1 hooks support enabled" | |
| 83 | 93 | } |
| 84 | 94 | |
| 85 | 95 | #if {[opt-bool markdown]} { |
| 86 | 96 | # # no-op. Markdown is now enabled by default. |
| 97 | +# msg-result "Markdown support enabled" | |
| 87 | 98 | #} |
| 88 | 99 | |
| 89 | 100 | if {[opt-bool static]} { |
| 90 | 101 | # XXX: This will not work on all systems. |
| 91 | 102 | define-append EXTRA_LDFLAGS -static |
| 103 | + msg-result "Trying to link statically" | |
| 92 | 104 | } |
| 93 | 105 | |
| 94 | 106 | set tclpath [opt-val with-tcl] |
| 95 | 107 | if {$tclpath ne ""} { |
| 96 | 108 | set tclprivatestubs [opt-bool with-tcl-private-stubs] |
| @@ -222,10 +234,11 @@ | ||
| 222 | 234 | set zlibpath [opt-val with-zlib] |
| 223 | 235 | if {$zlibpath ne ""} { |
| 224 | 236 | cc-with [list -cflags "-I$zlibpath -L$zlibpath"] |
| 225 | 237 | define-append EXTRA_CFLAGS -I$zlibpath |
| 226 | 238 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 239 | + msg-result "Using zlib from $zlibpath" | |
| 227 | 240 | } |
| 228 | 241 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 229 | 242 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 230 | 243 | } |
| 231 | 244 | |
| @@ -252,16 +265,26 @@ | ||
| 252 | 265 | cc-check-function-in-lib iconv iconv |
| 253 | 266 | |
| 254 | 267 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 255 | 268 | if {![cc-check-functions getloadavg]} { |
| 256 | 269 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 270 | + msg-result "Load average support unavailable" | |
| 257 | 271 | } |
| 258 | 272 | |
| 259 | 273 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 260 | 274 | if {![cc-check-functions getpassphrase]} { |
| 261 | 275 | # Haiku needs this |
| 262 | 276 | cc-check-function-in-lib getpass bsd |
| 263 | 277 | } |
| 264 | 278 | cc-check-function-in-lib dlopen dl |
| 279 | + | |
| 280 | +# Check for the FuseFS library | |
| 281 | +if {[opt-bool fusefs]} { | |
| 282 | + if {[cc-check-function-in-lib fuse_mount fuse]} { | |
| 283 | + define FOSSIL_HAVE_FUSEFS 1 | |
| 284 | + define-append LIBS -lfuse | |
| 285 | + msg-result "FuseFS support enabled" | |
| 286 | + } | |
| 287 | +} | |
| 265 | 288 | |
| 266 | 289 | make-template Makefile.in |
| 267 | 290 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 268 | 291 |
| --- auto.def | |
| +++ auto.def | |
| @@ -4,17 +4,19 @@ | |
| 4 | |
| 5 | options { |
| 6 | with-openssl:path|auto|none |
| 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 10 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 11 | with-tcl-private-stubs=0 |
| 12 | => {Enable Tcl integration via private stubs mechanism} |
| 13 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 14 | static=0 => {Link a static executable} |
| 15 | lineedit=1 => {Disable line editing} |
| 16 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 17 | json=0 => {Build with fossil JSON API enabled} |
| 18 | } |
| 19 | |
| 20 | # sqlite wants these types if possible |
| @@ -69,28 +71,38 @@ | |
| 69 | define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500 |
| 70 | } |
| 71 | |
| 72 | if {[opt-bool fossil-debug]} { |
| 73 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 74 | } |
| 75 | |
| 76 | if {[opt-bool json]} { |
| 77 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 78 | # is required in the CFLAGS because json*.c |
| 79 | # have #ifdef guards around the whole file without |
| 80 | # reading config.h first. |
| 81 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 82 | define FOSSIL_ENABLE_JSON |
| 83 | } |
| 84 | |
| 85 | #if {[opt-bool markdown]} { |
| 86 | # # no-op. Markdown is now enabled by default. |
| 87 | #} |
| 88 | |
| 89 | if {[opt-bool static]} { |
| 90 | # XXX: This will not work on all systems. |
| 91 | define-append EXTRA_LDFLAGS -static |
| 92 | } |
| 93 | |
| 94 | set tclpath [opt-val with-tcl] |
| 95 | if {$tclpath ne ""} { |
| 96 | set tclprivatestubs [opt-bool with-tcl-private-stubs] |
| @@ -222,10 +234,11 @@ | |
| 222 | set zlibpath [opt-val with-zlib] |
| 223 | if {$zlibpath ne ""} { |
| 224 | cc-with [list -cflags "-I$zlibpath -L$zlibpath"] |
| 225 | define-append EXTRA_CFLAGS -I$zlibpath |
| 226 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 227 | } |
| 228 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 229 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 230 | } |
| 231 | |
| @@ -252,16 +265,26 @@ | |
| 252 | cc-check-function-in-lib iconv iconv |
| 253 | |
| 254 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 255 | if {![cc-check-functions getloadavg]} { |
| 256 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 257 | } |
| 258 | |
| 259 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 260 | if {![cc-check-functions getpassphrase]} { |
| 261 | # Haiku needs this |
| 262 | cc-check-function-in-lib getpass bsd |
| 263 | } |
| 264 | cc-check-function-in-lib dlopen dl |
| 265 | |
| 266 | make-template Makefile.in |
| 267 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 268 |
| --- auto.def | |
| +++ auto.def | |
| @@ -4,17 +4,19 @@ | |
| 4 | |
| 5 | options { |
| 6 | with-openssl:path|auto|none |
| 7 | => {Look for openssl in the given path, or auto or none} |
| 8 | with-zlib:path => {Look for zlib in the given path} |
| 9 | with-th1-hooks=0 => {Enable TH1 hooks for commands and web pages} |
| 10 | with-tcl:path => {Enable Tcl integration, with Tcl in the specified path} |
| 11 | with-tcl-stubs=0 => {Enable Tcl integration via stubs library mechanism} |
| 12 | with-tcl-private-stubs=0 |
| 13 | => {Enable Tcl integration via private stubs mechanism} |
| 14 | internal-sqlite=1 => {Don't use the internal SQLite, use the system one} |
| 15 | static=0 => {Link a static executable} |
| 16 | lineedit=1 => {Disable line editing} |
| 17 | fusefs=1 => {Disable the Fuse Filesystem} |
| 18 | fossil-debug=0 => {Build with fossil debugging enabled} |
| 19 | json=0 => {Build with fossil JSON API enabled} |
| 20 | } |
| 21 | |
| 22 | # sqlite wants these types if possible |
| @@ -69,28 +71,38 @@ | |
| 71 | define-append EXTRA_CFLAGS -D_XOPEN_SOURCE=500 |
| 72 | } |
| 73 | |
| 74 | if {[opt-bool fossil-debug]} { |
| 75 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 76 | msg-result "Debugging support enabled" |
| 77 | } |
| 78 | |
| 79 | if {[opt-bool json]} { |
| 80 | # Reminder/FIXME (stephan): FOSSIL_ENABLE_JSON |
| 81 | # is required in the CFLAGS because json*.c |
| 82 | # have #ifdef guards around the whole file without |
| 83 | # reading config.h first. |
| 84 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_JSON |
| 85 | define FOSSIL_ENABLE_JSON |
| 86 | msg-result "JSON support enabled" |
| 87 | } |
| 88 | |
| 89 | if {[opt-bool with-th1-hooks]} { |
| 90 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_TH1_HOOKS |
| 91 | define FOSSIL_ENABLE_TH1_HOOKS |
| 92 | msg-result "TH1 hooks support enabled" |
| 93 | } |
| 94 | |
| 95 | #if {[opt-bool markdown]} { |
| 96 | # # no-op. Markdown is now enabled by default. |
| 97 | # msg-result "Markdown support enabled" |
| 98 | #} |
| 99 | |
| 100 | if {[opt-bool static]} { |
| 101 | # XXX: This will not work on all systems. |
| 102 | define-append EXTRA_LDFLAGS -static |
| 103 | msg-result "Trying to link statically" |
| 104 | } |
| 105 | |
| 106 | set tclpath [opt-val with-tcl] |
| 107 | if {$tclpath ne ""} { |
| 108 | set tclprivatestubs [opt-bool with-tcl-private-stubs] |
| @@ -222,10 +234,11 @@ | |
| 234 | set zlibpath [opt-val with-zlib] |
| 235 | if {$zlibpath ne ""} { |
| 236 | cc-with [list -cflags "-I$zlibpath -L$zlibpath"] |
| 237 | define-append EXTRA_CFLAGS -I$zlibpath |
| 238 | define-append EXTRA_LDFLAGS -L$zlibpath |
| 239 | msg-result "Using zlib from $zlibpath" |
| 240 | } |
| 241 | if {![cc-check-includes zlib.h] || ![cc-check-function-in-lib inflateEnd z]} { |
| 242 | user-error "zlib not found please install it or specify the location with --with-zlib" |
| 243 | } |
| 244 | |
| @@ -252,16 +265,26 @@ | |
| 265 | cc-check-function-in-lib iconv iconv |
| 266 | |
| 267 | # Check for getloadavg(), and if it doesn't exist, define FOSSIL_OMIT_LOAD_AVERAGE |
| 268 | if {![cc-check-functions getloadavg]} { |
| 269 | define FOSSIL_OMIT_LOAD_AVERAGE 1 |
| 270 | msg-result "Load average support unavailable" |
| 271 | } |
| 272 | |
| 273 | # Check for getpassphrase() for Solaris 10 where getpass() truncates to 10 chars |
| 274 | if {![cc-check-functions getpassphrase]} { |
| 275 | # Haiku needs this |
| 276 | cc-check-function-in-lib getpass bsd |
| 277 | } |
| 278 | cc-check-function-in-lib dlopen dl |
| 279 | |
| 280 | # Check for the FuseFS library |
| 281 | if {[opt-bool fusefs]} { |
| 282 | if {[cc-check-function-in-lib fuse_mount fuse]} { |
| 283 | define FOSSIL_HAVE_FUSEFS 1 |
| 284 | define-append LIBS -lfuse |
| 285 | msg-result "FuseFS support enabled" |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | make-template Makefile.in |
| 290 | make-config-header autoconfig.h -auto {USE_* FOSSIL_*} |
| 291 |
+25
-8
| --- autosetup/autosetup | ||
| +++ autosetup/autosetup | ||
| @@ -925,11 +925,11 @@ | ||
| 925 | 925 | } |
| 926 | 926 | |
| 927 | 927 | # Load module source in the global scope by executing the given command |
| 928 | 928 | proc automf_load {args} { |
| 929 | 929 | if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} { |
| 930 | - autosetup-full-error [error-dump $msg $opts] | |
| 930 | + autosetup-full-error [error-dump $msg $opts $::autosetup(debug)] | |
| 931 | 931 | } |
| 932 | 932 | } |
| 933 | 933 | |
| 934 | 934 | # Initial settings |
| 935 | 935 | set autosetup(exe) $::argv0 |
| @@ -1706,18 +1706,35 @@ | ||
| 1706 | 1706 | return $msg |
| 1707 | 1707 | } |
| 1708 | 1708 | |
| 1709 | 1709 | # Given the return from [catch {...} msg opts], returns an appropriate |
| 1710 | 1710 | # error message. A nice one for Jim and a less-nice one for Tcl. |
| 1711 | +# If 'fulltrace' is set, a full stack trace is provided. | |
| 1712 | +# Otherwise a simple message is provided. | |
| 1711 | 1713 | # |
| 1712 | -# This is designed for developer errors, e.g. in module code | |
| 1714 | +# This is designed for developer errors, e.g. in module code or auto.def code | |
| 1715 | +# | |
| 1713 | 1716 | # |
| 1714 | -proc error-dump {msg opts} { | |
| 1717 | +proc error-dump {msg opts fulltrace} { | |
| 1715 | 1718 | if {$::autosetup(istcl)} { |
| 1716 | - return "Error: [dict get $opts -errorinfo]" | |
| 1719 | + if {$fulltrace} { | |
| 1720 | + return "Error: [dict get $opts -errorinfo]" | |
| 1721 | + } else { | |
| 1722 | + return "Error: $msg" | |
| 1723 | + } | |
| 1717 | 1724 | } else { |
| 1718 | - return "Error: $msg\n[stackdump $opts(-errorinfo)]" | |
| 1725 | + lassign $opts(-errorinfo) p f l | |
| 1726 | + if {$f ne ""} { | |
| 1727 | + set result "$f:$l: Error: " | |
| 1728 | + } | |
| 1729 | + append result "$msg\n" | |
| 1730 | + if {$fulltrace} { | |
| 1731 | + append result [stackdump $opts(-errorinfo)] | |
| 1732 | + } | |
| 1733 | + | |
| 1734 | + # Remove the trailing newline | |
| 1735 | + string trim $result | |
| 1719 | 1736 | } |
| 1720 | 1737 | } |
| 1721 | 1738 | } |
| 1722 | 1739 | |
| 1723 | 1740 | # ----- module text-formatting ----- |
| @@ -1886,13 +1903,13 @@ | ||
| 1886 | 1903 | # Entry/Exit |
| 1887 | 1904 | # |
| 1888 | 1905 | if {$autosetup(debug)} { |
| 1889 | 1906 | main $argv |
| 1890 | 1907 | } |
| 1891 | -if {[catch {main $argv} msg] == 1} { | |
| 1908 | +if {[catch {main $argv} msg opts] == 1} { | |
| 1892 | 1909 | show-notices |
| 1893 | - puts stderr [error-stacktrace $msg] | |
| 1894 | - if {!$autosetup(debug) && !$autosetup(istcl)} { | |
| 1910 | + autosetup-full-error [error-dump $msg $opts $::autosetup(debug)] | |
| 1911 | + if {!$autosetup(debug)} { | |
| 1895 | 1912 | puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace" |
| 1896 | 1913 | } |
| 1897 | 1914 | exit 1 |
| 1898 | 1915 | } |
| 1899 | 1916 |
| --- autosetup/autosetup | |
| +++ autosetup/autosetup | |
| @@ -925,11 +925,11 @@ | |
| 925 | } |
| 926 | |
| 927 | # Load module source in the global scope by executing the given command |
| 928 | proc automf_load {args} { |
| 929 | if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} { |
| 930 | autosetup-full-error [error-dump $msg $opts] |
| 931 | } |
| 932 | } |
| 933 | |
| 934 | # Initial settings |
| 935 | set autosetup(exe) $::argv0 |
| @@ -1706,18 +1706,35 @@ | |
| 1706 | return $msg |
| 1707 | } |
| 1708 | |
| 1709 | # Given the return from [catch {...} msg opts], returns an appropriate |
| 1710 | # error message. A nice one for Jim and a less-nice one for Tcl. |
| 1711 | # |
| 1712 | # This is designed for developer errors, e.g. in module code |
| 1713 | # |
| 1714 | proc error-dump {msg opts} { |
| 1715 | if {$::autosetup(istcl)} { |
| 1716 | return "Error: [dict get $opts -errorinfo]" |
| 1717 | } else { |
| 1718 | return "Error: $msg\n[stackdump $opts(-errorinfo)]" |
| 1719 | } |
| 1720 | } |
| 1721 | } |
| 1722 | |
| 1723 | # ----- module text-formatting ----- |
| @@ -1886,13 +1903,13 @@ | |
| 1886 | # Entry/Exit |
| 1887 | # |
| 1888 | if {$autosetup(debug)} { |
| 1889 | main $argv |
| 1890 | } |
| 1891 | if {[catch {main $argv} msg] == 1} { |
| 1892 | show-notices |
| 1893 | puts stderr [error-stacktrace $msg] |
| 1894 | if {!$autosetup(debug) && !$autosetup(istcl)} { |
| 1895 | puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace" |
| 1896 | } |
| 1897 | exit 1 |
| 1898 | } |
| 1899 |
| --- autosetup/autosetup | |
| +++ autosetup/autosetup | |
| @@ -925,11 +925,11 @@ | |
| 925 | } |
| 926 | |
| 927 | # Load module source in the global scope by executing the given command |
| 928 | proc automf_load {args} { |
| 929 | if {[catch [list uplevel #0 $args] msg opts] ni {0 2 3}} { |
| 930 | autosetup-full-error [error-dump $msg $opts $::autosetup(debug)] |
| 931 | } |
| 932 | } |
| 933 | |
| 934 | # Initial settings |
| 935 | set autosetup(exe) $::argv0 |
| @@ -1706,18 +1706,35 @@ | |
| 1706 | return $msg |
| 1707 | } |
| 1708 | |
| 1709 | # Given the return from [catch {...} msg opts], returns an appropriate |
| 1710 | # error message. A nice one for Jim and a less-nice one for Tcl. |
| 1711 | # If 'fulltrace' is set, a full stack trace is provided. |
| 1712 | # Otherwise a simple message is provided. |
| 1713 | # |
| 1714 | # This is designed for developer errors, e.g. in module code or auto.def code |
| 1715 | # |
| 1716 | # |
| 1717 | proc error-dump {msg opts fulltrace} { |
| 1718 | if {$::autosetup(istcl)} { |
| 1719 | if {$fulltrace} { |
| 1720 | return "Error: [dict get $opts -errorinfo]" |
| 1721 | } else { |
| 1722 | return "Error: $msg" |
| 1723 | } |
| 1724 | } else { |
| 1725 | lassign $opts(-errorinfo) p f l |
| 1726 | if {$f ne ""} { |
| 1727 | set result "$f:$l: Error: " |
| 1728 | } |
| 1729 | append result "$msg\n" |
| 1730 | if {$fulltrace} { |
| 1731 | append result [stackdump $opts(-errorinfo)] |
| 1732 | } |
| 1733 | |
| 1734 | # Remove the trailing newline |
| 1735 | string trim $result |
| 1736 | } |
| 1737 | } |
| 1738 | } |
| 1739 | |
| 1740 | # ----- module text-formatting ----- |
| @@ -1886,13 +1903,13 @@ | |
| 1903 | # Entry/Exit |
| 1904 | # |
| 1905 | if {$autosetup(debug)} { |
| 1906 | main $argv |
| 1907 | } |
| 1908 | if {[catch {main $argv} msg opts] == 1} { |
| 1909 | show-notices |
| 1910 | autosetup-full-error [error-dump $msg $opts $::autosetup(debug)] |
| 1911 | if {!$autosetup(debug)} { |
| 1912 | puts stderr "Try: '[file tail $autosetup(exe)] --debug' for a full stack trace" |
| 1913 | } |
| 1914 | exit 1 |
| 1915 | } |
| 1916 |
| --- autosetup/cc-shared.tcl | ||
| +++ autosetup/cc-shared.tcl | ||
| @@ -94,10 +94,19 @@ | ||
| 94 | 94 | define SHOBJ_LDFLAGS -b |
| 95 | 95 | define SH_CFLAGS +z |
| 96 | 96 | define SH_LINKFLAGS -Wl,+s |
| 97 | 97 | define LD_LIBRARY_PATH SHLIB_PATH |
| 98 | 98 | } |
| 99 | + *-*-haiku { | |
| 100 | + define SHOBJ_CFLAGS "" | |
| 101 | + define SHOBJ_LDFLAGS -shared | |
| 102 | + define SH_CFLAGS "" | |
| 103 | + define SH_LDFLAGS -shared | |
| 104 | + define SH_LINKFLAGS "" | |
| 105 | + define SH_SOPREFIX "" | |
| 106 | + define LD_LIBRARY_PATH LIBRARY_PATH | |
| 107 | + } | |
| 99 | 108 | } |
| 100 | 109 | |
| 101 | 110 | if {![is-defined SHOBJ_LDFLAGS_R]} { |
| 102 | 111 | define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS] |
| 103 | 112 | } |
| 104 | 113 |
| --- autosetup/cc-shared.tcl | |
| +++ autosetup/cc-shared.tcl | |
| @@ -94,10 +94,19 @@ | |
| 94 | define SHOBJ_LDFLAGS -b |
| 95 | define SH_CFLAGS +z |
| 96 | define SH_LINKFLAGS -Wl,+s |
| 97 | define LD_LIBRARY_PATH SHLIB_PATH |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | if {![is-defined SHOBJ_LDFLAGS_R]} { |
| 102 | define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS] |
| 103 | } |
| 104 |
| --- autosetup/cc-shared.tcl | |
| +++ autosetup/cc-shared.tcl | |
| @@ -94,10 +94,19 @@ | |
| 94 | define SHOBJ_LDFLAGS -b |
| 95 | define SH_CFLAGS +z |
| 96 | define SH_LINKFLAGS -Wl,+s |
| 97 | define LD_LIBRARY_PATH SHLIB_PATH |
| 98 | } |
| 99 | *-*-haiku { |
| 100 | define SHOBJ_CFLAGS "" |
| 101 | define SHOBJ_LDFLAGS -shared |
| 102 | define SH_CFLAGS "" |
| 103 | define SH_LDFLAGS -shared |
| 104 | define SH_LINKFLAGS "" |
| 105 | define SH_SOPREFIX "" |
| 106 | define LD_LIBRARY_PATH LIBRARY_PATH |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | if {![is-defined SHOBJ_LDFLAGS_R]} { |
| 111 | define SHOBJ_LDFLAGS_R [get-define SHOBJ_LDFLAGS] |
| 112 | } |
| 113 |
+9
-7
| --- autosetup/cc.tcl | ||
| +++ autosetup/cc.tcl | ||
| @@ -333,11 +333,11 @@ | ||
| 333 | 333 | } |
| 334 | 334 | -libs { |
| 335 | 335 | # Note that new libraries are added before previous libraries |
| 336 | 336 | set new($name) [list {*}$value {*}$new($name)] |
| 337 | 337 | } |
| 338 | - -link - -lang { | |
| 338 | + -link - -lang - -nooutput { | |
| 339 | 339 | set new($name) $value |
| 340 | 340 | } |
| 341 | 341 | -source - -sourcefile - -code { |
| 342 | 342 | # XXX: These probably are only valid directly from cctest |
| 343 | 343 | set new($name) $value |
| @@ -428,10 +428,11 @@ | ||
| 428 | 428 | ## -lang c|c++ Use the C (default) or C++ compiler |
| 429 | 429 | ## -libs liblist List of libraries to link, e.g. {-ldl -lm} |
| 430 | 430 | ## -code code Code to compile in the body of main() |
| 431 | 431 | ## -source code Compile a complete program. Ignore -includes, -declare and -code |
| 432 | 432 | ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file] |
| 433 | +## -nooutput 1 Treat any compiler output (e.g. a warning) as an error | |
| 433 | 434 | # |
| 434 | 435 | # Unless -source or -sourcefile is specified, the C program looks like: |
| 435 | 436 | # |
| 436 | 437 | ## #include <firstinclude> /* same for remaining includes in the list */ |
| 437 | 438 | ## |
| @@ -521,11 +522,12 @@ | ||
| 521 | 522 | } |
| 522 | 523 | |
| 523 | 524 | writefile $src $lines\n |
| 524 | 525 | |
| 525 | 526 | set ok 1 |
| 526 | - if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} { | |
| 527 | + set err [catch {exec-with-stderr {*}$cmdline} result errinfo] | |
| 528 | + if {$err || ($opts(-nooutput) && [string length $result])} { | |
| 527 | 529 | configlog "Failed: [join $cmdline]" |
| 528 | 530 | configlog $result |
| 529 | 531 | configlog "============" |
| 530 | 532 | configlog "The failed code was:" |
| 531 | 533 | configlog $lines |
| @@ -671,27 +673,27 @@ | ||
| 671 | 673 | } |
| 672 | 674 | |
| 673 | 675 | define CCACHE [find-an-executable [get-env CCACHE ccache]] |
| 674 | 676 | |
| 675 | 677 | # Initial cctest settings |
| 676 | -cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}} | |
| 678 | +cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0} | |
| 677 | 679 | set autosetup(cc-include-deps) {} |
| 678 | 680 | |
| 679 | 681 | msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]" |
| 680 | 682 | if {[get-define CXX] ne "false"} { |
| 681 | 683 | msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]" |
| 682 | 684 | } |
| 683 | 685 | msg-result "Build C compiler...[get-define CC_FOR_BUILD]" |
| 684 | 686 | |
| 685 | -# On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories | |
| 686 | -# but some compilers don't support -gstabs, so test for it here. | |
| 687 | +# On Darwin, we prefer to use -g0 to avoid creating .dSYM directories | |
| 688 | +# but some compilers may not support it, so test here. | |
| 687 | 689 | switch -glob -- [get-define host] { |
| 688 | 690 | *-*-darwin* { |
| 689 | - if {[cctest -cflags {-gstabs}]} { | |
| 690 | - define cc-default-debug -gstabs | |
| 691 | + if {[cctest -cflags {-g0}]} { | |
| 692 | + define cc-default-debug -g0 | |
| 691 | 693 | } |
| 692 | 694 | } |
| 693 | 695 | } |
| 694 | 696 | |
| 695 | 697 | if {![cc-check-includes stdlib.h]} { |
| 696 | 698 | user-error "Compiler does not work. See config.log" |
| 697 | 699 | } |
| 698 | 700 |
| --- autosetup/cc.tcl | |
| +++ autosetup/cc.tcl | |
| @@ -333,11 +333,11 @@ | |
| 333 | } |
| 334 | -libs { |
| 335 | # Note that new libraries are added before previous libraries |
| 336 | set new($name) [list {*}$value {*}$new($name)] |
| 337 | } |
| 338 | -link - -lang { |
| 339 | set new($name) $value |
| 340 | } |
| 341 | -source - -sourcefile - -code { |
| 342 | # XXX: These probably are only valid directly from cctest |
| 343 | set new($name) $value |
| @@ -428,10 +428,11 @@ | |
| 428 | ## -lang c|c++ Use the C (default) or C++ compiler |
| 429 | ## -libs liblist List of libraries to link, e.g. {-ldl -lm} |
| 430 | ## -code code Code to compile in the body of main() |
| 431 | ## -source code Compile a complete program. Ignore -includes, -declare and -code |
| 432 | ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file] |
| 433 | # |
| 434 | # Unless -source or -sourcefile is specified, the C program looks like: |
| 435 | # |
| 436 | ## #include <firstinclude> /* same for remaining includes in the list */ |
| 437 | ## |
| @@ -521,11 +522,12 @@ | |
| 521 | } |
| 522 | |
| 523 | writefile $src $lines\n |
| 524 | |
| 525 | set ok 1 |
| 526 | if {[catch {exec-with-stderr {*}$cmdline} result errinfo]} { |
| 527 | configlog "Failed: [join $cmdline]" |
| 528 | configlog $result |
| 529 | configlog "============" |
| 530 | configlog "The failed code was:" |
| 531 | configlog $lines |
| @@ -671,27 +673,27 @@ | |
| 671 | } |
| 672 | |
| 673 | define CCACHE [find-an-executable [get-env CCACHE ccache]] |
| 674 | |
| 675 | # Initial cctest settings |
| 676 | cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {}} |
| 677 | set autosetup(cc-include-deps) {} |
| 678 | |
| 679 | msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]" |
| 680 | if {[get-define CXX] ne "false"} { |
| 681 | msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]" |
| 682 | } |
| 683 | msg-result "Build C compiler...[get-define CC_FOR_BUILD]" |
| 684 | |
| 685 | # On Darwin, we prefer to use -gstabs to avoid creating .dSYM directories |
| 686 | # but some compilers don't support -gstabs, so test for it here. |
| 687 | switch -glob -- [get-define host] { |
| 688 | *-*-darwin* { |
| 689 | if {[cctest -cflags {-gstabs}]} { |
| 690 | define cc-default-debug -gstabs |
| 691 | } |
| 692 | } |
| 693 | } |
| 694 | |
| 695 | if {![cc-check-includes stdlib.h]} { |
| 696 | user-error "Compiler does not work. See config.log" |
| 697 | } |
| 698 |
| --- autosetup/cc.tcl | |
| +++ autosetup/cc.tcl | |
| @@ -333,11 +333,11 @@ | |
| 333 | } |
| 334 | -libs { |
| 335 | # Note that new libraries are added before previous libraries |
| 336 | set new($name) [list {*}$value {*}$new($name)] |
| 337 | } |
| 338 | -link - -lang - -nooutput { |
| 339 | set new($name) $value |
| 340 | } |
| 341 | -source - -sourcefile - -code { |
| 342 | # XXX: These probably are only valid directly from cctest |
| 343 | set new($name) $value |
| @@ -428,10 +428,11 @@ | |
| 428 | ## -lang c|c++ Use the C (default) or C++ compiler |
| 429 | ## -libs liblist List of libraries to link, e.g. {-ldl -lm} |
| 430 | ## -code code Code to compile in the body of main() |
| 431 | ## -source code Compile a complete program. Ignore -includes, -declare and -code |
| 432 | ## -sourcefile file Shorthand for -source [readfile [get-define srcdir]/$file] |
| 433 | ## -nooutput 1 Treat any compiler output (e.g. a warning) as an error |
| 434 | # |
| 435 | # Unless -source or -sourcefile is specified, the C program looks like: |
| 436 | # |
| 437 | ## #include <firstinclude> /* same for remaining includes in the list */ |
| 438 | ## |
| @@ -521,11 +522,12 @@ | |
| 522 | } |
| 523 | |
| 524 | writefile $src $lines\n |
| 525 | |
| 526 | set ok 1 |
| 527 | set err [catch {exec-with-stderr {*}$cmdline} result errinfo] |
| 528 | if {$err || ($opts(-nooutput) && [string length $result])} { |
| 529 | configlog "Failed: [join $cmdline]" |
| 530 | configlog $result |
| 531 | configlog "============" |
| 532 | configlog "The failed code was:" |
| 533 | configlog $lines |
| @@ -671,27 +673,27 @@ | |
| 673 | } |
| 674 | |
| 675 | define CCACHE [find-an-executable [get-env CCACHE ccache]] |
| 676 | |
| 677 | # Initial cctest settings |
| 678 | cc-store-settings {-cflags {} -includes {} -declare {} -link 0 -lang c -libs {} -code {} -nooutput 0} |
| 679 | set autosetup(cc-include-deps) {} |
| 680 | |
| 681 | msg-result "C compiler...[get-define CCACHE] [get-define CC] [get-define CFLAGS]" |
| 682 | if {[get-define CXX] ne "false"} { |
| 683 | msg-result "C++ compiler...[get-define CCACHE] [get-define CXX] [get-define CXXFLAGS]" |
| 684 | } |
| 685 | msg-result "Build C compiler...[get-define CC_FOR_BUILD]" |
| 686 | |
| 687 | # On Darwin, we prefer to use -g0 to avoid creating .dSYM directories |
| 688 | # but some compilers may not support it, so test here. |
| 689 | switch -glob -- [get-define host] { |
| 690 | *-*-darwin* { |
| 691 | if {[cctest -cflags {-g0}]} { |
| 692 | define cc-default-debug -g0 |
| 693 | } |
| 694 | } |
| 695 | } |
| 696 | |
| 697 | if {![cc-check-includes stdlib.h]} { |
| 698 | user-error "Compiler does not work. See config.log" |
| 699 | } |
| 700 |
+53
-53
| --- autosetup/jimsh0.c | ||
| +++ autosetup/jimsh0.c | ||
| @@ -42,10 +42,11 @@ | ||
| 42 | 42 | #define HAVE_ISATTY |
| 43 | 43 | #define HAVE_SYS_TIME_H |
| 44 | 44 | #define HAVE_DIRENT_H |
| 45 | 45 | #define HAVE_UNISTD_H |
| 46 | 46 | #endif |
| 47 | +#define JIM_VERSION 75 | |
| 47 | 48 | #ifndef JIM_WIN32COMPAT_H |
| 48 | 49 | #define JIM_WIN32COMPAT_H |
| 49 | 50 | |
| 50 | 51 | |
| 51 | 52 | |
| @@ -185,12 +186,10 @@ | ||
| 185 | 186 | #endif |
| 186 | 187 | |
| 187 | 188 | #define UCHAR(c) ((unsigned char)(c)) |
| 188 | 189 | |
| 189 | 190 | |
| 190 | -#define JIM_VERSION 74 | |
| 191 | - | |
| 192 | 191 | #define JIM_OK 0 |
| 193 | 192 | #define JIM_ERR 1 |
| 194 | 193 | #define JIM_RETURN 2 |
| 195 | 194 | #define JIM_BREAK 3 |
| 196 | 195 | #define JIM_CONTINUE 4 |
| @@ -832,16 +831,10 @@ | ||
| 832 | 831 | double *doublePtr); |
| 833 | 832 | JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr, |
| 834 | 833 | double doubleValue); |
| 835 | 834 | JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue); |
| 836 | 835 | |
| 837 | - | |
| 838 | -JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp, | |
| 839 | - const char *str); | |
| 840 | -JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp, | |
| 841 | - const char *str); | |
| 842 | - | |
| 843 | 836 | |
| 844 | 837 | JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc, |
| 845 | 838 | Jim_Obj *const *argv, const char *msg); |
| 846 | 839 | JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr, |
| 847 | 840 | const char * const *tablePtr, int *indexPtr, const char *name, int flags); |
| @@ -875,11 +868,11 @@ | ||
| 875 | 868 | JIM_EXPORT void Jim_HistoryShow(void); |
| 876 | 869 | |
| 877 | 870 | |
| 878 | 871 | JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp); |
| 879 | 872 | JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base); |
| 880 | -JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp); | |
| 873 | +JIM_EXPORT int Jim_IsBigEndian(void); | |
| 881 | 874 | #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask) |
| 882 | 875 | |
| 883 | 876 | |
| 884 | 877 | JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName); |
| 885 | 878 | JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp); |
| @@ -1775,19 +1768,11 @@ | ||
| 1775 | 1768 | |
| 1776 | 1769 | Jim_DecrRefCount(interp, af->filename); |
| 1777 | 1770 | |
| 1778 | 1771 | #ifdef jim_ext_eventloop |
| 1779 | 1772 | |
| 1780 | - if (af->rEvent) { | |
| 1781 | - Jim_DeleteFileHandler(interp, af->fp); | |
| 1782 | - } | |
| 1783 | - if (af->wEvent) { | |
| 1784 | - Jim_DeleteFileHandler(interp, af->fp); | |
| 1785 | - } | |
| 1786 | - if (af->eEvent) { | |
| 1787 | - Jim_DeleteFileHandler(interp, af->fp); | |
| 1788 | - } | |
| 1773 | + Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION); | |
| 1789 | 1774 | #endif |
| 1790 | 1775 | Jim_Free(af); |
| 1791 | 1776 | } |
| 1792 | 1777 | |
| 1793 | 1778 | static int JimCheckStreamError(Jim_Interp *interp, AioFile *af) |
| @@ -2147,27 +2132,26 @@ | ||
| 2147 | 2132 | } |
| 2148 | 2133 | |
| 2149 | 2134 | #ifdef jim_ext_eventloop |
| 2150 | 2135 | static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData) |
| 2151 | 2136 | { |
| 2152 | - Jim_Obj *objPtr = clientData; | |
| 2137 | + Jim_Obj **objPtrPtr = clientData; | |
| 2153 | 2138 | |
| 2154 | - Jim_DecrRefCount(interp, objPtr); | |
| 2139 | + Jim_DecrRefCount(interp, *objPtrPtr); | |
| 2140 | + *objPtrPtr = NULL; | |
| 2155 | 2141 | } |
| 2156 | 2142 | |
| 2157 | 2143 | static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask) |
| 2158 | 2144 | { |
| 2159 | - Jim_Obj *objPtr = clientData; | |
| 2145 | + Jim_Obj **objPtrPtr = clientData; | |
| 2160 | 2146 | |
| 2161 | - return Jim_EvalObjBackground(interp, objPtr); | |
| 2147 | + return Jim_EvalObjBackground(interp, *objPtrPtr); | |
| 2162 | 2148 | } |
| 2163 | 2149 | |
| 2164 | 2150 | static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj, |
| 2165 | 2151 | int argc, Jim_Obj * const *argv) |
| 2166 | 2152 | { |
| 2167 | - int scriptlen = 0; | |
| 2168 | - | |
| 2169 | 2153 | if (argc == 0) { |
| 2170 | 2154 | |
| 2171 | 2155 | if (*scriptHandlerObj) { |
| 2172 | 2156 | Jim_SetResult(interp, *scriptHandlerObj); |
| 2173 | 2157 | } |
| @@ -2174,27 +2158,25 @@ | ||
| 2174 | 2158 | return JIM_OK; |
| 2175 | 2159 | } |
| 2176 | 2160 | |
| 2177 | 2161 | if (*scriptHandlerObj) { |
| 2178 | 2162 | |
| 2179 | - Jim_DeleteFileHandler(interp, af->fp); | |
| 2180 | - *scriptHandlerObj = NULL; | |
| 2163 | + Jim_DeleteFileHandler(interp, af->fp, mask); | |
| 2181 | 2164 | } |
| 2182 | 2165 | |
| 2183 | 2166 | |
| 2184 | - Jim_GetString(argv[0], &scriptlen); | |
| 2185 | - if (scriptlen == 0) { | |
| 2167 | + if (Jim_Length(argv[0]) == 0) { | |
| 2186 | 2168 | |
| 2187 | 2169 | return JIM_OK; |
| 2188 | 2170 | } |
| 2189 | 2171 | |
| 2190 | 2172 | |
| 2191 | 2173 | Jim_IncrRefCount(argv[0]); |
| 2192 | 2174 | *scriptHandlerObj = argv[0]; |
| 2193 | 2175 | |
| 2194 | 2176 | Jim_CreateFileHandler(interp, af->fp, mask, |
| 2195 | - JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer); | |
| 2177 | + JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer); | |
| 2196 | 2178 | |
| 2197 | 2179 | return JIM_OK; |
| 2198 | 2180 | } |
| 2199 | 2181 | |
| 2200 | 2182 | static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| @@ -4005,11 +3987,11 @@ | ||
| 4005 | 3987 | static void JimRestoreEnv(char **env); |
| 4006 | 3988 | static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv, |
| 4007 | 3989 | pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr); |
| 4008 | 3990 | static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr); |
| 4009 | 3991 | static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId); |
| 4010 | -static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents); | |
| 3992 | +static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len); | |
| 4011 | 3993 | static fdtype JimOpenForWrite(const char *filename, int append); |
| 4012 | 3994 | static int JimRewindFd(fdtype fd); |
| 4013 | 3995 | |
| 4014 | 3996 | static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg) |
| 4015 | 3997 | { |
| @@ -4347,10 +4329,11 @@ | ||
| 4347 | 4329 | int cmdCount; /* Count of number of distinct commands |
| 4348 | 4330 | * found in argc/argv. */ |
| 4349 | 4331 | const char *input = NULL; /* Describes input for pipeline, depending |
| 4350 | 4332 | * on "inputFile". NULL means take input |
| 4351 | 4333 | * from stdin/pipe. */ |
| 4334 | + int input_len = 0; | |
| 4352 | 4335 | |
| 4353 | 4336 | #define FILE_NAME 0 |
| 4354 | 4337 | #define FILE_APPEND 1 |
| 4355 | 4338 | #define FILE_HANDLE 2 |
| 4356 | 4339 | #define FILE_TEXT 3 |
| @@ -4412,19 +4395,20 @@ | ||
| 4412 | 4395 | if (arg[0] == '<') { |
| 4413 | 4396 | inputFile = FILE_NAME; |
| 4414 | 4397 | input = arg + 1; |
| 4415 | 4398 | if (*input == '<') { |
| 4416 | 4399 | inputFile = FILE_TEXT; |
| 4400 | + input_len = Jim_Length(argv[i]) - 2; | |
| 4417 | 4401 | input++; |
| 4418 | 4402 | } |
| 4419 | 4403 | else if (*input == '@') { |
| 4420 | 4404 | inputFile = FILE_HANDLE; |
| 4421 | 4405 | input++; |
| 4422 | 4406 | } |
| 4423 | 4407 | |
| 4424 | 4408 | if (!*input && ++i < argc) { |
| 4425 | - input = Jim_String(argv[i]); | |
| 4409 | + input = Jim_GetString(argv[i], &input_len); | |
| 4426 | 4410 | } |
| 4427 | 4411 | } |
| 4428 | 4412 | else if (arg[0] == '>') { |
| 4429 | 4413 | int dup_error = 0; |
| 4430 | 4414 | |
| @@ -4498,11 +4482,11 @@ | ||
| 4498 | 4482 | |
| 4499 | 4483 | save_environ = JimSaveEnv(JimBuildEnv(interp)); |
| 4500 | 4484 | |
| 4501 | 4485 | if (input != NULL) { |
| 4502 | 4486 | if (inputFile == FILE_TEXT) { |
| 4503 | - inputId = JimCreateTemp(interp, input); | |
| 4487 | + inputId = JimCreateTemp(interp, input, input_len); | |
| 4504 | 4488 | if (inputId == JIM_BAD_FD) { |
| 4505 | 4489 | goto error; |
| 4506 | 4490 | } |
| 4507 | 4491 | } |
| 4508 | 4492 | else if (inputFile == FILE_HANDLE) { |
| @@ -4587,11 +4571,11 @@ | ||
| 4587 | 4571 | goto error; |
| 4588 | 4572 | } |
| 4589 | 4573 | } |
| 4590 | 4574 | } |
| 4591 | 4575 | else if (errFilePtr != NULL) { |
| 4592 | - errorId = JimCreateTemp(interp, NULL); | |
| 4576 | + errorId = JimCreateTemp(interp, NULL, 0); | |
| 4593 | 4577 | if (errorId == JIM_BAD_FD) { |
| 4594 | 4578 | goto error; |
| 4595 | 4579 | } |
| 4596 | 4580 | *errFilePtr = JimDupFd(errorId); |
| 4597 | 4581 | } |
| @@ -4953,11 +4937,11 @@ | ||
| 4953 | 4937 | *status = ret; |
| 4954 | 4938 | CloseHandle(pid); |
| 4955 | 4939 | return pid; |
| 4956 | 4940 | } |
| 4957 | 4941 | |
| 4958 | -static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents) | |
| 4942 | +static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len) | |
| 4959 | 4943 | { |
| 4960 | 4944 | char name[MAX_PATH]; |
| 4961 | 4945 | HANDLE handle; |
| 4962 | 4946 | |
| 4963 | 4947 | if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) { |
| @@ -4977,11 +4961,11 @@ | ||
| 4977 | 4961 | FILE *fh = JimFdOpenForWrite(JimDupFd(handle)); |
| 4978 | 4962 | if (fh == NULL) { |
| 4979 | 4963 | goto error; |
| 4980 | 4964 | } |
| 4981 | 4965 | |
| 4982 | - if (fwrite(contents, strlen(contents), 1, fh) != 1) { | |
| 4966 | + if (fwrite(contents, len, 1, fh) != 1) { | |
| 4983 | 4967 | fclose(fh); |
| 4984 | 4968 | goto error; |
| 4985 | 4969 | } |
| 4986 | 4970 | fseek(fh, 0, SEEK_SET); |
| 4987 | 4971 | fclose(fh); |
| @@ -5196,11 +5180,11 @@ | ||
| 5196 | 5180 | static int JimRewindFd(int fd) |
| 5197 | 5181 | { |
| 5198 | 5182 | return lseek(fd, 0L, SEEK_SET); |
| 5199 | 5183 | } |
| 5200 | 5184 | |
| 5201 | -static int JimCreateTemp(Jim_Interp *interp, const char *contents) | |
| 5185 | +static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len) | |
| 5202 | 5186 | { |
| 5203 | 5187 | char inName[] = "/tmp/tcl.tmp.XXXXXX"; |
| 5204 | 5188 | |
| 5205 | 5189 | int fd = mkstemp(inName); |
| 5206 | 5190 | if (fd == JIM_BAD_FD) { |
| @@ -5207,12 +5191,11 @@ | ||
| 5207 | 5191 | Jim_SetResultErrno(interp, "couldn't create temp file"); |
| 5208 | 5192 | return -1; |
| 5209 | 5193 | } |
| 5210 | 5194 | unlink(inName); |
| 5211 | 5195 | if (contents) { |
| 5212 | - int length = strlen(contents); | |
| 5213 | - if (write(fd, contents, length) != length) { | |
| 5196 | + if (write(fd, contents, len) != len) { | |
| 5214 | 5197 | Jim_SetResultErrno(interp, "couldn't write temp file"); |
| 5215 | 5198 | close(fd); |
| 5216 | 5199 | return -1; |
| 5217 | 5200 | } |
| 5218 | 5201 | lseek(fd, 0L, SEEK_SET); |
| @@ -5671,10 +5654,11 @@ | ||
| 5671 | 5654 | #ifdef JIM_MAINTAINER |
| 5672 | 5655 | #define JIM_DEBUG_COMMAND |
| 5673 | 5656 | #define JIM_DEBUG_PANIC |
| 5674 | 5657 | #endif |
| 5675 | 5658 | |
| 5659 | + | |
| 5676 | 5660 | |
| 5677 | 5661 | #define JIM_INTEGER_SPACE 24 |
| 5678 | 5662 | |
| 5679 | 5663 | const char *jim_tt_name(int type); |
| 5680 | 5664 | |
| @@ -6029,11 +6013,12 @@ | ||
| 6029 | 6013 | if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) { |
| 6030 | 6014 | |
| 6031 | 6015 | return i; |
| 6032 | 6016 | } |
| 6033 | 6017 | |
| 6034 | - return 10; | |
| 6018 | + *base = 10; | |
| 6019 | + return 0; | |
| 6035 | 6020 | } |
| 6036 | 6021 | |
| 6037 | 6022 | static long jim_strtol(const char *str, char **endptr) |
| 6038 | 6023 | { |
| 6039 | 6024 | int sign; |
| @@ -6109,10 +6094,12 @@ | ||
| 6109 | 6094 | return len; |
| 6110 | 6095 | } |
| 6111 | 6096 | |
| 6112 | 6097 | if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') { |
| 6113 | 6098 | buf[i] = toupper(UCHAR(buf[i])); |
| 6099 | + if (buf[i] == 'n' || buf[i] == 'N') | |
| 6100 | + buf[i+2] = toupper(UCHAR(buf[i+2])); | |
| 6114 | 6101 | buf[i + 3] = 0; |
| 6115 | 6102 | return i + 3; |
| 6116 | 6103 | } |
| 6117 | 6104 | } |
| 6118 | 6105 | |
| @@ -7581,17 +7568,21 @@ | ||
| 7581 | 7568 | objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr; |
| 7582 | 7569 | if (objPtr->nextObjPtr) |
| 7583 | 7570 | objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr; |
| 7584 | 7571 | if (interp->liveList == objPtr) |
| 7585 | 7572 | interp->liveList = objPtr->nextObjPtr; |
| 7573 | +#ifdef JIM_DISABLE_OBJECT_POOL | |
| 7574 | + Jim_Free(objPtr); | |
| 7575 | +#else | |
| 7586 | 7576 | |
| 7587 | 7577 | objPtr->prevObjPtr = NULL; |
| 7588 | 7578 | objPtr->nextObjPtr = interp->freeList; |
| 7589 | 7579 | if (interp->freeList) |
| 7590 | 7580 | interp->freeList->prevObjPtr = objPtr; |
| 7591 | 7581 | interp->freeList = objPtr; |
| 7592 | 7582 | objPtr->refCount = -1; |
| 7583 | +#endif | |
| 7593 | 7584 | } |
| 7594 | 7585 | |
| 7595 | 7586 | |
| 7596 | 7587 | void Jim_InvalidateStringRep(Jim_Obj *objPtr) |
| 7597 | 7588 | { |
| @@ -8244,10 +8235,19 @@ | ||
| 8244 | 8235 | } |
| 8245 | 8236 | |
| 8246 | 8237 | return strObjPtr; |
| 8247 | 8238 | } |
| 8248 | 8239 | |
| 8240 | + | |
| 8241 | +#ifdef HAVE_ISASCII | |
| 8242 | +#define jim_isascii isascii | |
| 8243 | +#else | |
| 8244 | +static int jim_isascii(int c) | |
| 8245 | +{ | |
| 8246 | + return !(c & ~0x7f); | |
| 8247 | +} | |
| 8248 | +#endif | |
| 8249 | 8249 | |
| 8250 | 8250 | static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict) |
| 8251 | 8251 | { |
| 8252 | 8252 | static const char * const strclassnames[] = { |
| 8253 | 8253 | "integer", "alpha", "alnum", "ascii", "digit", |
| @@ -8291,11 +8291,11 @@ | ||
| 8291 | 8291 | return JIM_OK; |
| 8292 | 8292 | } |
| 8293 | 8293 | |
| 8294 | 8294 | case STR_IS_ALPHA: isclassfunc = isalpha; break; |
| 8295 | 8295 | case STR_IS_ALNUM: isclassfunc = isalnum; break; |
| 8296 | - case STR_IS_ASCII: isclassfunc = isascii; break; | |
| 8296 | + case STR_IS_ASCII: isclassfunc = jim_isascii; break; | |
| 8297 | 8297 | case STR_IS_DIGIT: isclassfunc = isdigit; break; |
| 8298 | 8298 | case STR_IS_LOWER: isclassfunc = islower; break; |
| 8299 | 8299 | case STR_IS_UPPER: isclassfunc = isupper; break; |
| 8300 | 8300 | case STR_IS_SPACE: isclassfunc = isspace; break; |
| 8301 | 8301 | case STR_IS_XDIGIT: isclassfunc = isxdigit; break; |
| @@ -10213,11 +10213,11 @@ | ||
| 10213 | 10213 | Jim_Collect(interp); |
| 10214 | 10214 | } |
| 10215 | 10215 | } |
| 10216 | 10216 | #endif |
| 10217 | 10217 | |
| 10218 | -static int JimIsBigEndian(void) | |
| 10218 | +int Jim_IsBigEndian(void) | |
| 10219 | 10219 | { |
| 10220 | 10220 | union { |
| 10221 | 10221 | unsigned short s; |
| 10222 | 10222 | unsigned char c[2]; |
| 10223 | 10223 | } uval = {0x0102}; |
| @@ -10269,11 +10269,11 @@ | ||
| 10269 | 10269 | Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0"); |
| 10270 | 10270 | |
| 10271 | 10271 | Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS); |
| 10272 | 10272 | Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM); |
| 10273 | 10273 | Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR); |
| 10274 | - Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian"); | |
| 10274 | + Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian"); | |
| 10275 | 10275 | Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0"); |
| 10276 | 10276 | Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *))); |
| 10277 | 10277 | Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide))); |
| 10278 | 10278 | |
| 10279 | 10279 | return i; |
| @@ -10449,17 +10449,11 @@ | ||
| 10449 | 10449 | interp->stackTrace = stackTraceObj; |
| 10450 | 10450 | interp->errorFlag = 1; |
| 10451 | 10451 | |
| 10452 | 10452 | len = Jim_ListLength(interp, interp->stackTrace); |
| 10453 | 10453 | if (len >= 3) { |
| 10454 | - Jim_Obj *filenameObj; | |
| 10455 | - | |
| 10456 | - Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE); | |
| 10457 | - | |
| 10458 | - Jim_GetString(filenameObj, &len); | |
| 10459 | - | |
| 10460 | - if (!Jim_Length(filenameObj)) { | |
| 10454 | + if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) { | |
| 10461 | 10455 | interp->addStackTrace = 1; |
| 10462 | 10456 | } |
| 10463 | 10457 | } |
| 10464 | 10458 | } |
| 10465 | 10459 | |
| @@ -10485,14 +10479,15 @@ | ||
| 10485 | 10479 | if (!*procname && Jim_Length(fileNameObj)) { |
| 10486 | 10480 | |
| 10487 | 10481 | int len = Jim_ListLength(interp, interp->stackTrace); |
| 10488 | 10482 | |
| 10489 | 10483 | if (len >= 3) { |
| 10490 | - Jim_Obj *objPtr; | |
| 10491 | - if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) { | |
| 10484 | + Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3); | |
| 10485 | + if (Jim_Length(objPtr)) { | |
| 10492 | 10486 | |
| 10493 | - if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) { | |
| 10487 | + objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2); | |
| 10488 | + if (Jim_Length(objPtr) == 0) { | |
| 10494 | 10489 | |
| 10495 | 10490 | ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0); |
| 10496 | 10491 | ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0); |
| 10497 | 10492 | return; |
| 10498 | 10493 | } |
| @@ -17159,10 +17154,15 @@ | ||
| 17159 | 17154 | |
| 17160 | 17155 | static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| 17161 | 17156 | { |
| 17162 | 17157 | int retcode; |
| 17163 | 17158 | |
| 17159 | + if (argc < 2) { | |
| 17160 | + Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?"); | |
| 17161 | + return JIM_ERR; | |
| 17162 | + } | |
| 17163 | + | |
| 17164 | 17164 | |
| 17165 | 17165 | interp->local++; |
| 17166 | 17166 | retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1); |
| 17167 | 17167 | interp->local--; |
| 17168 | 17168 | |
| @@ -19552,11 +19552,11 @@ | ||
| 19552 | 19552 | char *num_buffer = NULL; |
| 19553 | 19553 | int num_buffer_size = 0; |
| 19554 | 19554 | |
| 19555 | 19555 | span = format = Jim_GetString(fmtObjPtr, &formatLen); |
| 19556 | 19556 | formatEnd = format + formatLen; |
| 19557 | - resultPtr = Jim_NewStringObj(interp, "", 0); | |
| 19557 | + resultPtr = Jim_NewEmptyStringObj(interp); | |
| 19558 | 19558 | |
| 19559 | 19559 | while (format != formatEnd) { |
| 19560 | 19560 | char *end; |
| 19561 | 19561 | int gotMinus, sawFlag; |
| 19562 | 19562 | int gotPrecision, useShort; |
| 19563 | 19563 |
| --- autosetup/jimsh0.c | |
| +++ autosetup/jimsh0.c | |
| @@ -42,10 +42,11 @@ | |
| 42 | #define HAVE_ISATTY |
| 43 | #define HAVE_SYS_TIME_H |
| 44 | #define HAVE_DIRENT_H |
| 45 | #define HAVE_UNISTD_H |
| 46 | #endif |
| 47 | #ifndef JIM_WIN32COMPAT_H |
| 48 | #define JIM_WIN32COMPAT_H |
| 49 | |
| 50 | |
| 51 | |
| @@ -185,12 +186,10 @@ | |
| 185 | #endif |
| 186 | |
| 187 | #define UCHAR(c) ((unsigned char)(c)) |
| 188 | |
| 189 | |
| 190 | #define JIM_VERSION 74 |
| 191 | |
| 192 | #define JIM_OK 0 |
| 193 | #define JIM_ERR 1 |
| 194 | #define JIM_RETURN 2 |
| 195 | #define JIM_BREAK 3 |
| 196 | #define JIM_CONTINUE 4 |
| @@ -832,16 +831,10 @@ | |
| 832 | double *doublePtr); |
| 833 | JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr, |
| 834 | double doubleValue); |
| 835 | JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue); |
| 836 | |
| 837 | |
| 838 | JIM_EXPORT const char * Jim_GetSharedString (Jim_Interp *interp, |
| 839 | const char *str); |
| 840 | JIM_EXPORT void Jim_ReleaseSharedString (Jim_Interp *interp, |
| 841 | const char *str); |
| 842 | |
| 843 | |
| 844 | JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc, |
| 845 | Jim_Obj *const *argv, const char *msg); |
| 846 | JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr, |
| 847 | const char * const *tablePtr, int *indexPtr, const char *name, int flags); |
| @@ -875,11 +868,11 @@ | |
| 875 | JIM_EXPORT void Jim_HistoryShow(void); |
| 876 | |
| 877 | |
| 878 | JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp); |
| 879 | JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base); |
| 880 | JIM_EXPORT int Jim_CheckSignal(Jim_Interp *interp); |
| 881 | #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask) |
| 882 | |
| 883 | |
| 884 | JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName); |
| 885 | JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp); |
| @@ -1775,19 +1768,11 @@ | |
| 1775 | |
| 1776 | Jim_DecrRefCount(interp, af->filename); |
| 1777 | |
| 1778 | #ifdef jim_ext_eventloop |
| 1779 | |
| 1780 | if (af->rEvent) { |
| 1781 | Jim_DeleteFileHandler(interp, af->fp); |
| 1782 | } |
| 1783 | if (af->wEvent) { |
| 1784 | Jim_DeleteFileHandler(interp, af->fp); |
| 1785 | } |
| 1786 | if (af->eEvent) { |
| 1787 | Jim_DeleteFileHandler(interp, af->fp); |
| 1788 | } |
| 1789 | #endif |
| 1790 | Jim_Free(af); |
| 1791 | } |
| 1792 | |
| 1793 | static int JimCheckStreamError(Jim_Interp *interp, AioFile *af) |
| @@ -2147,27 +2132,26 @@ | |
| 2147 | } |
| 2148 | |
| 2149 | #ifdef jim_ext_eventloop |
| 2150 | static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData) |
| 2151 | { |
| 2152 | Jim_Obj *objPtr = clientData; |
| 2153 | |
| 2154 | Jim_DecrRefCount(interp, objPtr); |
| 2155 | } |
| 2156 | |
| 2157 | static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask) |
| 2158 | { |
| 2159 | Jim_Obj *objPtr = clientData; |
| 2160 | |
| 2161 | return Jim_EvalObjBackground(interp, objPtr); |
| 2162 | } |
| 2163 | |
| 2164 | static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj, |
| 2165 | int argc, Jim_Obj * const *argv) |
| 2166 | { |
| 2167 | int scriptlen = 0; |
| 2168 | |
| 2169 | if (argc == 0) { |
| 2170 | |
| 2171 | if (*scriptHandlerObj) { |
| 2172 | Jim_SetResult(interp, *scriptHandlerObj); |
| 2173 | } |
| @@ -2174,27 +2158,25 @@ | |
| 2174 | return JIM_OK; |
| 2175 | } |
| 2176 | |
| 2177 | if (*scriptHandlerObj) { |
| 2178 | |
| 2179 | Jim_DeleteFileHandler(interp, af->fp); |
| 2180 | *scriptHandlerObj = NULL; |
| 2181 | } |
| 2182 | |
| 2183 | |
| 2184 | Jim_GetString(argv[0], &scriptlen); |
| 2185 | if (scriptlen == 0) { |
| 2186 | |
| 2187 | return JIM_OK; |
| 2188 | } |
| 2189 | |
| 2190 | |
| 2191 | Jim_IncrRefCount(argv[0]); |
| 2192 | *scriptHandlerObj = argv[0]; |
| 2193 | |
| 2194 | Jim_CreateFileHandler(interp, af->fp, mask, |
| 2195 | JimAioFileEventHandler, *scriptHandlerObj, JimAioFileEventFinalizer); |
| 2196 | |
| 2197 | return JIM_OK; |
| 2198 | } |
| 2199 | |
| 2200 | static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| @@ -4005,11 +3987,11 @@ | |
| 4005 | static void JimRestoreEnv(char **env); |
| 4006 | static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv, |
| 4007 | pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr); |
| 4008 | static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr); |
| 4009 | static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId); |
| 4010 | static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents); |
| 4011 | static fdtype JimOpenForWrite(const char *filename, int append); |
| 4012 | static int JimRewindFd(fdtype fd); |
| 4013 | |
| 4014 | static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg) |
| 4015 | { |
| @@ -4347,10 +4329,11 @@ | |
| 4347 | int cmdCount; /* Count of number of distinct commands |
| 4348 | * found in argc/argv. */ |
| 4349 | const char *input = NULL; /* Describes input for pipeline, depending |
| 4350 | * on "inputFile". NULL means take input |
| 4351 | * from stdin/pipe. */ |
| 4352 | |
| 4353 | #define FILE_NAME 0 |
| 4354 | #define FILE_APPEND 1 |
| 4355 | #define FILE_HANDLE 2 |
| 4356 | #define FILE_TEXT 3 |
| @@ -4412,19 +4395,20 @@ | |
| 4412 | if (arg[0] == '<') { |
| 4413 | inputFile = FILE_NAME; |
| 4414 | input = arg + 1; |
| 4415 | if (*input == '<') { |
| 4416 | inputFile = FILE_TEXT; |
| 4417 | input++; |
| 4418 | } |
| 4419 | else if (*input == '@') { |
| 4420 | inputFile = FILE_HANDLE; |
| 4421 | input++; |
| 4422 | } |
| 4423 | |
| 4424 | if (!*input && ++i < argc) { |
| 4425 | input = Jim_String(argv[i]); |
| 4426 | } |
| 4427 | } |
| 4428 | else if (arg[0] == '>') { |
| 4429 | int dup_error = 0; |
| 4430 | |
| @@ -4498,11 +4482,11 @@ | |
| 4498 | |
| 4499 | save_environ = JimSaveEnv(JimBuildEnv(interp)); |
| 4500 | |
| 4501 | if (input != NULL) { |
| 4502 | if (inputFile == FILE_TEXT) { |
| 4503 | inputId = JimCreateTemp(interp, input); |
| 4504 | if (inputId == JIM_BAD_FD) { |
| 4505 | goto error; |
| 4506 | } |
| 4507 | } |
| 4508 | else if (inputFile == FILE_HANDLE) { |
| @@ -4587,11 +4571,11 @@ | |
| 4587 | goto error; |
| 4588 | } |
| 4589 | } |
| 4590 | } |
| 4591 | else if (errFilePtr != NULL) { |
| 4592 | errorId = JimCreateTemp(interp, NULL); |
| 4593 | if (errorId == JIM_BAD_FD) { |
| 4594 | goto error; |
| 4595 | } |
| 4596 | *errFilePtr = JimDupFd(errorId); |
| 4597 | } |
| @@ -4953,11 +4937,11 @@ | |
| 4953 | *status = ret; |
| 4954 | CloseHandle(pid); |
| 4955 | return pid; |
| 4956 | } |
| 4957 | |
| 4958 | static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents) |
| 4959 | { |
| 4960 | char name[MAX_PATH]; |
| 4961 | HANDLE handle; |
| 4962 | |
| 4963 | if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) { |
| @@ -4977,11 +4961,11 @@ | |
| 4977 | FILE *fh = JimFdOpenForWrite(JimDupFd(handle)); |
| 4978 | if (fh == NULL) { |
| 4979 | goto error; |
| 4980 | } |
| 4981 | |
| 4982 | if (fwrite(contents, strlen(contents), 1, fh) != 1) { |
| 4983 | fclose(fh); |
| 4984 | goto error; |
| 4985 | } |
| 4986 | fseek(fh, 0, SEEK_SET); |
| 4987 | fclose(fh); |
| @@ -5196,11 +5180,11 @@ | |
| 5196 | static int JimRewindFd(int fd) |
| 5197 | { |
| 5198 | return lseek(fd, 0L, SEEK_SET); |
| 5199 | } |
| 5200 | |
| 5201 | static int JimCreateTemp(Jim_Interp *interp, const char *contents) |
| 5202 | { |
| 5203 | char inName[] = "/tmp/tcl.tmp.XXXXXX"; |
| 5204 | |
| 5205 | int fd = mkstemp(inName); |
| 5206 | if (fd == JIM_BAD_FD) { |
| @@ -5207,12 +5191,11 @@ | |
| 5207 | Jim_SetResultErrno(interp, "couldn't create temp file"); |
| 5208 | return -1; |
| 5209 | } |
| 5210 | unlink(inName); |
| 5211 | if (contents) { |
| 5212 | int length = strlen(contents); |
| 5213 | if (write(fd, contents, length) != length) { |
| 5214 | Jim_SetResultErrno(interp, "couldn't write temp file"); |
| 5215 | close(fd); |
| 5216 | return -1; |
| 5217 | } |
| 5218 | lseek(fd, 0L, SEEK_SET); |
| @@ -5671,10 +5654,11 @@ | |
| 5671 | #ifdef JIM_MAINTAINER |
| 5672 | #define JIM_DEBUG_COMMAND |
| 5673 | #define JIM_DEBUG_PANIC |
| 5674 | #endif |
| 5675 | |
| 5676 | |
| 5677 | #define JIM_INTEGER_SPACE 24 |
| 5678 | |
| 5679 | const char *jim_tt_name(int type); |
| 5680 | |
| @@ -6029,11 +6013,12 @@ | |
| 6029 | if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) { |
| 6030 | |
| 6031 | return i; |
| 6032 | } |
| 6033 | |
| 6034 | return 10; |
| 6035 | } |
| 6036 | |
| 6037 | static long jim_strtol(const char *str, char **endptr) |
| 6038 | { |
| 6039 | int sign; |
| @@ -6109,10 +6094,12 @@ | |
| 6109 | return len; |
| 6110 | } |
| 6111 | |
| 6112 | if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') { |
| 6113 | buf[i] = toupper(UCHAR(buf[i])); |
| 6114 | buf[i + 3] = 0; |
| 6115 | return i + 3; |
| 6116 | } |
| 6117 | } |
| 6118 | |
| @@ -7581,17 +7568,21 @@ | |
| 7581 | objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr; |
| 7582 | if (objPtr->nextObjPtr) |
| 7583 | objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr; |
| 7584 | if (interp->liveList == objPtr) |
| 7585 | interp->liveList = objPtr->nextObjPtr; |
| 7586 | |
| 7587 | objPtr->prevObjPtr = NULL; |
| 7588 | objPtr->nextObjPtr = interp->freeList; |
| 7589 | if (interp->freeList) |
| 7590 | interp->freeList->prevObjPtr = objPtr; |
| 7591 | interp->freeList = objPtr; |
| 7592 | objPtr->refCount = -1; |
| 7593 | } |
| 7594 | |
| 7595 | |
| 7596 | void Jim_InvalidateStringRep(Jim_Obj *objPtr) |
| 7597 | { |
| @@ -8244,10 +8235,19 @@ | |
| 8244 | } |
| 8245 | |
| 8246 | return strObjPtr; |
| 8247 | } |
| 8248 | |
| 8249 | |
| 8250 | static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict) |
| 8251 | { |
| 8252 | static const char * const strclassnames[] = { |
| 8253 | "integer", "alpha", "alnum", "ascii", "digit", |
| @@ -8291,11 +8291,11 @@ | |
| 8291 | return JIM_OK; |
| 8292 | } |
| 8293 | |
| 8294 | case STR_IS_ALPHA: isclassfunc = isalpha; break; |
| 8295 | case STR_IS_ALNUM: isclassfunc = isalnum; break; |
| 8296 | case STR_IS_ASCII: isclassfunc = isascii; break; |
| 8297 | case STR_IS_DIGIT: isclassfunc = isdigit; break; |
| 8298 | case STR_IS_LOWER: isclassfunc = islower; break; |
| 8299 | case STR_IS_UPPER: isclassfunc = isupper; break; |
| 8300 | case STR_IS_SPACE: isclassfunc = isspace; break; |
| 8301 | case STR_IS_XDIGIT: isclassfunc = isxdigit; break; |
| @@ -10213,11 +10213,11 @@ | |
| 10213 | Jim_Collect(interp); |
| 10214 | } |
| 10215 | } |
| 10216 | #endif |
| 10217 | |
| 10218 | static int JimIsBigEndian(void) |
| 10219 | { |
| 10220 | union { |
| 10221 | unsigned short s; |
| 10222 | unsigned char c[2]; |
| 10223 | } uval = {0x0102}; |
| @@ -10269,11 +10269,11 @@ | |
| 10269 | Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0"); |
| 10270 | |
| 10271 | Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS); |
| 10272 | Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM); |
| 10273 | Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR); |
| 10274 | Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", JimIsBigEndian() ? "bigEndian" : "littleEndian"); |
| 10275 | Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0"); |
| 10276 | Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *))); |
| 10277 | Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide))); |
| 10278 | |
| 10279 | return i; |
| @@ -10449,17 +10449,11 @@ | |
| 10449 | interp->stackTrace = stackTraceObj; |
| 10450 | interp->errorFlag = 1; |
| 10451 | |
| 10452 | len = Jim_ListLength(interp, interp->stackTrace); |
| 10453 | if (len >= 3) { |
| 10454 | Jim_Obj *filenameObj; |
| 10455 | |
| 10456 | Jim_ListIndex(interp, interp->stackTrace, len - 2, &filenameObj, JIM_NONE); |
| 10457 | |
| 10458 | Jim_GetString(filenameObj, &len); |
| 10459 | |
| 10460 | if (!Jim_Length(filenameObj)) { |
| 10461 | interp->addStackTrace = 1; |
| 10462 | } |
| 10463 | } |
| 10464 | } |
| 10465 | |
| @@ -10485,14 +10479,15 @@ | |
| 10485 | if (!*procname && Jim_Length(fileNameObj)) { |
| 10486 | |
| 10487 | int len = Jim_ListLength(interp, interp->stackTrace); |
| 10488 | |
| 10489 | if (len >= 3) { |
| 10490 | Jim_Obj *objPtr; |
| 10491 | if (Jim_ListIndex(interp, interp->stackTrace, len - 3, &objPtr, JIM_NONE) == JIM_OK && Jim_Length(objPtr)) { |
| 10492 | |
| 10493 | if (Jim_ListIndex(interp, interp->stackTrace, len - 2, &objPtr, JIM_NONE) == JIM_OK && !Jim_Length(objPtr)) { |
| 10494 | |
| 10495 | ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0); |
| 10496 | ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0); |
| 10497 | return; |
| 10498 | } |
| @@ -17159,10 +17154,15 @@ | |
| 17159 | |
| 17160 | static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| 17161 | { |
| 17162 | int retcode; |
| 17163 | |
| 17164 | |
| 17165 | interp->local++; |
| 17166 | retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1); |
| 17167 | interp->local--; |
| 17168 | |
| @@ -19552,11 +19552,11 @@ | |
| 19552 | char *num_buffer = NULL; |
| 19553 | int num_buffer_size = 0; |
| 19554 | |
| 19555 | span = format = Jim_GetString(fmtObjPtr, &formatLen); |
| 19556 | formatEnd = format + formatLen; |
| 19557 | resultPtr = Jim_NewStringObj(interp, "", 0); |
| 19558 | |
| 19559 | while (format != formatEnd) { |
| 19560 | char *end; |
| 19561 | int gotMinus, sawFlag; |
| 19562 | int gotPrecision, useShort; |
| 19563 |
| --- autosetup/jimsh0.c | |
| +++ autosetup/jimsh0.c | |
| @@ -42,10 +42,11 @@ | |
| 42 | #define HAVE_ISATTY |
| 43 | #define HAVE_SYS_TIME_H |
| 44 | #define HAVE_DIRENT_H |
| 45 | #define HAVE_UNISTD_H |
| 46 | #endif |
| 47 | #define JIM_VERSION 75 |
| 48 | #ifndef JIM_WIN32COMPAT_H |
| 49 | #define JIM_WIN32COMPAT_H |
| 50 | |
| 51 | |
| 52 | |
| @@ -185,12 +186,10 @@ | |
| 186 | #endif |
| 187 | |
| 188 | #define UCHAR(c) ((unsigned char)(c)) |
| 189 | |
| 190 | |
| 191 | #define JIM_OK 0 |
| 192 | #define JIM_ERR 1 |
| 193 | #define JIM_RETURN 2 |
| 194 | #define JIM_BREAK 3 |
| 195 | #define JIM_CONTINUE 4 |
| @@ -832,16 +831,10 @@ | |
| 831 | double *doublePtr); |
| 832 | JIM_EXPORT void Jim_SetDouble(Jim_Interp *interp, Jim_Obj *objPtr, |
| 833 | double doubleValue); |
| 834 | JIM_EXPORT Jim_Obj * Jim_NewDoubleObj(Jim_Interp *interp, double doubleValue); |
| 835 | |
| 836 | |
| 837 | JIM_EXPORT void Jim_WrongNumArgs (Jim_Interp *interp, int argc, |
| 838 | Jim_Obj *const *argv, const char *msg); |
| 839 | JIM_EXPORT int Jim_GetEnum (Jim_Interp *interp, Jim_Obj *objPtr, |
| 840 | const char * const *tablePtr, int *indexPtr, const char *name, int flags); |
| @@ -875,11 +868,11 @@ | |
| 868 | JIM_EXPORT void Jim_HistoryShow(void); |
| 869 | |
| 870 | |
| 871 | JIM_EXPORT int Jim_InitStaticExtensions(Jim_Interp *interp); |
| 872 | JIM_EXPORT int Jim_StringToWide(const char *str, jim_wide *widePtr, int base); |
| 873 | JIM_EXPORT int Jim_IsBigEndian(void); |
| 874 | #define Jim_CheckSignal(i) ((i)->signal_level && (i)->sigmask) |
| 875 | |
| 876 | |
| 877 | JIM_EXPORT int Jim_LoadLibrary(Jim_Interp *interp, const char *pathName); |
| 878 | JIM_EXPORT void Jim_FreeLoadHandles(Jim_Interp *interp); |
| @@ -1775,19 +1768,11 @@ | |
| 1768 | |
| 1769 | Jim_DecrRefCount(interp, af->filename); |
| 1770 | |
| 1771 | #ifdef jim_ext_eventloop |
| 1772 | |
| 1773 | Jim_DeleteFileHandler(interp, af->fp, JIM_EVENT_READABLE | JIM_EVENT_WRITABLE | JIM_EVENT_EXCEPTION); |
| 1774 | #endif |
| 1775 | Jim_Free(af); |
| 1776 | } |
| 1777 | |
| 1778 | static int JimCheckStreamError(Jim_Interp *interp, AioFile *af) |
| @@ -2147,27 +2132,26 @@ | |
| 2132 | } |
| 2133 | |
| 2134 | #ifdef jim_ext_eventloop |
| 2135 | static void JimAioFileEventFinalizer(Jim_Interp *interp, void *clientData) |
| 2136 | { |
| 2137 | Jim_Obj **objPtrPtr = clientData; |
| 2138 | |
| 2139 | Jim_DecrRefCount(interp, *objPtrPtr); |
| 2140 | *objPtrPtr = NULL; |
| 2141 | } |
| 2142 | |
| 2143 | static int JimAioFileEventHandler(Jim_Interp *interp, void *clientData, int mask) |
| 2144 | { |
| 2145 | Jim_Obj **objPtrPtr = clientData; |
| 2146 | |
| 2147 | return Jim_EvalObjBackground(interp, *objPtrPtr); |
| 2148 | } |
| 2149 | |
| 2150 | static int aio_eventinfo(Jim_Interp *interp, AioFile * af, unsigned mask, Jim_Obj **scriptHandlerObj, |
| 2151 | int argc, Jim_Obj * const *argv) |
| 2152 | { |
| 2153 | if (argc == 0) { |
| 2154 | |
| 2155 | if (*scriptHandlerObj) { |
| 2156 | Jim_SetResult(interp, *scriptHandlerObj); |
| 2157 | } |
| @@ -2174,27 +2158,25 @@ | |
| 2158 | return JIM_OK; |
| 2159 | } |
| 2160 | |
| 2161 | if (*scriptHandlerObj) { |
| 2162 | |
| 2163 | Jim_DeleteFileHandler(interp, af->fp, mask); |
| 2164 | } |
| 2165 | |
| 2166 | |
| 2167 | if (Jim_Length(argv[0]) == 0) { |
| 2168 | |
| 2169 | return JIM_OK; |
| 2170 | } |
| 2171 | |
| 2172 | |
| 2173 | Jim_IncrRefCount(argv[0]); |
| 2174 | *scriptHandlerObj = argv[0]; |
| 2175 | |
| 2176 | Jim_CreateFileHandler(interp, af->fp, mask, |
| 2177 | JimAioFileEventHandler, scriptHandlerObj, JimAioFileEventFinalizer); |
| 2178 | |
| 2179 | return JIM_OK; |
| 2180 | } |
| 2181 | |
| 2182 | static int aio_cmd_readable(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| @@ -4005,11 +3987,11 @@ | |
| 3987 | static void JimRestoreEnv(char **env); |
| 3988 | static int JimCreatePipeline(Jim_Interp *interp, int argc, Jim_Obj *const *argv, |
| 3989 | pidtype **pidArrayPtr, fdtype *inPipePtr, fdtype *outPipePtr, fdtype *errFilePtr); |
| 3990 | static void JimDetachPids(Jim_Interp *interp, int numPids, const pidtype *pidPtr); |
| 3991 | static int JimCleanupChildren(Jim_Interp *interp, int numPids, pidtype *pidPtr, fdtype errorId); |
| 3992 | static fdtype JimCreateTemp(Jim_Interp *interp, const char *contents, int len); |
| 3993 | static fdtype JimOpenForWrite(const char *filename, int append); |
| 3994 | static int JimRewindFd(fdtype fd); |
| 3995 | |
| 3996 | static void Jim_SetResultErrno(Jim_Interp *interp, const char *msg) |
| 3997 | { |
| @@ -4347,10 +4329,11 @@ | |
| 4329 | int cmdCount; /* Count of number of distinct commands |
| 4330 | * found in argc/argv. */ |
| 4331 | const char *input = NULL; /* Describes input for pipeline, depending |
| 4332 | * on "inputFile". NULL means take input |
| 4333 | * from stdin/pipe. */ |
| 4334 | int input_len = 0; |
| 4335 | |
| 4336 | #define FILE_NAME 0 |
| 4337 | #define FILE_APPEND 1 |
| 4338 | #define FILE_HANDLE 2 |
| 4339 | #define FILE_TEXT 3 |
| @@ -4412,19 +4395,20 @@ | |
| 4395 | if (arg[0] == '<') { |
| 4396 | inputFile = FILE_NAME; |
| 4397 | input = arg + 1; |
| 4398 | if (*input == '<') { |
| 4399 | inputFile = FILE_TEXT; |
| 4400 | input_len = Jim_Length(argv[i]) - 2; |
| 4401 | input++; |
| 4402 | } |
| 4403 | else if (*input == '@') { |
| 4404 | inputFile = FILE_HANDLE; |
| 4405 | input++; |
| 4406 | } |
| 4407 | |
| 4408 | if (!*input && ++i < argc) { |
| 4409 | input = Jim_GetString(argv[i], &input_len); |
| 4410 | } |
| 4411 | } |
| 4412 | else if (arg[0] == '>') { |
| 4413 | int dup_error = 0; |
| 4414 | |
| @@ -4498,11 +4482,11 @@ | |
| 4482 | |
| 4483 | save_environ = JimSaveEnv(JimBuildEnv(interp)); |
| 4484 | |
| 4485 | if (input != NULL) { |
| 4486 | if (inputFile == FILE_TEXT) { |
| 4487 | inputId = JimCreateTemp(interp, input, input_len); |
| 4488 | if (inputId == JIM_BAD_FD) { |
| 4489 | goto error; |
| 4490 | } |
| 4491 | } |
| 4492 | else if (inputFile == FILE_HANDLE) { |
| @@ -4587,11 +4571,11 @@ | |
| 4571 | goto error; |
| 4572 | } |
| 4573 | } |
| 4574 | } |
| 4575 | else if (errFilePtr != NULL) { |
| 4576 | errorId = JimCreateTemp(interp, NULL, 0); |
| 4577 | if (errorId == JIM_BAD_FD) { |
| 4578 | goto error; |
| 4579 | } |
| 4580 | *errFilePtr = JimDupFd(errorId); |
| 4581 | } |
| @@ -4953,11 +4937,11 @@ | |
| 4937 | *status = ret; |
| 4938 | CloseHandle(pid); |
| 4939 | return pid; |
| 4940 | } |
| 4941 | |
| 4942 | static HANDLE JimCreateTemp(Jim_Interp *interp, const char *contents, int len) |
| 4943 | { |
| 4944 | char name[MAX_PATH]; |
| 4945 | HANDLE handle; |
| 4946 | |
| 4947 | if (!GetTempPath(MAX_PATH, name) || !GetTempFileName(name, "JIM", 0, name)) { |
| @@ -4977,11 +4961,11 @@ | |
| 4961 | FILE *fh = JimFdOpenForWrite(JimDupFd(handle)); |
| 4962 | if (fh == NULL) { |
| 4963 | goto error; |
| 4964 | } |
| 4965 | |
| 4966 | if (fwrite(contents, len, 1, fh) != 1) { |
| 4967 | fclose(fh); |
| 4968 | goto error; |
| 4969 | } |
| 4970 | fseek(fh, 0, SEEK_SET); |
| 4971 | fclose(fh); |
| @@ -5196,11 +5180,11 @@ | |
| 5180 | static int JimRewindFd(int fd) |
| 5181 | { |
| 5182 | return lseek(fd, 0L, SEEK_SET); |
| 5183 | } |
| 5184 | |
| 5185 | static int JimCreateTemp(Jim_Interp *interp, const char *contents, int len) |
| 5186 | { |
| 5187 | char inName[] = "/tmp/tcl.tmp.XXXXXX"; |
| 5188 | |
| 5189 | int fd = mkstemp(inName); |
| 5190 | if (fd == JIM_BAD_FD) { |
| @@ -5207,12 +5191,11 @@ | |
| 5191 | Jim_SetResultErrno(interp, "couldn't create temp file"); |
| 5192 | return -1; |
| 5193 | } |
| 5194 | unlink(inName); |
| 5195 | if (contents) { |
| 5196 | if (write(fd, contents, len) != len) { |
| 5197 | Jim_SetResultErrno(interp, "couldn't write temp file"); |
| 5198 | close(fd); |
| 5199 | return -1; |
| 5200 | } |
| 5201 | lseek(fd, 0L, SEEK_SET); |
| @@ -5671,10 +5654,11 @@ | |
| 5654 | #ifdef JIM_MAINTAINER |
| 5655 | #define JIM_DEBUG_COMMAND |
| 5656 | #define JIM_DEBUG_PANIC |
| 5657 | #endif |
| 5658 | |
| 5659 | |
| 5660 | |
| 5661 | #define JIM_INTEGER_SPACE 24 |
| 5662 | |
| 5663 | const char *jim_tt_name(int type); |
| 5664 | |
| @@ -6029,11 +6013,12 @@ | |
| 6013 | if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) { |
| 6014 | |
| 6015 | return i; |
| 6016 | } |
| 6017 | |
| 6018 | *base = 10; |
| 6019 | return 0; |
| 6020 | } |
| 6021 | |
| 6022 | static long jim_strtol(const char *str, char **endptr) |
| 6023 | { |
| 6024 | int sign; |
| @@ -6109,10 +6094,12 @@ | |
| 6094 | return len; |
| 6095 | } |
| 6096 | |
| 6097 | if (buf[i] == 'i' || buf[i] == 'I' || buf[i] == 'n' || buf[i] == 'N') { |
| 6098 | buf[i] = toupper(UCHAR(buf[i])); |
| 6099 | if (buf[i] == 'n' || buf[i] == 'N') |
| 6100 | buf[i+2] = toupper(UCHAR(buf[i+2])); |
| 6101 | buf[i + 3] = 0; |
| 6102 | return i + 3; |
| 6103 | } |
| 6104 | } |
| 6105 | |
| @@ -7581,17 +7568,21 @@ | |
| 7568 | objPtr->prevObjPtr->nextObjPtr = objPtr->nextObjPtr; |
| 7569 | if (objPtr->nextObjPtr) |
| 7570 | objPtr->nextObjPtr->prevObjPtr = objPtr->prevObjPtr; |
| 7571 | if (interp->liveList == objPtr) |
| 7572 | interp->liveList = objPtr->nextObjPtr; |
| 7573 | #ifdef JIM_DISABLE_OBJECT_POOL |
| 7574 | Jim_Free(objPtr); |
| 7575 | #else |
| 7576 | |
| 7577 | objPtr->prevObjPtr = NULL; |
| 7578 | objPtr->nextObjPtr = interp->freeList; |
| 7579 | if (interp->freeList) |
| 7580 | interp->freeList->prevObjPtr = objPtr; |
| 7581 | interp->freeList = objPtr; |
| 7582 | objPtr->refCount = -1; |
| 7583 | #endif |
| 7584 | } |
| 7585 | |
| 7586 | |
| 7587 | void Jim_InvalidateStringRep(Jim_Obj *objPtr) |
| 7588 | { |
| @@ -8244,10 +8235,19 @@ | |
| 8235 | } |
| 8236 | |
| 8237 | return strObjPtr; |
| 8238 | } |
| 8239 | |
| 8240 | |
| 8241 | #ifdef HAVE_ISASCII |
| 8242 | #define jim_isascii isascii |
| 8243 | #else |
| 8244 | static int jim_isascii(int c) |
| 8245 | { |
| 8246 | return !(c & ~0x7f); |
| 8247 | } |
| 8248 | #endif |
| 8249 | |
| 8250 | static int JimStringIs(Jim_Interp *interp, Jim_Obj *strObjPtr, Jim_Obj *strClass, int strict) |
| 8251 | { |
| 8252 | static const char * const strclassnames[] = { |
| 8253 | "integer", "alpha", "alnum", "ascii", "digit", |
| @@ -8291,11 +8291,11 @@ | |
| 8291 | return JIM_OK; |
| 8292 | } |
| 8293 | |
| 8294 | case STR_IS_ALPHA: isclassfunc = isalpha; break; |
| 8295 | case STR_IS_ALNUM: isclassfunc = isalnum; break; |
| 8296 | case STR_IS_ASCII: isclassfunc = jim_isascii; break; |
| 8297 | case STR_IS_DIGIT: isclassfunc = isdigit; break; |
| 8298 | case STR_IS_LOWER: isclassfunc = islower; break; |
| 8299 | case STR_IS_UPPER: isclassfunc = isupper; break; |
| 8300 | case STR_IS_SPACE: isclassfunc = isspace; break; |
| 8301 | case STR_IS_XDIGIT: isclassfunc = isxdigit; break; |
| @@ -10213,11 +10213,11 @@ | |
| 10213 | Jim_Collect(interp); |
| 10214 | } |
| 10215 | } |
| 10216 | #endif |
| 10217 | |
| 10218 | int Jim_IsBigEndian(void) |
| 10219 | { |
| 10220 | union { |
| 10221 | unsigned short s; |
| 10222 | unsigned char c[2]; |
| 10223 | } uval = {0x0102}; |
| @@ -10269,11 +10269,11 @@ | |
| 10269 | Jim_SetVariableStrWithStr(i, JIM_INTERACTIVE, "0"); |
| 10270 | |
| 10271 | Jim_SetVariableStrWithStr(i, "tcl_platform(os)", TCL_PLATFORM_OS); |
| 10272 | Jim_SetVariableStrWithStr(i, "tcl_platform(platform)", TCL_PLATFORM_PLATFORM); |
| 10273 | Jim_SetVariableStrWithStr(i, "tcl_platform(pathSeparator)", TCL_PLATFORM_PATH_SEPARATOR); |
| 10274 | Jim_SetVariableStrWithStr(i, "tcl_platform(byteOrder)", Jim_IsBigEndian() ? "bigEndian" : "littleEndian"); |
| 10275 | Jim_SetVariableStrWithStr(i, "tcl_platform(threaded)", "0"); |
| 10276 | Jim_SetVariableStr(i, "tcl_platform(pointerSize)", Jim_NewIntObj(i, sizeof(void *))); |
| 10277 | Jim_SetVariableStr(i, "tcl_platform(wordSize)", Jim_NewIntObj(i, sizeof(jim_wide))); |
| 10278 | |
| 10279 | return i; |
| @@ -10449,17 +10449,11 @@ | |
| 10449 | interp->stackTrace = stackTraceObj; |
| 10450 | interp->errorFlag = 1; |
| 10451 | |
| 10452 | len = Jim_ListLength(interp, interp->stackTrace); |
| 10453 | if (len >= 3) { |
| 10454 | if (Jim_Length(Jim_ListGetIndex(interp, interp->stackTrace, len - 2)) == 0) { |
| 10455 | interp->addStackTrace = 1; |
| 10456 | } |
| 10457 | } |
| 10458 | } |
| 10459 | |
| @@ -10485,14 +10479,15 @@ | |
| 10479 | if (!*procname && Jim_Length(fileNameObj)) { |
| 10480 | |
| 10481 | int len = Jim_ListLength(interp, interp->stackTrace); |
| 10482 | |
| 10483 | if (len >= 3) { |
| 10484 | Jim_Obj *objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 3); |
| 10485 | if (Jim_Length(objPtr)) { |
| 10486 | |
| 10487 | objPtr = Jim_ListGetIndex(interp, interp->stackTrace, len - 2); |
| 10488 | if (Jim_Length(objPtr) == 0) { |
| 10489 | |
| 10490 | ListSetIndex(interp, interp->stackTrace, len - 2, fileNameObj, 0); |
| 10491 | ListSetIndex(interp, interp->stackTrace, len - 1, Jim_NewIntObj(interp, linenr), 0); |
| 10492 | return; |
| 10493 | } |
| @@ -17159,10 +17154,15 @@ | |
| 17154 | |
| 17155 | static int Jim_LocalCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv) |
| 17156 | { |
| 17157 | int retcode; |
| 17158 | |
| 17159 | if (argc < 2) { |
| 17160 | Jim_WrongNumArgs(interp, 1, argv, "cmd ?args ...?"); |
| 17161 | return JIM_ERR; |
| 17162 | } |
| 17163 | |
| 17164 | |
| 17165 | interp->local++; |
| 17166 | retcode = Jim_EvalObjVector(interp, argc - 1, argv + 1); |
| 17167 | interp->local--; |
| 17168 | |
| @@ -19552,11 +19552,11 @@ | |
| 19552 | char *num_buffer = NULL; |
| 19553 | int num_buffer_size = 0; |
| 19554 | |
| 19555 | span = format = Jim_GetString(fmtObjPtr, &formatLen); |
| 19556 | formatEnd = format + formatLen; |
| 19557 | resultPtr = Jim_NewEmptyStringObj(interp); |
| 19558 | |
| 19559 | while (format != formatEnd) { |
| 19560 | char *end; |
| 19561 | int gotMinus, sawFlag; |
| 19562 | int gotPrecision, useShort; |
| 19563 |
+195
| --- autosetup/local.tcl | ||
| +++ autosetup/local.tcl | ||
| @@ -26,5 +26,200 @@ | ||
| 26 | 26 | set tclconfig($name) [string trim $value '] |
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | return [array get tclconfig] |
| 30 | 30 | } |
| 31 | + | |
| 32 | +# The complex extension checking is done here. | |
| 33 | + | |
| 34 | +global withinfo | |
| 35 | +global extdb | |
| 36 | + | |
| 37 | +# Final determination of module status | |
| 38 | +dict set extdb status {} | |
| 39 | + | |
| 40 | +# Returns 1 if the extension has the attribute | |
| 41 | +proc ext-has {ext attr} { | |
| 42 | + expr {$attr in [dict get $::extdb attrs $ext]} | |
| 43 | +} | |
| 44 | + | |
| 45 | +# Returns an entry from the extension 'info' table, or $default otherwise | |
| 46 | +proc ext-get {ext key {default {}}} { | |
| 47 | + if {[dict exists $::extdb info $ext $key]} { | |
| 48 | + return [dict get $::extdb info $ext $key] | |
| 49 | + } else { | |
| 50 | + return $default | |
| 51 | + } | |
| 52 | +} | |
| 53 | + | |
| 54 | +# Set the status of the extension to the given value, and returns the value | |
| 55 | +proc ext-set-status {ext value} { | |
| 56 | + dict set ::extdb status $ext $value | |
| 57 | + return $value | |
| 58 | +} | |
| 59 | + | |
| 60 | +# Returns the status of the extension, or ? if unknown | |
| 61 | +proc ext-get-status {ext} { | |
| 62 | + if {[dict exists $::extdb status $ext]} { | |
| 63 | + return [dict get $::extdb status $ext] | |
| 64 | + } | |
| 65 | + return ? | |
| 66 | +} | |
| 67 | + | |
| 68 | +proc check-extension-status {ext required} { | |
| 69 | + global withinfo | |
| 70 | + | |
| 71 | + set status [ext-get-status $ext] | |
| 72 | + | |
| 73 | + if {$ext in $withinfo(without)} { | |
| 74 | + # Disabled without further ado | |
| 75 | + msg-result "Extension $ext...disabled" | |
| 76 | + return [ext-set-status $ext n] | |
| 77 | + } | |
| 78 | + | |
| 79 | + if {$status in {m y n}} { | |
| 80 | + return $status | |
| 81 | + } | |
| 82 | + | |
| 83 | + # required is "required" if this extension *must* be enabled | |
| 84 | + # required is "wanted" if it is not fatal for this extension | |
| 85 | + # not to be enabled | |
| 86 | + | |
| 87 | + array set depinfo {m 0 y 0 n 0} | |
| 88 | + | |
| 89 | + # Check direct dependencies | |
| 90 | + if [ext-get $ext check 1] { | |
| 91 | + # "check" conditions are met | |
| 92 | + } else { | |
| 93 | + # not met | |
| 94 | + incr depinfo(n) | |
| 95 | + } | |
| 96 | + | |
| 97 | + if {$depinfo(n) == 0} { | |
| 98 | + # Now extension dependencies | |
| 99 | + foreach i [ext-get $ext dep] { | |
| 100 | + set status [check-extension-status $i $required] | |
| 101 | + #puts "$ext: dep $i $required => $status" | |
| 102 | + incr depinfo($status) | |
| 103 | + if {$depinfo(n)} { | |
| 104 | + break | |
| 105 | + } | |
| 106 | + } | |
| 107 | + } | |
| 108 | + | |
| 109 | + #parray depinfo | |
| 110 | + | |
| 111 | + if {$depinfo(n)} { | |
| 112 | + msg-checking "Extension $ext..." | |
| 113 | + if {$required eq "required"} { | |
| 114 | + user-error "dependencies not met" | |
| 115 | + } | |
| 116 | + msg-result "disabled (dependencies)" | |
| 117 | + return [ext-set-status $ext n] | |
| 118 | + } | |
| 119 | + | |
| 120 | + # Selected as a module? | |
| 121 | + if {$ext in $withinfo(mod)} { | |
| 122 | + if {[ext-has $ext tcl]} { | |
| 123 | + # Easy, a Tcl module | |
| 124 | + msg-result "Extension $ext...tcl" | |
| 125 | + } elseif {[ext-has $ext static]} { | |
| 126 | + user-error "Extension $ext can't be a module" | |
| 127 | + } else { | |
| 128 | + msg-result "Extension $ext...module" | |
| 129 | + foreach i [ext-get $ext libdep] { | |
| 130 | + define-append LDLIBS_$ext [get-define $i ""] | |
| 131 | + } | |
| 132 | + } | |
| 133 | + return [ext-set-status $ext m] | |
| 134 | + } | |
| 135 | + | |
| 136 | + # Selected as a static extension? | |
| 137 | + if {[ext-has $ext shared]} { | |
| 138 | + user-error "Extension $ext can only be selected as a module" | |
| 139 | + } elseif {$ext in $withinfo(ext) || $required eq "$required"} { | |
| 140 | + msg-result "Extension $ext...enabled" | |
| 141 | + } elseif {$ext in $withinfo(maybe)} { | |
| 142 | + msg-result "Extension $ext...enabled (default)" | |
| 143 | + } else { | |
| 144 | + # Could be selected, but isn't (yet) | |
| 145 | + return [ext-set-status $ext x] | |
| 146 | + } | |
| 147 | + foreach i [ext-get $ext libdep] { | |
| 148 | + define-append LDLIBS [get-define $i ""] | |
| 149 | + } | |
| 150 | + return [ext-set-status $ext y] | |
| 151 | +} | |
| 152 | + | |
| 153 | +# Examines the user options (the $withinfo array) | |
| 154 | +# and the extension database ($extdb) to determine | |
| 155 | +# what is selected, and in what way. | |
| 156 | +# | |
| 157 | +# The results are available via ext-get-status | |
| 158 | +# And a dictionary is returned containing four keys: | |
| 159 | +# static-c extensions which are static C | |
| 160 | +# static-tcl extensions which are static Tcl | |
| 161 | +# module-c extensions which are C modules | |
| 162 | +# module-tcl extensions which are Tcl modules | |
| 163 | +proc check-extensions {} { | |
| 164 | + global extdb withinfo | |
| 165 | + | |
| 166 | + # Check valid extension names | |
| 167 | + foreach i [concat $withinfo(ext) $withinfo(mod)] { | |
| 168 | + if {![dict exists $extdb attrs $i]} { | |
| 169 | + user-error "Unknown extension: $i" | |
| 170 | + } | |
| 171 | + } | |
| 172 | + | |
| 173 | + set extlist [lsort [dict keys [dict get $extdb attrs]]] | |
| 174 | + | |
| 175 | + set withinfo(maybe) {} | |
| 176 | + | |
| 177 | + # Now work out the default status. We have. | |
| 178 | + # normal case, include !optional if possible | |
| 179 | + # --without=default, don't include optional | |
| 180 | + if {$withinfo(nodefault)} { | |
| 181 | + lappend withinfo(maybe) stdlib | |
| 182 | + } else { | |
| 183 | + foreach i $extlist { | |
| 184 | + if {![ext-has $i optional]} { | |
| 185 | + lappend withinfo(maybe) $i | |
| 186 | + } | |
| 187 | + } | |
| 188 | + } | |
| 189 | + | |
| 190 | + foreach i $extlist { | |
| 191 | + define LDLIBS_$i "" | |
| 192 | + } | |
| 193 | + | |
| 194 | + foreach i [concat $withinfo(ext) $withinfo(mod)] { | |
| 195 | + check-extension-status $i required | |
| 196 | + } | |
| 197 | + foreach i $withinfo(maybe) { | |
| 198 | + check-extension-status $i wanted | |
| 199 | + } | |
| 200 | + | |
| 201 | + array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}} | |
| 202 | + | |
| 203 | + foreach i $extlist { | |
| 204 | + set status [ext-get-status $i] | |
| 205 | + set tcl [ext-has $i tcl] | |
| 206 | + switch $status,$tcl { | |
| 207 | + y,1 { | |
| 208 | + define jim_ext_$i | |
| 209 | + lappend extinfo(static-tcl) $i | |
| 210 | + } | |
| 211 | + y,0 { | |
| 212 | + define jim_ext_$i | |
| 213 | + lappend extinfo(static-c) $i | |
| 214 | + # If there are any static C++ extensions, jimsh must be linked using | |
| 215 | + # the C++ compiler | |
| 216 | + if {[ext-has $i cpp]} { | |
| 217 | + define HAVE_CXX_EXTENSIONS | |
| 218 | + } | |
| 219 | + } | |
| 220 | + m,1 { lappend extinfo(module-tcl) $i } | |
| 221 | + m,0 { lappend extinfo(module-c) $i } | |
| 222 | + } | |
| 223 | + } | |
| 224 | + return [array get extinfo] | |
| 225 | +} | |
| 31 | 226 | |
| 32 | 227 | ADDED setup/fossil.iss |
| --- autosetup/local.tcl | |
| +++ autosetup/local.tcl | |
| @@ -26,5 +26,200 @@ | |
| 26 | set tclconfig($name) [string trim $value '] |
| 27 | } |
| 28 | } |
| 29 | return [array get tclconfig] |
| 30 | } |
| 31 | |
| 32 | DDED setup/fossil.iss |
| --- autosetup/local.tcl | |
| +++ autosetup/local.tcl | |
| @@ -26,5 +26,200 @@ | |
| 26 | set tclconfig($name) [string trim $value '] |
| 27 | } |
| 28 | } |
| 29 | return [array get tclconfig] |
| 30 | } |
| 31 | |
| 32 | # The complex extension checking is done here. |
| 33 | |
| 34 | global withinfo |
| 35 | global extdb |
| 36 | |
| 37 | # Final determination of module status |
| 38 | dict set extdb status {} |
| 39 | |
| 40 | # Returns 1 if the extension has the attribute |
| 41 | proc ext-has {ext attr} { |
| 42 | expr {$attr in [dict get $::extdb attrs $ext]} |
| 43 | } |
| 44 | |
| 45 | # Returns an entry from the extension 'info' table, or $default otherwise |
| 46 | proc ext-get {ext key {default {}}} { |
| 47 | if {[dict exists $::extdb info $ext $key]} { |
| 48 | return [dict get $::extdb info $ext $key] |
| 49 | } else { |
| 50 | return $default |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | # Set the status of the extension to the given value, and returns the value |
| 55 | proc ext-set-status {ext value} { |
| 56 | dict set ::extdb status $ext $value |
| 57 | return $value |
| 58 | } |
| 59 | |
| 60 | # Returns the status of the extension, or ? if unknown |
| 61 | proc ext-get-status {ext} { |
| 62 | if {[dict exists $::extdb status $ext]} { |
| 63 | return [dict get $::extdb status $ext] |
| 64 | } |
| 65 | return ? |
| 66 | } |
| 67 | |
| 68 | proc check-extension-status {ext required} { |
| 69 | global withinfo |
| 70 | |
| 71 | set status [ext-get-status $ext] |
| 72 | |
| 73 | if {$ext in $withinfo(without)} { |
| 74 | # Disabled without further ado |
| 75 | msg-result "Extension $ext...disabled" |
| 76 | return [ext-set-status $ext n] |
| 77 | } |
| 78 | |
| 79 | if {$status in {m y n}} { |
| 80 | return $status |
| 81 | } |
| 82 | |
| 83 | # required is "required" if this extension *must* be enabled |
| 84 | # required is "wanted" if it is not fatal for this extension |
| 85 | # not to be enabled |
| 86 | |
| 87 | array set depinfo {m 0 y 0 n 0} |
| 88 | |
| 89 | # Check direct dependencies |
| 90 | if [ext-get $ext check 1] { |
| 91 | # "check" conditions are met |
| 92 | } else { |
| 93 | # not met |
| 94 | incr depinfo(n) |
| 95 | } |
| 96 | |
| 97 | if {$depinfo(n) == 0} { |
| 98 | # Now extension dependencies |
| 99 | foreach i [ext-get $ext dep] { |
| 100 | set status [check-extension-status $i $required] |
| 101 | #puts "$ext: dep $i $required => $status" |
| 102 | incr depinfo($status) |
| 103 | if {$depinfo(n)} { |
| 104 | break |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | #parray depinfo |
| 110 | |
| 111 | if {$depinfo(n)} { |
| 112 | msg-checking "Extension $ext..." |
| 113 | if {$required eq "required"} { |
| 114 | user-error "dependencies not met" |
| 115 | } |
| 116 | msg-result "disabled (dependencies)" |
| 117 | return [ext-set-status $ext n] |
| 118 | } |
| 119 | |
| 120 | # Selected as a module? |
| 121 | if {$ext in $withinfo(mod)} { |
| 122 | if {[ext-has $ext tcl]} { |
| 123 | # Easy, a Tcl module |
| 124 | msg-result "Extension $ext...tcl" |
| 125 | } elseif {[ext-has $ext static]} { |
| 126 | user-error "Extension $ext can't be a module" |
| 127 | } else { |
| 128 | msg-result "Extension $ext...module" |
| 129 | foreach i [ext-get $ext libdep] { |
| 130 | define-append LDLIBS_$ext [get-define $i ""] |
| 131 | } |
| 132 | } |
| 133 | return [ext-set-status $ext m] |
| 134 | } |
| 135 | |
| 136 | # Selected as a static extension? |
| 137 | if {[ext-has $ext shared]} { |
| 138 | user-error "Extension $ext can only be selected as a module" |
| 139 | } elseif {$ext in $withinfo(ext) || $required eq "$required"} { |
| 140 | msg-result "Extension $ext...enabled" |
| 141 | } elseif {$ext in $withinfo(maybe)} { |
| 142 | msg-result "Extension $ext...enabled (default)" |
| 143 | } else { |
| 144 | # Could be selected, but isn't (yet) |
| 145 | return [ext-set-status $ext x] |
| 146 | } |
| 147 | foreach i [ext-get $ext libdep] { |
| 148 | define-append LDLIBS [get-define $i ""] |
| 149 | } |
| 150 | return [ext-set-status $ext y] |
| 151 | } |
| 152 | |
| 153 | # Examines the user options (the $withinfo array) |
| 154 | # and the extension database ($extdb) to determine |
| 155 | # what is selected, and in what way. |
| 156 | # |
| 157 | # The results are available via ext-get-status |
| 158 | # And a dictionary is returned containing four keys: |
| 159 | # static-c extensions which are static C |
| 160 | # static-tcl extensions which are static Tcl |
| 161 | # module-c extensions which are C modules |
| 162 | # module-tcl extensions which are Tcl modules |
| 163 | proc check-extensions {} { |
| 164 | global extdb withinfo |
| 165 | |
| 166 | # Check valid extension names |
| 167 | foreach i [concat $withinfo(ext) $withinfo(mod)] { |
| 168 | if {![dict exists $extdb attrs $i]} { |
| 169 | user-error "Unknown extension: $i" |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | set extlist [lsort [dict keys [dict get $extdb attrs]]] |
| 174 | |
| 175 | set withinfo(maybe) {} |
| 176 | |
| 177 | # Now work out the default status. We have. |
| 178 | # normal case, include !optional if possible |
| 179 | # --without=default, don't include optional |
| 180 | if {$withinfo(nodefault)} { |
| 181 | lappend withinfo(maybe) stdlib |
| 182 | } else { |
| 183 | foreach i $extlist { |
| 184 | if {![ext-has $i optional]} { |
| 185 | lappend withinfo(maybe) $i |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | foreach i $extlist { |
| 191 | define LDLIBS_$i "" |
| 192 | } |
| 193 | |
| 194 | foreach i [concat $withinfo(ext) $withinfo(mod)] { |
| 195 | check-extension-status $i required |
| 196 | } |
| 197 | foreach i $withinfo(maybe) { |
| 198 | check-extension-status $i wanted |
| 199 | } |
| 200 | |
| 201 | array set extinfo {static-c {} static-tcl {} module-c {} module-tcl {}} |
| 202 | |
| 203 | foreach i $extlist { |
| 204 | set status [ext-get-status $i] |
| 205 | set tcl [ext-has $i tcl] |
| 206 | switch $status,$tcl { |
| 207 | y,1 { |
| 208 | define jim_ext_$i |
| 209 | lappend extinfo(static-tcl) $i |
| 210 | } |
| 211 | y,0 { |
| 212 | define jim_ext_$i |
| 213 | lappend extinfo(static-c) $i |
| 214 | # If there are any static C++ extensions, jimsh must be linked using |
| 215 | # the C++ compiler |
| 216 | if {[ext-has $i cpp]} { |
| 217 | define HAVE_CXX_EXTENSIONS |
| 218 | } |
| 219 | } |
| 220 | m,1 { lappend extinfo(module-tcl) $i } |
| 221 | m,0 { lappend extinfo(module-c) $i } |
| 222 | } |
| 223 | } |
| 224 | return [array get extinfo] |
| 225 | } |
| 226 | |
| 227 | DDED setup/fossil.iss |
+66
| --- a/setup/fossil.iss | ||
| +++ b/setup/fossil.iss | ||
| @@ -0,0 +1,66 @@ | ||
| 1 | +; | |
| 2 | +; Copyrig | |
| 3 | +; | |
| 4 | + (c) 2014 D. Richard Hipp | |
| 5 | +; | |
| 6 | +; This program is free software; you | |
| 7 | + can redistribute it and/or | |
| 8 | +; modify it under the terms of the S | |
| 9 | +implified BSD License (also | |
| 10 | +; | |
| 11 | +; | |
| 12 | +; This program is distributed in the hope that it will be useful, | |
| 13 | +ope that it will be useful, | |
| 14 | +; but without any warranty; without e | |
| 15 | +ven the implied warranty of | |
| 16 | + | |
| 17 | +; | |
| 18 | +; Author contact information: | |
| 19 | +; [email protected] | |
| 20 | +; http://www.hwaci.com/drh/ | |
| 21 | +; | |
| 22 | + | |
| 23 | +[Setup] | |
| 24 | +w.hwaci.com/drh/ | |
| 25 | +; | |
| 26 | + | |
| 27 | +[Setup] | |
| 28 | +A | |
| 29 | +AlwaysShowComponentsList=false | |
| 30 | +aysShowComponentsList=false | |
| 31 | +AppCopyright=Copyright (c) D. Richard | |
| 32 | +Hipp. All rights r | |
| 33 | +AppName=Fossil | |
| 34 | +314c52f057 | |
| 35 | +AppPublisherURL=https://www.fossil-scm.org/ | |
| 36 | +AppSupportURL=https:////www.fossil-scm.org/ | |
| 37 | +X@DC,1: | |
| 38 | +P@Di,1: | |
| 39 | +1S@E6,q: | |
| 40 | +AppReadmeFile=https://www.fossil-scm.org: | |
| 41 | +R@Gd,Q: | |
| 42 | +DefaultGroupNameSupportURL=http: | |
| 43 | +R@Gd,Q: | |
| 44 | +Defa: | |
| 45 | +R@Gd,Q: | |
| 46 | +DefaultGroupNameY@JM,1: | |
| 47 | +X@Jt,I: | |
| 48 | + | |
| 49 | + | |
| 50 | +[Components] | |
| 51 | +1S@Kd,e: | |
| 52 | + | |
| 53 | + | |
| 54 | +[Dirs] | |
| 55 | +Name: {app}\bin | |
| 56 | + | |
| 57 | + | |
| 58 | +[Files] | |
| 59 | +1i@Mc,G: | |
| 60 | + | |
| 61 | + | |
| 62 | +[Registry] | |
| 63 | +Q@Mc,2H@Ow,2: | |
| 64 | +_~AvY;: | |
| 65 | +R@Gd,Q: | |
| 66 | +DefaultGrou |
| --- a/setup/fossil.iss | |
| +++ b/setup/fossil.iss | |
| @@ -0,0 +1,66 @@ | |
| --- a/setup/fossil.iss | |
| +++ b/setup/fossil.iss | |
| @@ -0,0 +1,66 @@ | |
| 1 | ; |
| 2 | ; Copyrig |
| 3 | ; |
| 4 | (c) 2014 D. Richard Hipp |
| 5 | ; |
| 6 | ; This program is free software; you |
| 7 | can redistribute it and/or |
| 8 | ; modify it under the terms of the S |
| 9 | implified BSD License (also |
| 10 | ; |
| 11 | ; |
| 12 | ; This program is distributed in the hope that it will be useful, |
| 13 | ope that it will be useful, |
| 14 | ; but without any warranty; without e |
| 15 | ven the implied warranty of |
| 16 | |
| 17 | ; |
| 18 | ; Author contact information: |
| 19 | ; [email protected] |
| 20 | ; http://www.hwaci.com/drh/ |
| 21 | ; |
| 22 | |
| 23 | [Setup] |
| 24 | w.hwaci.com/drh/ |
| 25 | ; |
| 26 | |
| 27 | [Setup] |
| 28 | A |
| 29 | AlwaysShowComponentsList=false |
| 30 | aysShowComponentsList=false |
| 31 | AppCopyright=Copyright (c) D. Richard |
| 32 | Hipp. All rights r |
| 33 | AppName=Fossil |
| 34 | 314c52f057 |
| 35 | AppPublisherURL=https://www.fossil-scm.org/ |
| 36 | AppSupportURL=https:////www.fossil-scm.org/ |
| 37 | X@DC,1: |
| 38 | P@Di,1: |
| 39 | 1S@E6,q: |
| 40 | AppReadmeFile=https://www.fossil-scm.org: |
| 41 | R@Gd,Q: |
| 42 | DefaultGroupNameSupportURL=http: |
| 43 | R@Gd,Q: |
| 44 | Defa: |
| 45 | R@Gd,Q: |
| 46 | DefaultGroupNameY@JM,1: |
| 47 | X@Jt,I: |
| 48 | |
| 49 | |
| 50 | [Components] |
| 51 | 1S@Kd,e: |
| 52 | |
| 53 | |
| 54 | [Dirs] |
| 55 | Name: {app}\bin |
| 56 | |
| 57 | |
| 58 | [Files] |
| 59 | 1i@Mc,G: |
| 60 | |
| 61 | |
| 62 | [Registry] |
| 63 | Q@Mc,2H@Ow,2: |
| 64 | _~AvY;: |
| 65 | R@Gd,Q: |
| 66 | DefaultGrou |
+1
-1
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | 394 | fossil_free(z); |
| 395 | - comment_print(aBisectOption[i].zDesc, 27, 79); | |
| 395 | + comment_print(aBisectOption[i].zDesc, 27, -1); | |
| 396 | 396 | } |
| 397 | 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | 398 | unsigned int i; |
| 399 | 399 | n = strlen(g.argv[3]); |
| 400 | 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 | 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, 79); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, -1); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
+1
-1
| --- src/bisect.c | ||
| +++ src/bisect.c | ||
| @@ -390,11 +390,11 @@ | ||
| 390 | 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | 394 | fossil_free(z); |
| 395 | - comment_print(aBisectOption[i].zDesc, 27, 79); | |
| 395 | + comment_print(aBisectOption[i].zDesc, 27, -1); | |
| 396 | 396 | } |
| 397 | 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | 398 | unsigned int i; |
| 399 | 399 | n = strlen(g.argv[3]); |
| 400 | 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 | 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, 79); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
| --- src/bisect.c | |
| +++ src/bisect.c | |
| @@ -390,11 +390,11 @@ | |
| 390 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 391 | char *z = mprintf("bisect-%s", aBisectOption[i].zName); |
| 392 | fossil_print(" %-15s %-6s ", aBisectOption[i].zName, |
| 393 | db_lget(z, (char*)aBisectOption[i].zDefault)); |
| 394 | fossil_free(z); |
| 395 | comment_print(aBisectOption[i].zDesc, 27, -1); |
| 396 | } |
| 397 | }else if( g.argc==4 || g.argc==5 ){ |
| 398 | unsigned int i; |
| 399 | n = strlen(g.argv[3]); |
| 400 | for(i=0; i<sizeof(aBisectOption)/sizeof(aBisectOption[0]); i++){ |
| 401 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -176,11 +176,11 @@ | ||
| 176 | 176 | |
| 177 | 177 | /* Commit */ |
| 178 | 178 | db_end_transaction(0); |
| 179 | 179 | |
| 180 | 180 | /* Do an autosync push, if requested */ |
| 181 | - if( !isPrivate ) autosync_loop(SYNC_PUSH,db_get_int("autosync-tries", 1)); | |
| 181 | + if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1)); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /* |
| 185 | 185 | ** Prepare a query that will list branches. |
| 186 | 186 | ** |
| 187 | 187 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -176,11 +176,11 @@ | |
| 176 | |
| 177 | /* Commit */ |
| 178 | db_end_transaction(0); |
| 179 | |
| 180 | /* Do an autosync push, if requested */ |
| 181 | if( !isPrivate ) autosync_loop(SYNC_PUSH,db_get_int("autosync-tries", 1)); |
| 182 | } |
| 183 | |
| 184 | /* |
| 185 | ** Prepare a query that will list branches. |
| 186 | ** |
| 187 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -176,11 +176,11 @@ | |
| 176 | |
| 177 | /* Commit */ |
| 178 | db_end_transaction(0); |
| 179 | |
| 180 | /* Do an autosync push, if requested */ |
| 181 | if( !isPrivate ) autosync_loop(SYNC_PUSH, db_get_int("autosync-tries", 1)); |
| 182 | } |
| 183 | |
| 184 | /* |
| 185 | ** Prepare a query that will list branches. |
| 186 | ** |
| 187 |
+19
-1
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -19,10 +19,16 @@ | ||
| 19 | 19 | ** text on a TTY. |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "comformat.h" |
| 23 | 23 | #include <assert.h> |
| 24 | +#ifdef _WIN32 | |
| 25 | +# include <windows.h> | |
| 26 | +# include <wincon.h> | |
| 27 | +#else | |
| 28 | +# include <termios.h> | |
| 29 | +#endif | |
| 24 | 30 | |
| 25 | 31 | /* |
| 26 | 32 | ** Given a comment string zText, format that string for printing |
| 27 | 33 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | 34 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | ||
| 35 | 41 | int si, sk, i, k; |
| 36 | 42 | int doIndent = 0; |
| 37 | 43 | char *zBuf; |
| 38 | 44 | char zBuffer[400]; |
| 39 | 45 | int lineCnt = 0; |
| 40 | - | |
| 46 | +#if defined(_WIN32) | |
| 47 | + if ( lineLength<0 ){ | |
| 48 | + CONSOLE_SCREEN_BUFFER_INFO csbi; | |
| 49 | + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); | |
| 50 | + tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1; | |
| 51 | + } | |
| 52 | +#elif defined(TIOCGWINSZ) | |
| 53 | + if ( lineLength<0 ){ | |
| 54 | + struct winsize w; | |
| 55 | + ioctl(0, TIOCGWINSZ, &w); | |
| 56 | + tlen = w.ws_col - indent; | |
| 57 | + } | |
| 58 | +#endif | |
| 41 | 59 | if( zText==0 ) zText = "(NULL)"; |
| 42 | 60 | if( tlen<=0 ){ |
| 43 | 61 | tlen = strlen(zText); |
| 44 | 62 | } |
| 45 | 63 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 | 64 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,16 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | |
| 25 | /* |
| 26 | ** Given a comment string zText, format that string for printing |
| 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | |
| 35 | int si, sk, i, k; |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( zText==0 ) zText = "(NULL)"; |
| 42 | if( tlen<=0 ){ |
| 43 | tlen = strlen(zText); |
| 44 | } |
| 45 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,16 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | # include <wincon.h> |
| 27 | #else |
| 28 | # include <termios.h> |
| 29 | #endif |
| 30 | |
| 31 | /* |
| 32 | ** Given a comment string zText, format that string for printing |
| 33 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 34 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | |
| 41 | int si, sk, i, k; |
| 42 | int doIndent = 0; |
| 43 | char *zBuf; |
| 44 | char zBuffer[400]; |
| 45 | int lineCnt = 0; |
| 46 | #if defined(_WIN32) |
| 47 | if ( lineLength<0 ){ |
| 48 | CONSOLE_SCREEN_BUFFER_INFO csbi; |
| 49 | GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); |
| 50 | tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1; |
| 51 | } |
| 52 | #elif defined(TIOCGWINSZ) |
| 53 | if ( lineLength<0 ){ |
| 54 | struct winsize w; |
| 55 | ioctl(0, TIOCGWINSZ, &w); |
| 56 | tlen = w.ws_col - indent; |
| 57 | } |
| 58 | #endif |
| 59 | if( zText==0 ) zText = "(NULL)"; |
| 60 | if( tlen<=0 ){ |
| 61 | tlen = strlen(zText); |
| 62 | } |
| 63 | if( tlen >= (sizeof(zBuffer)) ){ |
| 64 |
+19
-1
| --- src/comformat.c | ||
| +++ src/comformat.c | ||
| @@ -19,10 +19,16 @@ | ||
| 19 | 19 | ** text on a TTY. |
| 20 | 20 | */ |
| 21 | 21 | #include "config.h" |
| 22 | 22 | #include "comformat.h" |
| 23 | 23 | #include <assert.h> |
| 24 | +#ifdef _WIN32 | |
| 25 | +# include <windows.h> | |
| 26 | +# include <wincon.h> | |
| 27 | +#else | |
| 28 | +# include <termios.h> | |
| 29 | +#endif | |
| 24 | 30 | |
| 25 | 31 | /* |
| 26 | 32 | ** Given a comment string zText, format that string for printing |
| 27 | 33 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | 34 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | ||
| 35 | 41 | int si, sk, i, k; |
| 36 | 42 | int doIndent = 0; |
| 37 | 43 | char *zBuf; |
| 38 | 44 | char zBuffer[400]; |
| 39 | 45 | int lineCnt = 0; |
| 40 | - | |
| 46 | +#if defined(_WIN32) | |
| 47 | + if ( lineLength<0 ){ | |
| 48 | + CONSOLE_SCREEN_BUFFER_INFO csbi; | |
| 49 | + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); | |
| 50 | + tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1; | |
| 51 | + } | |
| 52 | +#elif defined(TIOCGWINSZ) | |
| 53 | + if ( lineLength<0 ){ | |
| 54 | + struct winsize w; | |
| 55 | + ioctl(0, TIOCGWINSZ, &w); | |
| 56 | + tlen = w.ws_col - indent; | |
| 57 | + } | |
| 58 | +#endif | |
| 41 | 59 | if( zText==0 ) zText = "(NULL)"; |
| 42 | 60 | if( tlen<=0 ){ |
| 43 | 61 | tlen = strlen(zText); |
| 44 | 62 | } |
| 45 | 63 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 | 64 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,16 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | |
| 25 | /* |
| 26 | ** Given a comment string zText, format that string for printing |
| 27 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 28 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | |
| 35 | int si, sk, i, k; |
| 36 | int doIndent = 0; |
| 37 | char *zBuf; |
| 38 | char zBuffer[400]; |
| 39 | int lineCnt = 0; |
| 40 | |
| 41 | if( zText==0 ) zText = "(NULL)"; |
| 42 | if( tlen<=0 ){ |
| 43 | tlen = strlen(zText); |
| 44 | } |
| 45 | if( tlen >= (sizeof(zBuffer)) ){ |
| 46 |
| --- src/comformat.c | |
| +++ src/comformat.c | |
| @@ -19,10 +19,16 @@ | |
| 19 | ** text on a TTY. |
| 20 | */ |
| 21 | #include "config.h" |
| 22 | #include "comformat.h" |
| 23 | #include <assert.h> |
| 24 | #ifdef _WIN32 |
| 25 | # include <windows.h> |
| 26 | # include <wincon.h> |
| 27 | #else |
| 28 | # include <termios.h> |
| 29 | #endif |
| 30 | |
| 31 | /* |
| 32 | ** Given a comment string zText, format that string for printing |
| 33 | ** on a TTY. Assume that the output cursors is indent spaces from |
| 34 | ** the left margin and that a single line can contain no more than |
| @@ -35,11 +41,23 @@ | |
| 41 | int si, sk, i, k; |
| 42 | int doIndent = 0; |
| 43 | char *zBuf; |
| 44 | char zBuffer[400]; |
| 45 | int lineCnt = 0; |
| 46 | #if defined(_WIN32) |
| 47 | if ( lineLength<0 ){ |
| 48 | CONSOLE_SCREEN_BUFFER_INFO csbi; |
| 49 | GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi); |
| 50 | tlen = csbi.srWindow.Right - csbi.srWindow.Left - indent + 1; |
| 51 | } |
| 52 | #elif defined(TIOCGWINSZ) |
| 53 | if ( lineLength<0 ){ |
| 54 | struct winsize w; |
| 55 | ioctl(0, TIOCGWINSZ, &w); |
| 56 | tlen = w.ws_col - indent; |
| 57 | } |
| 58 | #endif |
| 59 | if( zText==0 ) zText = "(NULL)"; |
| 60 | if( tlen<=0 ){ |
| 61 | tlen = strlen(zText); |
| 62 | } |
| 63 | if( tlen >= (sizeof(zBuffer)) ){ |
| 64 |
+1
-2
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -49,20 +49,19 @@ | ||
| 49 | 49 | #include <stdarg.h> |
| 50 | 50 | #include <assert.h> |
| 51 | 51 | |
| 52 | 52 | #endif |
| 53 | 53 | |
| 54 | -#if defined(__MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) | |
| 54 | +#if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) | |
| 55 | 55 | # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 56 | 56 | typedef int socklen_t; |
| 57 | 57 | # endif |
| 58 | 58 | # ifndef _WIN32 |
| 59 | 59 | # define _WIN32 |
| 60 | 60 | # endif |
| 61 | 61 | #else |
| 62 | 62 | # include <sys/types.h> |
| 63 | -# include <termios.h> | |
| 64 | 63 | # include <signal.h> |
| 65 | 64 | # include <pwd.h> |
| 66 | 65 | #endif |
| 67 | 66 | |
| 68 | 67 | /* |
| 69 | 68 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -49,20 +49,19 @@ | |
| 49 | #include <stdarg.h> |
| 50 | #include <assert.h> |
| 51 | |
| 52 | #endif |
| 53 | |
| 54 | #if defined(__MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 55 | # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 56 | typedef int socklen_t; |
| 57 | # endif |
| 58 | # ifndef _WIN32 |
| 59 | # define _WIN32 |
| 60 | # endif |
| 61 | #else |
| 62 | # include <sys/types.h> |
| 63 | # include <termios.h> |
| 64 | # include <signal.h> |
| 65 | # include <pwd.h> |
| 66 | #endif |
| 67 | |
| 68 | /* |
| 69 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -49,20 +49,19 @@ | |
| 49 | #include <stdarg.h> |
| 50 | #include <assert.h> |
| 51 | |
| 52 | #endif |
| 53 | |
| 54 | #if defined( __MINGW32__) || defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 55 | # if defined(__DMC__) || defined(_MSC_VER) || defined(__POCC__) |
| 56 | typedef int socklen_t; |
| 57 | # endif |
| 58 | # ifndef _WIN32 |
| 59 | # define _WIN32 |
| 60 | # endif |
| 61 | #else |
| 62 | # include <sys/types.h> |
| 63 | # include <signal.h> |
| 64 | # include <pwd.h> |
| 65 | #endif |
| 66 | |
| 67 | /* |
| 68 |
+1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -97,10 +97,11 @@ | ||
| 97 | 97 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 98 | 98 | { "timeline-plaintext", CONFIGSET_SKIN }, |
| 99 | 99 | { "adunit", CONFIGSET_SKIN }, |
| 100 | 100 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 101 | 101 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 102 | + { "th1-hooks", CONFIGSET_TH1 }, | |
| 102 | 103 | { "th1-setup", CONFIGSET_TH1 }, |
| 103 | 104 | { "th1-uri-regexp", CONFIGSET_TH1 }, |
| 104 | 105 | |
| 105 | 106 | #ifdef FOSSIL_ENABLE_TCL |
| 106 | 107 | { "tcl", CONFIGSET_TH1 }, |
| 107 | 108 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -97,10 +97,11 @@ | |
| 97 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 98 | { "timeline-plaintext", CONFIGSET_SKIN }, |
| 99 | { "adunit", CONFIGSET_SKIN }, |
| 100 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 101 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 102 | { "th1-setup", CONFIGSET_TH1 }, |
| 103 | { "th1-uri-regexp", CONFIGSET_TH1 }, |
| 104 | |
| 105 | #ifdef FOSSIL_ENABLE_TCL |
| 106 | { "tcl", CONFIGSET_TH1 }, |
| 107 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -97,10 +97,11 @@ | |
| 97 | { "timeline-max-comment", CONFIGSET_SKIN }, |
| 98 | { "timeline-plaintext", CONFIGSET_SKIN }, |
| 99 | { "adunit", CONFIGSET_SKIN }, |
| 100 | { "adunit-omit-if-admin", CONFIGSET_SKIN }, |
| 101 | { "adunit-omit-if-user", CONFIGSET_SKIN }, |
| 102 | { "th1-hooks", CONFIGSET_TH1 }, |
| 103 | { "th1-setup", CONFIGSET_TH1 }, |
| 104 | { "th1-uri-regexp", CONFIGSET_TH1 }, |
| 105 | |
| 106 | #ifdef FOSSIL_ENABLE_TCL |
| 107 | { "tcl", CONFIGSET_TH1 }, |
| 108 |
M
src/db.c
+40
-11
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -785,10 +785,31 @@ | ||
| 785 | 785 | assert( g.zMainDbType!=0 ); |
| 786 | 786 | db_attach(zDbName, zLabel); |
| 787 | 787 | if( pWasAttached ) *pWasAttached = 1; |
| 788 | 788 | } |
| 789 | 789 | } |
| 790 | + | |
| 791 | +/* | |
| 792 | +** Close the user database. | |
| 793 | +*/ | |
| 794 | +void db_close_config(){ | |
| 795 | + if( g.useAttach ){ | |
| 796 | + db_detach("configdb"); | |
| 797 | + g.useAttach = 0; | |
| 798 | + g.zConfigDbName = 0; | |
| 799 | + }else if( g.dbConfig ){ | |
| 800 | + sqlite3_close(g.dbConfig); | |
| 801 | + g.dbConfig = 0; | |
| 802 | + g.zConfigDbType = 0; | |
| 803 | + g.zConfigDbName = 0; | |
| 804 | + }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){ | |
| 805 | + sqlite3_close(g.db); | |
| 806 | + g.db = 0; | |
| 807 | + g.zMainDbType = 0; | |
| 808 | + g.zConfigDbName = 0; | |
| 809 | + } | |
| 810 | +} | |
| 790 | 811 | |
| 791 | 812 | /* |
| 792 | 813 | ** Open the user database in "~/.fossil". Create the database anew if |
| 793 | 814 | ** it does not already exist. |
| 794 | 815 | ** |
| @@ -801,11 +822,14 @@ | ||
| 801 | 822 | ** case, invoke this routine with useAttach as 1. |
| 802 | 823 | */ |
| 803 | 824 | void db_open_config(int useAttach){ |
| 804 | 825 | char *zDbName; |
| 805 | 826 | char *zHome; |
| 806 | - if( g.zConfigDbName ) return; | |
| 827 | + if( g.zConfigDbName ){ | |
| 828 | + if( useAttach==g.useAttach ) return; | |
| 829 | + db_close_config(); | |
| 830 | + } | |
| 807 | 831 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 808 | 832 | zHome = fossil_getenv("LOCALAPPDATA"); |
| 809 | 833 | if( zHome==0 ){ |
| 810 | 834 | zHome = fossil_getenv("APPDATA"); |
| 811 | 835 | if( zHome==0 ){ |
| @@ -941,11 +965,11 @@ | ||
| 941 | 965 | int db_open_local(const char *zDbName){ |
| 942 | 966 | int i, n; |
| 943 | 967 | char zPwd[2000]; |
| 944 | 968 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 945 | 969 | |
| 946 | - if( g.localOpen) return 1; | |
| 970 | + if( g.localOpen ) return 1; | |
| 947 | 971 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 948 | 972 | n = strlen(zPwd); |
| 949 | 973 | while( n>0 ){ |
| 950 | 974 | for(i=0; i<count(aDbName); i++){ |
| 951 | 975 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| @@ -1045,11 +1069,11 @@ | ||
| 1045 | 1069 | ** use the repository of the open checkout if there is one. |
| 1046 | 1070 | ** |
| 1047 | 1071 | ** Error out if the repository cannot be opened. |
| 1048 | 1072 | */ |
| 1049 | 1073 | void db_find_and_open_repository(int bFlags, int nArgUsed){ |
| 1050 | - const char *zRep = find_option("repository", "R", 1); | |
| 1074 | + const char *zRep = find_repository_option(); | |
| 1051 | 1075 | if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){ |
| 1052 | 1076 | zRep = g.argv[nArgUsed]; |
| 1053 | 1077 | } |
| 1054 | 1078 | if( zRep==0 ){ |
| 1055 | 1079 | if( db_open_local(0)==0 ){ |
| @@ -1920,11 +1944,11 @@ | ||
| 1920 | 1944 | int rc = 0; |
| 1921 | 1945 | db_prepare( &q, "PRAGMA table_info(%Q)", zTableName ); |
| 1922 | 1946 | while(SQLITE_ROW == db_step(&q)){ |
| 1923 | 1947 | /* Columns: (cid, name, type, notnull, dflt_value, pk) */ |
| 1924 | 1948 | char const * zCol = db_column_text(&q, 1); |
| 1925 | - if(0==fossil_strcmp(zColName, zCol)){ | |
| 1949 | + if( 0==fossil_strcmp(zColName, zCol) ){ | |
| 1926 | 1950 | rc = 1; |
| 1927 | 1951 | break; |
| 1928 | 1952 | } |
| 1929 | 1953 | } |
| 1930 | 1954 | db_finalize(&q); |
| @@ -2040,11 +2064,11 @@ | ||
| 2040 | 2064 | db_lset_int("checkout", 0); |
| 2041 | 2065 | oldArgv = g.argv; |
| 2042 | 2066 | oldArgc = g.argc; |
| 2043 | 2067 | azNewArgv[0] = g.argv[0]; |
| 2044 | 2068 | g.argv = azNewArgv; |
| 2045 | - if( !emptyFlag){ | |
| 2069 | + if( !emptyFlag ){ | |
| 2046 | 2070 | g.argc = 3; |
| 2047 | 2071 | if( oldArgc==4 ){ |
| 2048 | 2072 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 2049 | 2073 | }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2050 | 2074 | azNewArgv[g.argc-1] = "--latest"; |
| @@ -2169,14 +2193,15 @@ | ||
| 2169 | 2193 | { "ssh-command", 0, 40, 0, 0, "" }, |
| 2170 | 2194 | { "ssl-ca-location", 0, 40, 0, 0, "" }, |
| 2171 | 2195 | { "ssl-identity", 0, 40, 0, 0, "" }, |
| 2172 | 2196 | #ifdef FOSSIL_ENABLE_TCL |
| 2173 | 2197 | { "tcl", 0, 0, 0, 0, "off" }, |
| 2174 | - { "tcl-setup", 0, 40, 0, 1, "" }, | |
| 2198 | + { "tcl-setup", 0, 40, 1, 1, "" }, | |
| 2175 | 2199 | #endif |
| 2176 | - { "th1-setup", 0, 40, 0, 1, "" }, | |
| 2177 | - { "th1-uri-regexp", 0, 40, 0, 0, "" }, | |
| 2200 | + { "th1-hooks", 0, 0, 0, 0, "off" }, | |
| 2201 | + { "th1-setup", 0, 40, 1, 1, "" }, | |
| 2202 | + { "th1-uri-regexp", 0, 40, 1, 0, "" }, | |
| 2178 | 2203 | { "web-browser", 0, 32, 0, 0, "" }, |
| 2179 | 2204 | { "white-foreground", 0, 0, 0, 0, "off" }, |
| 2180 | 2205 | { 0,0,0,0,0,0 } |
| 2181 | 2206 | }; |
| 2182 | 2207 | |
| @@ -2375,19 +2400,23 @@ | ||
| 2375 | 2400 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2376 | 2401 | ** interpreter will be able to evaluate arbitrary TH1 |
| 2377 | 2402 | ** expressions and scripts. Default: off. |
| 2378 | 2403 | ** |
| 2379 | 2404 | ** tcl-setup This is the setup script to be evaluated after creating |
| 2380 | -** and initializing the Tcl interpreter. By default, this | |
| 2405 | +** (versionable) and initializing the Tcl interpreter. By default, this | |
| 2381 | 2406 | ** is empty and no extra setup is performed. |
| 2407 | +** | |
| 2408 | +** th1-hooks If enabled (and Fossil was compiled with support for TH1 | |
| 2409 | +** hooks), special TH1 commands will be called before and | |
| 2410 | +** after any Fossil command or web page. Default: off. | |
| 2382 | 2411 | ** |
| 2383 | 2412 | ** th1-setup This is the setup script to be evaluated after creating |
| 2384 | -** and initializing the TH1 interpreter. By default, this | |
| 2413 | +** (versionable) and initializing the TH1 interpreter. By default, this | |
| 2385 | 2414 | ** is empty and no extra setup is performed. |
| 2386 | 2415 | ** |
| 2387 | 2416 | ** th1-uri-regexp Specify which URI's are allowed in HTTP requests from |
| 2388 | -** TH1 scripts. If empty, no HTTP requests are allowed | |
| 2417 | +** (versionable) TH1 scripts. If empty, no HTTP requests are allowed | |
| 2389 | 2418 | ** whatsoever. The default is an empty string. |
| 2390 | 2419 | ** |
| 2391 | 2420 | ** web-browser A shell command used to launch your preferred |
| 2392 | 2421 | ** web browser when given a URL as an argument. |
| 2393 | 2422 | ** Defaults to "start" on windows, "open" on Mac, |
| 2394 | 2423 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -785,10 +785,31 @@ | |
| 785 | assert( g.zMainDbType!=0 ); |
| 786 | db_attach(zDbName, zLabel); |
| 787 | if( pWasAttached ) *pWasAttached = 1; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | /* |
| 792 | ** Open the user database in "~/.fossil". Create the database anew if |
| 793 | ** it does not already exist. |
| 794 | ** |
| @@ -801,11 +822,14 @@ | |
| 801 | ** case, invoke this routine with useAttach as 1. |
| 802 | */ |
| 803 | void db_open_config(int useAttach){ |
| 804 | char *zDbName; |
| 805 | char *zHome; |
| 806 | if( g.zConfigDbName ) return; |
| 807 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 808 | zHome = fossil_getenv("LOCALAPPDATA"); |
| 809 | if( zHome==0 ){ |
| 810 | zHome = fossil_getenv("APPDATA"); |
| 811 | if( zHome==0 ){ |
| @@ -941,11 +965,11 @@ | |
| 941 | int db_open_local(const char *zDbName){ |
| 942 | int i, n; |
| 943 | char zPwd[2000]; |
| 944 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 945 | |
| 946 | if( g.localOpen) return 1; |
| 947 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 948 | n = strlen(zPwd); |
| 949 | while( n>0 ){ |
| 950 | for(i=0; i<count(aDbName); i++){ |
| 951 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| @@ -1045,11 +1069,11 @@ | |
| 1045 | ** use the repository of the open checkout if there is one. |
| 1046 | ** |
| 1047 | ** Error out if the repository cannot be opened. |
| 1048 | */ |
| 1049 | void db_find_and_open_repository(int bFlags, int nArgUsed){ |
| 1050 | const char *zRep = find_option("repository", "R", 1); |
| 1051 | if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){ |
| 1052 | zRep = g.argv[nArgUsed]; |
| 1053 | } |
| 1054 | if( zRep==0 ){ |
| 1055 | if( db_open_local(0)==0 ){ |
| @@ -1920,11 +1944,11 @@ | |
| 1920 | int rc = 0; |
| 1921 | db_prepare( &q, "PRAGMA table_info(%Q)", zTableName ); |
| 1922 | while(SQLITE_ROW == db_step(&q)){ |
| 1923 | /* Columns: (cid, name, type, notnull, dflt_value, pk) */ |
| 1924 | char const * zCol = db_column_text(&q, 1); |
| 1925 | if(0==fossil_strcmp(zColName, zCol)){ |
| 1926 | rc = 1; |
| 1927 | break; |
| 1928 | } |
| 1929 | } |
| 1930 | db_finalize(&q); |
| @@ -2040,11 +2064,11 @@ | |
| 2040 | db_lset_int("checkout", 0); |
| 2041 | oldArgv = g.argv; |
| 2042 | oldArgc = g.argc; |
| 2043 | azNewArgv[0] = g.argv[0]; |
| 2044 | g.argv = azNewArgv; |
| 2045 | if( !emptyFlag){ |
| 2046 | g.argc = 3; |
| 2047 | if( oldArgc==4 ){ |
| 2048 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 2049 | }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2050 | azNewArgv[g.argc-1] = "--latest"; |
| @@ -2169,14 +2193,15 @@ | |
| 2169 | { "ssh-command", 0, 40, 0, 0, "" }, |
| 2170 | { "ssl-ca-location", 0, 40, 0, 0, "" }, |
| 2171 | { "ssl-identity", 0, 40, 0, 0, "" }, |
| 2172 | #ifdef FOSSIL_ENABLE_TCL |
| 2173 | { "tcl", 0, 0, 0, 0, "off" }, |
| 2174 | { "tcl-setup", 0, 40, 0, 1, "" }, |
| 2175 | #endif |
| 2176 | { "th1-setup", 0, 40, 0, 1, "" }, |
| 2177 | { "th1-uri-regexp", 0, 40, 0, 0, "" }, |
| 2178 | { "web-browser", 0, 32, 0, 0, "" }, |
| 2179 | { "white-foreground", 0, 0, 0, 0, "off" }, |
| 2180 | { 0,0,0,0,0,0 } |
| 2181 | }; |
| 2182 | |
| @@ -2375,19 +2400,23 @@ | |
| 2375 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2376 | ** interpreter will be able to evaluate arbitrary TH1 |
| 2377 | ** expressions and scripts. Default: off. |
| 2378 | ** |
| 2379 | ** tcl-setup This is the setup script to be evaluated after creating |
| 2380 | ** and initializing the Tcl interpreter. By default, this |
| 2381 | ** is empty and no extra setup is performed. |
| 2382 | ** |
| 2383 | ** th1-setup This is the setup script to be evaluated after creating |
| 2384 | ** and initializing the TH1 interpreter. By default, this |
| 2385 | ** is empty and no extra setup is performed. |
| 2386 | ** |
| 2387 | ** th1-uri-regexp Specify which URI's are allowed in HTTP requests from |
| 2388 | ** TH1 scripts. If empty, no HTTP requests are allowed |
| 2389 | ** whatsoever. The default is an empty string. |
| 2390 | ** |
| 2391 | ** web-browser A shell command used to launch your preferred |
| 2392 | ** web browser when given a URL as an argument. |
| 2393 | ** Defaults to "start" on windows, "open" on Mac, |
| 2394 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -785,10 +785,31 @@ | |
| 785 | assert( g.zMainDbType!=0 ); |
| 786 | db_attach(zDbName, zLabel); |
| 787 | if( pWasAttached ) *pWasAttached = 1; |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | /* |
| 792 | ** Close the user database. |
| 793 | */ |
| 794 | void db_close_config(){ |
| 795 | if( g.useAttach ){ |
| 796 | db_detach("configdb"); |
| 797 | g.useAttach = 0; |
| 798 | g.zConfigDbName = 0; |
| 799 | }else if( g.dbConfig ){ |
| 800 | sqlite3_close(g.dbConfig); |
| 801 | g.dbConfig = 0; |
| 802 | g.zConfigDbType = 0; |
| 803 | g.zConfigDbName = 0; |
| 804 | }else if( g.db && fossil_strcmp(g.zMainDbType, "configdb")==0 ){ |
| 805 | sqlite3_close(g.db); |
| 806 | g.db = 0; |
| 807 | g.zMainDbType = 0; |
| 808 | g.zConfigDbName = 0; |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | /* |
| 813 | ** Open the user database in "~/.fossil". Create the database anew if |
| 814 | ** it does not already exist. |
| 815 | ** |
| @@ -801,11 +822,14 @@ | |
| 822 | ** case, invoke this routine with useAttach as 1. |
| 823 | */ |
| 824 | void db_open_config(int useAttach){ |
| 825 | char *zDbName; |
| 826 | char *zHome; |
| 827 | if( g.zConfigDbName ){ |
| 828 | if( useAttach==g.useAttach ) return; |
| 829 | db_close_config(); |
| 830 | } |
| 831 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 832 | zHome = fossil_getenv("LOCALAPPDATA"); |
| 833 | if( zHome==0 ){ |
| 834 | zHome = fossil_getenv("APPDATA"); |
| 835 | if( zHome==0 ){ |
| @@ -941,11 +965,11 @@ | |
| 965 | int db_open_local(const char *zDbName){ |
| 966 | int i, n; |
| 967 | char zPwd[2000]; |
| 968 | static const char aDbName[][10] = { "_FOSSIL_", ".fslckout", ".fos" }; |
| 969 | |
| 970 | if( g.localOpen ) return 1; |
| 971 | file_getcwd(zPwd, sizeof(zPwd)-20); |
| 972 | n = strlen(zPwd); |
| 973 | while( n>0 ){ |
| 974 | for(i=0; i<count(aDbName); i++){ |
| 975 | sqlite3_snprintf(sizeof(zPwd)-n, &zPwd[n], "/%s", aDbName[i]); |
| @@ -1045,11 +1069,11 @@ | |
| 1069 | ** use the repository of the open checkout if there is one. |
| 1070 | ** |
| 1071 | ** Error out if the repository cannot be opened. |
| 1072 | */ |
| 1073 | void db_find_and_open_repository(int bFlags, int nArgUsed){ |
| 1074 | const char *zRep = find_repository_option(); |
| 1075 | if( zRep==0 && nArgUsed && g.argc==nArgUsed+1 ){ |
| 1076 | zRep = g.argv[nArgUsed]; |
| 1077 | } |
| 1078 | if( zRep==0 ){ |
| 1079 | if( db_open_local(0)==0 ){ |
| @@ -1920,11 +1944,11 @@ | |
| 1944 | int rc = 0; |
| 1945 | db_prepare( &q, "PRAGMA table_info(%Q)", zTableName ); |
| 1946 | while(SQLITE_ROW == db_step(&q)){ |
| 1947 | /* Columns: (cid, name, type, notnull, dflt_value, pk) */ |
| 1948 | char const * zCol = db_column_text(&q, 1); |
| 1949 | if( 0==fossil_strcmp(zColName, zCol) ){ |
| 1950 | rc = 1; |
| 1951 | break; |
| 1952 | } |
| 1953 | } |
| 1954 | db_finalize(&q); |
| @@ -2040,11 +2064,11 @@ | |
| 2064 | db_lset_int("checkout", 0); |
| 2065 | oldArgv = g.argv; |
| 2066 | oldArgc = g.argc; |
| 2067 | azNewArgv[0] = g.argv[0]; |
| 2068 | g.argv = azNewArgv; |
| 2069 | if( !emptyFlag ){ |
| 2070 | g.argc = 3; |
| 2071 | if( oldArgc==4 ){ |
| 2072 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 2073 | }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2074 | azNewArgv[g.argc-1] = "--latest"; |
| @@ -2169,14 +2193,15 @@ | |
| 2193 | { "ssh-command", 0, 40, 0, 0, "" }, |
| 2194 | { "ssl-ca-location", 0, 40, 0, 0, "" }, |
| 2195 | { "ssl-identity", 0, 40, 0, 0, "" }, |
| 2196 | #ifdef FOSSIL_ENABLE_TCL |
| 2197 | { "tcl", 0, 0, 0, 0, "off" }, |
| 2198 | { "tcl-setup", 0, 40, 1, 1, "" }, |
| 2199 | #endif |
| 2200 | { "th1-hooks", 0, 0, 0, 0, "off" }, |
| 2201 | { "th1-setup", 0, 40, 1, 1, "" }, |
| 2202 | { "th1-uri-regexp", 0, 40, 1, 0, "" }, |
| 2203 | { "web-browser", 0, 32, 0, 0, "" }, |
| 2204 | { "white-foreground", 0, 0, 0, 0, "off" }, |
| 2205 | { 0,0,0,0,0,0 } |
| 2206 | }; |
| 2207 | |
| @@ -2375,19 +2400,23 @@ | |
| 2400 | ** scripts to be evaluated from TH1. Additionally, the Tcl |
| 2401 | ** interpreter will be able to evaluate arbitrary TH1 |
| 2402 | ** expressions and scripts. Default: off. |
| 2403 | ** |
| 2404 | ** tcl-setup This is the setup script to be evaluated after creating |
| 2405 | ** (versionable) and initializing the Tcl interpreter. By default, this |
| 2406 | ** is empty and no extra setup is performed. |
| 2407 | ** |
| 2408 | ** th1-hooks If enabled (and Fossil was compiled with support for TH1 |
| 2409 | ** hooks), special TH1 commands will be called before and |
| 2410 | ** after any Fossil command or web page. Default: off. |
| 2411 | ** |
| 2412 | ** th1-setup This is the setup script to be evaluated after creating |
| 2413 | ** (versionable) and initializing the TH1 interpreter. By default, this |
| 2414 | ** is empty and no extra setup is performed. |
| 2415 | ** |
| 2416 | ** th1-uri-regexp Specify which URI's are allowed in HTTP requests from |
| 2417 | ** (versionable) TH1 scripts. If empty, no HTTP requests are allowed |
| 2418 | ** whatsoever. The default is an empty string. |
| 2419 | ** |
| 2420 | ** web-browser A shell command used to launch your preferred |
| 2421 | ** web browser when given a URL as an argument. |
| 2422 | ** Defaults to "start" on windows, "open" on Mac, |
| 2423 |
+1
-7
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -356,17 +356,11 @@ | ||
| 356 | 356 | width = atoi(zWidth); |
| 357 | 357 | if( (width!=0) && (width<=39) ){ |
| 358 | 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | 359 | } |
| 360 | 360 | }else{ |
| 361 | -#ifdef TIOCGWINSZ | |
| 362 | - struct winsize w; | |
| 363 | - ioctl(0, TIOCGWINSZ, &w); | |
| 364 | - width = w.ws_col; | |
| 365 | -#else | |
| 366 | - width = 79; | |
| 367 | -#endif | |
| 361 | + width = -1; | |
| 368 | 362 | } |
| 369 | 363 | db_find_and_open_repository(0,0); |
| 370 | 364 | if( recomputeFlag ) leaf_rebuild(); |
| 371 | 365 | blob_zero(&sql); |
| 372 | 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 373 | 367 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,17 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | #ifdef TIOCGWINSZ |
| 362 | struct winsize w; |
| 363 | ioctl(0, TIOCGWINSZ, &w); |
| 364 | width = w.ws_col; |
| 365 | #else |
| 366 | width = 79; |
| 367 | #endif |
| 368 | } |
| 369 | db_find_and_open_repository(0,0); |
| 370 | if( recomputeFlag ) leaf_rebuild(); |
| 371 | blob_zero(&sql); |
| 372 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 373 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,17 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | width = -1; |
| 362 | } |
| 363 | db_find_and_open_repository(0,0); |
| 364 | if( recomputeFlag ) leaf_rebuild(); |
| 365 | blob_zero(&sql); |
| 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 367 |
+1
-7
| --- src/descendants.c | ||
| +++ src/descendants.c | ||
| @@ -356,17 +356,11 @@ | ||
| 356 | 356 | width = atoi(zWidth); |
| 357 | 357 | if( (width!=0) && (width<=39) ){ |
| 358 | 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | 359 | } |
| 360 | 360 | }else{ |
| 361 | -#ifdef TIOCGWINSZ | |
| 362 | - struct winsize w; | |
| 363 | - ioctl(0, TIOCGWINSZ, &w); | |
| 364 | - width = w.ws_col; | |
| 365 | -#else | |
| 366 | - width = 79; | |
| 367 | -#endif | |
| 361 | + width = -1; | |
| 368 | 362 | } |
| 369 | 363 | db_find_and_open_repository(0,0); |
| 370 | 364 | if( recomputeFlag ) leaf_rebuild(); |
| 371 | 365 | blob_zero(&sql); |
| 372 | 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 373 | 367 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,17 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | #ifdef TIOCGWINSZ |
| 362 | struct winsize w; |
| 363 | ioctl(0, TIOCGWINSZ, &w); |
| 364 | width = w.ws_col; |
| 365 | #else |
| 366 | width = 79; |
| 367 | #endif |
| 368 | } |
| 369 | db_find_and_open_repository(0,0); |
| 370 | if( recomputeFlag ) leaf_rebuild(); |
| 371 | blob_zero(&sql); |
| 372 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 373 |
| --- src/descendants.c | |
| +++ src/descendants.c | |
| @@ -356,17 +356,11 @@ | |
| 356 | width = atoi(zWidth); |
| 357 | if( (width!=0) && (width<=39) ){ |
| 358 | fossil_fatal("-W|--width value must be >39 or 0"); |
| 359 | } |
| 360 | }else{ |
| 361 | width = -1; |
| 362 | } |
| 363 | db_find_and_open_repository(0,0); |
| 364 | if( recomputeFlag ) leaf_rebuild(); |
| 365 | blob_zero(&sql); |
| 366 | blob_append(&sql, timeline_query_for_tty(), -1); |
| 367 |
+7
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -146,16 +146,20 @@ | ||
| 146 | 146 | /* this is the default, no-op */ |
| 147 | 147 | } |
| 148 | 148 | zLimit = find_option("limit","n",1); |
| 149 | 149 | zWidth = find_option("width","W",1); |
| 150 | 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | - iWidth = zWidth ? atoi(zWidth) : 79; | |
| 152 | 151 | zOffset = find_option("offset",0,1); |
| 153 | 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | 153 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | - if( (iWidth!=0) && (iWidth<=22) ){ | |
| 156 | - fossil_fatal("-W|--width value must be >22 or 0"); | |
| 154 | + if( zWidth ){ | |
| 155 | + iWidth = atoi(zWidth); | |
| 156 | + if( (iWidth!=0) && (iWidth<=22) ){ | |
| 157 | + fossil_fatal("-W|--width value must be >22 or 0"); | |
| 158 | + } | |
| 159 | + }else{ | |
| 160 | + iWidth = -1; | |
| 157 | 161 | } |
| 158 | 162 | if( g.argc!=3 ){ |
| 159 | 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | 164 | } |
| 161 | 165 | file_tree_name(g.argv[2], &fname, 1); |
| 162 | 166 | |
| 163 | 167 | ADDED src/fusefs.c |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | iWidth = zWidth ? atoi(zWidth) : 79; |
| 152 | zOffset = find_option("offset",0,1); |
| 153 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 156 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 157 | } |
| 158 | if( g.argc!=3 ){ |
| 159 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | } |
| 161 | file_tree_name(g.argv[2], &fname, 1); |
| 162 | |
| 163 | DDED src/fusefs.c |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | zOffset = find_option("offset",0,1); |
| 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 153 | iBrief = (find_option("brief","b",0) == 0); |
| 154 | if( zWidth ){ |
| 155 | iWidth = atoi(zWidth); |
| 156 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 157 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 158 | } |
| 159 | }else{ |
| 160 | iWidth = -1; |
| 161 | } |
| 162 | if( g.argc!=3 ){ |
| 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 164 | } |
| 165 | file_tree_name(g.argv[2], &fname, 1); |
| 166 | |
| 167 | DDED src/fusefs.c |
+7
-3
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -146,16 +146,20 @@ | ||
| 146 | 146 | /* this is the default, no-op */ |
| 147 | 147 | } |
| 148 | 148 | zLimit = find_option("limit","n",1); |
| 149 | 149 | zWidth = find_option("width","W",1); |
| 150 | 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | - iWidth = zWidth ? atoi(zWidth) : 79; | |
| 152 | 151 | zOffset = find_option("offset",0,1); |
| 153 | 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | 153 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | - if( (iWidth!=0) && (iWidth<=22) ){ | |
| 156 | - fossil_fatal("-W|--width value must be >22 or 0"); | |
| 154 | + if( zWidth ){ | |
| 155 | + iWidth = atoi(zWidth); | |
| 156 | + if( (iWidth!=0) && (iWidth<=22) ){ | |
| 157 | + fossil_fatal("-W|--width value must be >22 or 0"); | |
| 158 | + } | |
| 159 | + }else{ | |
| 160 | + iWidth = -1; | |
| 157 | 161 | } |
| 158 | 162 | if( g.argc!=3 ){ |
| 159 | 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | 164 | } |
| 161 | 165 | file_tree_name(g.argv[2], &fname, 1); |
| 162 | 166 | |
| 163 | 167 | ADDED src/fusefs.c |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | iWidth = zWidth ? atoi(zWidth) : 79; |
| 152 | zOffset = find_option("offset",0,1); |
| 153 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 154 | iBrief = (find_option("brief","b",0) == 0); |
| 155 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 156 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 157 | } |
| 158 | if( g.argc!=3 ){ |
| 159 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 160 | } |
| 161 | file_tree_name(g.argv[2], &fname, 1); |
| 162 | |
| 163 | DDED src/fusefs.c |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -146,16 +146,20 @@ | |
| 146 | /* this is the default, no-op */ |
| 147 | } |
| 148 | zLimit = find_option("limit","n",1); |
| 149 | zWidth = find_option("width","W",1); |
| 150 | iLimit = zLimit ? atoi(zLimit) : -1; |
| 151 | zOffset = find_option("offset",0,1); |
| 152 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 153 | iBrief = (find_option("brief","b",0) == 0); |
| 154 | if( zWidth ){ |
| 155 | iWidth = atoi(zWidth); |
| 156 | if( (iWidth!=0) && (iWidth<=22) ){ |
| 157 | fossil_fatal("-W|--width value must be >22 or 0"); |
| 158 | } |
| 159 | }else{ |
| 160 | iWidth = -1; |
| 161 | } |
| 162 | if( g.argc!=3 ){ |
| 163 | usage("?-l|--log? ?-b|--brief? FILENAME"); |
| 164 | } |
| 165 | file_tree_name(g.argv[2], &fname, 1); |
| 166 | |
| 167 | DDED src/fusefs.c |
+8
| --- a/src/fusefs.c | ||
| +++ b/src/fusefs.c | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +/*the versiondef | |
| 2 | +# define STRINGIFY_(X) #X | |
| 3 | +# define STRINGIFY(X) STRINGIFY_(X) | |
| 4 | + return 0; | |
| 5 | +#endif | |
| 6 | +} | |
| 7 | +#ifdef#ifndef | |
| 8 | + fossil_fatal("this build of fossil do |
| --- a/src/fusefs.c | |
| +++ b/src/fusefs.c | |
| @@ -0,0 +1,8 @@ | |
| --- a/src/fusefs.c | |
| +++ b/src/fusefs.c | |
| @@ -0,0 +1,8 @@ | |
| 1 | /*the versiondef |
| 2 | # define STRINGIFY_(X) #X |
| 3 | # define STRINGIFY(X) STRINGIFY_(X) |
| 4 | return 0; |
| 5 | #endif |
| 6 | } |
| 7 | #ifdef#ifndef |
| 8 | fossil_fatal("this build of fossil do |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -132,11 +132,11 @@ | ||
| 132 | 132 | fossil_print("tags: %s\n", zTags); |
| 133 | 133 | } |
| 134 | 134 | free(zTags); |
| 135 | 135 | if( zComment ){ |
| 136 | 136 | fossil_print("comment: "); |
| 137 | - comment_print(zComment, 14, 79); | |
| 137 | + comment_print(zComment, 14, -1); | |
| 138 | 138 | free(zComment); |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, 79); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, -1); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -132,11 +132,11 @@ | ||
| 132 | 132 | fossil_print("tags: %s\n", zTags); |
| 133 | 133 | } |
| 134 | 134 | free(zTags); |
| 135 | 135 | if( zComment ){ |
| 136 | 136 | fossil_print("comment: "); |
| 137 | - comment_print(zComment, 14, 79); | |
| 137 | + comment_print(zComment, 14, -1); | |
| 138 | 138 | free(zComment); |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | /* |
| 143 | 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, 79); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -132,11 +132,11 @@ | |
| 132 | fossil_print("tags: %s\n", zTags); |
| 133 | } |
| 134 | free(zTags); |
| 135 | if( zComment ){ |
| 136 | fossil_print("comment: "); |
| 137 | comment_print(zComment, 14, -1); |
| 138 | free(zComment); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /* |
| 143 |
+135
-10
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -124,10 +124,11 @@ | ||
| 124 | 124 | sqlite3 *dbConfig; /* Separate connection for global_config table */ |
| 125 | 125 | int useAttach; /* True if global_config is attached to repository */ |
| 126 | 126 | const char *zConfigDbName;/* Path of the config database. NULL if not open */ |
| 127 | 127 | sqlite3_int64 now; /* Seconds since 1970 */ |
| 128 | 128 | int repositoryOpen; /* True if the main repository database is open */ |
| 129 | + char *zRepositoryOption; /* Most recent cached repository option value */ | |
| 129 | 130 | char *zRepositoryName; /* Name of the repository database */ |
| 130 | 131 | const char *zMainDbType;/* "configdb", "localdb", or "repository" */ |
| 131 | 132 | const char *zConfigDbType; /* "configdb", "localdb", or "repository" */ |
| 132 | 133 | int localOpen; /* True if the local database is open */ |
| 133 | 134 | char *zLocalRoot; /* The directory holding the local database */ |
| @@ -155,10 +156,11 @@ | ||
| 155 | 156 | int cgiOutput; /* Write error and status messages to CGI */ |
| 156 | 157 | int xferPanic; /* Write error messages in XFER protocol */ |
| 157 | 158 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 158 | 159 | Th_Interp *interp; /* The TH1 interpreter */ |
| 159 | 160 | char *th1Setup; /* The TH1 post-creation setup script, if any */ |
| 161 | + int th1Flags; /* The TH1 integration state flags */ | |
| 160 | 162 | FILE *httpIn; /* Accept HTTP input from here */ |
| 161 | 163 | FILE *httpOut; /* Send HTTP output here */ |
| 162 | 164 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 163 | 165 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 164 | 166 | int *aCommitFile; /* Array of files to be committed */ |
| @@ -194,10 +196,13 @@ | ||
| 194 | 196 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 195 | 197 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 196 | 198 | |
| 197 | 199 | int parseCnt[10]; /* Counts of artifacts parsed */ |
| 198 | 200 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 201 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 202 | + int fNoThHook; /* Disable all TH1 command/webpage hooks */ | |
| 203 | +#endif | |
| 199 | 204 | int thTrace; /* True to enable TH1 debugging output */ |
| 200 | 205 | Blob thLog; /* Text of the TH1 debugging output */ |
| 201 | 206 | |
| 202 | 207 | int isHome; /* True if rendering the "home" page */ |
| 203 | 208 | |
| @@ -620,10 +625,13 @@ | ||
| 620 | 625 | g.fSshClient = 0; |
| 621 | 626 | g.zSshCmd = 0; |
| 622 | 627 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 623 | 628 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 624 | 629 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 630 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 631 | + g.fNoThHook = find_option("no-th-hook", 0, 0)!=0; | |
| 632 | +#endif | |
| 625 | 633 | g.zHttpAuth = 0; |
| 626 | 634 | g.zLogin = find_option("user", "U", 1); |
| 627 | 635 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 628 | 636 | g.zErrlog = find_option("errorlog", 0, 1); |
| 629 | 637 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| @@ -649,13 +657,30 @@ | ||
| 649 | 657 | if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open"); |
| 650 | 658 | /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */ |
| 651 | 659 | #endif |
| 652 | 660 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 653 | 661 | if( rc==1 ){ |
| 654 | - fossil_fatal("%s: unknown command: %s\n" | |
| 655 | - "%s: use \"help\" for more information\n", | |
| 656 | - g.argv[0], zCmdName, g.argv[0]); | |
| 662 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 663 | + if( !g.isHTTP && !g.fNoThHook ){ | |
| 664 | + rc = Th_CommandHook(zCmdName, 0); | |
| 665 | + }else{ | |
| 666 | + rc = TH_OK; | |
| 667 | + } | |
| 668 | + if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ | |
| 669 | + if( rc==TH_OK || rc==TH_RETURN ){ | |
| 670 | +#endif | |
| 671 | + fossil_fatal("%s: unknown command: %s\n" | |
| 672 | + "%s: use \"help\" for more information\n", | |
| 673 | + g.argv[0], zCmdName, g.argv[0]); | |
| 674 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 675 | + } | |
| 676 | + if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ | |
| 677 | + Th_CommandNotify(zCmdName, 0); | |
| 678 | + } | |
| 679 | + } | |
| 680 | + fossil_exit(0); | |
| 681 | +#endif | |
| 657 | 682 | }else if( rc==2 ){ |
| 658 | 683 | int i, n; |
| 659 | 684 | Blob couldbe; |
| 660 | 685 | blob_zero(&couldbe); |
| 661 | 686 | n = strlen(zCmdName); |
| @@ -669,11 +694,44 @@ | ||
| 669 | 694 | "%s: use \"help\" for more information\n", |
| 670 | 695 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 671 | 696 | fossil_exit(1); |
| 672 | 697 | } |
| 673 | 698 | atexit( fossil_atexit ); |
| 674 | - aCommand[idx].xFunc(); | |
| 699 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 700 | + /* | |
| 701 | + ** The TH1 return codes from the hook will be handled as follows: | |
| 702 | + ** | |
| 703 | + ** TH_OK: The xFunc() and the TH1 notification will both be executed. | |
| 704 | + ** | |
| 705 | + ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be | |
| 706 | + ** skipped. If the xFunc() is being hooked, the error message | |
| 707 | + ** will be emitted. | |
| 708 | + ** | |
| 709 | + ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped. | |
| 710 | + ** | |
| 711 | + ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be | |
| 712 | + ** skipped. | |
| 713 | + ** | |
| 714 | + ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be | |
| 715 | + ** executed. | |
| 716 | + */ | |
| 717 | + if( !g.isHTTP && !g.fNoThHook ){ | |
| 718 | + rc = Th_CommandHook(aCommand[idx].zName, aCommand[idx].cmdFlags); | |
| 719 | + }else{ | |
| 720 | + rc = TH_OK; | |
| 721 | + } | |
| 722 | + if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ | |
| 723 | + if( rc==TH_OK || rc==TH_RETURN ){ | |
| 724 | +#endif | |
| 725 | + aCommand[idx].xFunc(); | |
| 726 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 727 | + } | |
| 728 | + if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ | |
| 729 | + Th_CommandNotify(aCommand[idx].zName, aCommand[idx].cmdFlags); | |
| 730 | + } | |
| 731 | + } | |
| 732 | +#endif | |
| 675 | 733 | fossil_exit(0); |
| 676 | 734 | /*NOT_REACHED*/ |
| 677 | 735 | return 0; |
| 678 | 736 | } |
| 679 | 737 | |
| @@ -739,10 +797,24 @@ | ||
| 739 | 797 | break; |
| 740 | 798 | } |
| 741 | 799 | } |
| 742 | 800 | return zReturn; |
| 743 | 801 | } |
| 802 | + | |
| 803 | +/* | |
| 804 | +** Look for a repository command-line option. If present, [re-]cache it in | |
| 805 | +** the global state and return the new pointer, freeing any previous value. | |
| 806 | +** If absent and there is no cached value, return NULL. | |
| 807 | +*/ | |
| 808 | +const char *find_repository_option(){ | |
| 809 | + const char *zRepository = find_option("repository", "R", 1); | |
| 810 | + if( zRepository ){ | |
| 811 | + if( g.zRepositoryOption ) fossil_free(g.zRepositoryOption); | |
| 812 | + g.zRepositoryOption = mprintf("%s", zRepository); | |
| 813 | + } | |
| 814 | + return g.zRepositoryOption; | |
| 815 | +} | |
| 744 | 816 | |
| 745 | 817 | /* |
| 746 | 818 | ** Verify that there are no unprocessed command-line options. If |
| 747 | 819 | ** Any remaining command-line argument begins with "-" print |
| 748 | 820 | ** an error message and quit. |
| @@ -861,10 +933,13 @@ | ||
| 861 | 933 | fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid()); |
| 862 | 934 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 863 | 935 | fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion()); |
| 864 | 936 | #if defined(FOSSIL_ENABLE_SSL) |
| 865 | 937 | fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION)); |
| 938 | +#endif | |
| 939 | +#if defined(FOSSIL_ENABLE_TH1_HOOKS) | |
| 940 | + fossil_print("TH1_HOOKS\n"); | |
| 866 | 941 | #endif |
| 867 | 942 | #if defined(FOSSIL_ENABLE_TCL) |
| 868 | 943 | Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL); |
| 869 | 944 | rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1); |
| 870 | 945 | zRc = Th_ReturnCodeName(rc, 0); |
| @@ -1486,21 +1561,37 @@ | ||
| 1486 | 1561 | } |
| 1487 | 1562 | |
| 1488 | 1563 | /* Locate the method specified by the path and execute the function |
| 1489 | 1564 | ** that implements that method. |
| 1490 | 1565 | */ |
| 1491 | - if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) && | |
| 1492 | - name_search("not_found", aWebpage, count(aWebpage), &idx) ){ | |
| 1566 | + if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) ){ | |
| 1493 | 1567 | #ifdef FOSSIL_ENABLE_JSON |
| 1494 | 1568 | if(g.json.isJsonMode){ |
| 1495 | 1569 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0); |
| 1496 | 1570 | }else |
| 1497 | 1571 | #endif |
| 1498 | 1572 | { |
| 1499 | - cgi_set_status(404,"Not Found"); | |
| 1500 | - @ <h1>Not Found</h1> | |
| 1501 | - @ <p>Page not found: %h(g.zPath)</p> | |
| 1573 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1574 | + int rc; | |
| 1575 | + if( !g.fNoThHook ){ | |
| 1576 | + rc = Th_WebpageHook(g.zPath, 0); | |
| 1577 | + }else{ | |
| 1578 | + rc = TH_OK; | |
| 1579 | + } | |
| 1580 | + if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ | |
| 1581 | + if( rc==TH_OK || rc==TH_RETURN ){ | |
| 1582 | +#endif | |
| 1583 | + cgi_set_status(404,"Not Found"); | |
| 1584 | + @ <h1>Not Found</h1> | |
| 1585 | + @ <p>Page not found: %h(g.zPath)</p> | |
| 1586 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1587 | + } | |
| 1588 | + if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ | |
| 1589 | + Th_WebpageNotify(g.zPath, 0); | |
| 1590 | + } | |
| 1591 | + } | |
| 1592 | +#endif | |
| 1502 | 1593 | } |
| 1503 | 1594 | }else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){ |
| 1504 | 1595 | #ifdef FOSSIL_ENABLE_JSON |
| 1505 | 1596 | if(g.json.isJsonMode){ |
| 1506 | 1597 | json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0); |
| @@ -1510,11 +1601,45 @@ | ||
| 1510 | 1601 | @ <h1>Server Configuration Error</h1> |
| 1511 | 1602 | @ <p>The database schema on the server is out-of-date. Please ask |
| 1512 | 1603 | @ the administrator to run <b>fossil rebuild</b>.</p> |
| 1513 | 1604 | } |
| 1514 | 1605 | }else{ |
| 1515 | - aWebpage[idx].xFunc(); | |
| 1606 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1607 | + /* | |
| 1608 | + ** The TH1 return codes from the hook will be handled as follows: | |
| 1609 | + ** | |
| 1610 | + ** TH_OK: The xFunc() and the TH1 notification will both be executed. | |
| 1611 | + ** | |
| 1612 | + ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be | |
| 1613 | + ** skipped. If the xFunc() is being hooked, the error message | |
| 1614 | + ** will be emitted. | |
| 1615 | + ** | |
| 1616 | + ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped. | |
| 1617 | + ** | |
| 1618 | + ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be | |
| 1619 | + ** skipped. | |
| 1620 | + ** | |
| 1621 | + ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be | |
| 1622 | + ** executed. | |
| 1623 | + */ | |
| 1624 | + int rc; | |
| 1625 | + if( !g.fNoThHook ){ | |
| 1626 | + rc = Th_WebpageHook(aWebpage[idx].zName, aWebpage[idx].cmdFlags); | |
| 1627 | + }else{ | |
| 1628 | + rc = TH_OK; | |
| 1629 | + } | |
| 1630 | + if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ | |
| 1631 | + if( rc==TH_OK || rc==TH_RETURN ){ | |
| 1632 | +#endif | |
| 1633 | + aWebpage[idx].xFunc(); | |
| 1634 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1635 | + } | |
| 1636 | + if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ | |
| 1637 | + Th_WebpageNotify(aWebpage[idx].zName, aWebpage[idx].cmdFlags); | |
| 1638 | + } | |
| 1639 | + } | |
| 1640 | +#endif | |
| 1516 | 1641 | } |
| 1517 | 1642 | |
| 1518 | 1643 | /* Return the result. |
| 1519 | 1644 | */ |
| 1520 | 1645 | cgi_reply(); |
| 1521 | 1646 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -124,10 +124,11 @@ | |
| 124 | sqlite3 *dbConfig; /* Separate connection for global_config table */ |
| 125 | int useAttach; /* True if global_config is attached to repository */ |
| 126 | const char *zConfigDbName;/* Path of the config database. NULL if not open */ |
| 127 | sqlite3_int64 now; /* Seconds since 1970 */ |
| 128 | int repositoryOpen; /* True if the main repository database is open */ |
| 129 | char *zRepositoryName; /* Name of the repository database */ |
| 130 | const char *zMainDbType;/* "configdb", "localdb", or "repository" */ |
| 131 | const char *zConfigDbType; /* "configdb", "localdb", or "repository" */ |
| 132 | int localOpen; /* True if the local database is open */ |
| 133 | char *zLocalRoot; /* The directory holding the local database */ |
| @@ -155,10 +156,11 @@ | |
| 155 | int cgiOutput; /* Write error and status messages to CGI */ |
| 156 | int xferPanic; /* Write error messages in XFER protocol */ |
| 157 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 158 | Th_Interp *interp; /* The TH1 interpreter */ |
| 159 | char *th1Setup; /* The TH1 post-creation setup script, if any */ |
| 160 | FILE *httpIn; /* Accept HTTP input from here */ |
| 161 | FILE *httpOut; /* Send HTTP output here */ |
| 162 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 163 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 164 | int *aCommitFile; /* Array of files to be committed */ |
| @@ -194,10 +196,13 @@ | |
| 194 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 195 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 196 | |
| 197 | int parseCnt[10]; /* Counts of artifacts parsed */ |
| 198 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 199 | int thTrace; /* True to enable TH1 debugging output */ |
| 200 | Blob thLog; /* Text of the TH1 debugging output */ |
| 201 | |
| 202 | int isHome; /* True if rendering the "home" page */ |
| 203 | |
| @@ -620,10 +625,13 @@ | |
| 620 | g.fSshClient = 0; |
| 621 | g.zSshCmd = 0; |
| 622 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 623 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 624 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 625 | g.zHttpAuth = 0; |
| 626 | g.zLogin = find_option("user", "U", 1); |
| 627 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 628 | g.zErrlog = find_option("errorlog", 0, 1); |
| 629 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| @@ -649,13 +657,30 @@ | |
| 649 | if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open"); |
| 650 | /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */ |
| 651 | #endif |
| 652 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 653 | if( rc==1 ){ |
| 654 | fossil_fatal("%s: unknown command: %s\n" |
| 655 | "%s: use \"help\" for more information\n", |
| 656 | g.argv[0], zCmdName, g.argv[0]); |
| 657 | }else if( rc==2 ){ |
| 658 | int i, n; |
| 659 | Blob couldbe; |
| 660 | blob_zero(&couldbe); |
| 661 | n = strlen(zCmdName); |
| @@ -669,11 +694,44 @@ | |
| 669 | "%s: use \"help\" for more information\n", |
| 670 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 671 | fossil_exit(1); |
| 672 | } |
| 673 | atexit( fossil_atexit ); |
| 674 | aCommand[idx].xFunc(); |
| 675 | fossil_exit(0); |
| 676 | /*NOT_REACHED*/ |
| 677 | return 0; |
| 678 | } |
| 679 | |
| @@ -739,10 +797,24 @@ | |
| 739 | break; |
| 740 | } |
| 741 | } |
| 742 | return zReturn; |
| 743 | } |
| 744 | |
| 745 | /* |
| 746 | ** Verify that there are no unprocessed command-line options. If |
| 747 | ** Any remaining command-line argument begins with "-" print |
| 748 | ** an error message and quit. |
| @@ -861,10 +933,13 @@ | |
| 861 | fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid()); |
| 862 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 863 | fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion()); |
| 864 | #if defined(FOSSIL_ENABLE_SSL) |
| 865 | fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION)); |
| 866 | #endif |
| 867 | #if defined(FOSSIL_ENABLE_TCL) |
| 868 | Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL); |
| 869 | rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1); |
| 870 | zRc = Th_ReturnCodeName(rc, 0); |
| @@ -1486,21 +1561,37 @@ | |
| 1486 | } |
| 1487 | |
| 1488 | /* Locate the method specified by the path and execute the function |
| 1489 | ** that implements that method. |
| 1490 | */ |
| 1491 | if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) && |
| 1492 | name_search("not_found", aWebpage, count(aWebpage), &idx) ){ |
| 1493 | #ifdef FOSSIL_ENABLE_JSON |
| 1494 | if(g.json.isJsonMode){ |
| 1495 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0); |
| 1496 | }else |
| 1497 | #endif |
| 1498 | { |
| 1499 | cgi_set_status(404,"Not Found"); |
| 1500 | @ <h1>Not Found</h1> |
| 1501 | @ <p>Page not found: %h(g.zPath)</p> |
| 1502 | } |
| 1503 | }else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){ |
| 1504 | #ifdef FOSSIL_ENABLE_JSON |
| 1505 | if(g.json.isJsonMode){ |
| 1506 | json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0); |
| @@ -1510,11 +1601,45 @@ | |
| 1510 | @ <h1>Server Configuration Error</h1> |
| 1511 | @ <p>The database schema on the server is out-of-date. Please ask |
| 1512 | @ the administrator to run <b>fossil rebuild</b>.</p> |
| 1513 | } |
| 1514 | }else{ |
| 1515 | aWebpage[idx].xFunc(); |
| 1516 | } |
| 1517 | |
| 1518 | /* Return the result. |
| 1519 | */ |
| 1520 | cgi_reply(); |
| 1521 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -124,10 +124,11 @@ | |
| 124 | sqlite3 *dbConfig; /* Separate connection for global_config table */ |
| 125 | int useAttach; /* True if global_config is attached to repository */ |
| 126 | const char *zConfigDbName;/* Path of the config database. NULL if not open */ |
| 127 | sqlite3_int64 now; /* Seconds since 1970 */ |
| 128 | int repositoryOpen; /* True if the main repository database is open */ |
| 129 | char *zRepositoryOption; /* Most recent cached repository option value */ |
| 130 | char *zRepositoryName; /* Name of the repository database */ |
| 131 | const char *zMainDbType;/* "configdb", "localdb", or "repository" */ |
| 132 | const char *zConfigDbType; /* "configdb", "localdb", or "repository" */ |
| 133 | int localOpen; /* True if the local database is open */ |
| 134 | char *zLocalRoot; /* The directory holding the local database */ |
| @@ -155,10 +156,11 @@ | |
| 156 | int cgiOutput; /* Write error and status messages to CGI */ |
| 157 | int xferPanic; /* Write error messages in XFER protocol */ |
| 158 | int fullHttpReply; /* True for full HTTP reply. False for CGI reply */ |
| 159 | Th_Interp *interp; /* The TH1 interpreter */ |
| 160 | char *th1Setup; /* The TH1 post-creation setup script, if any */ |
| 161 | int th1Flags; /* The TH1 integration state flags */ |
| 162 | FILE *httpIn; /* Accept HTTP input from here */ |
| 163 | FILE *httpOut; /* Send HTTP output here */ |
| 164 | int xlinkClusterOnly; /* Set when cloning. Only process clusters */ |
| 165 | int fTimeFormat; /* 1 for UTC. 2 for localtime. 0 not yet selected */ |
| 166 | int *aCommitFile; /* Array of files to be committed */ |
| @@ -194,10 +196,13 @@ | |
| 196 | char zCsrfToken[12]; /* Value of the anti-CSRF token */ |
| 197 | int okCsrf; /* Anti-CSRF token is present and valid */ |
| 198 | |
| 199 | int parseCnt[10]; /* Counts of artifacts parsed */ |
| 200 | FILE *fDebug; /* Write debug information here, if the file exists */ |
| 201 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 202 | int fNoThHook; /* Disable all TH1 command/webpage hooks */ |
| 203 | #endif |
| 204 | int thTrace; /* True to enable TH1 debugging output */ |
| 205 | Blob thLog; /* Text of the TH1 debugging output */ |
| 206 | |
| 207 | int isHome; /* True if rendering the "home" page */ |
| 208 | |
| @@ -620,10 +625,13 @@ | |
| 625 | g.fSshClient = 0; |
| 626 | g.zSshCmd = 0; |
| 627 | if( g.fSqlTrace ) g.fSqlStats = 1; |
| 628 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 629 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 630 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 631 | g.fNoThHook = find_option("no-th-hook", 0, 0)!=0; |
| 632 | #endif |
| 633 | g.zHttpAuth = 0; |
| 634 | g.zLogin = find_option("user", "U", 1); |
| 635 | g.zSSLIdentity = find_option("ssl-identity", 0, 1); |
| 636 | g.zErrlog = find_option("errorlog", 0, 1); |
| 637 | if( find_option("utc",0,0) ) g.fTimeFormat = 1; |
| @@ -649,13 +657,30 @@ | |
| 657 | if( !is_valid_fd(2) ) fossil_panic("file descriptor 2 not open"); |
| 658 | /* if( is_valid_fd(3) ) fossil_warning("file descriptor 3 is open"); */ |
| 659 | #endif |
| 660 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 661 | if( rc==1 ){ |
| 662 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 663 | if( !g.isHTTP && !g.fNoThHook ){ |
| 664 | rc = Th_CommandHook(zCmdName, 0); |
| 665 | }else{ |
| 666 | rc = TH_OK; |
| 667 | } |
| 668 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 669 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 670 | #endif |
| 671 | fossil_fatal("%s: unknown command: %s\n" |
| 672 | "%s: use \"help\" for more information\n", |
| 673 | g.argv[0], zCmdName, g.argv[0]); |
| 674 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 675 | } |
| 676 | if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| 677 | Th_CommandNotify(zCmdName, 0); |
| 678 | } |
| 679 | } |
| 680 | fossil_exit(0); |
| 681 | #endif |
| 682 | }else if( rc==2 ){ |
| 683 | int i, n; |
| 684 | Blob couldbe; |
| 685 | blob_zero(&couldbe); |
| 686 | n = strlen(zCmdName); |
| @@ -669,11 +694,44 @@ | |
| 694 | "%s: use \"help\" for more information\n", |
| 695 | g.argv[0], zCmdName, g.argv[0], blob_str(&couldbe), g.argv[0]); |
| 696 | fossil_exit(1); |
| 697 | } |
| 698 | atexit( fossil_atexit ); |
| 699 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 700 | /* |
| 701 | ** The TH1 return codes from the hook will be handled as follows: |
| 702 | ** |
| 703 | ** TH_OK: The xFunc() and the TH1 notification will both be executed. |
| 704 | ** |
| 705 | ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be |
| 706 | ** skipped. If the xFunc() is being hooked, the error message |
| 707 | ** will be emitted. |
| 708 | ** |
| 709 | ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped. |
| 710 | ** |
| 711 | ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be |
| 712 | ** skipped. |
| 713 | ** |
| 714 | ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be |
| 715 | ** executed. |
| 716 | */ |
| 717 | if( !g.isHTTP && !g.fNoThHook ){ |
| 718 | rc = Th_CommandHook(aCommand[idx].zName, aCommand[idx].cmdFlags); |
| 719 | }else{ |
| 720 | rc = TH_OK; |
| 721 | } |
| 722 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 723 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 724 | #endif |
| 725 | aCommand[idx].xFunc(); |
| 726 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 727 | } |
| 728 | if( !g.isHTTP && !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| 729 | Th_CommandNotify(aCommand[idx].zName, aCommand[idx].cmdFlags); |
| 730 | } |
| 731 | } |
| 732 | #endif |
| 733 | fossil_exit(0); |
| 734 | /*NOT_REACHED*/ |
| 735 | return 0; |
| 736 | } |
| 737 | |
| @@ -739,10 +797,24 @@ | |
| 797 | break; |
| 798 | } |
| 799 | } |
| 800 | return zReturn; |
| 801 | } |
| 802 | |
| 803 | /* |
| 804 | ** Look for a repository command-line option. If present, [re-]cache it in |
| 805 | ** the global state and return the new pointer, freeing any previous value. |
| 806 | ** If absent and there is no cached value, return NULL. |
| 807 | */ |
| 808 | const char *find_repository_option(){ |
| 809 | const char *zRepository = find_option("repository", "R", 1); |
| 810 | if( zRepository ){ |
| 811 | if( g.zRepositoryOption ) fossil_free(g.zRepositoryOption); |
| 812 | g.zRepositoryOption = mprintf("%s", zRepository); |
| 813 | } |
| 814 | return g.zRepositoryOption; |
| 815 | } |
| 816 | |
| 817 | /* |
| 818 | ** Verify that there are no unprocessed command-line options. If |
| 819 | ** Any remaining command-line argument begins with "-" print |
| 820 | ** an error message and quit. |
| @@ -861,10 +933,13 @@ | |
| 933 | fossil_print("SQLite %s %.30s\n", sqlite3_libversion(), sqlite3_sourceid()); |
| 934 | fossil_print("Schema version %s\n", AUX_SCHEMA); |
| 935 | fossil_print("zlib %s, loaded %s\n", ZLIB_VERSION, zlibVersion()); |
| 936 | #if defined(FOSSIL_ENABLE_SSL) |
| 937 | fossil_print("SSL (%s)\n", SSLeay_version(SSLEAY_VERSION)); |
| 938 | #endif |
| 939 | #if defined(FOSSIL_ENABLE_TH1_HOOKS) |
| 940 | fossil_print("TH1_HOOKS\n"); |
| 941 | #endif |
| 942 | #if defined(FOSSIL_ENABLE_TCL) |
| 943 | Th_FossilInit(TH_INIT_DEFAULT | TH_INIT_FORCE_TCL); |
| 944 | rc = Th_Eval(g.interp, 0, "tclInvoke info patchlevel", -1); |
| 945 | zRc = Th_ReturnCodeName(rc, 0); |
| @@ -1486,21 +1561,37 @@ | |
| 1561 | } |
| 1562 | |
| 1563 | /* Locate the method specified by the path and execute the function |
| 1564 | ** that implements that method. |
| 1565 | */ |
| 1566 | if( name_search(g.zPath, aWebpage, count(aWebpage), &idx) ){ |
| 1567 | #ifdef FOSSIL_ENABLE_JSON |
| 1568 | if(g.json.isJsonMode){ |
| 1569 | json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,0); |
| 1570 | }else |
| 1571 | #endif |
| 1572 | { |
| 1573 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1574 | int rc; |
| 1575 | if( !g.fNoThHook ){ |
| 1576 | rc = Th_WebpageHook(g.zPath, 0); |
| 1577 | }else{ |
| 1578 | rc = TH_OK; |
| 1579 | } |
| 1580 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 1581 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 1582 | #endif |
| 1583 | cgi_set_status(404,"Not Found"); |
| 1584 | @ <h1>Not Found</h1> |
| 1585 | @ <p>Page not found: %h(g.zPath)</p> |
| 1586 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1587 | } |
| 1588 | if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| 1589 | Th_WebpageNotify(g.zPath, 0); |
| 1590 | } |
| 1591 | } |
| 1592 | #endif |
| 1593 | } |
| 1594 | }else if( aWebpage[idx].xFunc!=page_xfer && db_schema_is_outofdate() ){ |
| 1595 | #ifdef FOSSIL_ENABLE_JSON |
| 1596 | if(g.json.isJsonMode){ |
| 1597 | json_err(FSL_JSON_E_DB_NEEDS_REBUILD,NULL,0); |
| @@ -1510,11 +1601,45 @@ | |
| 1601 | @ <h1>Server Configuration Error</h1> |
| 1602 | @ <p>The database schema on the server is out-of-date. Please ask |
| 1603 | @ the administrator to run <b>fossil rebuild</b>.</p> |
| 1604 | } |
| 1605 | }else{ |
| 1606 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1607 | /* |
| 1608 | ** The TH1 return codes from the hook will be handled as follows: |
| 1609 | ** |
| 1610 | ** TH_OK: The xFunc() and the TH1 notification will both be executed. |
| 1611 | ** |
| 1612 | ** TH_ERROR: The xFunc() will be executed, the TH1 notification will be |
| 1613 | ** skipped. If the xFunc() is being hooked, the error message |
| 1614 | ** will be emitted. |
| 1615 | ** |
| 1616 | ** TH_BREAK: The xFunc() and the TH1 notification will both be skipped. |
| 1617 | ** |
| 1618 | ** TH_RETURN: The xFunc() will be executed, the TH1 notification will be |
| 1619 | ** skipped. |
| 1620 | ** |
| 1621 | ** TH_CONTINUE: The xFunc() will be skipped, the TH1 notification will be |
| 1622 | ** executed. |
| 1623 | */ |
| 1624 | int rc; |
| 1625 | if( !g.fNoThHook ){ |
| 1626 | rc = Th_WebpageHook(aWebpage[idx].zName, aWebpage[idx].cmdFlags); |
| 1627 | }else{ |
| 1628 | rc = TH_OK; |
| 1629 | } |
| 1630 | if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){ |
| 1631 | if( rc==TH_OK || rc==TH_RETURN ){ |
| 1632 | #endif |
| 1633 | aWebpage[idx].xFunc(); |
| 1634 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1635 | } |
| 1636 | if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){ |
| 1637 | Th_WebpageNotify(aWebpage[idx].zName, aWebpage[idx].cmdFlags); |
| 1638 | } |
| 1639 | } |
| 1640 | #endif |
| 1641 | } |
| 1642 | |
| 1643 | /* Return the result. |
| 1644 | */ |
| 1645 | cgi_reply(); |
| 1646 |
+11
-1
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -42,10 +42,11 @@ | ||
| 42 | 42 | $(SRCDIR)/encode.c \ |
| 43 | 43 | $(SRCDIR)/event.c \ |
| 44 | 44 | $(SRCDIR)/export.c \ |
| 45 | 45 | $(SRCDIR)/file.c \ |
| 46 | 46 | $(SRCDIR)/finfo.c \ |
| 47 | + $(SRCDIR)/fusefs.c \ | |
| 47 | 48 | $(SRCDIR)/glob.c \ |
| 48 | 49 | $(SRCDIR)/graph.c \ |
| 49 | 50 | $(SRCDIR)/gzip.c \ |
| 50 | 51 | $(SRCDIR)/http.c \ |
| 51 | 52 | $(SRCDIR)/http_socket.c \ |
| @@ -154,10 +155,11 @@ | ||
| 154 | 155 | $(OBJDIR)/encode_.c \ |
| 155 | 156 | $(OBJDIR)/event_.c \ |
| 156 | 157 | $(OBJDIR)/export_.c \ |
| 157 | 158 | $(OBJDIR)/file_.c \ |
| 158 | 159 | $(OBJDIR)/finfo_.c \ |
| 160 | + $(OBJDIR)/fusefs_.c \ | |
| 159 | 161 | $(OBJDIR)/glob_.c \ |
| 160 | 162 | $(OBJDIR)/graph_.c \ |
| 161 | 163 | $(OBJDIR)/gzip_.c \ |
| 162 | 164 | $(OBJDIR)/http_.c \ |
| 163 | 165 | $(OBJDIR)/http_socket_.c \ |
| @@ -266,10 +268,11 @@ | ||
| 266 | 268 | $(OBJDIR)/encode.o \ |
| 267 | 269 | $(OBJDIR)/event.o \ |
| 268 | 270 | $(OBJDIR)/export.o \ |
| 269 | 271 | $(OBJDIR)/file.o \ |
| 270 | 272 | $(OBJDIR)/finfo.o \ |
| 273 | + $(OBJDIR)/fusefs.o \ | |
| 271 | 274 | $(OBJDIR)/glob.o \ |
| 272 | 275 | $(OBJDIR)/graph.o \ |
| 273 | 276 | $(OBJDIR)/gzip.o \ |
| 274 | 277 | $(OBJDIR)/http.o \ |
| 275 | 278 | $(OBJDIR)/http_socket.o \ |
| @@ -421,11 +424,11 @@ | ||
| 421 | 424 | |
| 422 | 425 | |
| 423 | 426 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 424 | 427 | $(OBJDIR)/mkindex $(TRANS_SRC) >$@ |
| 425 | 428 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 426 | - $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h | |
| 429 | + $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h | |
| 427 | 430 | touch $(OBJDIR)/headers |
| 428 | 431 | $(OBJDIR)/headers: Makefile |
| 429 | 432 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 430 | 433 | Makefile: |
| 431 | 434 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -636,10 +639,17 @@ | ||
| 636 | 639 | |
| 637 | 640 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 638 | 641 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 639 | 642 | |
| 640 | 643 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 644 | +$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate | |
| 645 | + $(OBJDIR)/translate $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c | |
| 646 | + | |
| 647 | +$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h | |
| 648 | + $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c | |
| 649 | + | |
| 650 | +$(OBJDIR)/fusefs.h: $(OBJDIR)/headers | |
| 641 | 651 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 642 | 652 | $(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 643 | 653 | |
| 644 | 654 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 645 | 655 | $(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c |
| 646 | 656 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -42,10 +42,11 @@ | |
| 42 | $(SRCDIR)/encode.c \ |
| 43 | $(SRCDIR)/event.c \ |
| 44 | $(SRCDIR)/export.c \ |
| 45 | $(SRCDIR)/file.c \ |
| 46 | $(SRCDIR)/finfo.c \ |
| 47 | $(SRCDIR)/glob.c \ |
| 48 | $(SRCDIR)/graph.c \ |
| 49 | $(SRCDIR)/gzip.c \ |
| 50 | $(SRCDIR)/http.c \ |
| 51 | $(SRCDIR)/http_socket.c \ |
| @@ -154,10 +155,11 @@ | |
| 154 | $(OBJDIR)/encode_.c \ |
| 155 | $(OBJDIR)/event_.c \ |
| 156 | $(OBJDIR)/export_.c \ |
| 157 | $(OBJDIR)/file_.c \ |
| 158 | $(OBJDIR)/finfo_.c \ |
| 159 | $(OBJDIR)/glob_.c \ |
| 160 | $(OBJDIR)/graph_.c \ |
| 161 | $(OBJDIR)/gzip_.c \ |
| 162 | $(OBJDIR)/http_.c \ |
| 163 | $(OBJDIR)/http_socket_.c \ |
| @@ -266,10 +268,11 @@ | |
| 266 | $(OBJDIR)/encode.o \ |
| 267 | $(OBJDIR)/event.o \ |
| 268 | $(OBJDIR)/export.o \ |
| 269 | $(OBJDIR)/file.o \ |
| 270 | $(OBJDIR)/finfo.o \ |
| 271 | $(OBJDIR)/glob.o \ |
| 272 | $(OBJDIR)/graph.o \ |
| 273 | $(OBJDIR)/gzip.o \ |
| 274 | $(OBJDIR)/http.o \ |
| 275 | $(OBJDIR)/http_socket.o \ |
| @@ -421,11 +424,11 @@ | |
| 421 | |
| 422 | |
| 423 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 424 | $(OBJDIR)/mkindex $(TRANS_SRC) >$@ |
| 425 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 426 | $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h |
| 427 | touch $(OBJDIR)/headers |
| 428 | $(OBJDIR)/headers: Makefile |
| 429 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 430 | Makefile: |
| 431 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -636,10 +639,17 @@ | |
| 636 | |
| 637 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 638 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 639 | |
| 640 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 641 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 642 | $(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 643 | |
| 644 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 645 | $(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c |
| 646 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -42,10 +42,11 @@ | |
| 42 | $(SRCDIR)/encode.c \ |
| 43 | $(SRCDIR)/event.c \ |
| 44 | $(SRCDIR)/export.c \ |
| 45 | $(SRCDIR)/file.c \ |
| 46 | $(SRCDIR)/finfo.c \ |
| 47 | $(SRCDIR)/fusefs.c \ |
| 48 | $(SRCDIR)/glob.c \ |
| 49 | $(SRCDIR)/graph.c \ |
| 50 | $(SRCDIR)/gzip.c \ |
| 51 | $(SRCDIR)/http.c \ |
| 52 | $(SRCDIR)/http_socket.c \ |
| @@ -154,10 +155,11 @@ | |
| 155 | $(OBJDIR)/encode_.c \ |
| 156 | $(OBJDIR)/event_.c \ |
| 157 | $(OBJDIR)/export_.c \ |
| 158 | $(OBJDIR)/file_.c \ |
| 159 | $(OBJDIR)/finfo_.c \ |
| 160 | $(OBJDIR)/fusefs_.c \ |
| 161 | $(OBJDIR)/glob_.c \ |
| 162 | $(OBJDIR)/graph_.c \ |
| 163 | $(OBJDIR)/gzip_.c \ |
| 164 | $(OBJDIR)/http_.c \ |
| 165 | $(OBJDIR)/http_socket_.c \ |
| @@ -266,10 +268,11 @@ | |
| 268 | $(OBJDIR)/encode.o \ |
| 269 | $(OBJDIR)/event.o \ |
| 270 | $(OBJDIR)/export.o \ |
| 271 | $(OBJDIR)/file.o \ |
| 272 | $(OBJDIR)/finfo.o \ |
| 273 | $(OBJDIR)/fusefs.o \ |
| 274 | $(OBJDIR)/glob.o \ |
| 275 | $(OBJDIR)/graph.o \ |
| 276 | $(OBJDIR)/gzip.o \ |
| 277 | $(OBJDIR)/http.o \ |
| 278 | $(OBJDIR)/http_socket.o \ |
| @@ -421,11 +424,11 @@ | |
| 424 | |
| 425 | |
| 426 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 427 | $(OBJDIR)/mkindex $(TRANS_SRC) >$@ |
| 428 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 429 | $(OBJDIR)/makeheaders $(OBJDIR)/add_.c:$(OBJDIR)/add.h $(OBJDIR)/allrepo_.c:$(OBJDIR)/allrepo.h $(OBJDIR)/attach_.c:$(OBJDIR)/attach.h $(OBJDIR)/bag_.c:$(OBJDIR)/bag.h $(OBJDIR)/bisect_.c:$(OBJDIR)/bisect.h $(OBJDIR)/blob_.c:$(OBJDIR)/blob.h $(OBJDIR)/branch_.c:$(OBJDIR)/branch.h $(OBJDIR)/browse_.c:$(OBJDIR)/browse.h $(OBJDIR)/cache_.c:$(OBJDIR)/cache.h $(OBJDIR)/captcha_.c:$(OBJDIR)/captcha.h $(OBJDIR)/cgi_.c:$(OBJDIR)/cgi.h $(OBJDIR)/checkin_.c:$(OBJDIR)/checkin.h $(OBJDIR)/checkout_.c:$(OBJDIR)/checkout.h $(OBJDIR)/clearsign_.c:$(OBJDIR)/clearsign.h $(OBJDIR)/clone_.c:$(OBJDIR)/clone.h $(OBJDIR)/comformat_.c:$(OBJDIR)/comformat.h $(OBJDIR)/configure_.c:$(OBJDIR)/configure.h $(OBJDIR)/content_.c:$(OBJDIR)/content.h $(OBJDIR)/db_.c:$(OBJDIR)/db.h $(OBJDIR)/delta_.c:$(OBJDIR)/delta.h $(OBJDIR)/deltacmd_.c:$(OBJDIR)/deltacmd.h $(OBJDIR)/descendants_.c:$(OBJDIR)/descendants.h $(OBJDIR)/diff_.c:$(OBJDIR)/diff.h $(OBJDIR)/diffcmd_.c:$(OBJDIR)/diffcmd.h $(OBJDIR)/doc_.c:$(OBJDIR)/doc.h $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h $(OBJDIR)/event_.c:$(OBJDIR)/event.h $(OBJDIR)/export_.c:$(OBJDIR)/export.h $(OBJDIR)/file_.c:$(OBJDIR)/file.h $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h $(OBJDIR)/http_.c:$(OBJDIR)/http.h $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h $(OBJDIR)/http_ssl_.c:$(OBJDIR)/http_ssl.h $(OBJDIR)/http_transport_.c:$(OBJDIR)/http_transport.h $(OBJDIR)/import_.c:$(OBJDIR)/import.h $(OBJDIR)/info_.c:$(OBJDIR)/info.h $(OBJDIR)/json_.c:$(OBJDIR)/json.h $(OBJDIR)/json_artifact_.c:$(OBJDIR)/json_artifact.h $(OBJDIR)/json_branch_.c:$(OBJDIR)/json_branch.h $(OBJDIR)/json_config_.c:$(OBJDIR)/json_config.h $(OBJDIR)/json_diff_.c:$(OBJDIR)/json_diff.h $(OBJDIR)/json_dir_.c:$(OBJDIR)/json_dir.h $(OBJDIR)/json_finfo_.c:$(OBJDIR)/json_finfo.h $(OBJDIR)/json_login_.c:$(OBJDIR)/json_login.h $(OBJDIR)/json_query_.c:$(OBJDIR)/json_query.h $(OBJDIR)/json_report_.c:$(OBJDIR)/json_report.h $(OBJDIR)/json_status_.c:$(OBJDIR)/json_status.h $(OBJDIR)/json_tag_.c:$(OBJDIR)/json_tag.h $(OBJDIR)/json_timeline_.c:$(OBJDIR)/json_timeline.h $(OBJDIR)/json_user_.c:$(OBJDIR)/json_user.h $(OBJDIR)/json_wiki_.c:$(OBJDIR)/json_wiki.h $(OBJDIR)/leaf_.c:$(OBJDIR)/leaf.h $(OBJDIR)/loadctrl_.c:$(OBJDIR)/loadctrl.h $(OBJDIR)/login_.c:$(OBJDIR)/login.h $(OBJDIR)/lookslike_.c:$(OBJDIR)/lookslike.h $(OBJDIR)/main_.c:$(OBJDIR)/main.h $(OBJDIR)/manifest_.c:$(OBJDIR)/manifest.h $(OBJDIR)/markdown_.c:$(OBJDIR)/markdown.h $(OBJDIR)/markdown_html_.c:$(OBJDIR)/markdown_html.h $(OBJDIR)/md5_.c:$(OBJDIR)/md5.h $(OBJDIR)/merge_.c:$(OBJDIR)/merge.h $(OBJDIR)/merge3_.c:$(OBJDIR)/merge3.h $(OBJDIR)/moderate_.c:$(OBJDIR)/moderate.h $(OBJDIR)/name_.c:$(OBJDIR)/name.h $(OBJDIR)/path_.c:$(OBJDIR)/path.h $(OBJDIR)/pivot_.c:$(OBJDIR)/pivot.h $(OBJDIR)/popen_.c:$(OBJDIR)/popen.h $(OBJDIR)/pqueue_.c:$(OBJDIR)/pqueue.h $(OBJDIR)/printf_.c:$(OBJDIR)/printf.h $(OBJDIR)/rebuild_.c:$(OBJDIR)/rebuild.h $(OBJDIR)/regexp_.c:$(OBJDIR)/regexp.h $(OBJDIR)/report_.c:$(OBJDIR)/report.h $(OBJDIR)/rss_.c:$(OBJDIR)/rss.h $(OBJDIR)/schema_.c:$(OBJDIR)/schema.h $(OBJDIR)/search_.c:$(OBJDIR)/search.h $(OBJDIR)/setup_.c:$(OBJDIR)/setup.h $(OBJDIR)/sha1_.c:$(OBJDIR)/sha1.h $(OBJDIR)/shun_.c:$(OBJDIR)/shun.h $(OBJDIR)/skins_.c:$(OBJDIR)/skins.h $(OBJDIR)/sqlcmd_.c:$(OBJDIR)/sqlcmd.h $(OBJDIR)/stash_.c:$(OBJDIR)/stash.h $(OBJDIR)/stat_.c:$(OBJDIR)/stat.h $(OBJDIR)/style_.c:$(OBJDIR)/style.h $(OBJDIR)/sync_.c:$(OBJDIR)/sync.h $(OBJDIR)/tag_.c:$(OBJDIR)/tag.h $(OBJDIR)/tar_.c:$(OBJDIR)/tar.h $(OBJDIR)/th_main_.c:$(OBJDIR)/th_main.h $(OBJDIR)/timeline_.c:$(OBJDIR)/timeline.h $(OBJDIR)/tkt_.c:$(OBJDIR)/tkt.h $(OBJDIR)/tktsetup_.c:$(OBJDIR)/tktsetup.h $(OBJDIR)/undo_.c:$(OBJDIR)/undo.h $(OBJDIR)/unicode_.c:$(OBJDIR)/unicode.h $(OBJDIR)/update_.c:$(OBJDIR)/update.h $(OBJDIR)/url_.c:$(OBJDIR)/url.h $(OBJDIR)/user_.c:$(OBJDIR)/user.h $(OBJDIR)/utf8_.c:$(OBJDIR)/utf8.h $(OBJDIR)/util_.c:$(OBJDIR)/util.h $(OBJDIR)/verify_.c:$(OBJDIR)/verify.h $(OBJDIR)/vfile_.c:$(OBJDIR)/vfile.h $(OBJDIR)/wiki_.c:$(OBJDIR)/wiki.h $(OBJDIR)/wikiformat_.c:$(OBJDIR)/wikiformat.h $(OBJDIR)/winfile_.c:$(OBJDIR)/winfile.h $(OBJDIR)/winhttp_.c:$(OBJDIR)/winhttp.h $(OBJDIR)/wysiwyg_.c:$(OBJDIR)/wysiwyg.h $(OBJDIR)/xfer_.c:$(OBJDIR)/xfer.h $(OBJDIR)/xfersetup_.c:$(OBJDIR)/xfersetup.h $(OBJDIR)/zip_.c:$(OBJDIR)/zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h $(OBJDIR)/VERSION.h |
| 430 | touch $(OBJDIR)/headers |
| 431 | $(OBJDIR)/headers: Makefile |
| 432 | $(OBJDIR)/json.o $(OBJDIR)/json_artifact.o $(OBJDIR)/json_branch.o $(OBJDIR)/json_config.o $(OBJDIR)/json_diff.o $(OBJDIR)/json_dir.o $(OBJDIR)/json_finfo.o $(OBJDIR)/json_login.o $(OBJDIR)/json_query.o $(OBJDIR)/json_report.o $(OBJDIR)/json_status.o $(OBJDIR)/json_tag.o $(OBJDIR)/json_timeline.o $(OBJDIR)/json_user.o $(OBJDIR)/json_wiki.o : $(SRCDIR)/json_detail.h |
| 433 | Makefile: |
| 434 | $(OBJDIR)/add_.c: $(SRCDIR)/add.c $(OBJDIR)/translate |
| @@ -636,10 +639,17 @@ | |
| 639 | |
| 640 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 641 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 642 | |
| 643 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 644 | $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate |
| 645 | $(OBJDIR)/translate $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c |
| 646 | |
| 647 | $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h |
| 648 | $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c |
| 649 | |
| 650 | $(OBJDIR)/fusefs.h: $(OBJDIR)/headers |
| 651 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 652 | $(OBJDIR)/translate $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 653 | |
| 654 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 655 | $(XTCC) -o $(OBJDIR)/glob.o -c $(OBJDIR)/glob_.c |
| 656 |
+34
-1
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -46,10 +46,11 @@ | ||
| 46 | 46 | encode |
| 47 | 47 | event |
| 48 | 48 | export |
| 49 | 49 | file |
| 50 | 50 | finfo |
| 51 | + fusefs | |
| 51 | 52 | glob |
| 52 | 53 | graph |
| 53 | 54 | gzip |
| 54 | 55 | http |
| 55 | 56 | http_socket |
| @@ -408,10 +409,14 @@ | ||
| 408 | 409 | # FOSSIL_ENABLE_JSON = 1 |
| 409 | 410 | |
| 410 | 411 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 411 | 412 | # |
| 412 | 413 | # FOSSIL_ENABLE_SSL = 1 |
| 414 | + | |
| 415 | +#### Enable hooks for commands and web pages via TH1 | |
| 416 | +# | |
| 417 | +# FOSSIL_ENABLE_TH1_HOOKS = 1 | |
| 413 | 418 | |
| 414 | 419 | #### Enable scripting support via Tcl/Tk |
| 415 | 420 | # |
| 416 | 421 | # FOSSIL_ENABLE_TCL = 1 |
| 417 | 422 | |
| @@ -537,10 +542,16 @@ | ||
| 537 | 542 | # With HTTPS support |
| 538 | 543 | ifdef FOSSIL_ENABLE_SSL |
| 539 | 544 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 540 | 545 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 541 | 546 | endif |
| 547 | + | |
| 548 | +# With TH1 hook support | |
| 549 | +ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 550 | +TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 551 | +RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 552 | +endif | |
| 542 | 553 | |
| 543 | 554 | # With Tcl support |
| 544 | 555 | ifdef FOSSIL_ENABLE_TCL |
| 545 | 556 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 546 | 557 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -612,11 +623,15 @@ | ||
| 612 | 623 | # |
| 613 | 624 | TCLSH = tclsh |
| 614 | 625 | |
| 615 | 626 | #### Nullsoft installer MakeNSIS location |
| 616 | 627 | # |
| 617 | -MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" | |
| 628 | +MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" | |
| 629 | + | |
| 630 | +#### Inno Setup executable location | |
| 631 | +# | |
| 632 | +INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" | |
| 618 | 633 | |
| 619 | 634 | #### Include a configuration file that can override any one of these settings. |
| 620 | 635 | # |
| 621 | 636 | -include config.w32 |
| 622 | 637 | |
| @@ -652,10 +667,11 @@ | ||
| 652 | 667 | ifdef USE_WINDOWS |
| 653 | 668 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 654 | 669 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 655 | 670 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 656 | 671 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 672 | +CAT = type | |
| 657 | 673 | CP = copy |
| 658 | 674 | MV = copy |
| 659 | 675 | RM = del /Q |
| 660 | 676 | MKDIR = -mkdir |
| 661 | 677 | RMDIR = rmdir /S /Q |
| @@ -662,10 +678,11 @@ | ||
| 662 | 678 | else |
| 663 | 679 | TRANSLATE = $(OBJDIR)/translate |
| 664 | 680 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 665 | 681 | MKINDEX = $(OBJDIR)/mkindex |
| 666 | 682 | VERSION = $(OBJDIR)/version |
| 683 | +CAT = cat | |
| 667 | 684 | CP = cp |
| 668 | 685 | MV = mv |
| 669 | 686 | RM = rm -f |
| 670 | 687 | MKDIR = -mkdir -p |
| 671 | 688 | RMDIR = rm -rf |
| @@ -777,10 +794,13 @@ | ||
| 777 | 794 | $(RMDIR) $(OBJDIR) |
| 778 | 795 | endif |
| 779 | 796 | |
| 780 | 797 | setup: $(OBJDIR) $(APPNAME) |
| 781 | 798 | $(MAKENSIS) ./setup/fossil.nsi |
| 799 | + | |
| 800 | +innosetup: $(OBJDIR) $(APPNAME) | |
| 801 | + $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) | |
| 782 | 802 | } |
| 783 | 803 | |
| 784 | 804 | set mhargs {} |
| 785 | 805 | foreach s [lsort $src] { |
| 786 | 806 | if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"} |
| @@ -1024,10 +1044,13 @@ | ||
| 1024 | 1044 | # Uncomment to enable JSON API |
| 1025 | 1045 | # FOSSIL_ENABLE_JSON = 1 |
| 1026 | 1046 | |
| 1027 | 1047 | # Uncomment to enable SSL support |
| 1028 | 1048 | # FOSSIL_ENABLE_SSL = 1 |
| 1049 | + | |
| 1050 | +# Uncomment to enable TH1 hooks | |
| 1051 | +# FOSSIL_ENABLE_TH1_HOOKS = 1 | |
| 1029 | 1052 | |
| 1030 | 1053 | # Uncomment to enable Tcl support |
| 1031 | 1054 | # FOSSIL_ENABLE_TCL = 1 |
| 1032 | 1055 | |
| 1033 | 1056 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -1082,10 +1105,15 @@ | ||
| 1082 | 1105 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 1083 | 1106 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 1084 | 1107 | LIBS = $(LIBS) $(SSLLIB) |
| 1085 | 1108 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 1086 | 1109 | !endif |
| 1110 | + | |
| 1111 | +!ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1112 | +TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 1113 | +RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 1114 | +!endif | |
| 1087 | 1115 | |
| 1088 | 1116 | !ifdef FOSSIL_ENABLE_TCL |
| 1089 | 1117 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 1090 | 1118 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 1091 | 1119 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -1190,10 +1218,11 @@ | ||
| 1190 | 1218 | clean: |
| 1191 | 1219 | -del $(OX)\*.obj |
| 1192 | 1220 | -del *.obj |
| 1193 | 1221 | -del *_.c |
| 1194 | 1222 | -del *.h |
| 1223 | + -del *.ilk | |
| 1195 | 1224 | -del *.map |
| 1196 | 1225 | -del *.res |
| 1197 | 1226 | -del headers |
| 1198 | 1227 | -del linkopts |
| 1199 | 1228 | -del vc*.pdb |
| @@ -1200,13 +1229,17 @@ | ||
| 1200 | 1229 | |
| 1201 | 1230 | realclean: clean |
| 1202 | 1231 | -del $(APPNAME) |
| 1203 | 1232 | -del $(PDBNAME) |
| 1204 | 1233 | -del translate$E |
| 1234 | + -del translate$P | |
| 1205 | 1235 | -del mkindex$E |
| 1236 | + -del mkindex$P | |
| 1206 | 1237 | -del makeheaders$E |
| 1238 | + -del makeheaders$P | |
| 1207 | 1239 | -del mkversion$E |
| 1240 | + -del mkversion$P | |
| 1208 | 1241 | |
| 1209 | 1242 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 1210 | 1243 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 1211 | 1244 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 1212 | 1245 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| 1213 | 1246 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -46,10 +46,11 @@ | |
| 46 | encode |
| 47 | event |
| 48 | export |
| 49 | file |
| 50 | finfo |
| 51 | glob |
| 52 | graph |
| 53 | gzip |
| 54 | http |
| 55 | http_socket |
| @@ -408,10 +409,14 @@ | |
| 408 | # FOSSIL_ENABLE_JSON = 1 |
| 409 | |
| 410 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 411 | # |
| 412 | # FOSSIL_ENABLE_SSL = 1 |
| 413 | |
| 414 | #### Enable scripting support via Tcl/Tk |
| 415 | # |
| 416 | # FOSSIL_ENABLE_TCL = 1 |
| 417 | |
| @@ -537,10 +542,16 @@ | |
| 537 | # With HTTPS support |
| 538 | ifdef FOSSIL_ENABLE_SSL |
| 539 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 540 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 541 | endif |
| 542 | |
| 543 | # With Tcl support |
| 544 | ifdef FOSSIL_ENABLE_TCL |
| 545 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 546 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -612,11 +623,15 @@ | |
| 612 | # |
| 613 | TCLSH = tclsh |
| 614 | |
| 615 | #### Nullsoft installer MakeNSIS location |
| 616 | # |
| 617 | MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" |
| 618 | |
| 619 | #### Include a configuration file that can override any one of these settings. |
| 620 | # |
| 621 | -include config.w32 |
| 622 | |
| @@ -652,10 +667,11 @@ | |
| 652 | ifdef USE_WINDOWS |
| 653 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 654 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 655 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 656 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 657 | CP = copy |
| 658 | MV = copy |
| 659 | RM = del /Q |
| 660 | MKDIR = -mkdir |
| 661 | RMDIR = rmdir /S /Q |
| @@ -662,10 +678,11 @@ | |
| 662 | else |
| 663 | TRANSLATE = $(OBJDIR)/translate |
| 664 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 665 | MKINDEX = $(OBJDIR)/mkindex |
| 666 | VERSION = $(OBJDIR)/version |
| 667 | CP = cp |
| 668 | MV = mv |
| 669 | RM = rm -f |
| 670 | MKDIR = -mkdir -p |
| 671 | RMDIR = rm -rf |
| @@ -777,10 +794,13 @@ | |
| 777 | $(RMDIR) $(OBJDIR) |
| 778 | endif |
| 779 | |
| 780 | setup: $(OBJDIR) $(APPNAME) |
| 781 | $(MAKENSIS) ./setup/fossil.nsi |
| 782 | } |
| 783 | |
| 784 | set mhargs {} |
| 785 | foreach s [lsort $src] { |
| 786 | if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"} |
| @@ -1024,10 +1044,13 @@ | |
| 1024 | # Uncomment to enable JSON API |
| 1025 | # FOSSIL_ENABLE_JSON = 1 |
| 1026 | |
| 1027 | # Uncomment to enable SSL support |
| 1028 | # FOSSIL_ENABLE_SSL = 1 |
| 1029 | |
| 1030 | # Uncomment to enable Tcl support |
| 1031 | # FOSSIL_ENABLE_TCL = 1 |
| 1032 | |
| 1033 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -1082,10 +1105,15 @@ | |
| 1082 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 1083 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 1084 | LIBS = $(LIBS) $(SSLLIB) |
| 1085 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 1086 | !endif |
| 1087 | |
| 1088 | !ifdef FOSSIL_ENABLE_TCL |
| 1089 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 1090 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 1091 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -1190,10 +1218,11 @@ | |
| 1190 | clean: |
| 1191 | -del $(OX)\*.obj |
| 1192 | -del *.obj |
| 1193 | -del *_.c |
| 1194 | -del *.h |
| 1195 | -del *.map |
| 1196 | -del *.res |
| 1197 | -del headers |
| 1198 | -del linkopts |
| 1199 | -del vc*.pdb |
| @@ -1200,13 +1229,17 @@ | |
| 1200 | |
| 1201 | realclean: clean |
| 1202 | -del $(APPNAME) |
| 1203 | -del $(PDBNAME) |
| 1204 | -del translate$E |
| 1205 | -del mkindex$E |
| 1206 | -del makeheaders$E |
| 1207 | -del mkversion$E |
| 1208 | |
| 1209 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 1210 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 1211 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 1212 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| 1213 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -46,10 +46,11 @@ | |
| 46 | encode |
| 47 | event |
| 48 | export |
| 49 | file |
| 50 | finfo |
| 51 | fusefs |
| 52 | glob |
| 53 | graph |
| 54 | gzip |
| 55 | http |
| 56 | http_socket |
| @@ -408,10 +409,14 @@ | |
| 409 | # FOSSIL_ENABLE_JSON = 1 |
| 410 | |
| 411 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 412 | # |
| 413 | # FOSSIL_ENABLE_SSL = 1 |
| 414 | |
| 415 | #### Enable hooks for commands and web pages via TH1 |
| 416 | # |
| 417 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 418 | |
| 419 | #### Enable scripting support via Tcl/Tk |
| 420 | # |
| 421 | # FOSSIL_ENABLE_TCL = 1 |
| 422 | |
| @@ -537,10 +542,16 @@ | |
| 542 | # With HTTPS support |
| 543 | ifdef FOSSIL_ENABLE_SSL |
| 544 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 545 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 546 | endif |
| 547 | |
| 548 | # With TH1 hook support |
| 549 | ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 550 | TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 551 | RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 552 | endif |
| 553 | |
| 554 | # With Tcl support |
| 555 | ifdef FOSSIL_ENABLE_TCL |
| 556 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 557 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -612,11 +623,15 @@ | |
| 623 | # |
| 624 | TCLSH = tclsh |
| 625 | |
| 626 | #### Nullsoft installer MakeNSIS location |
| 627 | # |
| 628 | MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" |
| 629 | |
| 630 | #### Inno Setup executable location |
| 631 | # |
| 632 | INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" |
| 633 | |
| 634 | #### Include a configuration file that can override any one of these settings. |
| 635 | # |
| 636 | -include config.w32 |
| 637 | |
| @@ -652,10 +667,11 @@ | |
| 667 | ifdef USE_WINDOWS |
| 668 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 669 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 670 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 671 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 672 | CAT = type |
| 673 | CP = copy |
| 674 | MV = copy |
| 675 | RM = del /Q |
| 676 | MKDIR = -mkdir |
| 677 | RMDIR = rmdir /S /Q |
| @@ -662,10 +678,11 @@ | |
| 678 | else |
| 679 | TRANSLATE = $(OBJDIR)/translate |
| 680 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 681 | MKINDEX = $(OBJDIR)/mkindex |
| 682 | VERSION = $(OBJDIR)/version |
| 683 | CAT = cat |
| 684 | CP = cp |
| 685 | MV = mv |
| 686 | RM = rm -f |
| 687 | MKDIR = -mkdir -p |
| 688 | RMDIR = rm -rf |
| @@ -777,10 +794,13 @@ | |
| 794 | $(RMDIR) $(OBJDIR) |
| 795 | endif |
| 796 | |
| 797 | setup: $(OBJDIR) $(APPNAME) |
| 798 | $(MAKENSIS) ./setup/fossil.nsi |
| 799 | |
| 800 | innosetup: $(OBJDIR) $(APPNAME) |
| 801 | $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) |
| 802 | } |
| 803 | |
| 804 | set mhargs {} |
| 805 | foreach s [lsort $src] { |
| 806 | if {[string length $mhargs] > 0} {append mhargs " \\\n\t\t"} |
| @@ -1024,10 +1044,13 @@ | |
| 1044 | # Uncomment to enable JSON API |
| 1045 | # FOSSIL_ENABLE_JSON = 1 |
| 1046 | |
| 1047 | # Uncomment to enable SSL support |
| 1048 | # FOSSIL_ENABLE_SSL = 1 |
| 1049 | |
| 1050 | # Uncomment to enable TH1 hooks |
| 1051 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 1052 | |
| 1053 | # Uncomment to enable Tcl support |
| 1054 | # FOSSIL_ENABLE_TCL = 1 |
| 1055 | |
| 1056 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -1082,10 +1105,15 @@ | |
| 1105 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 1106 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 1107 | LIBS = $(LIBS) $(SSLLIB) |
| 1108 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 1109 | !endif |
| 1110 | |
| 1111 | !ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1112 | TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 1113 | RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 1114 | !endif |
| 1115 | |
| 1116 | !ifdef FOSSIL_ENABLE_TCL |
| 1117 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 1118 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 1119 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -1190,10 +1218,11 @@ | |
| 1218 | clean: |
| 1219 | -del $(OX)\*.obj |
| 1220 | -del *.obj |
| 1221 | -del *_.c |
| 1222 | -del *.h |
| 1223 | -del *.ilk |
| 1224 | -del *.map |
| 1225 | -del *.res |
| 1226 | -del headers |
| 1227 | -del linkopts |
| 1228 | -del vc*.pdb |
| @@ -1200,13 +1229,17 @@ | |
| 1229 | |
| 1230 | realclean: clean |
| 1231 | -del $(APPNAME) |
| 1232 | -del $(PDBNAME) |
| 1233 | -del translate$E |
| 1234 | -del translate$P |
| 1235 | -del mkindex$E |
| 1236 | -del mkindex$P |
| 1237 | -del makeheaders$E |
| 1238 | -del makeheaders$P |
| 1239 | -del mkversion$E |
| 1240 | -del mkversion$P |
| 1241 | |
| 1242 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 1243 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 1244 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 1245 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| 1246 |
+22
-13
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1161,14 +1161,15 @@ | ||
| 1161 | 1161 | ** of a file. |
| 1162 | 1162 | */ |
| 1163 | 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | 1164 | int mperm = PERM_REG; |
| 1165 | 1165 | if( pFile && pFile->zPerm){ |
| 1166 | - if( strstr(pFile->zPerm,"x")!=0 ) | |
| 1166 | + if( strstr(pFile->zPerm,"x")!=0 ){ | |
| 1167 | 1167 | mperm = PERM_EXE; |
| 1168 | - else if( strstr(pFile->zPerm,"l")!=0 ) | |
| 1168 | + }else if( strstr(pFile->zPerm,"l")!=0 ){ | |
| 1169 | 1169 | mperm = PERM_LNK; |
| 1170 | + } | |
| 1170 | 1171 | } |
| 1171 | 1172 | return mperm; |
| 1172 | 1173 | } |
| 1173 | 1174 | |
| 1174 | 1175 | /* |
| @@ -1227,11 +1228,15 @@ | ||
| 1227 | 1228 | ** That will usually be the case. If it is not found there, then do the |
| 1228 | 1229 | ** actual binary search. |
| 1229 | 1230 | ** |
| 1230 | 1231 | ** Update p->iFile to be the index of the file that is found. |
| 1231 | 1232 | */ |
| 1232 | -static ManifestFile *manifest_file_seek_base(Manifest *p, const char *zName){ | |
| 1233 | +static ManifestFile *manifest_file_seek_base( | |
| 1234 | + Manifest *p, /* Manifest to search */ | |
| 1235 | + const char *zName, /* Name of the file we are looking for */ | |
| 1236 | + int bBest /* 0: exact match only. 1: closest match */ | |
| 1237 | +){ | |
| 1233 | 1238 | int lwr, upr; |
| 1234 | 1239 | int c; |
| 1235 | 1240 | int i; |
| 1236 | 1241 | lwr = 0; |
| 1237 | 1242 | upr = p->nFile - 1; |
| @@ -1255,10 +1260,14 @@ | ||
| 1255 | 1260 | }else{ |
| 1256 | 1261 | p->iFile = i; |
| 1257 | 1262 | return &p->aFile[i]; |
| 1258 | 1263 | } |
| 1259 | 1264 | } |
| 1265 | + if( bBest ){ | |
| 1266 | + i = (int)strlen(zName); | |
| 1267 | + if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr]; | |
| 1268 | + } | |
| 1260 | 1269 | return 0; |
| 1261 | 1270 | } |
| 1262 | 1271 | |
| 1263 | 1272 | /* |
| 1264 | 1273 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| @@ -1268,18 +1277,18 @@ | ||
| 1268 | 1277 | ** This routine works even if p is a delta-manifest. The pointer |
| 1269 | 1278 | ** returned might be to the baseline. |
| 1270 | 1279 | ** |
| 1271 | 1280 | ** We assume that filenames are in sorted order and use a binary search. |
| 1272 | 1281 | */ |
| 1273 | -ManifestFile *manifest_file_seek(Manifest *p, const char *zName){ | |
| 1282 | +ManifestFile *manifest_file_seek(Manifest *p, const char *zName, int bBest){ | |
| 1274 | 1283 | ManifestFile *pFile; |
| 1275 | 1284 | |
| 1276 | - pFile = manifest_file_seek_base(p, zName); | |
| 1285 | + pFile = manifest_file_seek_base(p, zName, p->zBaseline ? 0 : bBest); | |
| 1277 | 1286 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1278 | 1287 | if( pFile==0 && p->zBaseline ){ |
| 1279 | 1288 | fetch_baseline(p, 1); |
| 1280 | - pFile = manifest_file_seek_base(p->pBaseline, zName); | |
| 1289 | + pFile = manifest_file_seek_base(p->pBaseline, zName,bBest); | |
| 1281 | 1290 | } |
| 1282 | 1291 | return pFile; |
| 1283 | 1292 | } |
| 1284 | 1293 | |
| 1285 | 1294 | /* |
| @@ -1289,11 +1298,11 @@ | ||
| 1289 | 1298 | */ |
| 1290 | 1299 | ManifestFile *manifest_file_find(Manifest *p, const char *zName){ |
| 1291 | 1300 | int i; |
| 1292 | 1301 | Manifest *pBase; |
| 1293 | 1302 | if( filenames_are_case_sensitive() ){ |
| 1294 | - return manifest_file_seek(p, zName); | |
| 1303 | + return manifest_file_seek(p, zName, 0); | |
| 1295 | 1304 | } |
| 1296 | 1305 | for(i=0; i<p->nFile; i++){ |
| 1297 | 1306 | if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){ |
| 1298 | 1307 | return &p->aFile[i]; |
| 1299 | 1308 | } |
| @@ -1389,11 +1398,11 @@ | ||
| 1389 | 1398 | ** is where most of the changes will be found. |
| 1390 | 1399 | */ |
| 1391 | 1400 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1392 | 1401 | int mperm = manifest_file_mperm(pChildFile); |
| 1393 | 1402 | if( pChildFile->zPrior ){ |
| 1394 | - pParentFile = manifest_file_seek(pParent, pChildFile->zPrior); | |
| 1403 | + pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0); | |
| 1395 | 1404 | if( pParentFile ){ |
| 1396 | 1405 | /* File with name change */ |
| 1397 | 1406 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1398 | 1407 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1399 | 1408 | }else{ |
| @@ -1401,11 +1410,11 @@ | ||
| 1401 | 1410 | ** Treat this like a new file. */ |
| 1402 | 1411 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1403 | 1412 | isPublic, mperm); |
| 1404 | 1413 | } |
| 1405 | 1414 | }else{ |
| 1406 | - pParentFile = manifest_file_seek(pParent, pChildFile->zName); | |
| 1415 | + pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0); | |
| 1407 | 1416 | if( pParentFile==0 ){ |
| 1408 | 1417 | if( pChildFile->zUuid ){ |
| 1409 | 1418 | /* A new file */ |
| 1410 | 1419 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1411 | 1420 | isPublic, mperm); |
| @@ -1423,22 +1432,22 @@ | ||
| 1423 | 1432 | ** are deleted or modified in the parent but which reappear or revert |
| 1424 | 1433 | ** to baseline in the child and show such files as being added or changed |
| 1425 | 1434 | ** in the child. */ |
| 1426 | 1435 | for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){ |
| 1427 | 1436 | if( pParentFile->zUuid ){ |
| 1428 | - pChildFile = manifest_file_seek_base(pChild, pParentFile->zName); | |
| 1437 | + pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0); | |
| 1429 | 1438 | if( pChildFile==0 ){ |
| 1430 | 1439 | /* The child file reverts to baseline. Show this as a change */ |
| 1431 | - pChildFile = manifest_file_seek(pChild, pParentFile->zName); | |
| 1440 | + pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); | |
| 1432 | 1441 | if( pChildFile ){ |
| 1433 | 1442 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1434 | 1443 | pChildFile->zName, 0, isPublic, |
| 1435 | 1444 | manifest_file_mperm(pChildFile)); |
| 1436 | 1445 | } |
| 1437 | 1446 | } |
| 1438 | 1447 | }else{ |
| 1439 | - pChildFile = manifest_file_seek(pChild, pParentFile->zName); | |
| 1448 | + pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); | |
| 1440 | 1449 | if( pChildFile ){ |
| 1441 | 1450 | /* File resurrected in the child after having been deleted in |
| 1442 | 1451 | ** the parent. Show this as an added file. */ |
| 1443 | 1452 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1444 | 1453 | isPublic, manifest_file_mperm(pChildFile)); |
| @@ -1448,11 +1457,11 @@ | ||
| 1448 | 1457 | }else if( pChild->zBaseline==0 ){ |
| 1449 | 1458 | /* pChild is a baseline. Look for files that are present in pParent |
| 1450 | 1459 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1451 | 1460 | manifest_file_rewind(pParent); |
| 1452 | 1461 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1453 | - pChildFile = manifest_file_seek(pChild, pParentFile->zName); | |
| 1462 | + pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); | |
| 1454 | 1463 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1455 | 1464 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1456 | 1465 | isPublic, 0); |
| 1457 | 1466 | } |
| 1458 | 1467 | } |
| 1459 | 1468 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1161,14 +1161,15 @@ | |
| 1161 | ** of a file. |
| 1162 | */ |
| 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | int mperm = PERM_REG; |
| 1165 | if( pFile && pFile->zPerm){ |
| 1166 | if( strstr(pFile->zPerm,"x")!=0 ) |
| 1167 | mperm = PERM_EXE; |
| 1168 | else if( strstr(pFile->zPerm,"l")!=0 ) |
| 1169 | mperm = PERM_LNK; |
| 1170 | } |
| 1171 | return mperm; |
| 1172 | } |
| 1173 | |
| 1174 | /* |
| @@ -1227,11 +1228,15 @@ | |
| 1227 | ** That will usually be the case. If it is not found there, then do the |
| 1228 | ** actual binary search. |
| 1229 | ** |
| 1230 | ** Update p->iFile to be the index of the file that is found. |
| 1231 | */ |
| 1232 | static ManifestFile *manifest_file_seek_base(Manifest *p, const char *zName){ |
| 1233 | int lwr, upr; |
| 1234 | int c; |
| 1235 | int i; |
| 1236 | lwr = 0; |
| 1237 | upr = p->nFile - 1; |
| @@ -1255,10 +1260,14 @@ | |
| 1255 | }else{ |
| 1256 | p->iFile = i; |
| 1257 | return &p->aFile[i]; |
| 1258 | } |
| 1259 | } |
| 1260 | return 0; |
| 1261 | } |
| 1262 | |
| 1263 | /* |
| 1264 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| @@ -1268,18 +1277,18 @@ | |
| 1268 | ** This routine works even if p is a delta-manifest. The pointer |
| 1269 | ** returned might be to the baseline. |
| 1270 | ** |
| 1271 | ** We assume that filenames are in sorted order and use a binary search. |
| 1272 | */ |
| 1273 | ManifestFile *manifest_file_seek(Manifest *p, const char *zName){ |
| 1274 | ManifestFile *pFile; |
| 1275 | |
| 1276 | pFile = manifest_file_seek_base(p, zName); |
| 1277 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1278 | if( pFile==0 && p->zBaseline ){ |
| 1279 | fetch_baseline(p, 1); |
| 1280 | pFile = manifest_file_seek_base(p->pBaseline, zName); |
| 1281 | } |
| 1282 | return pFile; |
| 1283 | } |
| 1284 | |
| 1285 | /* |
| @@ -1289,11 +1298,11 @@ | |
| 1289 | */ |
| 1290 | ManifestFile *manifest_file_find(Manifest *p, const char *zName){ |
| 1291 | int i; |
| 1292 | Manifest *pBase; |
| 1293 | if( filenames_are_case_sensitive() ){ |
| 1294 | return manifest_file_seek(p, zName); |
| 1295 | } |
| 1296 | for(i=0; i<p->nFile; i++){ |
| 1297 | if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){ |
| 1298 | return &p->aFile[i]; |
| 1299 | } |
| @@ -1389,11 +1398,11 @@ | |
| 1389 | ** is where most of the changes will be found. |
| 1390 | */ |
| 1391 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1392 | int mperm = manifest_file_mperm(pChildFile); |
| 1393 | if( pChildFile->zPrior ){ |
| 1394 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior); |
| 1395 | if( pParentFile ){ |
| 1396 | /* File with name change */ |
| 1397 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1398 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1399 | }else{ |
| @@ -1401,11 +1410,11 @@ | |
| 1401 | ** Treat this like a new file. */ |
| 1402 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1403 | isPublic, mperm); |
| 1404 | } |
| 1405 | }else{ |
| 1406 | pParentFile = manifest_file_seek(pParent, pChildFile->zName); |
| 1407 | if( pParentFile==0 ){ |
| 1408 | if( pChildFile->zUuid ){ |
| 1409 | /* A new file */ |
| 1410 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1411 | isPublic, mperm); |
| @@ -1423,22 +1432,22 @@ | |
| 1423 | ** are deleted or modified in the parent but which reappear or revert |
| 1424 | ** to baseline in the child and show such files as being added or changed |
| 1425 | ** in the child. */ |
| 1426 | for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){ |
| 1427 | if( pParentFile->zUuid ){ |
| 1428 | pChildFile = manifest_file_seek_base(pChild, pParentFile->zName); |
| 1429 | if( pChildFile==0 ){ |
| 1430 | /* The child file reverts to baseline. Show this as a change */ |
| 1431 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1432 | if( pChildFile ){ |
| 1433 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1434 | pChildFile->zName, 0, isPublic, |
| 1435 | manifest_file_mperm(pChildFile)); |
| 1436 | } |
| 1437 | } |
| 1438 | }else{ |
| 1439 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1440 | if( pChildFile ){ |
| 1441 | /* File resurrected in the child after having been deleted in |
| 1442 | ** the parent. Show this as an added file. */ |
| 1443 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1444 | isPublic, manifest_file_mperm(pChildFile)); |
| @@ -1448,11 +1457,11 @@ | |
| 1448 | }else if( pChild->zBaseline==0 ){ |
| 1449 | /* pChild is a baseline. Look for files that are present in pParent |
| 1450 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1451 | manifest_file_rewind(pParent); |
| 1452 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1453 | pChildFile = manifest_file_seek(pChild, pParentFile->zName); |
| 1454 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1455 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1456 | isPublic, 0); |
| 1457 | } |
| 1458 | } |
| 1459 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1161,14 +1161,15 @@ | |
| 1161 | ** of a file. |
| 1162 | */ |
| 1163 | int manifest_file_mperm(ManifestFile *pFile){ |
| 1164 | int mperm = PERM_REG; |
| 1165 | if( pFile && pFile->zPerm){ |
| 1166 | if( strstr(pFile->zPerm,"x")!=0 ){ |
| 1167 | mperm = PERM_EXE; |
| 1168 | }else if( strstr(pFile->zPerm,"l")!=0 ){ |
| 1169 | mperm = PERM_LNK; |
| 1170 | } |
| 1171 | } |
| 1172 | return mperm; |
| 1173 | } |
| 1174 | |
| 1175 | /* |
| @@ -1227,11 +1228,15 @@ | |
| 1228 | ** That will usually be the case. If it is not found there, then do the |
| 1229 | ** actual binary search. |
| 1230 | ** |
| 1231 | ** Update p->iFile to be the index of the file that is found. |
| 1232 | */ |
| 1233 | static ManifestFile *manifest_file_seek_base( |
| 1234 | Manifest *p, /* Manifest to search */ |
| 1235 | const char *zName, /* Name of the file we are looking for */ |
| 1236 | int bBest /* 0: exact match only. 1: closest match */ |
| 1237 | ){ |
| 1238 | int lwr, upr; |
| 1239 | int c; |
| 1240 | int i; |
| 1241 | lwr = 0; |
| 1242 | upr = p->nFile - 1; |
| @@ -1255,10 +1260,14 @@ | |
| 1260 | }else{ |
| 1261 | p->iFile = i; |
| 1262 | return &p->aFile[i]; |
| 1263 | } |
| 1264 | } |
| 1265 | if( bBest ){ |
| 1266 | i = (int)strlen(zName); |
| 1267 | if( strncmp(zName, p->aFile[lwr].zName, i)==0 ) return &p->aFile[lwr]; |
| 1268 | } |
| 1269 | return 0; |
| 1270 | } |
| 1271 | |
| 1272 | /* |
| 1273 | ** Locate a file named zName in the aFile[] array of the given manifest. |
| @@ -1268,18 +1277,18 @@ | |
| 1277 | ** This routine works even if p is a delta-manifest. The pointer |
| 1278 | ** returned might be to the baseline. |
| 1279 | ** |
| 1280 | ** We assume that filenames are in sorted order and use a binary search. |
| 1281 | */ |
| 1282 | ManifestFile *manifest_file_seek(Manifest *p, const char *zName, int bBest){ |
| 1283 | ManifestFile *pFile; |
| 1284 | |
| 1285 | pFile = manifest_file_seek_base(p, zName, p->zBaseline ? 0 : bBest); |
| 1286 | if( pFile && pFile->zUuid==0 ) return 0; |
| 1287 | if( pFile==0 && p->zBaseline ){ |
| 1288 | fetch_baseline(p, 1); |
| 1289 | pFile = manifest_file_seek_base(p->pBaseline, zName,bBest); |
| 1290 | } |
| 1291 | return pFile; |
| 1292 | } |
| 1293 | |
| 1294 | /* |
| @@ -1289,11 +1298,11 @@ | |
| 1298 | */ |
| 1299 | ManifestFile *manifest_file_find(Manifest *p, const char *zName){ |
| 1300 | int i; |
| 1301 | Manifest *pBase; |
| 1302 | if( filenames_are_case_sensitive() ){ |
| 1303 | return manifest_file_seek(p, zName, 0); |
| 1304 | } |
| 1305 | for(i=0; i<p->nFile; i++){ |
| 1306 | if( fossil_stricmp(zName, p->aFile[i].zName)==0 ){ |
| 1307 | return &p->aFile[i]; |
| 1308 | } |
| @@ -1389,11 +1398,11 @@ | |
| 1398 | ** is where most of the changes will be found. |
| 1399 | */ |
| 1400 | for(i=0, pChildFile=pChild->aFile; i<pChild->nFile; i++, pChildFile++){ |
| 1401 | int mperm = manifest_file_mperm(pChildFile); |
| 1402 | if( pChildFile->zPrior ){ |
| 1403 | pParentFile = manifest_file_seek(pParent, pChildFile->zPrior, 0); |
| 1404 | if( pParentFile ){ |
| 1405 | /* File with name change */ |
| 1406 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1407 | pChildFile->zName, pChildFile->zPrior, isPublic, mperm); |
| 1408 | }else{ |
| @@ -1401,11 +1410,11 @@ | |
| 1410 | ** Treat this like a new file. */ |
| 1411 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1412 | isPublic, mperm); |
| 1413 | } |
| 1414 | }else{ |
| 1415 | pParentFile = manifest_file_seek(pParent, pChildFile->zName, 0); |
| 1416 | if( pParentFile==0 ){ |
| 1417 | if( pChildFile->zUuid ){ |
| 1418 | /* A new file */ |
| 1419 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1420 | isPublic, mperm); |
| @@ -1423,22 +1432,22 @@ | |
| 1432 | ** are deleted or modified in the parent but which reappear or revert |
| 1433 | ** to baseline in the child and show such files as being added or changed |
| 1434 | ** in the child. */ |
| 1435 | for(i=0, pParentFile=pParent->aFile; i<pParent->nFile; i++, pParentFile++){ |
| 1436 | if( pParentFile->zUuid ){ |
| 1437 | pChildFile = manifest_file_seek_base(pChild, pParentFile->zName, 0); |
| 1438 | if( pChildFile==0 ){ |
| 1439 | /* The child file reverts to baseline. Show this as a change */ |
| 1440 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1441 | if( pChildFile ){ |
| 1442 | add_one_mlink(cid, pParentFile->zUuid, pChildFile->zUuid, |
| 1443 | pChildFile->zName, 0, isPublic, |
| 1444 | manifest_file_mperm(pChildFile)); |
| 1445 | } |
| 1446 | } |
| 1447 | }else{ |
| 1448 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1449 | if( pChildFile ){ |
| 1450 | /* File resurrected in the child after having been deleted in |
| 1451 | ** the parent. Show this as an added file. */ |
| 1452 | add_one_mlink(cid, 0, pChildFile->zUuid, pChildFile->zName, 0, |
| 1453 | isPublic, manifest_file_mperm(pChildFile)); |
| @@ -1448,11 +1457,11 @@ | |
| 1457 | }else if( pChild->zBaseline==0 ){ |
| 1458 | /* pChild is a baseline. Look for files that are present in pParent |
| 1459 | ** but are missing from pChild and mark them as having been deleted. */ |
| 1460 | manifest_file_rewind(pParent); |
| 1461 | while( (pParentFile = manifest_file_next(pParent,0))!=0 ){ |
| 1462 | pChildFile = manifest_file_seek(pChild, pParentFile->zName, 0); |
| 1463 | if( pChildFile==0 && pParentFile->zUuid!=0 ){ |
| 1464 | add_one_mlink(cid, pParentFile->zUuid, 0, pParentFile->zName, 0, |
| 1465 | isPublic, 0); |
| 1466 | } |
| 1467 | } |
| 1468 |
+2
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | indent-1, zLabel, |
| 48 | 48 | db_column_text(&q, 3), |
| 49 | 49 | db_column_text(&q, 1), |
| 50 | 50 | db_column_text(&q, 0), |
| 51 | 51 | indent, ""); |
| 52 | - comment_print(zCom, indent, 78); | |
| 52 | + comment_print(zCom, indent, -1); | |
| 53 | 53 | fossil_free(zCom); |
| 54 | 54 | } |
| 55 | 55 | db_finalize(&q); |
| 56 | 56 | } |
| 57 | 57 | |
| @@ -210,11 +210,11 @@ | ||
| 210 | 210 | ); |
| 211 | 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | - comment_print(zCom, 0, 79); | |
| 215 | + comment_print(zCom, 0, -1); | |
| 216 | 216 | fossil_free(zCom); |
| 217 | 217 | } |
| 218 | 218 | db_finalize(&q); |
| 219 | 219 | }else{ |
| 220 | 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 | 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, 78); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, 79); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, -1); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, -1); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
+2
-2
| --- src/merge.c | ||
| +++ src/merge.c | ||
| @@ -47,11 +47,11 @@ | ||
| 47 | 47 | indent-1, zLabel, |
| 48 | 48 | db_column_text(&q, 3), |
| 49 | 49 | db_column_text(&q, 1), |
| 50 | 50 | db_column_text(&q, 0), |
| 51 | 51 | indent, ""); |
| 52 | - comment_print(zCom, indent, 78); | |
| 52 | + comment_print(zCom, indent, -1); | |
| 53 | 53 | fossil_free(zCom); |
| 54 | 54 | } |
| 55 | 55 | db_finalize(&q); |
| 56 | 56 | } |
| 57 | 57 | |
| @@ -210,11 +210,11 @@ | ||
| 210 | 210 | ); |
| 211 | 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | - comment_print(zCom, 0, 79); | |
| 215 | + comment_print(zCom, 0, -1); | |
| 216 | 216 | fossil_free(zCom); |
| 217 | 217 | } |
| 218 | 218 | db_finalize(&q); |
| 219 | 219 | }else{ |
| 220 | 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 | 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, 78); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, 79); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
| --- src/merge.c | |
| +++ src/merge.c | |
| @@ -47,11 +47,11 @@ | |
| 47 | indent-1, zLabel, |
| 48 | db_column_text(&q, 3), |
| 49 | db_column_text(&q, 1), |
| 50 | db_column_text(&q, 0), |
| 51 | indent, ""); |
| 52 | comment_print(zCom, indent, -1); |
| 53 | fossil_free(zCom); |
| 54 | } |
| 55 | db_finalize(&q); |
| 56 | } |
| 57 | |
| @@ -210,11 +210,11 @@ | |
| 210 | ); |
| 211 | if( db_step(&q)==SQLITE_ROW ){ |
| 212 | char *zCom = mprintf("Merging fork [%S] at %s by %s: \"%s\"", |
| 213 | db_column_text(&q, 0), db_column_text(&q, 1), |
| 214 | db_column_text(&q, 3), db_column_text(&q, 2)); |
| 215 | comment_print(zCom, 0, -1); |
| 216 | fossil_free(zCom); |
| 217 | } |
| 218 | db_finalize(&q); |
| 219 | }else{ |
| 220 | usage("?OPTIONS? ?VERSION?"); |
| 221 |
+29
-23
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -582,11 +582,11 @@ | ||
| 582 | 582 | default: zType = "Unknown"; break; |
| 583 | 583 | } |
| 584 | 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | 585 | db_column_text(&q, 1)); |
| 586 | 586 | fossil_print("comment: "); |
| 587 | - comment_print(db_column_text(&q,3), 12, 78); | |
| 587 | + comment_print(db_column_text(&q,3), 12, -1); | |
| 588 | 588 | } |
| 589 | 589 | db_finalize(&q); |
| 590 | 590 | |
| 591 | 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | ||
| 604 | 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | 605 | db_column_text(&q, 1), |
| 606 | 606 | db_column_text(&q, 3), |
| 607 | 607 | db_column_text(&q, 2)); |
| 608 | 608 | fossil_print(" "); |
| 609 | - comment_print(db_column_text(&q,4), 12, 78); | |
| 609 | + comment_print(db_column_text(&q,4), 12, -1); | |
| 610 | 610 | } |
| 611 | 611 | db_finalize(&q); |
| 612 | 612 | |
| 613 | 613 | /* Check to see if this object is used as an attachment */ |
| 614 | 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | ||
| 639 | 639 | db_column_text(&q,7)); |
| 640 | 640 | } |
| 641 | 641 | fossil_print(" by user %s on %s\n", |
| 642 | 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | 643 | fossil_print(" "); |
| 644 | - comment_print(db_column_text(&q,1), 12, 78); | |
| 644 | + comment_print(db_column_text(&q,1), 12, -1); | |
| 645 | 645 | } |
| 646 | 646 | db_finalize(&q); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | /* |
| @@ -656,32 +656,38 @@ | ||
| 656 | 656 | */ |
| 657 | 657 | void whatis_cmd(void){ |
| 658 | 658 | int rid; |
| 659 | 659 | const char *zName; |
| 660 | 660 | int verboseFlag; |
| 661 | + int i; | |
| 661 | 662 | db_find_and_open_repository(0,0); |
| 662 | 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 663 | - if( g.argc!=3 ) usage("whatis NAME"); | |
| 664 | - zName = g.argv[2]; | |
| 665 | - rid = symbolic_name_to_rid(zName, 0); | |
| 666 | - if( rid<0 ){ | |
| 667 | - Stmt q; | |
| 668 | - int cnt = 0; | |
| 669 | - fossil_print("Ambiguous artifact name prefix: %s\n", zName); | |
| 670 | - db_prepare(&q, | |
| 671 | - "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", | |
| 672 | - zName, zName | |
| 673 | - ); | |
| 674 | - while( db_step(&q)==SQLITE_ROW ){ | |
| 675 | - if( cnt++ ) fossil_print("%.79c\n", '-'); | |
| 676 | - whatis_rid(db_column_int(&q, 0), verboseFlag); | |
| 677 | - } | |
| 678 | - db_finalize(&q); | |
| 679 | - }else if( rid==0 ){ | |
| 680 | - fossil_print("Unknown artifact: %s\n", zName); | |
| 681 | - }else{ | |
| 682 | - whatis_rid(rid, verboseFlag); | |
| 664 | + if( g.argc<3 ) usage("whatis NAME ..."); | |
| 665 | + for(i=2; i<g.argc; i++){ | |
| 666 | + zName = g.argv[i]; | |
| 667 | + if( i>2 ) fossil_print("%.79c\n",'-'); | |
| 668 | + rid = symbolic_name_to_rid(zName, 0); | |
| 669 | + if( rid<0 ){ | |
| 670 | + Stmt q; | |
| 671 | + int cnt = 0; | |
| 672 | + fossil_print("name: %s (ambiguous)\n", zName); | |
| 673 | + db_prepare(&q, | |
| 674 | + "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", | |
| 675 | + zName, zName | |
| 676 | + ); | |
| 677 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 678 | + if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt); | |
| 679 | + whatis_rid(db_column_int(&q, 0), verboseFlag); | |
| 680 | + } | |
| 681 | + db_finalize(&q); | |
| 682 | + }else if( rid==0 ){ | |
| 683 | + /* 0123456789 12 */ | |
| 684 | + fossil_print("unknown: %s\n", zName); | |
| 685 | + }else{ | |
| 686 | + fossil_print("name: %s\n", zName); | |
| 687 | + whatis_rid(rid, verboseFlag); | |
| 688 | + } | |
| 683 | 689 | } |
| 684 | 690 | } |
| 685 | 691 | |
| 686 | 692 | /* |
| 687 | 693 | ** COMMAND: test-whatis-all |
| 688 | 694 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, 78); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, 78); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, 78); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| @@ -656,32 +656,38 @@ | |
| 656 | */ |
| 657 | void whatis_cmd(void){ |
| 658 | int rid; |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | db_find_and_open_repository(0,0); |
| 662 | verboseFlag = find_option("verbose","v",0)!=0; |
| 663 | if( g.argc!=3 ) usage("whatis NAME"); |
| 664 | zName = g.argv[2]; |
| 665 | rid = symbolic_name_to_rid(zName, 0); |
| 666 | if( rid<0 ){ |
| 667 | Stmt q; |
| 668 | int cnt = 0; |
| 669 | fossil_print("Ambiguous artifact name prefix: %s\n", zName); |
| 670 | db_prepare(&q, |
| 671 | "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", |
| 672 | zName, zName |
| 673 | ); |
| 674 | while( db_step(&q)==SQLITE_ROW ){ |
| 675 | if( cnt++ ) fossil_print("%.79c\n", '-'); |
| 676 | whatis_rid(db_column_int(&q, 0), verboseFlag); |
| 677 | } |
| 678 | db_finalize(&q); |
| 679 | }else if( rid==0 ){ |
| 680 | fossil_print("Unknown artifact: %s\n", zName); |
| 681 | }else{ |
| 682 | whatis_rid(rid, verboseFlag); |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | /* |
| 687 | ** COMMAND: test-whatis-all |
| 688 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, -1); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, -1); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, -1); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| @@ -656,32 +656,38 @@ | |
| 656 | */ |
| 657 | void whatis_cmd(void){ |
| 658 | int rid; |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | int i; |
| 662 | db_find_and_open_repository(0,0); |
| 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 664 | if( g.argc<3 ) usage("whatis NAME ..."); |
| 665 | for(i=2; i<g.argc; i++){ |
| 666 | zName = g.argv[i]; |
| 667 | if( i>2 ) fossil_print("%.79c\n",'-'); |
| 668 | rid = symbolic_name_to_rid(zName, 0); |
| 669 | if( rid<0 ){ |
| 670 | Stmt q; |
| 671 | int cnt = 0; |
| 672 | fossil_print("name: %s (ambiguous)\n", zName); |
| 673 | db_prepare(&q, |
| 674 | "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", |
| 675 | zName, zName |
| 676 | ); |
| 677 | while( db_step(&q)==SQLITE_ROW ){ |
| 678 | if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt); |
| 679 | whatis_rid(db_column_int(&q, 0), verboseFlag); |
| 680 | } |
| 681 | db_finalize(&q); |
| 682 | }else if( rid==0 ){ |
| 683 | /* 0123456789 12 */ |
| 684 | fossil_print("unknown: %s\n", zName); |
| 685 | }else{ |
| 686 | fossil_print("name: %s\n", zName); |
| 687 | whatis_rid(rid, verboseFlag); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | /* |
| 693 | ** COMMAND: test-whatis-all |
| 694 |
+29
-23
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -582,11 +582,11 @@ | ||
| 582 | 582 | default: zType = "Unknown"; break; |
| 583 | 583 | } |
| 584 | 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | 585 | db_column_text(&q, 1)); |
| 586 | 586 | fossil_print("comment: "); |
| 587 | - comment_print(db_column_text(&q,3), 12, 78); | |
| 587 | + comment_print(db_column_text(&q,3), 12, -1); | |
| 588 | 588 | } |
| 589 | 589 | db_finalize(&q); |
| 590 | 590 | |
| 591 | 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | ||
| 604 | 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | 605 | db_column_text(&q, 1), |
| 606 | 606 | db_column_text(&q, 3), |
| 607 | 607 | db_column_text(&q, 2)); |
| 608 | 608 | fossil_print(" "); |
| 609 | - comment_print(db_column_text(&q,4), 12, 78); | |
| 609 | + comment_print(db_column_text(&q,4), 12, -1); | |
| 610 | 610 | } |
| 611 | 611 | db_finalize(&q); |
| 612 | 612 | |
| 613 | 613 | /* Check to see if this object is used as an attachment */ |
| 614 | 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | ||
| 639 | 639 | db_column_text(&q,7)); |
| 640 | 640 | } |
| 641 | 641 | fossil_print(" by user %s on %s\n", |
| 642 | 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | 643 | fossil_print(" "); |
| 644 | - comment_print(db_column_text(&q,1), 12, 78); | |
| 644 | + comment_print(db_column_text(&q,1), 12, -1); | |
| 645 | 645 | } |
| 646 | 646 | db_finalize(&q); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | /* |
| @@ -656,32 +656,38 @@ | ||
| 656 | 656 | */ |
| 657 | 657 | void whatis_cmd(void){ |
| 658 | 658 | int rid; |
| 659 | 659 | const char *zName; |
| 660 | 660 | int verboseFlag; |
| 661 | + int i; | |
| 661 | 662 | db_find_and_open_repository(0,0); |
| 662 | 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 663 | - if( g.argc!=3 ) usage("whatis NAME"); | |
| 664 | - zName = g.argv[2]; | |
| 665 | - rid = symbolic_name_to_rid(zName, 0); | |
| 666 | - if( rid<0 ){ | |
| 667 | - Stmt q; | |
| 668 | - int cnt = 0; | |
| 669 | - fossil_print("Ambiguous artifact name prefix: %s\n", zName); | |
| 670 | - db_prepare(&q, | |
| 671 | - "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", | |
| 672 | - zName, zName | |
| 673 | - ); | |
| 674 | - while( db_step(&q)==SQLITE_ROW ){ | |
| 675 | - if( cnt++ ) fossil_print("%.79c\n", '-'); | |
| 676 | - whatis_rid(db_column_int(&q, 0), verboseFlag); | |
| 677 | - } | |
| 678 | - db_finalize(&q); | |
| 679 | - }else if( rid==0 ){ | |
| 680 | - fossil_print("Unknown artifact: %s\n", zName); | |
| 681 | - }else{ | |
| 682 | - whatis_rid(rid, verboseFlag); | |
| 664 | + if( g.argc<3 ) usage("whatis NAME ..."); | |
| 665 | + for(i=2; i<g.argc; i++){ | |
| 666 | + zName = g.argv[i]; | |
| 667 | + if( i>2 ) fossil_print("%.79c\n",'-'); | |
| 668 | + rid = symbolic_name_to_rid(zName, 0); | |
| 669 | + if( rid<0 ){ | |
| 670 | + Stmt q; | |
| 671 | + int cnt = 0; | |
| 672 | + fossil_print("name: %s (ambiguous)\n", zName); | |
| 673 | + db_prepare(&q, | |
| 674 | + "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", | |
| 675 | + zName, zName | |
| 676 | + ); | |
| 677 | + while( db_step(&q)==SQLITE_ROW ){ | |
| 678 | + if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt); | |
| 679 | + whatis_rid(db_column_int(&q, 0), verboseFlag); | |
| 680 | + } | |
| 681 | + db_finalize(&q); | |
| 682 | + }else if( rid==0 ){ | |
| 683 | + /* 0123456789 12 */ | |
| 684 | + fossil_print("unknown: %s\n", zName); | |
| 685 | + }else{ | |
| 686 | + fossil_print("name: %s\n", zName); | |
| 687 | + whatis_rid(rid, verboseFlag); | |
| 688 | + } | |
| 683 | 689 | } |
| 684 | 690 | } |
| 685 | 691 | |
| 686 | 692 | /* |
| 687 | 693 | ** COMMAND: test-whatis-all |
| 688 | 694 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, 78); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, 78); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, 78); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| @@ -656,32 +656,38 @@ | |
| 656 | */ |
| 657 | void whatis_cmd(void){ |
| 658 | int rid; |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | db_find_and_open_repository(0,0); |
| 662 | verboseFlag = find_option("verbose","v",0)!=0; |
| 663 | if( g.argc!=3 ) usage("whatis NAME"); |
| 664 | zName = g.argv[2]; |
| 665 | rid = symbolic_name_to_rid(zName, 0); |
| 666 | if( rid<0 ){ |
| 667 | Stmt q; |
| 668 | int cnt = 0; |
| 669 | fossil_print("Ambiguous artifact name prefix: %s\n", zName); |
| 670 | db_prepare(&q, |
| 671 | "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", |
| 672 | zName, zName |
| 673 | ); |
| 674 | while( db_step(&q)==SQLITE_ROW ){ |
| 675 | if( cnt++ ) fossil_print("%.79c\n", '-'); |
| 676 | whatis_rid(db_column_int(&q, 0), verboseFlag); |
| 677 | } |
| 678 | db_finalize(&q); |
| 679 | }else if( rid==0 ){ |
| 680 | fossil_print("Unknown artifact: %s\n", zName); |
| 681 | }else{ |
| 682 | whatis_rid(rid, verboseFlag); |
| 683 | } |
| 684 | } |
| 685 | |
| 686 | /* |
| 687 | ** COMMAND: test-whatis-all |
| 688 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -582,11 +582,11 @@ | |
| 582 | default: zType = "Unknown"; break; |
| 583 | } |
| 584 | fossil_print("type: %s by %s on %s\n", zType, db_column_text(&q,2), |
| 585 | db_column_text(&q, 1)); |
| 586 | fossil_print("comment: "); |
| 587 | comment_print(db_column_text(&q,3), 12, -1); |
| 588 | } |
| 589 | db_finalize(&q); |
| 590 | |
| 591 | /* Check to see if this object is used as a file in a check-in */ |
| 592 | db_prepare(&q, |
| @@ -604,11 +604,11 @@ | |
| 604 | fossil_print(" part of [%.10s] by %s on %s\n", |
| 605 | db_column_text(&q, 1), |
| 606 | db_column_text(&q, 3), |
| 607 | db_column_text(&q, 2)); |
| 608 | fossil_print(" "); |
| 609 | comment_print(db_column_text(&q,4), 12, -1); |
| 610 | } |
| 611 | db_finalize(&q); |
| 612 | |
| 613 | /* Check to see if this object is used as an attachment */ |
| 614 | db_prepare(&q, |
| @@ -639,11 +639,11 @@ | |
| 639 | db_column_text(&q,7)); |
| 640 | } |
| 641 | fossil_print(" by user %s on %s\n", |
| 642 | db_column_text(&q,2), db_column_text(&q,3)); |
| 643 | fossil_print(" "); |
| 644 | comment_print(db_column_text(&q,1), 12, -1); |
| 645 | } |
| 646 | db_finalize(&q); |
| 647 | } |
| 648 | |
| 649 | /* |
| @@ -656,32 +656,38 @@ | |
| 656 | */ |
| 657 | void whatis_cmd(void){ |
| 658 | int rid; |
| 659 | const char *zName; |
| 660 | int verboseFlag; |
| 661 | int i; |
| 662 | db_find_and_open_repository(0,0); |
| 663 | verboseFlag = find_option("verbose","v",0)!=0; |
| 664 | if( g.argc<3 ) usage("whatis NAME ..."); |
| 665 | for(i=2; i<g.argc; i++){ |
| 666 | zName = g.argv[i]; |
| 667 | if( i>2 ) fossil_print("%.79c\n",'-'); |
| 668 | rid = symbolic_name_to_rid(zName, 0); |
| 669 | if( rid<0 ){ |
| 670 | Stmt q; |
| 671 | int cnt = 0; |
| 672 | fossil_print("name: %s (ambiguous)\n", zName); |
| 673 | db_prepare(&q, |
| 674 | "SELECT rid FROM blob WHERE uuid>=lower(%Q) AND uuid<(lower(%Q)||'z')", |
| 675 | zName, zName |
| 676 | ); |
| 677 | while( db_step(&q)==SQLITE_ROW ){ |
| 678 | if( cnt++ ) fossil_print("%12s---- meaning #%d ----\n", " ", cnt); |
| 679 | whatis_rid(db_column_int(&q, 0), verboseFlag); |
| 680 | } |
| 681 | db_finalize(&q); |
| 682 | }else if( rid==0 ){ |
| 683 | /* 0123456789 12 */ |
| 684 | fossil_print("unknown: %s\n", zName); |
| 685 | }else{ |
| 686 | fossil_print("name: %s\n", zName); |
| 687 | whatis_rid(rid, verboseFlag); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
| 692 | /* |
| 693 | ** COMMAND: test-whatis-all |
| 694 |
+1
-7
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -202,17 +202,11 @@ | ||
| 202 | 202 | width = atoi(zWidth); |
| 203 | 203 | if( (width!=0) && (width<=20) ){ |
| 204 | 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | 205 | } |
| 206 | 206 | }else{ |
| 207 | -#ifdef TIOCGWINSZ | |
| 208 | - struct winsize w; | |
| 209 | - ioctl(0, TIOCGWINSZ, &w); | |
| 210 | - width = w.ws_col; | |
| 211 | -#else | |
| 212 | - width = 79; | |
| 213 | -#endif | |
| 207 | + width = -1; | |
| 214 | 208 | } |
| 215 | 209 | |
| 216 | 210 | db_must_be_within_tree(); |
| 217 | 211 | if( g.argc<2 ) return; |
| 218 | 212 | blob_init(&pattern, g.argv[2], -1); |
| 219 | 213 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,17 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | #ifdef TIOCGWINSZ |
| 208 | struct winsize w; |
| 209 | ioctl(0, TIOCGWINSZ, &w); |
| 210 | width = w.ws_col; |
| 211 | #else |
| 212 | width = 79; |
| 213 | #endif |
| 214 | } |
| 215 | |
| 216 | db_must_be_within_tree(); |
| 217 | if( g.argc<2 ) return; |
| 218 | blob_init(&pattern, g.argv[2], -1); |
| 219 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,17 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | width = -1; |
| 208 | } |
| 209 | |
| 210 | db_must_be_within_tree(); |
| 211 | if( g.argc<2 ) return; |
| 212 | blob_init(&pattern, g.argv[2], -1); |
| 213 |
+1
-7
| --- src/search.c | ||
| +++ src/search.c | ||
| @@ -202,17 +202,11 @@ | ||
| 202 | 202 | width = atoi(zWidth); |
| 203 | 203 | if( (width!=0) && (width<=20) ){ |
| 204 | 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | 205 | } |
| 206 | 206 | }else{ |
| 207 | -#ifdef TIOCGWINSZ | |
| 208 | - struct winsize w; | |
| 209 | - ioctl(0, TIOCGWINSZ, &w); | |
| 210 | - width = w.ws_col; | |
| 211 | -#else | |
| 212 | - width = 79; | |
| 213 | -#endif | |
| 207 | + width = -1; | |
| 214 | 208 | } |
| 215 | 209 | |
| 216 | 210 | db_must_be_within_tree(); |
| 217 | 211 | if( g.argc<2 ) return; |
| 218 | 212 | blob_init(&pattern, g.argv[2], -1); |
| 219 | 213 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,17 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | #ifdef TIOCGWINSZ |
| 208 | struct winsize w; |
| 209 | ioctl(0, TIOCGWINSZ, &w); |
| 210 | width = w.ws_col; |
| 211 | #else |
| 212 | width = 79; |
| 213 | #endif |
| 214 | } |
| 215 | |
| 216 | db_must_be_within_tree(); |
| 217 | if( g.argc<2 ) return; |
| 218 | blob_init(&pattern, g.argv[2], -1); |
| 219 |
| --- src/search.c | |
| +++ src/search.c | |
| @@ -202,17 +202,11 @@ | |
| 202 | width = atoi(zWidth); |
| 203 | if( (width!=0) && (width<=20) ){ |
| 204 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 205 | } |
| 206 | }else{ |
| 207 | width = -1; |
| 208 | } |
| 209 | |
| 210 | db_must_be_within_tree(); |
| 211 | if( g.argc<2 ) return; |
| 212 | blob_init(&pattern, g.argv[2], -1); |
| 213 |
+1
-7
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -525,17 +525,11 @@ | ||
| 525 | 525 | width = atoi(zWidth); |
| 526 | 526 | if( (width!=0) && (width<=46) ){ |
| 527 | 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | 528 | } |
| 529 | 529 | }else{ |
| 530 | -#ifdef TIOCGWINSZ | |
| 531 | - struct winsize w; | |
| 532 | - ioctl(0, TIOCGWINSZ, &w); | |
| 533 | - width = w.ws_col; | |
| 534 | -#else | |
| 535 | - width = 79; | |
| 536 | -#endif | |
| 530 | + width = -1; | |
| 537 | 531 | } |
| 538 | 532 | if( !verboseFlag ){ |
| 539 | 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 540 | 534 | } |
| 541 | 535 | verify_all_options(); |
| 542 | 536 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,17 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | #ifdef TIOCGWINSZ |
| 531 | struct winsize w; |
| 532 | ioctl(0, TIOCGWINSZ, &w); |
| 533 | width = w.ws_col; |
| 534 | #else |
| 535 | width = 79; |
| 536 | #endif |
| 537 | } |
| 538 | if( !verboseFlag ){ |
| 539 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 540 | } |
| 541 | verify_all_options(); |
| 542 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,17 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | width = -1; |
| 531 | } |
| 532 | if( !verboseFlag ){ |
| 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 534 | } |
| 535 | verify_all_options(); |
| 536 |
+1
-7
| --- src/stash.c | ||
| +++ src/stash.c | ||
| @@ -525,17 +525,11 @@ | ||
| 525 | 525 | width = atoi(zWidth); |
| 526 | 526 | if( (width!=0) && (width<=46) ){ |
| 527 | 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | 528 | } |
| 529 | 529 | }else{ |
| 530 | -#ifdef TIOCGWINSZ | |
| 531 | - struct winsize w; | |
| 532 | - ioctl(0, TIOCGWINSZ, &w); | |
| 533 | - width = w.ws_col; | |
| 534 | -#else | |
| 535 | - width = 79; | |
| 536 | -#endif | |
| 530 | + width = -1; | |
| 537 | 531 | } |
| 538 | 532 | if( !verboseFlag ){ |
| 539 | 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 540 | 534 | } |
| 541 | 535 | verify_all_options(); |
| 542 | 536 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,17 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | #ifdef TIOCGWINSZ |
| 531 | struct winsize w; |
| 532 | ioctl(0, TIOCGWINSZ, &w); |
| 533 | width = w.ws_col; |
| 534 | #else |
| 535 | width = 79; |
| 536 | #endif |
| 537 | } |
| 538 | if( !verboseFlag ){ |
| 539 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 540 | } |
| 541 | verify_all_options(); |
| 542 |
| --- src/stash.c | |
| +++ src/stash.c | |
| @@ -525,17 +525,11 @@ | |
| 525 | width = atoi(zWidth); |
| 526 | if( (width!=0) && (width<=46) ){ |
| 527 | fossil_fatal("-W|--width value must be >46 or 0"); |
| 528 | } |
| 529 | }else{ |
| 530 | width = -1; |
| 531 | } |
| 532 | if( !verboseFlag ){ |
| 533 | verboseFlag = find_option("detail","l",0)!=0; /* deprecated */ |
| 534 | } |
| 535 | verify_all_options(); |
| 536 |
+10
-5
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -77,19 +77,24 @@ | ||
| 77 | 77 | return rc; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /* |
| 81 | 81 | ** This routine will try a number of times to perform autosync with a |
| 82 | -** .5 second sleep between attempts; returning the last autosync status. | |
| 82 | +** 0.5 second sleep between attempts; returning the last autosync status. | |
| 83 | 83 | */ |
| 84 | 84 | int autosync_loop(int flags, int nTries){ |
| 85 | 85 | int n = 0; |
| 86 | 86 | int rc = 0; |
| 87 | - while( (n==0 || n < nTries) && (rc = autosync(flags)) ){ | |
| 88 | - if( rc ) fossil_warning("Autosync failed%s", | |
| 89 | - ++n < nTries ? ", making another attempt." : "."); | |
| 90 | - if( n < nTries ) sqlite3_sleep(500); | |
| 87 | + while( (n==0 || n<nTries) && (rc=autosync(flags)) ){ | |
| 88 | + if( rc ){ | |
| 89 | + if( ++n<nTries ){ | |
| 90 | + fossil_warning("Autosync failed, making another attempt."); | |
| 91 | + sqlite3_sleep(500); | |
| 92 | + }else{ | |
| 93 | + fossil_warning("Autosync failed."); | |
| 94 | + } | |
| 95 | + } | |
| 91 | 96 | } |
| 92 | 97 | return rc; |
| 93 | 98 | } |
| 94 | 99 | |
| 95 | 100 | /* |
| 96 | 101 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -77,19 +77,24 @@ | |
| 77 | return rc; |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | ** This routine will try a number of times to perform autosync with a |
| 82 | ** .5 second sleep between attempts; returning the last autosync status. |
| 83 | */ |
| 84 | int autosync_loop(int flags, int nTries){ |
| 85 | int n = 0; |
| 86 | int rc = 0; |
| 87 | while( (n==0 || n < nTries) && (rc = autosync(flags)) ){ |
| 88 | if( rc ) fossil_warning("Autosync failed%s", |
| 89 | ++n < nTries ? ", making another attempt." : "."); |
| 90 | if( n < nTries ) sqlite3_sleep(500); |
| 91 | } |
| 92 | return rc; |
| 93 | } |
| 94 | |
| 95 | /* |
| 96 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -77,19 +77,24 @@ | |
| 77 | return rc; |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | ** This routine will try a number of times to perform autosync with a |
| 82 | ** 0.5 second sleep between attempts; returning the last autosync status. |
| 83 | */ |
| 84 | int autosync_loop(int flags, int nTries){ |
| 85 | int n = 0; |
| 86 | int rc = 0; |
| 87 | while( (n==0 || n<nTries) && (rc=autosync(flags)) ){ |
| 88 | if( rc ){ |
| 89 | if( ++n<nTries ){ |
| 90 | fossil_warning("Autosync failed, making another attempt."); |
| 91 | sqlite3_sleep(500); |
| 92 | }else{ |
| 93 | fossil_warning("Autosync failed."); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | return rc; |
| 98 | } |
| 99 | |
| 100 | /* |
| 101 |
+506
-2
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -30,13 +30,41 @@ | ||
| 30 | 30 | #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ |
| 31 | 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | +#define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ | |
| 35 | 36 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 37 | +#define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) | |
| 38 | +#endif | |
| 39 | + | |
| 40 | +/* | |
| 41 | +** Flags set by functions in this file to keep track of integration state | |
| 42 | +** information. These flags should not be used outside of this file. | |
| 43 | +*/ | |
| 44 | +#define TH_STATE_CONFIG ((u32)0x00000010) /* We opened the config. */ | |
| 45 | +#define TH_STATE_REPOSITORY ((u32)0x00000020) /* We opened the repository. */ | |
| 46 | +#define TH_STATE_MASK ((u32)0x00000030) /* All possible state flags. */ | |
| 47 | + | |
| 48 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 49 | +/* | |
| 50 | +** These are the "well-known" TH1 error messages that occur when no hook is | |
| 51 | +** registered to be called prior to executing a command or processing a web | |
| 52 | +** page, respectively. If one of these errors is seen, it will not be sent | |
| 53 | +** or displayed to the remote user or local interactive user, respectively. | |
| 54 | +*/ | |
| 55 | +#define NO_COMMAND_HOOK_ERROR "no such command: command_hook" | |
| 56 | +#define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook" | |
| 36 | 57 | #endif |
| 37 | 58 | |
| 59 | +/* | |
| 60 | +** These macros are used within this file to detect if the repository and | |
| 61 | +** configuration ("user") database are currently open. | |
| 62 | +*/ | |
| 63 | +#define Th_IsRepositoryOpen() (g.repositoryOpen) | |
| 64 | +#define Th_IsConfigOpen() (g.zConfigDbName!=0) | |
| 65 | + | |
| 38 | 66 | /* |
| 39 | 67 | ** Global variable counting the number of outstanding calls to malloc() |
| 40 | 68 | ** made by the th1 implementation. This is used to catch memory leaks |
| 41 | 69 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 42 | 70 | */ |
| @@ -74,10 +102,22 @@ | ||
| 74 | 102 | va_list ap; |
| 75 | 103 | va_start(ap, zFormat); |
| 76 | 104 | blob_vappendf(&g.thLog, zFormat, ap); |
| 77 | 105 | va_end(ap); |
| 78 | 106 | } |
| 107 | + | |
| 108 | +/* | |
| 109 | +** Forces input and output to be done via the CGI subsystem. | |
| 110 | +*/ | |
| 111 | +void Th_ForceCgi(int fullHttpReply){ | |
| 112 | + g.httpOut = stdout; | |
| 113 | + g.httpIn = stdin; | |
| 114 | + fossil_binary_mode(g.httpOut); | |
| 115 | + fossil_binary_mode(g.httpIn); | |
| 116 | + g.cgiOutput = 1; | |
| 117 | + g.fullHttpReply = fullHttpReply; | |
| 118 | +} | |
| 79 | 119 | |
| 80 | 120 | /* |
| 81 | 121 | ** Checks if the TH1 trace log needs to be enabled. If so, prepares |
| 82 | 122 | ** it for use. |
| 83 | 123 | */ |
| @@ -327,10 +367,11 @@ | ||
| 327 | 367 | ** |
| 328 | 368 | ** Return true if the fossil binary has the given compile-time feature |
| 329 | 369 | ** enabled. The set of features includes: |
| 330 | 370 | ** |
| 331 | 371 | ** "ssl" = FOSSIL_ENABLE_SSL |
| 372 | +** "th1Hooks" = FOSSIL_ENABLE_TH1_HOOKS | |
| 332 | 373 | ** "tcl" = FOSSIL_ENABLE_TCL |
| 333 | 374 | ** "useTclStubs" = USE_TCL_STUBS |
| 334 | 375 | ** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS |
| 335 | 376 | ** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS |
| 336 | 377 | ** "json" = FOSSIL_ENABLE_JSON |
| @@ -355,10 +396,15 @@ | ||
| 355 | 396 | } |
| 356 | 397 | #if defined(FOSSIL_ENABLE_SSL) |
| 357 | 398 | else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){ |
| 358 | 399 | rc = 1; |
| 359 | 400 | } |
| 401 | +#endif | |
| 402 | +#if defined(FOSSIL_ENABLE_TH1_HOOKS) | |
| 403 | + else if( 0 == fossil_strnicmp( zArg, "th1Hooks\0", 9 ) ){ | |
| 404 | + rc = 1; | |
| 405 | + } | |
| 360 | 406 | #endif |
| 361 | 407 | #if defined(FOSSIL_ENABLE_TCL) |
| 362 | 408 | else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){ |
| 363 | 409 | rc = 1; |
| 364 | 410 | } |
| @@ -572,10 +618,175 @@ | ||
| 572 | 618 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 573 | 619 | } |
| 574 | 620 | Th_SetResult(interp, g.zRepositoryName, -1); |
| 575 | 621 | return TH_OK; |
| 576 | 622 | } |
| 623 | + | |
| 624 | +/* | |
| 625 | +** TH1 command: checkout ?BOOLEAN? | |
| 626 | +** | |
| 627 | +** Return the fully qualified directory name of the current checkout or an | |
| 628 | +** empty string if it is not available. Optionally, it will attempt to find | |
| 629 | +** the current checkout, opening the configuration ("user") database and the | |
| 630 | +** repository as necessary, if the boolean argument is non-zero. | |
| 631 | +*/ | |
| 632 | +static int checkoutCmd( | |
| 633 | + Th_Interp *interp, | |
| 634 | + void *p, | |
| 635 | + int argc, | |
| 636 | + const char **argv, | |
| 637 | + int *argl | |
| 638 | +){ | |
| 639 | + if( argc!=1 && argc!=2 ){ | |
| 640 | + return Th_WrongNumArgs(interp, "checkout ?BOOLEAN?"); | |
| 641 | + } | |
| 642 | + if( argc==2 ){ | |
| 643 | + int openCheckout = 0; | |
| 644 | + if( Th_ToInt(interp, argv[1], argl[1], &openCheckout) ){ | |
| 645 | + return TH_ERROR; | |
| 646 | + } | |
| 647 | + if( openCheckout ) db_open_local(0); | |
| 648 | + } | |
| 649 | + Th_SetResult(interp, g.zLocalRoot, -1); | |
| 650 | + return TH_OK; | |
| 651 | +} | |
| 652 | + | |
| 653 | +/* | |
| 654 | +** TH1 command: trace STRING | |
| 655 | +** | |
| 656 | +** Generate a TH1 trace message if debugging is enabled. | |
| 657 | +*/ | |
| 658 | +static int traceCmd( | |
| 659 | + Th_Interp *interp, | |
| 660 | + void *p, | |
| 661 | + int argc, | |
| 662 | + const char **argv, | |
| 663 | + int *argl | |
| 664 | +){ | |
| 665 | + if( argc!=2 ){ | |
| 666 | + return Th_WrongNumArgs(interp, "trace STRING"); | |
| 667 | + } | |
| 668 | + if( g.thTrace ){ | |
| 669 | + Th_Trace("%s", argv[1]); | |
| 670 | + } | |
| 671 | + Th_SetResult(interp, 0, 0); | |
| 672 | + return TH_OK; | |
| 673 | +} | |
| 674 | + | |
| 675 | +/* | |
| 676 | +** TH1 command: getParameter NAME ?DEFAULT? | |
| 677 | +** | |
| 678 | +** Return the value of the specified query parameter or the specified default | |
| 679 | +** value when there is no matching query parameter. | |
| 680 | +*/ | |
| 681 | +static int getParameterCmd( | |
| 682 | + Th_Interp *interp, | |
| 683 | + void *p, | |
| 684 | + int argc, | |
| 685 | + const char **argv, | |
| 686 | + int *argl | |
| 687 | +){ | |
| 688 | + const char *zDefault = 0; | |
| 689 | + if( argc!=2 && argc!=3 ){ | |
| 690 | + return Th_WrongNumArgs(interp, "getParameter NAME ?DEFAULT?"); | |
| 691 | + } | |
| 692 | + if( argc==3 ){ | |
| 693 | + zDefault = argv[2]; | |
| 694 | + } | |
| 695 | + Th_SetResult(interp, cgi_parameter(argv[1], zDefault), -1); | |
| 696 | + return TH_OK; | |
| 697 | +} | |
| 698 | + | |
| 699 | +/* | |
| 700 | +** TH1 command: setParameter NAME VALUE | |
| 701 | +** | |
| 702 | +** Sets the value of the specified query parameter. | |
| 703 | +*/ | |
| 704 | +static int setParameterCmd( | |
| 705 | + Th_Interp *interp, | |
| 706 | + void *p, | |
| 707 | + int argc, | |
| 708 | + const char **argv, | |
| 709 | + int *argl | |
| 710 | +){ | |
| 711 | + if( argc!=3 ){ | |
| 712 | + return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); | |
| 713 | + } | |
| 714 | + cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); | |
| 715 | + return TH_OK; | |
| 716 | +} | |
| 717 | + | |
| 718 | +/* | |
| 719 | +** TH1 command: render STRING | |
| 720 | +** | |
| 721 | +** Renders the template and writes the results. | |
| 722 | +*/ | |
| 723 | +static int renderCmd( | |
| 724 | + Th_Interp *interp, | |
| 725 | + void *p, | |
| 726 | + int argc, | |
| 727 | + const char **argv, | |
| 728 | + int *argl | |
| 729 | +){ | |
| 730 | + int rc; | |
| 731 | + if( argc!=2 ){ | |
| 732 | + return Th_WrongNumArgs(interp, "render STRING"); | |
| 733 | + } | |
| 734 | + rc = Th_Render(argv[1]); | |
| 735 | + Th_SetResult(interp, 0, 0); | |
| 736 | + return rc; | |
| 737 | +} | |
| 738 | + | |
| 739 | +/* | |
| 740 | +** TH1 command: styleHeader TITLE | |
| 741 | +** | |
| 742 | +** Render the configured style header. | |
| 743 | +*/ | |
| 744 | +static int styleHeaderCmd( | |
| 745 | + Th_Interp *interp, | |
| 746 | + void *p, | |
| 747 | + int argc, | |
| 748 | + const char **argv, | |
| 749 | + int *argl | |
| 750 | +){ | |
| 751 | + if( argc!=2 ){ | |
| 752 | + return Th_WrongNumArgs(interp, "styleHeader TITLE"); | |
| 753 | + } | |
| 754 | + if( Th_IsRepositoryOpen() ){ | |
| 755 | + style_header("%s", argv[1]); | |
| 756 | + Th_SetResult(interp, 0, 0); | |
| 757 | + return TH_OK; | |
| 758 | + }else{ | |
| 759 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 760 | + return TH_ERROR; | |
| 761 | + } | |
| 762 | +} | |
| 763 | + | |
| 764 | +/* | |
| 765 | +** TH1 command: styleFooter | |
| 766 | +** | |
| 767 | +** Render the configured style footer. | |
| 768 | +*/ | |
| 769 | +static int styleFooterCmd( | |
| 770 | + Th_Interp *interp, | |
| 771 | + void *p, | |
| 772 | + int argc, | |
| 773 | + const char **argv, | |
| 774 | + int *argl | |
| 775 | +){ | |
| 776 | + if( argc!=1 ){ | |
| 777 | + return Th_WrongNumArgs(interp, "styleFooter"); | |
| 778 | + } | |
| 779 | + if( Th_IsRepositoryOpen() ){ | |
| 780 | + style_footer(); | |
| 781 | + Th_SetResult(interp, 0, 0); | |
| 782 | + return TH_OK; | |
| 783 | + }else{ | |
| 784 | + Th_SetResult(interp, "repository unavailable", -1); | |
| 785 | + return TH_ERROR; | |
| 786 | + } | |
| 787 | +} | |
| 577 | 788 | |
| 578 | 789 | #ifdef _WIN32 |
| 579 | 790 | # include <windows.h> |
| 580 | 791 | #else |
| 581 | 792 | # include <sys/time.h> |
| @@ -979,14 +1190,43 @@ | ||
| 979 | 1190 | ** attempts to try to find the repository and open it. |
| 980 | 1191 | */ |
| 981 | 1192 | void Th_OpenConfig( |
| 982 | 1193 | int openRepository |
| 983 | 1194 | ){ |
| 984 | - if( openRepository ){ | |
| 1195 | + if( openRepository && !Th_IsRepositoryOpen() ){ | |
| 985 | 1196 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 1197 | + if( Th_IsRepositoryOpen() ){ | |
| 1198 | + g.th1Flags |= TH_STATE_REPOSITORY; | |
| 1199 | + }else{ | |
| 1200 | + g.th1Flags &= ~TH_STATE_REPOSITORY; | |
| 1201 | + } | |
| 1202 | + } | |
| 1203 | + if( !Th_IsConfigOpen() ){ | |
| 1204 | + db_open_config(0); | |
| 1205 | + if( Th_IsConfigOpen() ){ | |
| 1206 | + g.th1Flags |= TH_STATE_CONFIG; | |
| 1207 | + }else{ | |
| 1208 | + g.th1Flags &= ~TH_STATE_CONFIG; | |
| 1209 | + } | |
| 1210 | + } | |
| 1211 | +} | |
| 1212 | + | |
| 1213 | +/* | |
| 1214 | +** Attempts to close the configuration ("user") database. Optionally, also | |
| 1215 | +** attempts to close the repository. | |
| 1216 | +*/ | |
| 1217 | +void Th_CloseConfig( | |
| 1218 | + int closeRepository | |
| 1219 | +){ | |
| 1220 | + if( g.th1Flags & TH_STATE_CONFIG ){ | |
| 1221 | + db_close_config(); | |
| 1222 | + g.th1Flags &= ~TH_STATE_CONFIG; | |
| 986 | 1223 | } |
| 987 | - db_open_config(0); | |
| 1224 | + if( closeRepository && (g.th1Flags & TH_STATE_REPOSITORY) ){ | |
| 1225 | + db_close(1); | |
| 1226 | + g.th1Flags &= ~TH_STATE_REPOSITORY; | |
| 1227 | + } | |
| 988 | 1228 | } |
| 989 | 1229 | |
| 990 | 1230 | /* |
| 991 | 1231 | ** Make sure the interpreter has been initialized. Initialize it if |
| 992 | 1232 | ** it has not been already. |
| @@ -1004,14 +1244,16 @@ | ||
| 1004 | 1244 | const char *zName; |
| 1005 | 1245 | Th_CommandProc xProc; |
| 1006 | 1246 | void *pContext; |
| 1007 | 1247 | } aCommand[] = { |
| 1008 | 1248 | {"anycap", anycapCmd, 0}, |
| 1249 | + {"checkout", checkoutCmd, 0}, | |
| 1009 | 1250 | {"combobox", comboboxCmd, 0}, |
| 1010 | 1251 | {"date", dateCmd, 0}, |
| 1011 | 1252 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 1012 | 1253 | {"enable_output", enableOutputCmd, 0}, |
| 1254 | + {"getParameter", getParameterCmd, 0}, | |
| 1013 | 1255 | {"httpize", httpizeCmd, 0}, |
| 1014 | 1256 | {"hascap", hascapCmd, 0}, |
| 1015 | 1257 | {"hasfeature", hasfeatureCmd, 0}, |
| 1016 | 1258 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 1017 | 1259 | {"htmlize", htmlizeCmd, 0}, |
| @@ -1019,13 +1261,18 @@ | ||
| 1019 | 1261 | {"linecount", linecntCmd, 0}, |
| 1020 | 1262 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1021 | 1263 | {"query", queryCmd, 0}, |
| 1022 | 1264 | {"randhex", randhexCmd, 0}, |
| 1023 | 1265 | {"regexp", regexpCmd, 0}, |
| 1266 | + {"render", renderCmd, 0}, | |
| 1024 | 1267 | {"repository", repositoryCmd, 0}, |
| 1268 | + {"setParameter", setParameterCmd, 0}, | |
| 1025 | 1269 | {"setting", settingCmd, 0}, |
| 1270 | + {"styleHeader", styleHeaderCmd, 0}, | |
| 1271 | + {"styleFooter", styleFooterCmd, 0}, | |
| 1026 | 1272 | {"tclReady", tclReadyCmd, 0}, |
| 1273 | + {"trace", traceCmd, 0}, | |
| 1027 | 1274 | {"stime", stimeCmd, 0}, |
| 1028 | 1275 | {"utime", utimeCmd, 0}, |
| 1029 | 1276 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1030 | 1277 | {0, 0, 0} |
| 1031 | 1278 | }; |
| @@ -1081,10 +1328,12 @@ | ||
| 1081 | 1328 | if( g.thTrace ){ |
| 1082 | 1329 | Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup, |
| 1083 | 1330 | Th_ReturnCodeName(rc, 0)); |
| 1084 | 1331 | } |
| 1085 | 1332 | } |
| 1333 | + g.th1Flags &= ~TH_INIT_MASK; | |
| 1334 | + g.th1Flags |= (flags & TH_INIT_MASK); | |
| 1086 | 1335 | } |
| 1087 | 1336 | |
| 1088 | 1337 | /* |
| 1089 | 1338 | ** Store a string value in a variable in the interpreter. |
| 1090 | 1339 | */ |
| @@ -1095,10 +1344,34 @@ | ||
| 1095 | 1344 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 1096 | 1345 | } |
| 1097 | 1346 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| 1098 | 1347 | } |
| 1099 | 1348 | } |
| 1349 | + | |
| 1350 | +/* | |
| 1351 | +** Store a list value in a variable in the interpreter. | |
| 1352 | +*/ | |
| 1353 | +void Th_StoreList( | |
| 1354 | + const char *zName, | |
| 1355 | + char **pzList, | |
| 1356 | + int nList | |
| 1357 | +){ | |
| 1358 | + Th_FossilInit(TH_INIT_DEFAULT); | |
| 1359 | + if( pzList ){ | |
| 1360 | + char *zValue = 0; | |
| 1361 | + int nValue = 0; | |
| 1362 | + int i; | |
| 1363 | + for(i=0; i<nList; i++){ | |
| 1364 | + Th_ListAppend(g.interp, &zValue, &nValue, pzList[i], -1); | |
| 1365 | + } | |
| 1366 | + if( g.thTrace ){ | |
| 1367 | + Th_Trace("set %h {%h}<br />\n", zName, zValue); | |
| 1368 | + } | |
| 1369 | + Th_SetVar(g.interp, zName, -1, zValue, nValue); | |
| 1370 | + Th_Free(g.interp, zValue); | |
| 1371 | + } | |
| 1372 | +} | |
| 1100 | 1373 | |
| 1101 | 1374 | /* |
| 1102 | 1375 | ** Store an integer value in a variable in the interpreter. |
| 1103 | 1376 | */ |
| 1104 | 1377 | void Th_StoreInt(const char *zName, int iValue){ |
| @@ -1193,10 +1466,193 @@ | ||
| 1193 | 1466 | i += 2; |
| 1194 | 1467 | } |
| 1195 | 1468 | return i; |
| 1196 | 1469 | } |
| 1197 | 1470 | |
| 1471 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1472 | +/* | |
| 1473 | +** This function determines if TH1 hooks are enabled for the repository. It | |
| 1474 | +** may be necessary to open the repository and/or the configuration ("user") | |
| 1475 | +** database from within this function. Before this function returns, any | |
| 1476 | +** database opened will be closed again. This is very important because some | |
| 1477 | +** commands do not expect the repository and/or the configuration ("user") | |
| 1478 | +** database to be open prior to their own code doing so. | |
| 1479 | +*/ | |
| 1480 | +int Th_AreHooksEnabled(void){ | |
| 1481 | + int rc; | |
| 1482 | + if( fossil_getenv("TH1_ENABLE_HOOKS")!=0 ){ | |
| 1483 | + return 1; | |
| 1484 | + } | |
| 1485 | + Th_OpenConfig(1); | |
| 1486 | + rc = db_get_boolean("th1-hooks", 0); | |
| 1487 | + Th_CloseConfig(1); | |
| 1488 | + return rc; | |
| 1489 | +} | |
| 1490 | + | |
| 1491 | +/* | |
| 1492 | +** This function is called by Fossil just prior to dispatching a command. | |
| 1493 | +** Returning a value other than TH_OK from this function (i.e. via an | |
| 1494 | +** evaluated script raising an error or calling [break]/[continue]) will | |
| 1495 | +** cause the actual command execution to be skipped. | |
| 1496 | +*/ | |
| 1497 | +int Th_CommandHook( | |
| 1498 | + const char *zName, | |
| 1499 | + char cmdFlags | |
| 1500 | +){ | |
| 1501 | + int rc = TH_OK; | |
| 1502 | + if( !Th_AreHooksEnabled() ) return rc; | |
| 1503 | + Th_FossilInit(TH_INIT_HOOK); | |
| 1504 | + Th_Store("cmd_name", zName); | |
| 1505 | + Th_StoreList("cmd_args", g.argv, g.argc); | |
| 1506 | + Th_StoreInt("cmd_flags", cmdFlags); | |
| 1507 | + rc = Th_Eval(g.interp, 0, "command_hook", -1); | |
| 1508 | + if( rc==TH_ERROR ){ | |
| 1509 | + int nResult = 0; | |
| 1510 | + char *zResult = (char*)Th_GetResult(g.interp, &nResult); | |
| 1511 | + /* | |
| 1512 | + ** Make sure that the TH1 script error was not caused by a "missing" | |
| 1513 | + ** command hook handler as that is not actually an error condition. | |
| 1514 | + */ | |
| 1515 | + if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){ | |
| 1516 | + sendError(zResult, nResult, 0); | |
| 1517 | + } | |
| 1518 | + } | |
| 1519 | + /* | |
| 1520 | + ** If the script returned TH_ERROR (e.g. the "command_hook" TH1 command does | |
| 1521 | + ** not exist because commands are not being hooked), return TH_OK because we | |
| 1522 | + ** do not want to skip executing essential commands unless the called command | |
| 1523 | + ** (i.e. "command_hook") explicitly forbids this by successfully returning | |
| 1524 | + ** TH_BREAK or TH_CONTINUE. | |
| 1525 | + */ | |
| 1526 | + if( g.thTrace ){ | |
| 1527 | + Th_Trace("[command_hook {%h}] => %h<br />\n", zName, | |
| 1528 | + Th_ReturnCodeName(rc, 0)); | |
| 1529 | + } | |
| 1530 | + /* | |
| 1531 | + ** Does our call to Th_FossilInit() result in opening a database? If so, | |
| 1532 | + ** clean it up now. This is very important because some commands do not | |
| 1533 | + ** expect the repository and/or the configuration ("user") database to be | |
| 1534 | + ** open prior to their own code doing so. | |
| 1535 | + */ | |
| 1536 | + if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); | |
| 1537 | + return (rc != TH_ERROR) ? rc : TH_OK; | |
| 1538 | +} | |
| 1539 | + | |
| 1540 | +/* | |
| 1541 | +** This function is called by Fossil just after dispatching a command. | |
| 1542 | +** Returning a value other than TH_OK from this function (i.e. via an | |
| 1543 | +** evaluated script raising an error or calling [break]/[continue]) may | |
| 1544 | +** cause an error message to be displayed to the local interactive user. | |
| 1545 | +** Currently, TH1 error messages generated by this function are ignored. | |
| 1546 | +*/ | |
| 1547 | +int Th_CommandNotify( | |
| 1548 | + const char *zName, | |
| 1549 | + char cmdFlags | |
| 1550 | +){ | |
| 1551 | + int rc = TH_OK; | |
| 1552 | + if( !Th_AreHooksEnabled() ) return rc; | |
| 1553 | + Th_FossilInit(TH_INIT_HOOK); | |
| 1554 | + Th_Store("cmd_name", zName); | |
| 1555 | + Th_StoreList("cmd_args", g.argv, g.argc); | |
| 1556 | + Th_StoreInt("cmd_flags", cmdFlags); | |
| 1557 | + rc = Th_Eval(g.interp, 0, "command_notify", -1); | |
| 1558 | + if( g.thTrace ){ | |
| 1559 | + Th_Trace("[command_notify {%h}] => %h<br />\n", zName, | |
| 1560 | + Th_ReturnCodeName(rc, 0)); | |
| 1561 | + } | |
| 1562 | + /* | |
| 1563 | + ** Does our call to Th_FossilInit() result in opening a database? If so, | |
| 1564 | + ** clean it up now. This is very important because some commands do not | |
| 1565 | + ** expect the repository and/or the configuration ("user") database to be | |
| 1566 | + ** open prior to their own code doing so. | |
| 1567 | + */ | |
| 1568 | + if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); | |
| 1569 | + return rc; | |
| 1570 | +} | |
| 1571 | + | |
| 1572 | +/* | |
| 1573 | +** This function is called by Fossil just prior to processing a web page. | |
| 1574 | +** Returning a value other than TH_OK from this function (i.e. via an | |
| 1575 | +** evaluated script raising an error or calling [break]/[continue]) will | |
| 1576 | +** cause the actual web page processing to be skipped. | |
| 1577 | +*/ | |
| 1578 | +int Th_WebpageHook( | |
| 1579 | + const char *zName, | |
| 1580 | + char cmdFlags | |
| 1581 | +){ | |
| 1582 | + int rc = TH_OK; | |
| 1583 | + if( !Th_AreHooksEnabled() ) return rc; | |
| 1584 | + Th_FossilInit(TH_INIT_HOOK); | |
| 1585 | + Th_Store("web_name", zName); | |
| 1586 | + Th_StoreList("web_args", g.argv, g.argc); | |
| 1587 | + Th_StoreInt("web_flags", cmdFlags); | |
| 1588 | + rc = Th_Eval(g.interp, 0, "webpage_hook", -1); | |
| 1589 | + if( rc==TH_ERROR ){ | |
| 1590 | + int nResult = 0; | |
| 1591 | + char *zResult = (char*)Th_GetResult(g.interp, &nResult); | |
| 1592 | + /* | |
| 1593 | + ** Make sure that the TH1 script error was not caused by a "missing" | |
| 1594 | + ** webpage hook handler as that is not actually an error condition. | |
| 1595 | + */ | |
| 1596 | + if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){ | |
| 1597 | + sendError(zResult, nResult, 1); | |
| 1598 | + } | |
| 1599 | + } | |
| 1600 | + /* | |
| 1601 | + ** If the script returned TH_ERROR (e.g. the "webpage_hook" TH1 command does | |
| 1602 | + ** not exist because commands are not being hooked), return TH_OK because we | |
| 1603 | + ** do not want to skip processing essential web pages unless the called | |
| 1604 | + ** command (i.e. "webpage_hook") explicitly forbids this by successfully | |
| 1605 | + ** returning TH_BREAK or TH_CONTINUE. | |
| 1606 | + */ | |
| 1607 | + if( g.thTrace ){ | |
| 1608 | + Th_Trace("[webpage_hook {%h}] => %h<br />\n", zName, | |
| 1609 | + Th_ReturnCodeName(rc, 0)); | |
| 1610 | + } | |
| 1611 | + /* | |
| 1612 | + ** Does our call to Th_FossilInit() result in opening a database? If so, | |
| 1613 | + ** clean it up now. This is very important because some commands do not | |
| 1614 | + ** expect the repository and/or the configuration ("user") database to be | |
| 1615 | + ** open prior to their own code doing so. | |
| 1616 | + */ | |
| 1617 | + if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); | |
| 1618 | + return (rc != TH_ERROR) ? rc : TH_OK; | |
| 1619 | +} | |
| 1620 | + | |
| 1621 | +/* | |
| 1622 | +** This function is called by Fossil just after processing a web page. | |
| 1623 | +** Returning a value other than TH_OK from this function (i.e. via an | |
| 1624 | +** evaluated script raising an error or calling [break]/[continue]) may | |
| 1625 | +** cause an error message to be displayed to the remote user. | |
| 1626 | +** Currently, TH1 error messages generated by this function are ignored. | |
| 1627 | +*/ | |
| 1628 | +int Th_WebpageNotify( | |
| 1629 | + const char *zName, | |
| 1630 | + char cmdFlags | |
| 1631 | +){ | |
| 1632 | + int rc = TH_OK; | |
| 1633 | + if( !Th_AreHooksEnabled() ) return rc; | |
| 1634 | + Th_FossilInit(TH_INIT_HOOK); | |
| 1635 | + Th_Store("web_name", zName); | |
| 1636 | + Th_StoreList("web_args", g.argv, g.argc); | |
| 1637 | + Th_StoreInt("web_flags", cmdFlags); | |
| 1638 | + rc = Th_Eval(g.interp, 0, "webpage_notify", -1); | |
| 1639 | + if( g.thTrace ){ | |
| 1640 | + Th_Trace("[webpage_notify {%h}] => %h<br />\n", zName, | |
| 1641 | + Th_ReturnCodeName(rc, 0)); | |
| 1642 | + } | |
| 1643 | + /* | |
| 1644 | + ** Does our call to Th_FossilInit() result in opening a database? If so, | |
| 1645 | + ** clean it up now. This is very important because some commands do not | |
| 1646 | + ** expect the repository and/or the configuration ("user") database to be | |
| 1647 | + ** open prior to their own code doing so. | |
| 1648 | + */ | |
| 1649 | + if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); | |
| 1650 | + return rc; | |
| 1651 | +} | |
| 1652 | +#endif | |
| 1653 | + | |
| 1198 | 1654 | /* |
| 1199 | 1655 | ** The z[] input contains text mixed with TH1 scripts. |
| 1200 | 1656 | ** The TH1 scripts are contained within <th1>...</th1>. |
| 1201 | 1657 | ** TH1 variables are $aaa or $<aaa>. The first form of |
| 1202 | 1658 | ** variable is literal. The second is run through htmlize |
| @@ -1259,12 +1715,16 @@ | ||
| 1259 | 1715 | |
| 1260 | 1716 | /* |
| 1261 | 1717 | ** COMMAND: test-th-render |
| 1262 | 1718 | */ |
| 1263 | 1719 | void test_th_render(void){ |
| 1720 | + int forceCgi, fullHttpReply; | |
| 1264 | 1721 | Blob in; |
| 1265 | 1722 | Th_InitTraceLog(); |
| 1723 | + forceCgi = find_option("th-force-cgi", 0, 0)!=0; | |
| 1724 | + fullHttpReply = find_option("th-full-http", 0, 0)!=0; | |
| 1725 | + if( forceCgi ) Th_ForceCgi(fullHttpReply); | |
| 1266 | 1726 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1267 | 1727 | Th_OpenConfig(1); |
| 1268 | 1728 | } |
| 1269 | 1729 | if( g.argc<3 ){ |
| 1270 | 1730 | usage("FILE"); |
| @@ -1271,19 +1731,24 @@ | ||
| 1271 | 1731 | } |
| 1272 | 1732 | blob_zero(&in); |
| 1273 | 1733 | blob_read_from_file(&in, g.argv[2]); |
| 1274 | 1734 | Th_Render(blob_str(&in)); |
| 1275 | 1735 | Th_PrintTraceLog(); |
| 1736 | + if( forceCgi ) cgi_reply(); | |
| 1276 | 1737 | } |
| 1277 | 1738 | |
| 1278 | 1739 | /* |
| 1279 | 1740 | ** COMMAND: test-th-eval |
| 1280 | 1741 | */ |
| 1281 | 1742 | void test_th_eval(void){ |
| 1282 | 1743 | int rc; |
| 1283 | 1744 | const char *zRc; |
| 1745 | + int forceCgi, fullHttpReply; | |
| 1284 | 1746 | Th_InitTraceLog(); |
| 1747 | + forceCgi = find_option("th-force-cgi", 0, 0)!=0; | |
| 1748 | + fullHttpReply = find_option("th-full-http", 0, 0)!=0; | |
| 1749 | + if( forceCgi ) Th_ForceCgi(fullHttpReply); | |
| 1285 | 1750 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1286 | 1751 | Th_OpenConfig(1); |
| 1287 | 1752 | } |
| 1288 | 1753 | if( g.argc!=3 ){ |
| 1289 | 1754 | usage("script"); |
| @@ -1291,6 +1756,45 @@ | ||
| 1291 | 1756 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1292 | 1757 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1293 | 1758 | zRc = Th_ReturnCodeName(rc, 1); |
| 1294 | 1759 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1295 | 1760 | Th_PrintTraceLog(); |
| 1761 | + if( forceCgi ) cgi_reply(); | |
| 1762 | +} | |
| 1763 | + | |
| 1764 | +#ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 1765 | +/* | |
| 1766 | +** COMMAND: test-th-hook | |
| 1767 | +*/ | |
| 1768 | +void test_th_hook(void){ | |
| 1769 | + int rc = TH_OK; | |
| 1770 | + int nResult = 0; | |
| 1771 | + char *zResult; | |
| 1772 | + int forceCgi, fullHttpReply; | |
| 1773 | + Th_InitTraceLog(); | |
| 1774 | + forceCgi = find_option("th-force-cgi", 0, 0)!=0; | |
| 1775 | + fullHttpReply = find_option("th-full-http", 0, 0)!=0; | |
| 1776 | + if( forceCgi ) Th_ForceCgi(fullHttpReply); | |
| 1777 | + if( g.argc<5 ){ | |
| 1778 | + usage("TYPE NAME FLAGS"); | |
| 1779 | + } | |
| 1780 | + if( fossil_stricmp(g.argv[2], "cmdhook")==0 ){ | |
| 1781 | + rc = Th_CommandHook(g.argv[3], (char)atoi(g.argv[4])); | |
| 1782 | + }else if( fossil_stricmp(g.argv[2], "cmdnotify")==0 ){ | |
| 1783 | + rc = Th_CommandNotify(g.argv[3], (char)atoi(g.argv[4])); | |
| 1784 | + }else if( fossil_stricmp(g.argv[2], "webhook")==0 ){ | |
| 1785 | + rc = Th_WebpageHook(g.argv[3], (char)atoi(g.argv[4])); | |
| 1786 | + }else if( fossil_stricmp(g.argv[2], "webnotify")==0 ){ | |
| 1787 | + rc = Th_WebpageNotify(g.argv[3], (char)atoi(g.argv[4])); | |
| 1788 | + }else{ | |
| 1789 | + fossil_fatal("Unknown TH1 hook %s\n", g.argv[2]); | |
| 1790 | + } | |
| 1791 | + zResult = (char*)Th_GetResult(g.interp, &nResult); | |
| 1792 | + sendText("RESULT (", -1, 0); | |
| 1793 | + sendText(Th_ReturnCodeName(rc, 0), -1, 0); | |
| 1794 | + sendText("): ", -1, 0); | |
| 1795 | + sendText(zResult, nResult, 0); | |
| 1796 | + sendText("\n", -1, 0); | |
| 1797 | + Th_PrintTraceLog(); | |
| 1798 | + if( forceCgi ) cgi_reply(); | |
| 1296 | 1799 | } |
| 1800 | +#endif | |
| 1297 | 1801 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -30,13 +30,41 @@ | |
| 30 | #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 36 | #endif |
| 37 | |
| 38 | /* |
| 39 | ** Global variable counting the number of outstanding calls to malloc() |
| 40 | ** made by the th1 implementation. This is used to catch memory leaks |
| 41 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 42 | */ |
| @@ -74,10 +102,22 @@ | |
| 74 | va_list ap; |
| 75 | va_start(ap, zFormat); |
| 76 | blob_vappendf(&g.thLog, zFormat, ap); |
| 77 | va_end(ap); |
| 78 | } |
| 79 | |
| 80 | /* |
| 81 | ** Checks if the TH1 trace log needs to be enabled. If so, prepares |
| 82 | ** it for use. |
| 83 | */ |
| @@ -327,10 +367,11 @@ | |
| 327 | ** |
| 328 | ** Return true if the fossil binary has the given compile-time feature |
| 329 | ** enabled. The set of features includes: |
| 330 | ** |
| 331 | ** "ssl" = FOSSIL_ENABLE_SSL |
| 332 | ** "tcl" = FOSSIL_ENABLE_TCL |
| 333 | ** "useTclStubs" = USE_TCL_STUBS |
| 334 | ** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS |
| 335 | ** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS |
| 336 | ** "json" = FOSSIL_ENABLE_JSON |
| @@ -355,10 +396,15 @@ | |
| 355 | } |
| 356 | #if defined(FOSSIL_ENABLE_SSL) |
| 357 | else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){ |
| 358 | rc = 1; |
| 359 | } |
| 360 | #endif |
| 361 | #if defined(FOSSIL_ENABLE_TCL) |
| 362 | else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){ |
| 363 | rc = 1; |
| 364 | } |
| @@ -572,10 +618,175 @@ | |
| 572 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 573 | } |
| 574 | Th_SetResult(interp, g.zRepositoryName, -1); |
| 575 | return TH_OK; |
| 576 | } |
| 577 | |
| 578 | #ifdef _WIN32 |
| 579 | # include <windows.h> |
| 580 | #else |
| 581 | # include <sys/time.h> |
| @@ -979,14 +1190,43 @@ | |
| 979 | ** attempts to try to find the repository and open it. |
| 980 | */ |
| 981 | void Th_OpenConfig( |
| 982 | int openRepository |
| 983 | ){ |
| 984 | if( openRepository ){ |
| 985 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 986 | } |
| 987 | db_open_config(0); |
| 988 | } |
| 989 | |
| 990 | /* |
| 991 | ** Make sure the interpreter has been initialized. Initialize it if |
| 992 | ** it has not been already. |
| @@ -1004,14 +1244,16 @@ | |
| 1004 | const char *zName; |
| 1005 | Th_CommandProc xProc; |
| 1006 | void *pContext; |
| 1007 | } aCommand[] = { |
| 1008 | {"anycap", anycapCmd, 0}, |
| 1009 | {"combobox", comboboxCmd, 0}, |
| 1010 | {"date", dateCmd, 0}, |
| 1011 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 1012 | {"enable_output", enableOutputCmd, 0}, |
| 1013 | {"httpize", httpizeCmd, 0}, |
| 1014 | {"hascap", hascapCmd, 0}, |
| 1015 | {"hasfeature", hasfeatureCmd, 0}, |
| 1016 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 1017 | {"htmlize", htmlizeCmd, 0}, |
| @@ -1019,13 +1261,18 @@ | |
| 1019 | {"linecount", linecntCmd, 0}, |
| 1020 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1021 | {"query", queryCmd, 0}, |
| 1022 | {"randhex", randhexCmd, 0}, |
| 1023 | {"regexp", regexpCmd, 0}, |
| 1024 | {"repository", repositoryCmd, 0}, |
| 1025 | {"setting", settingCmd, 0}, |
| 1026 | {"tclReady", tclReadyCmd, 0}, |
| 1027 | {"stime", stimeCmd, 0}, |
| 1028 | {"utime", utimeCmd, 0}, |
| 1029 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1030 | {0, 0, 0} |
| 1031 | }; |
| @@ -1081,10 +1328,12 @@ | |
| 1081 | if( g.thTrace ){ |
| 1082 | Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup, |
| 1083 | Th_ReturnCodeName(rc, 0)); |
| 1084 | } |
| 1085 | } |
| 1086 | } |
| 1087 | |
| 1088 | /* |
| 1089 | ** Store a string value in a variable in the interpreter. |
| 1090 | */ |
| @@ -1095,10 +1344,34 @@ | |
| 1095 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 1096 | } |
| 1097 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| 1098 | } |
| 1099 | } |
| 1100 | |
| 1101 | /* |
| 1102 | ** Store an integer value in a variable in the interpreter. |
| 1103 | */ |
| 1104 | void Th_StoreInt(const char *zName, int iValue){ |
| @@ -1193,10 +1466,193 @@ | |
| 1193 | i += 2; |
| 1194 | } |
| 1195 | return i; |
| 1196 | } |
| 1197 | |
| 1198 | /* |
| 1199 | ** The z[] input contains text mixed with TH1 scripts. |
| 1200 | ** The TH1 scripts are contained within <th1>...</th1>. |
| 1201 | ** TH1 variables are $aaa or $<aaa>. The first form of |
| 1202 | ** variable is literal. The second is run through htmlize |
| @@ -1259,12 +1715,16 @@ | |
| 1259 | |
| 1260 | /* |
| 1261 | ** COMMAND: test-th-render |
| 1262 | */ |
| 1263 | void test_th_render(void){ |
| 1264 | Blob in; |
| 1265 | Th_InitTraceLog(); |
| 1266 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1267 | Th_OpenConfig(1); |
| 1268 | } |
| 1269 | if( g.argc<3 ){ |
| 1270 | usage("FILE"); |
| @@ -1271,19 +1731,24 @@ | |
| 1271 | } |
| 1272 | blob_zero(&in); |
| 1273 | blob_read_from_file(&in, g.argv[2]); |
| 1274 | Th_Render(blob_str(&in)); |
| 1275 | Th_PrintTraceLog(); |
| 1276 | } |
| 1277 | |
| 1278 | /* |
| 1279 | ** COMMAND: test-th-eval |
| 1280 | */ |
| 1281 | void test_th_eval(void){ |
| 1282 | int rc; |
| 1283 | const char *zRc; |
| 1284 | Th_InitTraceLog(); |
| 1285 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1286 | Th_OpenConfig(1); |
| 1287 | } |
| 1288 | if( g.argc!=3 ){ |
| 1289 | usage("script"); |
| @@ -1291,6 +1756,45 @@ | |
| 1291 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1292 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1293 | zRc = Th_ReturnCodeName(rc, 1); |
| 1294 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1295 | Th_PrintTraceLog(); |
| 1296 | } |
| 1297 |
| --- src/th_main.c | |
| +++ src/th_main.c | |
| @@ -30,13 +30,41 @@ | |
| 30 | #define TH_INIT_NONE ((u32)0x00000000) /* No flags. */ |
| 31 | #define TH_INIT_NEED_CONFIG ((u32)0x00000001) /* Open configuration first? */ |
| 32 | #define TH_INIT_FORCE_TCL ((u32)0x00000002) /* Force Tcl to be enabled? */ |
| 33 | #define TH_INIT_FORCE_RESET ((u32)0x00000004) /* Force TH1 commands re-added? */ |
| 34 | #define TH_INIT_FORCE_SETUP ((u32)0x00000008) /* Force eval of setup script? */ |
| 35 | #define TH_INIT_MASK ((u32)0x0000000F) /* All possible init flags. */ |
| 36 | #define TH_INIT_DEFAULT (TH_INIT_NONE) /* Default flags. */ |
| 37 | #define TH_INIT_HOOK (TH_INIT_NEED_CONFIG | TH_INIT_FORCE_SETUP) |
| 38 | #endif |
| 39 | |
| 40 | /* |
| 41 | ** Flags set by functions in this file to keep track of integration state |
| 42 | ** information. These flags should not be used outside of this file. |
| 43 | */ |
| 44 | #define TH_STATE_CONFIG ((u32)0x00000010) /* We opened the config. */ |
| 45 | #define TH_STATE_REPOSITORY ((u32)0x00000020) /* We opened the repository. */ |
| 46 | #define TH_STATE_MASK ((u32)0x00000030) /* All possible state flags. */ |
| 47 | |
| 48 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 49 | /* |
| 50 | ** These are the "well-known" TH1 error messages that occur when no hook is |
| 51 | ** registered to be called prior to executing a command or processing a web |
| 52 | ** page, respectively. If one of these errors is seen, it will not be sent |
| 53 | ** or displayed to the remote user or local interactive user, respectively. |
| 54 | */ |
| 55 | #define NO_COMMAND_HOOK_ERROR "no such command: command_hook" |
| 56 | #define NO_WEBPAGE_HOOK_ERROR "no such command: webpage_hook" |
| 57 | #endif |
| 58 | |
| 59 | /* |
| 60 | ** These macros are used within this file to detect if the repository and |
| 61 | ** configuration ("user") database are currently open. |
| 62 | */ |
| 63 | #define Th_IsRepositoryOpen() (g.repositoryOpen) |
| 64 | #define Th_IsConfigOpen() (g.zConfigDbName!=0) |
| 65 | |
| 66 | /* |
| 67 | ** Global variable counting the number of outstanding calls to malloc() |
| 68 | ** made by the th1 implementation. This is used to catch memory leaks |
| 69 | ** in the interpreter. Obviously, it also means th1 is not threadsafe. |
| 70 | */ |
| @@ -74,10 +102,22 @@ | |
| 102 | va_list ap; |
| 103 | va_start(ap, zFormat); |
| 104 | blob_vappendf(&g.thLog, zFormat, ap); |
| 105 | va_end(ap); |
| 106 | } |
| 107 | |
| 108 | /* |
| 109 | ** Forces input and output to be done via the CGI subsystem. |
| 110 | */ |
| 111 | void Th_ForceCgi(int fullHttpReply){ |
| 112 | g.httpOut = stdout; |
| 113 | g.httpIn = stdin; |
| 114 | fossil_binary_mode(g.httpOut); |
| 115 | fossil_binary_mode(g.httpIn); |
| 116 | g.cgiOutput = 1; |
| 117 | g.fullHttpReply = fullHttpReply; |
| 118 | } |
| 119 | |
| 120 | /* |
| 121 | ** Checks if the TH1 trace log needs to be enabled. If so, prepares |
| 122 | ** it for use. |
| 123 | */ |
| @@ -327,10 +367,11 @@ | |
| 367 | ** |
| 368 | ** Return true if the fossil binary has the given compile-time feature |
| 369 | ** enabled. The set of features includes: |
| 370 | ** |
| 371 | ** "ssl" = FOSSIL_ENABLE_SSL |
| 372 | ** "th1Hooks" = FOSSIL_ENABLE_TH1_HOOKS |
| 373 | ** "tcl" = FOSSIL_ENABLE_TCL |
| 374 | ** "useTclStubs" = USE_TCL_STUBS |
| 375 | ** "tclStubs" = FOSSIL_ENABLE_TCL_STUBS |
| 376 | ** "tclPrivateStubs" = FOSSIL_ENABLE_TCL_PRIVATE_STUBS |
| 377 | ** "json" = FOSSIL_ENABLE_JSON |
| @@ -355,10 +396,15 @@ | |
| 396 | } |
| 397 | #if defined(FOSSIL_ENABLE_SSL) |
| 398 | else if( 0 == fossil_strnicmp( zArg, "ssl\0", 4 ) ){ |
| 399 | rc = 1; |
| 400 | } |
| 401 | #endif |
| 402 | #if defined(FOSSIL_ENABLE_TH1_HOOKS) |
| 403 | else if( 0 == fossil_strnicmp( zArg, "th1Hooks\0", 9 ) ){ |
| 404 | rc = 1; |
| 405 | } |
| 406 | #endif |
| 407 | #if defined(FOSSIL_ENABLE_TCL) |
| 408 | else if( 0 == fossil_strnicmp( zArg, "tcl\0", 4 ) ){ |
| 409 | rc = 1; |
| 410 | } |
| @@ -572,10 +618,175 @@ | |
| 618 | if( openRepository ) db_find_and_open_repository(OPEN_OK_NOT_FOUND, 0); |
| 619 | } |
| 620 | Th_SetResult(interp, g.zRepositoryName, -1); |
| 621 | return TH_OK; |
| 622 | } |
| 623 | |
| 624 | /* |
| 625 | ** TH1 command: checkout ?BOOLEAN? |
| 626 | ** |
| 627 | ** Return the fully qualified directory name of the current checkout or an |
| 628 | ** empty string if it is not available. Optionally, it will attempt to find |
| 629 | ** the current checkout, opening the configuration ("user") database and the |
| 630 | ** repository as necessary, if the boolean argument is non-zero. |
| 631 | */ |
| 632 | static int checkoutCmd( |
| 633 | Th_Interp *interp, |
| 634 | void *p, |
| 635 | int argc, |
| 636 | const char **argv, |
| 637 | int *argl |
| 638 | ){ |
| 639 | if( argc!=1 && argc!=2 ){ |
| 640 | return Th_WrongNumArgs(interp, "checkout ?BOOLEAN?"); |
| 641 | } |
| 642 | if( argc==2 ){ |
| 643 | int openCheckout = 0; |
| 644 | if( Th_ToInt(interp, argv[1], argl[1], &openCheckout) ){ |
| 645 | return TH_ERROR; |
| 646 | } |
| 647 | if( openCheckout ) db_open_local(0); |
| 648 | } |
| 649 | Th_SetResult(interp, g.zLocalRoot, -1); |
| 650 | return TH_OK; |
| 651 | } |
| 652 | |
| 653 | /* |
| 654 | ** TH1 command: trace STRING |
| 655 | ** |
| 656 | ** Generate a TH1 trace message if debugging is enabled. |
| 657 | */ |
| 658 | static int traceCmd( |
| 659 | Th_Interp *interp, |
| 660 | void *p, |
| 661 | int argc, |
| 662 | const char **argv, |
| 663 | int *argl |
| 664 | ){ |
| 665 | if( argc!=2 ){ |
| 666 | return Th_WrongNumArgs(interp, "trace STRING"); |
| 667 | } |
| 668 | if( g.thTrace ){ |
| 669 | Th_Trace("%s", argv[1]); |
| 670 | } |
| 671 | Th_SetResult(interp, 0, 0); |
| 672 | return TH_OK; |
| 673 | } |
| 674 | |
| 675 | /* |
| 676 | ** TH1 command: getParameter NAME ?DEFAULT? |
| 677 | ** |
| 678 | ** Return the value of the specified query parameter or the specified default |
| 679 | ** value when there is no matching query parameter. |
| 680 | */ |
| 681 | static int getParameterCmd( |
| 682 | Th_Interp *interp, |
| 683 | void *p, |
| 684 | int argc, |
| 685 | const char **argv, |
| 686 | int *argl |
| 687 | ){ |
| 688 | const char *zDefault = 0; |
| 689 | if( argc!=2 && argc!=3 ){ |
| 690 | return Th_WrongNumArgs(interp, "getParameter NAME ?DEFAULT?"); |
| 691 | } |
| 692 | if( argc==3 ){ |
| 693 | zDefault = argv[2]; |
| 694 | } |
| 695 | Th_SetResult(interp, cgi_parameter(argv[1], zDefault), -1); |
| 696 | return TH_OK; |
| 697 | } |
| 698 | |
| 699 | /* |
| 700 | ** TH1 command: setParameter NAME VALUE |
| 701 | ** |
| 702 | ** Sets the value of the specified query parameter. |
| 703 | */ |
| 704 | static int setParameterCmd( |
| 705 | Th_Interp *interp, |
| 706 | void *p, |
| 707 | int argc, |
| 708 | const char **argv, |
| 709 | int *argl |
| 710 | ){ |
| 711 | if( argc!=3 ){ |
| 712 | return Th_WrongNumArgs(interp, "setParameter NAME VALUE"); |
| 713 | } |
| 714 | cgi_replace_parameter(mprintf("%s", argv[1]), mprintf("%s", argv[2])); |
| 715 | return TH_OK; |
| 716 | } |
| 717 | |
| 718 | /* |
| 719 | ** TH1 command: render STRING |
| 720 | ** |
| 721 | ** Renders the template and writes the results. |
| 722 | */ |
| 723 | static int renderCmd( |
| 724 | Th_Interp *interp, |
| 725 | void *p, |
| 726 | int argc, |
| 727 | const char **argv, |
| 728 | int *argl |
| 729 | ){ |
| 730 | int rc; |
| 731 | if( argc!=2 ){ |
| 732 | return Th_WrongNumArgs(interp, "render STRING"); |
| 733 | } |
| 734 | rc = Th_Render(argv[1]); |
| 735 | Th_SetResult(interp, 0, 0); |
| 736 | return rc; |
| 737 | } |
| 738 | |
| 739 | /* |
| 740 | ** TH1 command: styleHeader TITLE |
| 741 | ** |
| 742 | ** Render the configured style header. |
| 743 | */ |
| 744 | static int styleHeaderCmd( |
| 745 | Th_Interp *interp, |
| 746 | void *p, |
| 747 | int argc, |
| 748 | const char **argv, |
| 749 | int *argl |
| 750 | ){ |
| 751 | if( argc!=2 ){ |
| 752 | return Th_WrongNumArgs(interp, "styleHeader TITLE"); |
| 753 | } |
| 754 | if( Th_IsRepositoryOpen() ){ |
| 755 | style_header("%s", argv[1]); |
| 756 | Th_SetResult(interp, 0, 0); |
| 757 | return TH_OK; |
| 758 | }else{ |
| 759 | Th_SetResult(interp, "repository unavailable", -1); |
| 760 | return TH_ERROR; |
| 761 | } |
| 762 | } |
| 763 | |
| 764 | /* |
| 765 | ** TH1 command: styleFooter |
| 766 | ** |
| 767 | ** Render the configured style footer. |
| 768 | */ |
| 769 | static int styleFooterCmd( |
| 770 | Th_Interp *interp, |
| 771 | void *p, |
| 772 | int argc, |
| 773 | const char **argv, |
| 774 | int *argl |
| 775 | ){ |
| 776 | if( argc!=1 ){ |
| 777 | return Th_WrongNumArgs(interp, "styleFooter"); |
| 778 | } |
| 779 | if( Th_IsRepositoryOpen() ){ |
| 780 | style_footer(); |
| 781 | Th_SetResult(interp, 0, 0); |
| 782 | return TH_OK; |
| 783 | }else{ |
| 784 | Th_SetResult(interp, "repository unavailable", -1); |
| 785 | return TH_ERROR; |
| 786 | } |
| 787 | } |
| 788 | |
| 789 | #ifdef _WIN32 |
| 790 | # include <windows.h> |
| 791 | #else |
| 792 | # include <sys/time.h> |
| @@ -979,14 +1190,43 @@ | |
| 1190 | ** attempts to try to find the repository and open it. |
| 1191 | */ |
| 1192 | void Th_OpenConfig( |
| 1193 | int openRepository |
| 1194 | ){ |
| 1195 | if( openRepository && !Th_IsRepositoryOpen() ){ |
| 1196 | db_find_and_open_repository(OPEN_ANY_SCHEMA | OPEN_OK_NOT_FOUND, 0); |
| 1197 | if( Th_IsRepositoryOpen() ){ |
| 1198 | g.th1Flags |= TH_STATE_REPOSITORY; |
| 1199 | }else{ |
| 1200 | g.th1Flags &= ~TH_STATE_REPOSITORY; |
| 1201 | } |
| 1202 | } |
| 1203 | if( !Th_IsConfigOpen() ){ |
| 1204 | db_open_config(0); |
| 1205 | if( Th_IsConfigOpen() ){ |
| 1206 | g.th1Flags |= TH_STATE_CONFIG; |
| 1207 | }else{ |
| 1208 | g.th1Flags &= ~TH_STATE_CONFIG; |
| 1209 | } |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | /* |
| 1214 | ** Attempts to close the configuration ("user") database. Optionally, also |
| 1215 | ** attempts to close the repository. |
| 1216 | */ |
| 1217 | void Th_CloseConfig( |
| 1218 | int closeRepository |
| 1219 | ){ |
| 1220 | if( g.th1Flags & TH_STATE_CONFIG ){ |
| 1221 | db_close_config(); |
| 1222 | g.th1Flags &= ~TH_STATE_CONFIG; |
| 1223 | } |
| 1224 | if( closeRepository && (g.th1Flags & TH_STATE_REPOSITORY) ){ |
| 1225 | db_close(1); |
| 1226 | g.th1Flags &= ~TH_STATE_REPOSITORY; |
| 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | /* |
| 1231 | ** Make sure the interpreter has been initialized. Initialize it if |
| 1232 | ** it has not been already. |
| @@ -1004,14 +1244,16 @@ | |
| 1244 | const char *zName; |
| 1245 | Th_CommandProc xProc; |
| 1246 | void *pContext; |
| 1247 | } aCommand[] = { |
| 1248 | {"anycap", anycapCmd, 0}, |
| 1249 | {"checkout", checkoutCmd, 0}, |
| 1250 | {"combobox", comboboxCmd, 0}, |
| 1251 | {"date", dateCmd, 0}, |
| 1252 | {"decorate", wikiCmd, (void*)&aFlags[2]}, |
| 1253 | {"enable_output", enableOutputCmd, 0}, |
| 1254 | {"getParameter", getParameterCmd, 0}, |
| 1255 | {"httpize", httpizeCmd, 0}, |
| 1256 | {"hascap", hascapCmd, 0}, |
| 1257 | {"hasfeature", hasfeatureCmd, 0}, |
| 1258 | {"html", putsCmd, (void*)&aFlags[0]}, |
| 1259 | {"htmlize", htmlizeCmd, 0}, |
| @@ -1019,13 +1261,18 @@ | |
| 1261 | {"linecount", linecntCmd, 0}, |
| 1262 | {"puts", putsCmd, (void*)&aFlags[1]}, |
| 1263 | {"query", queryCmd, 0}, |
| 1264 | {"randhex", randhexCmd, 0}, |
| 1265 | {"regexp", regexpCmd, 0}, |
| 1266 | {"render", renderCmd, 0}, |
| 1267 | {"repository", repositoryCmd, 0}, |
| 1268 | {"setParameter", setParameterCmd, 0}, |
| 1269 | {"setting", settingCmd, 0}, |
| 1270 | {"styleHeader", styleHeaderCmd, 0}, |
| 1271 | {"styleFooter", styleFooterCmd, 0}, |
| 1272 | {"tclReady", tclReadyCmd, 0}, |
| 1273 | {"trace", traceCmd, 0}, |
| 1274 | {"stime", stimeCmd, 0}, |
| 1275 | {"utime", utimeCmd, 0}, |
| 1276 | {"wiki", wikiCmd, (void*)&aFlags[0]}, |
| 1277 | {0, 0, 0} |
| 1278 | }; |
| @@ -1081,10 +1328,12 @@ | |
| 1328 | if( g.thTrace ){ |
| 1329 | Th_Trace("th1-setup {%h} => %h<br />\n", g.th1Setup, |
| 1330 | Th_ReturnCodeName(rc, 0)); |
| 1331 | } |
| 1332 | } |
| 1333 | g.th1Flags &= ~TH_INIT_MASK; |
| 1334 | g.th1Flags |= (flags & TH_INIT_MASK); |
| 1335 | } |
| 1336 | |
| 1337 | /* |
| 1338 | ** Store a string value in a variable in the interpreter. |
| 1339 | */ |
| @@ -1095,10 +1344,34 @@ | |
| 1344 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 1345 | } |
| 1346 | Th_SetVar(g.interp, zName, -1, zValue, strlen(zValue)); |
| 1347 | } |
| 1348 | } |
| 1349 | |
| 1350 | /* |
| 1351 | ** Store a list value in a variable in the interpreter. |
| 1352 | */ |
| 1353 | void Th_StoreList( |
| 1354 | const char *zName, |
| 1355 | char **pzList, |
| 1356 | int nList |
| 1357 | ){ |
| 1358 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1359 | if( pzList ){ |
| 1360 | char *zValue = 0; |
| 1361 | int nValue = 0; |
| 1362 | int i; |
| 1363 | for(i=0; i<nList; i++){ |
| 1364 | Th_ListAppend(g.interp, &zValue, &nValue, pzList[i], -1); |
| 1365 | } |
| 1366 | if( g.thTrace ){ |
| 1367 | Th_Trace("set %h {%h}<br />\n", zName, zValue); |
| 1368 | } |
| 1369 | Th_SetVar(g.interp, zName, -1, zValue, nValue); |
| 1370 | Th_Free(g.interp, zValue); |
| 1371 | } |
| 1372 | } |
| 1373 | |
| 1374 | /* |
| 1375 | ** Store an integer value in a variable in the interpreter. |
| 1376 | */ |
| 1377 | void Th_StoreInt(const char *zName, int iValue){ |
| @@ -1193,10 +1466,193 @@ | |
| 1466 | i += 2; |
| 1467 | } |
| 1468 | return i; |
| 1469 | } |
| 1470 | |
| 1471 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1472 | /* |
| 1473 | ** This function determines if TH1 hooks are enabled for the repository. It |
| 1474 | ** may be necessary to open the repository and/or the configuration ("user") |
| 1475 | ** database from within this function. Before this function returns, any |
| 1476 | ** database opened will be closed again. This is very important because some |
| 1477 | ** commands do not expect the repository and/or the configuration ("user") |
| 1478 | ** database to be open prior to their own code doing so. |
| 1479 | */ |
| 1480 | int Th_AreHooksEnabled(void){ |
| 1481 | int rc; |
| 1482 | if( fossil_getenv("TH1_ENABLE_HOOKS")!=0 ){ |
| 1483 | return 1; |
| 1484 | } |
| 1485 | Th_OpenConfig(1); |
| 1486 | rc = db_get_boolean("th1-hooks", 0); |
| 1487 | Th_CloseConfig(1); |
| 1488 | return rc; |
| 1489 | } |
| 1490 | |
| 1491 | /* |
| 1492 | ** This function is called by Fossil just prior to dispatching a command. |
| 1493 | ** Returning a value other than TH_OK from this function (i.e. via an |
| 1494 | ** evaluated script raising an error or calling [break]/[continue]) will |
| 1495 | ** cause the actual command execution to be skipped. |
| 1496 | */ |
| 1497 | int Th_CommandHook( |
| 1498 | const char *zName, |
| 1499 | char cmdFlags |
| 1500 | ){ |
| 1501 | int rc = TH_OK; |
| 1502 | if( !Th_AreHooksEnabled() ) return rc; |
| 1503 | Th_FossilInit(TH_INIT_HOOK); |
| 1504 | Th_Store("cmd_name", zName); |
| 1505 | Th_StoreList("cmd_args", g.argv, g.argc); |
| 1506 | Th_StoreInt("cmd_flags", cmdFlags); |
| 1507 | rc = Th_Eval(g.interp, 0, "command_hook", -1); |
| 1508 | if( rc==TH_ERROR ){ |
| 1509 | int nResult = 0; |
| 1510 | char *zResult = (char*)Th_GetResult(g.interp, &nResult); |
| 1511 | /* |
| 1512 | ** Make sure that the TH1 script error was not caused by a "missing" |
| 1513 | ** command hook handler as that is not actually an error condition. |
| 1514 | */ |
| 1515 | if( memcmp(zResult, NO_COMMAND_HOOK_ERROR, nResult)!=0 ){ |
| 1516 | sendError(zResult, nResult, 0); |
| 1517 | } |
| 1518 | } |
| 1519 | /* |
| 1520 | ** If the script returned TH_ERROR (e.g. the "command_hook" TH1 command does |
| 1521 | ** not exist because commands are not being hooked), return TH_OK because we |
| 1522 | ** do not want to skip executing essential commands unless the called command |
| 1523 | ** (i.e. "command_hook") explicitly forbids this by successfully returning |
| 1524 | ** TH_BREAK or TH_CONTINUE. |
| 1525 | */ |
| 1526 | if( g.thTrace ){ |
| 1527 | Th_Trace("[command_hook {%h}] => %h<br />\n", zName, |
| 1528 | Th_ReturnCodeName(rc, 0)); |
| 1529 | } |
| 1530 | /* |
| 1531 | ** Does our call to Th_FossilInit() result in opening a database? If so, |
| 1532 | ** clean it up now. This is very important because some commands do not |
| 1533 | ** expect the repository and/or the configuration ("user") database to be |
| 1534 | ** open prior to their own code doing so. |
| 1535 | */ |
| 1536 | if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); |
| 1537 | return (rc != TH_ERROR) ? rc : TH_OK; |
| 1538 | } |
| 1539 | |
| 1540 | /* |
| 1541 | ** This function is called by Fossil just after dispatching a command. |
| 1542 | ** Returning a value other than TH_OK from this function (i.e. via an |
| 1543 | ** evaluated script raising an error or calling [break]/[continue]) may |
| 1544 | ** cause an error message to be displayed to the local interactive user. |
| 1545 | ** Currently, TH1 error messages generated by this function are ignored. |
| 1546 | */ |
| 1547 | int Th_CommandNotify( |
| 1548 | const char *zName, |
| 1549 | char cmdFlags |
| 1550 | ){ |
| 1551 | int rc = TH_OK; |
| 1552 | if( !Th_AreHooksEnabled() ) return rc; |
| 1553 | Th_FossilInit(TH_INIT_HOOK); |
| 1554 | Th_Store("cmd_name", zName); |
| 1555 | Th_StoreList("cmd_args", g.argv, g.argc); |
| 1556 | Th_StoreInt("cmd_flags", cmdFlags); |
| 1557 | rc = Th_Eval(g.interp, 0, "command_notify", -1); |
| 1558 | if( g.thTrace ){ |
| 1559 | Th_Trace("[command_notify {%h}] => %h<br />\n", zName, |
| 1560 | Th_ReturnCodeName(rc, 0)); |
| 1561 | } |
| 1562 | /* |
| 1563 | ** Does our call to Th_FossilInit() result in opening a database? If so, |
| 1564 | ** clean it up now. This is very important because some commands do not |
| 1565 | ** expect the repository and/or the configuration ("user") database to be |
| 1566 | ** open prior to their own code doing so. |
| 1567 | */ |
| 1568 | if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); |
| 1569 | return rc; |
| 1570 | } |
| 1571 | |
| 1572 | /* |
| 1573 | ** This function is called by Fossil just prior to processing a web page. |
| 1574 | ** Returning a value other than TH_OK from this function (i.e. via an |
| 1575 | ** evaluated script raising an error or calling [break]/[continue]) will |
| 1576 | ** cause the actual web page processing to be skipped. |
| 1577 | */ |
| 1578 | int Th_WebpageHook( |
| 1579 | const char *zName, |
| 1580 | char cmdFlags |
| 1581 | ){ |
| 1582 | int rc = TH_OK; |
| 1583 | if( !Th_AreHooksEnabled() ) return rc; |
| 1584 | Th_FossilInit(TH_INIT_HOOK); |
| 1585 | Th_Store("web_name", zName); |
| 1586 | Th_StoreList("web_args", g.argv, g.argc); |
| 1587 | Th_StoreInt("web_flags", cmdFlags); |
| 1588 | rc = Th_Eval(g.interp, 0, "webpage_hook", -1); |
| 1589 | if( rc==TH_ERROR ){ |
| 1590 | int nResult = 0; |
| 1591 | char *zResult = (char*)Th_GetResult(g.interp, &nResult); |
| 1592 | /* |
| 1593 | ** Make sure that the TH1 script error was not caused by a "missing" |
| 1594 | ** webpage hook handler as that is not actually an error condition. |
| 1595 | */ |
| 1596 | if( memcmp(zResult, NO_WEBPAGE_HOOK_ERROR, nResult)!=0 ){ |
| 1597 | sendError(zResult, nResult, 1); |
| 1598 | } |
| 1599 | } |
| 1600 | /* |
| 1601 | ** If the script returned TH_ERROR (e.g. the "webpage_hook" TH1 command does |
| 1602 | ** not exist because commands are not being hooked), return TH_OK because we |
| 1603 | ** do not want to skip processing essential web pages unless the called |
| 1604 | ** command (i.e. "webpage_hook") explicitly forbids this by successfully |
| 1605 | ** returning TH_BREAK or TH_CONTINUE. |
| 1606 | */ |
| 1607 | if( g.thTrace ){ |
| 1608 | Th_Trace("[webpage_hook {%h}] => %h<br />\n", zName, |
| 1609 | Th_ReturnCodeName(rc, 0)); |
| 1610 | } |
| 1611 | /* |
| 1612 | ** Does our call to Th_FossilInit() result in opening a database? If so, |
| 1613 | ** clean it up now. This is very important because some commands do not |
| 1614 | ** expect the repository and/or the configuration ("user") database to be |
| 1615 | ** open prior to their own code doing so. |
| 1616 | */ |
| 1617 | if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); |
| 1618 | return (rc != TH_ERROR) ? rc : TH_OK; |
| 1619 | } |
| 1620 | |
| 1621 | /* |
| 1622 | ** This function is called by Fossil just after processing a web page. |
| 1623 | ** Returning a value other than TH_OK from this function (i.e. via an |
| 1624 | ** evaluated script raising an error or calling [break]/[continue]) may |
| 1625 | ** cause an error message to be displayed to the remote user. |
| 1626 | ** Currently, TH1 error messages generated by this function are ignored. |
| 1627 | */ |
| 1628 | int Th_WebpageNotify( |
| 1629 | const char *zName, |
| 1630 | char cmdFlags |
| 1631 | ){ |
| 1632 | int rc = TH_OK; |
| 1633 | if( !Th_AreHooksEnabled() ) return rc; |
| 1634 | Th_FossilInit(TH_INIT_HOOK); |
| 1635 | Th_Store("web_name", zName); |
| 1636 | Th_StoreList("web_args", g.argv, g.argc); |
| 1637 | Th_StoreInt("web_flags", cmdFlags); |
| 1638 | rc = Th_Eval(g.interp, 0, "webpage_notify", -1); |
| 1639 | if( g.thTrace ){ |
| 1640 | Th_Trace("[webpage_notify {%h}] => %h<br />\n", zName, |
| 1641 | Th_ReturnCodeName(rc, 0)); |
| 1642 | } |
| 1643 | /* |
| 1644 | ** Does our call to Th_FossilInit() result in opening a database? If so, |
| 1645 | ** clean it up now. This is very important because some commands do not |
| 1646 | ** expect the repository and/or the configuration ("user") database to be |
| 1647 | ** open prior to their own code doing so. |
| 1648 | */ |
| 1649 | if( TH_INIT_HOOK & TH_INIT_NEED_CONFIG ) Th_CloseConfig(1); |
| 1650 | return rc; |
| 1651 | } |
| 1652 | #endif |
| 1653 | |
| 1654 | /* |
| 1655 | ** The z[] input contains text mixed with TH1 scripts. |
| 1656 | ** The TH1 scripts are contained within <th1>...</th1>. |
| 1657 | ** TH1 variables are $aaa or $<aaa>. The first form of |
| 1658 | ** variable is literal. The second is run through htmlize |
| @@ -1259,12 +1715,16 @@ | |
| 1715 | |
| 1716 | /* |
| 1717 | ** COMMAND: test-th-render |
| 1718 | */ |
| 1719 | void test_th_render(void){ |
| 1720 | int forceCgi, fullHttpReply; |
| 1721 | Blob in; |
| 1722 | Th_InitTraceLog(); |
| 1723 | forceCgi = find_option("th-force-cgi", 0, 0)!=0; |
| 1724 | fullHttpReply = find_option("th-full-http", 0, 0)!=0; |
| 1725 | if( forceCgi ) Th_ForceCgi(fullHttpReply); |
| 1726 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1727 | Th_OpenConfig(1); |
| 1728 | } |
| 1729 | if( g.argc<3 ){ |
| 1730 | usage("FILE"); |
| @@ -1271,19 +1731,24 @@ | |
| 1731 | } |
| 1732 | blob_zero(&in); |
| 1733 | blob_read_from_file(&in, g.argv[2]); |
| 1734 | Th_Render(blob_str(&in)); |
| 1735 | Th_PrintTraceLog(); |
| 1736 | if( forceCgi ) cgi_reply(); |
| 1737 | } |
| 1738 | |
| 1739 | /* |
| 1740 | ** COMMAND: test-th-eval |
| 1741 | */ |
| 1742 | void test_th_eval(void){ |
| 1743 | int rc; |
| 1744 | const char *zRc; |
| 1745 | int forceCgi, fullHttpReply; |
| 1746 | Th_InitTraceLog(); |
| 1747 | forceCgi = find_option("th-force-cgi", 0, 0)!=0; |
| 1748 | fullHttpReply = find_option("th-full-http", 0, 0)!=0; |
| 1749 | if( forceCgi ) Th_ForceCgi(fullHttpReply); |
| 1750 | if( find_option("th-open-config", 0, 0)!=0 ){ |
| 1751 | Th_OpenConfig(1); |
| 1752 | } |
| 1753 | if( g.argc!=3 ){ |
| 1754 | usage("script"); |
| @@ -1291,6 +1756,45 @@ | |
| 1756 | Th_FossilInit(TH_INIT_DEFAULT); |
| 1757 | rc = Th_Eval(g.interp, 0, g.argv[2], -1); |
| 1758 | zRc = Th_ReturnCodeName(rc, 1); |
| 1759 | fossil_print("%s%s%s\n", zRc, zRc ? ": " : "", Th_GetResult(g.interp, 0)); |
| 1760 | Th_PrintTraceLog(); |
| 1761 | if( forceCgi ) cgi_reply(); |
| 1762 | } |
| 1763 | |
| 1764 | #ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 1765 | /* |
| 1766 | ** COMMAND: test-th-hook |
| 1767 | */ |
| 1768 | void test_th_hook(void){ |
| 1769 | int rc = TH_OK; |
| 1770 | int nResult = 0; |
| 1771 | char *zResult; |
| 1772 | int forceCgi, fullHttpReply; |
| 1773 | Th_InitTraceLog(); |
| 1774 | forceCgi = find_option("th-force-cgi", 0, 0)!=0; |
| 1775 | fullHttpReply = find_option("th-full-http", 0, 0)!=0; |
| 1776 | if( forceCgi ) Th_ForceCgi(fullHttpReply); |
| 1777 | if( g.argc<5 ){ |
| 1778 | usage("TYPE NAME FLAGS"); |
| 1779 | } |
| 1780 | if( fossil_stricmp(g.argv[2], "cmdhook")==0 ){ |
| 1781 | rc = Th_CommandHook(g.argv[3], (char)atoi(g.argv[4])); |
| 1782 | }else if( fossil_stricmp(g.argv[2], "cmdnotify")==0 ){ |
| 1783 | rc = Th_CommandNotify(g.argv[3], (char)atoi(g.argv[4])); |
| 1784 | }else if( fossil_stricmp(g.argv[2], "webhook")==0 ){ |
| 1785 | rc = Th_WebpageHook(g.argv[3], (char)atoi(g.argv[4])); |
| 1786 | }else if( fossil_stricmp(g.argv[2], "webnotify")==0 ){ |
| 1787 | rc = Th_WebpageNotify(g.argv[3], (char)atoi(g.argv[4])); |
| 1788 | }else{ |
| 1789 | fossil_fatal("Unknown TH1 hook %s\n", g.argv[2]); |
| 1790 | } |
| 1791 | zResult = (char*)Th_GetResult(g.interp, &nResult); |
| 1792 | sendText("RESULT (", -1, 0); |
| 1793 | sendText(Th_ReturnCodeName(rc, 0), -1, 0); |
| 1794 | sendText("): ", -1, 0); |
| 1795 | sendText(zResult, nResult, 0); |
| 1796 | sendText("\n", -1, 0); |
| 1797 | Th_PrintTraceLog(); |
| 1798 | if( forceCgi ) cgi_reply(); |
| 1799 | } |
| 1800 | #endif |
| 1801 |
+1
-7
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1780,17 +1780,11 @@ | ||
| 1780 | 1780 | width = atoi(zWidth); |
| 1781 | 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | 1783 | } |
| 1784 | 1784 | }else{ |
| 1785 | -#ifdef TIOCGWINSZ | |
| 1786 | - struct winsize w; | |
| 1787 | - ioctl(0, TIOCGWINSZ, &w); | |
| 1788 | - width = w.ws_col; | |
| 1789 | -#else | |
| 1790 | - width = 79; | |
| 1791 | -#endif | |
| 1785 | + width = -1; | |
| 1792 | 1786 | } |
| 1793 | 1787 | zOffset = find_option("offset",0,1); |
| 1794 | 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1795 | 1789 | if( g.argc>=4 ){ |
| 1796 | 1790 | k = strlen(g.argv[2]); |
| 1797 | 1791 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,17 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | #ifdef TIOCGWINSZ |
| 1786 | struct winsize w; |
| 1787 | ioctl(0, TIOCGWINSZ, &w); |
| 1788 | width = w.ws_col; |
| 1789 | #else |
| 1790 | width = 79; |
| 1791 | #endif |
| 1792 | } |
| 1793 | zOffset = find_option("offset",0,1); |
| 1794 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1795 | if( g.argc>=4 ){ |
| 1796 | k = strlen(g.argv[2]); |
| 1797 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,17 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | width = -1; |
| 1786 | } |
| 1787 | zOffset = find_option("offset",0,1); |
| 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1789 | if( g.argc>=4 ){ |
| 1790 | k = strlen(g.argv[2]); |
| 1791 |
+1
-7
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1780,17 +1780,11 @@ | ||
| 1780 | 1780 | width = atoi(zWidth); |
| 1781 | 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | 1783 | } |
| 1784 | 1784 | }else{ |
| 1785 | -#ifdef TIOCGWINSZ | |
| 1786 | - struct winsize w; | |
| 1787 | - ioctl(0, TIOCGWINSZ, &w); | |
| 1788 | - width = w.ws_col; | |
| 1789 | -#else | |
| 1790 | - width = 79; | |
| 1791 | -#endif | |
| 1785 | + width = -1; | |
| 1792 | 1786 | } |
| 1793 | 1787 | zOffset = find_option("offset",0,1); |
| 1794 | 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1795 | 1789 | if( g.argc>=4 ){ |
| 1796 | 1790 | k = strlen(g.argv[2]); |
| 1797 | 1791 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,17 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | #ifdef TIOCGWINSZ |
| 1786 | struct winsize w; |
| 1787 | ioctl(0, TIOCGWINSZ, &w); |
| 1788 | width = w.ws_col; |
| 1789 | #else |
| 1790 | width = 79; |
| 1791 | #endif |
| 1792 | } |
| 1793 | zOffset = find_option("offset",0,1); |
| 1794 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1795 | if( g.argc>=4 ){ |
| 1796 | k = strlen(g.argv[2]); |
| 1797 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1780,17 +1780,11 @@ | |
| 1780 | width = atoi(zWidth); |
| 1781 | if( (width!=0) && (width<=20) ){ |
| 1782 | fossil_fatal("-W|--width value must be >20 or 0"); |
| 1783 | } |
| 1784 | }else{ |
| 1785 | width = -1; |
| 1786 | } |
| 1787 | zOffset = find_option("offset",0,1); |
| 1788 | iOffset = zOffset ? atoi(zOffset) : 0; |
| 1789 | if( g.argc>=4 ){ |
| 1790 | k = strlen(g.argv[2]); |
| 1791 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -1264,11 +1264,11 @@ | ||
| 1264 | 1264 | fossil_print(" Change "); |
| 1265 | 1265 | } |
| 1266 | 1266 | fossil_print("%h: ",z); |
| 1267 | 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | - comment_print(blob_str(&val),4,79); | |
| 1269 | + comment_print(blob_str(&val),4,-1); | |
| 1270 | 1270 | }else{ |
| 1271 | 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | 1272 | } |
| 1273 | 1273 | blob_reset(&val); |
| 1274 | 1274 | } |
| 1275 | 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,79); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,-1); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -1264,11 +1264,11 @@ | ||
| 1264 | 1264 | fossil_print(" Change "); |
| 1265 | 1265 | } |
| 1266 | 1266 | fossil_print("%h: ",z); |
| 1267 | 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | - comment_print(blob_str(&val),4,79); | |
| 1269 | + comment_print(blob_str(&val),4,-1); | |
| 1270 | 1270 | }else{ |
| 1271 | 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | 1272 | } |
| 1273 | 1273 | blob_reset(&val); |
| 1274 | 1274 | } |
| 1275 | 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,79); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -1264,11 +1264,11 @@ | |
| 1264 | fossil_print(" Change "); |
| 1265 | } |
| 1266 | fossil_print("%h: ",z); |
| 1267 | if( blob_size(&val)>50 || contains_newline(&val)) { |
| 1268 | fossil_print("\n ",blob_str(&val)); |
| 1269 | comment_print(blob_str(&val),4,-1); |
| 1270 | }else{ |
| 1271 | fossil_print("%s\n",blob_str(&val)); |
| 1272 | } |
| 1273 | blob_reset(&val); |
| 1274 | } |
| 1275 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -130,11 +130,11 @@ | ||
| 130 | 130 | capture_case_sensitive_option(); |
| 131 | 131 | db_must_be_within_tree(); |
| 132 | 132 | vid = db_lget_int("checkout", 0); |
| 133 | 133 | user_select(); |
| 134 | 134 | if( !dryRunFlag && !internalUpdate ){ |
| 135 | - if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, | |
| 135 | + if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, | |
| 136 | 136 | db_get_int("autosync-tries", 1)) ){ |
| 137 | 137 | fossil_fatal("Cannot proceed with update"); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | capture_case_sensitive_option(); |
| 131 | db_must_be_within_tree(); |
| 132 | vid = db_lget_int("checkout", 0); |
| 133 | user_select(); |
| 134 | if( !dryRunFlag && !internalUpdate ){ |
| 135 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 136 | db_get_int("autosync-tries", 1)) ){ |
| 137 | fossil_fatal("Cannot proceed with update"); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -130,11 +130,11 @@ | |
| 130 | capture_case_sensitive_option(); |
| 131 | db_must_be_within_tree(); |
| 132 | vid = db_lget_int("checkout", 0); |
| 133 | user_select(); |
| 134 | if( !dryRunFlag && !internalUpdate ){ |
| 135 | if( autosync_loop(SYNC_PULL + SYNC_VERBOSE*verboseFlag, |
| 136 | db_get_int("autosync-tries", 1)) ){ |
| 137 | fossil_fatal("Cannot proceed with update"); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 |
+1
-1
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -674,11 +674,11 @@ | ||
| 674 | 674 | const char *zPassword = find_option("password", "W", 1); |
| 675 | 675 | const char *zPort = find_option("port", "P", 1); |
| 676 | 676 | const char *zNotFound = find_option("notfound", 0, 1); |
| 677 | 677 | const char *zFileGlob = find_option("files", 0, 1); |
| 678 | 678 | const char *zLocalAuth = find_option("localauth", 0, 0); |
| 679 | - const char *zRepository = find_option("repository", "R", 1); | |
| 679 | + const char *zRepository = find_repository_option(); | |
| 680 | 680 | int useSCGI = find_option("scgi", 0, 0)!=0; |
| 681 | 681 | Blob binPath; |
| 682 | 682 | |
| 683 | 683 | verify_all_options(); |
| 684 | 684 | if( g.argc==4 ){ |
| 685 | 685 | |
| 686 | 686 | ADDED test/subdir-b/readme.txt |
| 687 | 687 | ADDED test/subdir/one/two/three/four/five/six/readme.txt |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -674,11 +674,11 @@ | |
| 674 | const char *zPassword = find_option("password", "W", 1); |
| 675 | const char *zPort = find_option("port", "P", 1); |
| 676 | const char *zNotFound = find_option("notfound", 0, 1); |
| 677 | const char *zFileGlob = find_option("files", 0, 1); |
| 678 | const char *zLocalAuth = find_option("localauth", 0, 0); |
| 679 | const char *zRepository = find_option("repository", "R", 1); |
| 680 | int useSCGI = find_option("scgi", 0, 0)!=0; |
| 681 | Blob binPath; |
| 682 | |
| 683 | verify_all_options(); |
| 684 | if( g.argc==4 ){ |
| 685 | |
| 686 | DDED test/subdir-b/readme.txt |
| 687 | DDED test/subdir/one/two/three/four/five/six/readme.txt |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -674,11 +674,11 @@ | |
| 674 | const char *zPassword = find_option("password", "W", 1); |
| 675 | const char *zPort = find_option("port", "P", 1); |
| 676 | const char *zNotFound = find_option("notfound", 0, 1); |
| 677 | const char *zFileGlob = find_option("files", 0, 1); |
| 678 | const char *zLocalAuth = find_option("localauth", 0, 0); |
| 679 | const char *zRepository = find_repository_option(); |
| 680 | int useSCGI = find_option("scgi", 0, 0)!=0; |
| 681 | Blob binPath; |
| 682 | |
| 683 | verify_all_options(); |
| 684 | if( g.argc==4 ){ |
| 685 | |
| 686 | DDED test/subdir-b/readme.txt |
| 687 | DDED test/subdir/one/two/three/four/five/six/readme.txt |
| --- a/test/subdir-b/readme.txt | ||
| +++ b/test/subdir-b/readme.txt | ||
| @@ -0,0 +1,3 @@ | ||
| 1 | +This file exists in order to create the "subdir-b" subdirectory. There is | |
| 2 | +exists sibling directory "subdir" that is a prefix of this subdirectory. | |
| 3 | +This file exists for self-testing. |
| --- a/test/subdir-b/readme.txt | |
| +++ b/test/subdir-b/readme.txt | |
| @@ -0,0 +1,3 @@ | |
| --- a/test/subdir-b/readme.txt | |
| +++ b/test/subdir-b/readme.txt | |
| @@ -0,0 +1,3 @@ | |
| 1 | This file exists in order to create the "subdir-b" subdirectory. There is |
| 2 | exists sibling directory "subdir" that is a prefix of this subdirectory. |
| 3 | This file exists for self-testing. |
| --- a/test/subdir/one/two/three/four/five/six/readme.txt | ||
| +++ b/test/subdir/one/two/three/four/five/six/readme.txt | ||
| @@ -0,0 +1,2 @@ | ||
| 1 | +This file exists in order to provide Fossil with a test case of a file | |
| 2 | +that is deeply nested below many subdirectories. |
| --- a/test/subdir/one/two/three/four/five/six/readme.txt | |
| +++ b/test/subdir/one/two/three/four/five/six/readme.txt | |
| @@ -0,0 +1,2 @@ | |
| --- a/test/subdir/one/two/three/four/five/six/readme.txt | |
| +++ b/test/subdir/one/two/three/four/five/six/readme.txt | |
| @@ -0,0 +1,2 @@ | |
| 1 | This file exists in order to provide Fossil with a test case of a file |
| 2 | that is deeply nested below many subdirectories. |
+59
| --- test/tester.tcl | ||
| +++ test/tester.tcl | ||
| @@ -181,10 +181,69 @@ | ||
| 181 | 181 | # Append all arguments into a single value and then returns it. |
| 182 | 182 | # |
| 183 | 183 | proc appendArgs {args} { |
| 184 | 184 | eval append result $args |
| 185 | 185 | } |
| 186 | + | |
| 187 | +# Return the name of the versioned settings file containing the TH1 | |
| 188 | +# setup script. | |
| 189 | +# | |
| 190 | +proc getTh1SetupFileName {} { | |
| 191 | + # | |
| 192 | + # NOTE: This uses the "testdir" global variable provided by the | |
| 193 | + # test suite; alternatively, the root of the source tree | |
| 194 | + # could be obtained directly from Fossil. | |
| 195 | + # | |
| 196 | + return [file normalize [file join [file dirname $::testdir] \ | |
| 197 | + .fossil-settings th1-setup]] | |
| 198 | +} | |
| 199 | + | |
| 200 | +# Return the saved name of the versioned settings file containing | |
| 201 | +# the TH1 setup script. | |
| 202 | +# | |
| 203 | +proc getSavedTh1SetupFileName {} { | |
| 204 | + return [appendArgs [getTh1SetupFileName] . [pid]] | |
| 205 | +} | |
| 206 | + | |
| 207 | +# Sets the TH1 setup script to the one provided. Prior to calling | |
| 208 | +# this, the [saveTh1SetupFile] procedure should be called in order to | |
| 209 | +# preserve the existing TH1 setup script. Prior to completing the test, | |
| 210 | +# the [restoreTh1SetupFile] procedure should be called to restore the | |
| 211 | +# original TH1 setup script. | |
| 212 | +# | |
| 213 | +proc writeTh1SetupFile { data } { | |
| 214 | + return [write_file [getTh1SetupFileName] $data] | |
| 215 | +} | |
| 216 | + | |
| 217 | +# Saves the TH1 setup script file by renaming it, based on the current | |
| 218 | +# process ID. | |
| 219 | +# | |
| 220 | +proc saveTh1SetupFile {} { | |
| 221 | + set oldFileName [getTh1SetupFileName] | |
| 222 | + if {[file exists $oldFileName]} then { | |
| 223 | + set newFileName [getSavedTh1SetupFileName] | |
| 224 | + catch {file delete $newFileName} | |
| 225 | + file rename $oldFileName $newFileName | |
| 226 | + } | |
| 227 | +} | |
| 228 | + | |
| 229 | +# Restores the original TH1 setup script file by renaming it back, based | |
| 230 | +# on the current process ID. | |
| 231 | +# | |
| 232 | +proc restoreTh1SetupFile {} { | |
| 233 | + set oldFileName [getSavedTh1SetupFileName] | |
| 234 | + set newFileName [getTh1SetupFileName] | |
| 235 | + if {[file exists $oldFileName]} then { | |
| 236 | + catch {file delete $newFileName} | |
| 237 | + file rename $oldFileName $newFileName | |
| 238 | + } else { | |
| 239 | + # | |
| 240 | + # NOTE: There was no TH1 setup script file, delete the test one. | |
| 241 | + # | |
| 242 | + file delete $newFileName | |
| 243 | + } | |
| 244 | +} | |
| 186 | 245 | |
| 187 | 246 | # Perform a test |
| 188 | 247 | # |
| 189 | 248 | set test_count 0 |
| 190 | 249 | proc test {name expr} { |
| 191 | 250 | |
| 192 | 251 | ADDED test/th1-hooks-input.txt |
| 193 | 252 | ADDED test/th1-hooks.test |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -181,10 +181,69 @@ | |
| 181 | # Append all arguments into a single value and then returns it. |
| 182 | # |
| 183 | proc appendArgs {args} { |
| 184 | eval append result $args |
| 185 | } |
| 186 | |
| 187 | # Perform a test |
| 188 | # |
| 189 | set test_count 0 |
| 190 | proc test {name expr} { |
| 191 | |
| 192 | DDED test/th1-hooks-input.txt |
| 193 | DDED test/th1-hooks.test |
| --- test/tester.tcl | |
| +++ test/tester.tcl | |
| @@ -181,10 +181,69 @@ | |
| 181 | # Append all arguments into a single value and then returns it. |
| 182 | # |
| 183 | proc appendArgs {args} { |
| 184 | eval append result $args |
| 185 | } |
| 186 | |
| 187 | # Return the name of the versioned settings file containing the TH1 |
| 188 | # setup script. |
| 189 | # |
| 190 | proc getTh1SetupFileName {} { |
| 191 | # |
| 192 | # NOTE: This uses the "testdir" global variable provided by the |
| 193 | # test suite; alternatively, the root of the source tree |
| 194 | # could be obtained directly from Fossil. |
| 195 | # |
| 196 | return [file normalize [file join [file dirname $::testdir] \ |
| 197 | .fossil-settings th1-setup]] |
| 198 | } |
| 199 | |
| 200 | # Return the saved name of the versioned settings file containing |
| 201 | # the TH1 setup script. |
| 202 | # |
| 203 | proc getSavedTh1SetupFileName {} { |
| 204 | return [appendArgs [getTh1SetupFileName] . [pid]] |
| 205 | } |
| 206 | |
| 207 | # Sets the TH1 setup script to the one provided. Prior to calling |
| 208 | # this, the [saveTh1SetupFile] procedure should be called in order to |
| 209 | # preserve the existing TH1 setup script. Prior to completing the test, |
| 210 | # the [restoreTh1SetupFile] procedure should be called to restore the |
| 211 | # original TH1 setup script. |
| 212 | # |
| 213 | proc writeTh1SetupFile { data } { |
| 214 | return [write_file [getTh1SetupFileName] $data] |
| 215 | } |
| 216 | |
| 217 | # Saves the TH1 setup script file by renaming it, based on the current |
| 218 | # process ID. |
| 219 | # |
| 220 | proc saveTh1SetupFile {} { |
| 221 | set oldFileName [getTh1SetupFileName] |
| 222 | if {[file exists $oldFileName]} then { |
| 223 | set newFileName [getSavedTh1SetupFileName] |
| 224 | catch {file delete $newFileName} |
| 225 | file rename $oldFileName $newFileName |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | # Restores the original TH1 setup script file by renaming it back, based |
| 230 | # on the current process ID. |
| 231 | # |
| 232 | proc restoreTh1SetupFile {} { |
| 233 | set oldFileName [getSavedTh1SetupFileName] |
| 234 | set newFileName [getTh1SetupFileName] |
| 235 | if {[file exists $oldFileName]} then { |
| 236 | catch {file delete $newFileName} |
| 237 | file rename $oldFileName $newFileName |
| 238 | } else { |
| 239 | # |
| 240 | # NOTE: There was no TH1 setup script file, delete the test one. |
| 241 | # |
| 242 | file delete $newFileName |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | # Perform a test |
| 247 | # |
| 248 | set test_count 0 |
| 249 | proc test {name expr} { |
| 250 | |
| 251 | DDED test/th1-hooks-input.txt |
| 252 | DDED test/th1-hooks.test |
| --- a/test/th1-hooks-input.txt | ||
| +++ b/test/th1-hooks-input.txt | ||
| @@ -0,0 +1,4 @@ | ||
| 1 | +GET ${url} HTTP/1.1 | |
| 2 | +Host: localhost | |
| 3 | +User-Agent: Fossil | |
| 4 | + |
| --- a/test/th1-hooks-input.txt | |
| +++ b/test/th1-hooks-input.txt | |
| @@ -0,0 +1,4 @@ | |
| --- a/test/th1-hooks-input.txt | |
| +++ b/test/th1-hooks-input.txt | |
| @@ -0,0 +1,4 @@ | |
| 1 | GET ${url} HTTP/1.1 |
| 2 | Host: localhost |
| 3 | User-Agent: Fossil |
| 4 |
+88
| --- a/test/th1-hooks.test | ||
| +++ b/test/th1-hooks.test | ||
| @@ -0,0 +1,88 @@ | ||
| 1 | +# | |
| 2 | +# Co# | |
| 3 | +# Copyright (c) 2011 D. Richard Hipp | |
| 4 | +# | |
| 5 | +# This program is free software; you can redistribute i1 D. Richard Hipp | |
| 6 | +# | |
| 7 | +# This program is free software; you can redistribute it and/or | |
| 8 | +# modify it under the terms of the Simplified BSD License (also | |
| 9 | +# known as the "2-Clause License" or "FreeBSD License".) | |
| 10 | +# | |
| 11 | +# This program is distributed in the hope that it will be useful, | |
| 12 | +# but without any warranty; without even the implied warranty of | |
| 13 | +# merchantability or fitness for a particular purpose. | |
| 14 | +# | |
| 15 | +# Author contact information: | |
| 16 | +# [email protected] | |
| 17 | +# http://www.hwaci.com/drh/ | |
| 18 | +# | |
| 19 | +#################################$::RESULT | |
| 20 | +# TH1 Hooks | |
| 21 | +# | |
| 22 | + | |
| 23 | +fossil test-th-eval then "hasfeature th1Hooks" | |
| 24 | + | |
| 25 | +if {[normalize_result] ne "1"} { | |
| 26 | + ; compiled with TH1 hooks support." | |
| 27 | + test_cleanup_then_return | |
| 28 | +} | |
| 29 | + | |
| 30 | +######################### | |
| 31 | + | |
| 32 | +set env(TH1_ustom"} { | |
| 33 | + append {$::cmd_name eq "test4"} { | |
| 34 | + then{<title>Fossilproc fossil_th1_hook_http { repository url } { | |
| 35 | + set suffix [appendArgs [pid] - [getSeqNo] - [clmpPath [appendArgs test-hmpPath [appendArgs test-http-ou set data [subst [read_fil]] | |
| 36 | + | |
| 37 | + write_file $inFileName $data | |
| 38 | + fossil http $inFileName $outFileName 127.0.0.1 $repository | |
| 39 | + set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}] | |
| 40 | + | |
| 41 | + if {1} then { | |
| 42 | + catch {file delete $inFileName} | |
| 43 | + catch {frepository } | |
| 44 | + | |
| 45 | + return $result | |
| 46 | +} | |
| 47 | + | |
| 48 | +proc normat | |
| 49 | +} | |
| 50 | + | |
| 51 | +proc normalize_result {} { | |
| 52 | + return [string map [list \r\n \n] [string trim $::RESULT]] | |
| 53 | +} | |
| 54 | + | |
| 55 | +proc first_data_line {}\n] 0] | |
| 56 | +} | |
| 57 | + | |
| 58 | +proc second_data_line {}\n] 1] | |
| 59 | +} | |
| 60 | + | |
| 61 | +proc third_data_line {}\n] 2] | |
| 62 | +} | |
| 63 | + | |
| 64 | +proc lD. Richard Hipp | |
| 65 | +#\nlit \n] end-1] | |
| 66 | +} | |
| 67 | + | |
| 68 | +proc \rlit \n] end-1] | |
| 69 | +} | |
| 70 | + | |
| 71 | +proc \rlit \n] end-1] | |
| 72 | +} | |
| 73 | + | |
| 74 | +proc \rlit \n] end-1] | |
| 75 | +} | |
| 76 | + | |
| 77 | +proc \rlit \n] end-1] | |
| 78 | +} | |
| 79 | + | |
| 80 | +proc \r\n] end-1] | |
| 81 | +if {$::cmd_argsc {} { | |
| 82 | + return [lindex [split \n] end-1] | |
| 83 | +} | |
| 84 | + | |
| 85 | +proc # | |
| 86 | +# Co# | |
| 87 | +# Copyright (c)ght (c) 2lit \n] end-1RESULT]] eq | |
| 88 | +timeline}}2b {[secondtimeline}}2cthird_data_line]]}2dest3est4web-hooks-1b {[regexp |
| --- a/test/th1-hooks.test | |
| +++ b/test/th1-hooks.test | |
| @@ -0,0 +1,88 @@ | |
| --- a/test/th1-hooks.test | |
| +++ b/test/th1-hooks.test | |
| @@ -0,0 +1,88 @@ | |
| 1 | # |
| 2 | # Co# |
| 3 | # Copyright (c) 2011 D. Richard Hipp |
| 4 | # |
| 5 | # This program is free software; you can redistribute i1 D. Richard Hipp |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or |
| 8 | # modify it under the terms of the Simplified BSD License (also |
| 9 | # known as the "2-Clause License" or "FreeBSD License".) |
| 10 | # |
| 11 | # This program is distributed in the hope that it will be useful, |
| 12 | # but without any warranty; without even the implied warranty of |
| 13 | # merchantability or fitness for a particular purpose. |
| 14 | # |
| 15 | # Author contact information: |
| 16 | # [email protected] |
| 17 | # http://www.hwaci.com/drh/ |
| 18 | # |
| 19 | #################################$::RESULT |
| 20 | # TH1 Hooks |
| 21 | # |
| 22 | |
| 23 | fossil test-th-eval then "hasfeature th1Hooks" |
| 24 | |
| 25 | if {[normalize_result] ne "1"} { |
| 26 | ; compiled with TH1 hooks support." |
| 27 | test_cleanup_then_return |
| 28 | } |
| 29 | |
| 30 | ######################### |
| 31 | |
| 32 | set env(TH1_ustom"} { |
| 33 | append {$::cmd_name eq "test4"} { |
| 34 | then{<title>Fossilproc fossil_th1_hook_http { repository url } { |
| 35 | set suffix [appendArgs [pid] - [getSeqNo] - [clmpPath [appendArgs test-hmpPath [appendArgs test-http-ou set data [subst [read_fil]] |
| 36 | |
| 37 | write_file $inFileName $data |
| 38 | fossil http $inFileName $outFileName 127.0.0.1 $repository |
| 39 | set result [expr {[file exists $outFileName] ? [read_file $outFileName] : ""}] |
| 40 | |
| 41 | if {1} then { |
| 42 | catch {file delete $inFileName} |
| 43 | catch {frepository } |
| 44 | |
| 45 | return $result |
| 46 | } |
| 47 | |
| 48 | proc normat |
| 49 | } |
| 50 | |
| 51 | proc normalize_result {} { |
| 52 | return [string map [list \r\n \n] [string trim $::RESULT]] |
| 53 | } |
| 54 | |
| 55 | proc first_data_line {}\n] 0] |
| 56 | } |
| 57 | |
| 58 | proc second_data_line {}\n] 1] |
| 59 | } |
| 60 | |
| 61 | proc third_data_line {}\n] 2] |
| 62 | } |
| 63 | |
| 64 | proc lD. Richard Hipp |
| 65 | #\nlit \n] end-1] |
| 66 | } |
| 67 | |
| 68 | proc \rlit \n] end-1] |
| 69 | } |
| 70 | |
| 71 | proc \rlit \n] end-1] |
| 72 | } |
| 73 | |
| 74 | proc \rlit \n] end-1] |
| 75 | } |
| 76 | |
| 77 | proc \rlit \n] end-1] |
| 78 | } |
| 79 | |
| 80 | proc \r\n] end-1] |
| 81 | if {$::cmd_argsc {} { |
| 82 | return [lindex [split \n] end-1] |
| 83 | } |
| 84 | |
| 85 | proc # |
| 86 | # Co# |
| 87 | # Copyright (c)ght (c) 2lit \n] end-1RESULT]] eq |
| 88 | timeline}}2b {[secondtimeline}}2cthird_data_line]]}2dest3est4web-hooks-1b {[regexp |
+158
| --- test/th1.test | ||
| +++ test/th1.test | ||
| @@ -16,10 +16,15 @@ | ||
| 16 | 16 | ############################################################################ |
| 17 | 17 | # |
| 18 | 18 | # TH1 Commands |
| 19 | 19 | # |
| 20 | 20 | |
| 21 | +fossil test-th-eval --th-open-config "setting th1-hooks" | |
| 22 | +set th1Hooks [expr {$RESULT eq "1"}] | |
| 23 | + | |
| 24 | +############################################################################### | |
| 25 | + | |
| 21 | 26 | fossil test-th-eval --th-open-config "setting abc" |
| 22 | 27 | test th1-setting-1 {$RESULT eq ""} |
| 23 | 28 | |
| 24 | 29 | ############################################################################### |
| 25 | 30 | |
| @@ -472,5 +477,158 @@ | ||
| 472 | 477 | |
| 473 | 478 | ############################################################################### |
| 474 | 479 | |
| 475 | 480 | fossil test-th-eval "expr 0+0b" |
| 476 | 481 | test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}} |
| 482 | + | |
| 483 | +############################################################################### | |
| 484 | + | |
| 485 | +fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree". | |
| 486 | +test th1-checkout-1 {[string length $RESULT] > 0} | |
| 487 | + | |
| 488 | +############################################################################### | |
| 489 | + | |
| 490 | +fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree". | |
| 491 | +test th1-checkout-2 {[string length $RESULT] > 0} | |
| 492 | + | |
| 493 | +############################################################################### | |
| 494 | + | |
| 495 | +set savedPwd [pwd]; cd / | |
| 496 | +fossil test-th-eval "checkout 1" | |
| 497 | +cd $savedPwd; unset savedPwd | |
| 498 | +test th1-checkout-3 {[string length $RESULT] == 0} | |
| 499 | + | |
| 500 | +############################################################################### | |
| 501 | + | |
| 502 | +set savedPwd [pwd]; cd / | |
| 503 | +fossil test-th-eval "checkout" | |
| 504 | +cd $savedPwd; unset savedPwd | |
| 505 | +test th1-checkout-4 {[string length $RESULT] == 0} | |
| 506 | + | |
| 507 | +############################################################################### | |
| 508 | + | |
| 509 | +fossil test-th-eval "render {}" | |
| 510 | +test th1-render-1 {$RESULT eq {}} | |
| 511 | + | |
| 512 | +############################################################################### | |
| 513 | + | |
| 514 | +fossil test-th-eval "render {$<x> before <th1>set x 123</th1> after $<x> }" | |
| 515 | +test th1-render-2 {$RESULT eq {no such variable: x before after 123 }} | |
| 516 | + | |
| 517 | +############################################################################### | |
| 518 | + | |
| 519 | +fossil test-th-eval "trace {}" | |
| 520 | +test th1-trace-1 {$RESULT eq {}} | |
| 521 | + | |
| 522 | +############################################################################### | |
| 523 | + | |
| 524 | +fossil test-th-eval --th-trace "trace {}" | |
| 525 | +if {$th1Hooks} { | |
| 526 | + test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 527 | +{------------------ BEGIN TRACE LOG ------------------ | |
| 528 | + | |
| 529 | +------------------- END TRACE LOG -------------------}} | |
| 530 | +} else { | |
| 531 | + test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 532 | + {------------------ BEGIN TRACE LOG ------------------ | |
| 533 | +th1-setup {} => TH_OK<br /> | |
| 534 | + | |
| 535 | +------------------- END TRACE LOG -------------------}} | |
| 536 | +} | |
| 537 | + | |
| 538 | +############################################################################### | |
| 539 | + | |
| 540 | +fossil test-th-eval "trace {this is a trace message.}" | |
| 541 | +test th1-trace-3 {$RESULT eq {}} | |
| 542 | + | |
| 543 | +############################################################################### | |
| 544 | + | |
| 545 | +fossil test-th-eval --th-trace "trace {this is a trace message.}" | |
| 546 | +if {$th1Hooks} { | |
| 547 | + test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 548 | + {------------------ BEGIN TRACE LOG ------------------ | |
| 549 | +this is a trace message. | |
| 550 | +------------------- END TRACE LOG -------------------}} | |
| 551 | +} else { | |
| 552 | + test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ | |
| 553 | + {------------------ BEGIN TRACE LOG ------------------ | |
| 554 | +th1-setup {} => TH_OK<br /> | |
| 555 | +this is a trace message. | |
| 556 | +------------------- END TRACE LOG -------------------}} | |
| 557 | +} | |
| 558 | + | |
| 559 | +############################################################################### | |
| 560 | + | |
| 561 | +fossil test-th-eval "styleHeader {Page Title Here}" | |
| 562 | +test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}} | |
| 563 | + | |
| 564 | +############################################################################### | |
| 565 | + | |
| 566 | +fossil test-th-eval --th-open-config "styleHeader {Page Title Here}" | |
| 567 | +test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]} | |
| 568 | + | |
| 569 | +############################################################################### | |
| 570 | + | |
| 571 | +fossil test-th-eval "styleFooter" | |
| 572 | +test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}} | |
| 573 | + | |
| 574 | +############################################################################### | |
| 575 | + | |
| 576 | +fossil test-th-eval --th-open-config "styleFooter" | |
| 577 | +test th1-footer-2 {$RESULT eq {}} | |
| 578 | + | |
| 579 | +############################################################################### | |
| 580 | + | |
| 581 | +fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter" | |
| 582 | +test th1-footer-3 {[regexp -- {</body></html>} $RESULT]} | |
| 583 | + | |
| 584 | +############################################################################### | |
| 585 | + | |
| 586 | +fossil test-th-eval "getParameter" | |
| 587 | +test th1-get-parameter-1 {$RESULT eq \ | |
| 588 | + {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}} | |
| 589 | + | |
| 590 | +############################################################################### | |
| 591 | + | |
| 592 | +fossil test-th-eval "getParameter test1" | |
| 593 | +test th1-get-parameter-2 {$RESULT eq {}} | |
| 594 | + | |
| 595 | +############################################################################### | |
| 596 | + | |
| 597 | +fossil test-th-eval "getParameter test1 defValue1" | |
| 598 | +test th1-get-parameter-3 {$RESULT eq {defValue1}} | |
| 599 | + | |
| 600 | +############################################################################### | |
| 601 | + | |
| 602 | +fossil test-th-eval "setParameter" | |
| 603 | +test th1-set-parameter-1 {$RESULT eq \ | |
| 604 | + {TH_ERROR: wrong # args: should be "setParameter NAME VALUE"}} | |
| 605 | + | |
| 606 | +############################################################################### | |
| 607 | + | |
| 608 | +fossil test-th-eval "setParameter test1 value1; getParameter test1" | |
| 609 | +test th1-set-parameter-2 {$RESULT eq {value1}} | |
| 610 | + | |
| 611 | +############################################################################### | |
| 612 | + | |
| 613 | +fossil test-th-eval "setParameter test2 value2; getParameter test1" | |
| 614 | +test th1-set-parameter-3 {$RESULT eq {}} | |
| 615 | + | |
| 616 | +############################################################################### | |
| 617 | + | |
| 618 | +fossil test-th-eval "setParameter test3 value3; getParameter test3" | |
| 619 | +test th1-set-parameter-4 {$RESULT eq {value3}} | |
| 620 | + | |
| 621 | +############################################################################### | |
| 622 | + | |
| 623 | +fossil test-th-eval "setParameter test3 value3; getParameter test3 defValue3" | |
| 624 | +test th1-set-parameter-5 {$RESULT eq {value3}} | |
| 625 | + | |
| 626 | +############################################################################### | |
| 627 | + | |
| 628 | +fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4" | |
| 629 | +test th1-set-parameter-6 {$RESULT eq {value5}} | |
| 630 | + | |
| 631 | +############################################################################### | |
| 632 | + | |
| 633 | +fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4" | |
| 634 | +test th1-set-parameter-7 {$RESULT eq {value5}} | |
| 477 | 635 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -16,10 +16,15 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # TH1 Commands |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval --th-open-config "setting abc" |
| 22 | test th1-setting-1 {$RESULT eq ""} |
| 23 | |
| 24 | ############################################################################### |
| 25 | |
| @@ -472,5 +477,158 @@ | |
| 472 | |
| 473 | ############################################################################### |
| 474 | |
| 475 | fossil test-th-eval "expr 0+0b" |
| 476 | test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}} |
| 477 |
| --- test/th1.test | |
| +++ test/th1.test | |
| @@ -16,10 +16,15 @@ | |
| 16 | ############################################################################ |
| 17 | # |
| 18 | # TH1 Commands |
| 19 | # |
| 20 | |
| 21 | fossil test-th-eval --th-open-config "setting th1-hooks" |
| 22 | set th1Hooks [expr {$RESULT eq "1"}] |
| 23 | |
| 24 | ############################################################################### |
| 25 | |
| 26 | fossil test-th-eval --th-open-config "setting abc" |
| 27 | test th1-setting-1 {$RESULT eq ""} |
| 28 | |
| 29 | ############################################################################### |
| 30 | |
| @@ -472,5 +477,158 @@ | |
| 477 | |
| 478 | ############################################################################### |
| 479 | |
| 480 | fossil test-th-eval "expr 0+0b" |
| 481 | test th1-expr-35 {$RESULT eq {TH_ERROR: expected number, got: "0b"}} |
| 482 | |
| 483 | ############################################################################### |
| 484 | |
| 485 | fossil test-th-eval "checkout 1"; # NOTE: Assumes running "in tree". |
| 486 | test th1-checkout-1 {[string length $RESULT] > 0} |
| 487 | |
| 488 | ############################################################################### |
| 489 | |
| 490 | fossil test-th-eval "checkout"; # NOTE: Assumes running "in tree". |
| 491 | test th1-checkout-2 {[string length $RESULT] > 0} |
| 492 | |
| 493 | ############################################################################### |
| 494 | |
| 495 | set savedPwd [pwd]; cd / |
| 496 | fossil test-th-eval "checkout 1" |
| 497 | cd $savedPwd; unset savedPwd |
| 498 | test th1-checkout-3 {[string length $RESULT] == 0} |
| 499 | |
| 500 | ############################################################################### |
| 501 | |
| 502 | set savedPwd [pwd]; cd / |
| 503 | fossil test-th-eval "checkout" |
| 504 | cd $savedPwd; unset savedPwd |
| 505 | test th1-checkout-4 {[string length $RESULT] == 0} |
| 506 | |
| 507 | ############################################################################### |
| 508 | |
| 509 | fossil test-th-eval "render {}" |
| 510 | test th1-render-1 {$RESULT eq {}} |
| 511 | |
| 512 | ############################################################################### |
| 513 | |
| 514 | fossil test-th-eval "render {$<x> before <th1>set x 123</th1> after $<x> }" |
| 515 | test th1-render-2 {$RESULT eq {no such variable: x before after 123 }} |
| 516 | |
| 517 | ############################################################################### |
| 518 | |
| 519 | fossil test-th-eval "trace {}" |
| 520 | test th1-trace-1 {$RESULT eq {}} |
| 521 | |
| 522 | ############################################################################### |
| 523 | |
| 524 | fossil test-th-eval --th-trace "trace {}" |
| 525 | if {$th1Hooks} { |
| 526 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 527 | {------------------ BEGIN TRACE LOG ------------------ |
| 528 | |
| 529 | ------------------- END TRACE LOG -------------------}} |
| 530 | } else { |
| 531 | test th1-trace-2 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 532 | {------------------ BEGIN TRACE LOG ------------------ |
| 533 | th1-setup {} => TH_OK<br /> |
| 534 | |
| 535 | ------------------- END TRACE LOG -------------------}} |
| 536 | } |
| 537 | |
| 538 | ############################################################################### |
| 539 | |
| 540 | fossil test-th-eval "trace {this is a trace message.}" |
| 541 | test th1-trace-3 {$RESULT eq {}} |
| 542 | |
| 543 | ############################################################################### |
| 544 | |
| 545 | fossil test-th-eval --th-trace "trace {this is a trace message.}" |
| 546 | if {$th1Hooks} { |
| 547 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 548 | {------------------ BEGIN TRACE LOG ------------------ |
| 549 | this is a trace message. |
| 550 | ------------------- END TRACE LOG -------------------}} |
| 551 | } else { |
| 552 | test th1-trace-4 {[string map [list \r\n \n] [string trim $RESULT]] eq \ |
| 553 | {------------------ BEGIN TRACE LOG ------------------ |
| 554 | th1-setup {} => TH_OK<br /> |
| 555 | this is a trace message. |
| 556 | ------------------- END TRACE LOG -------------------}} |
| 557 | } |
| 558 | |
| 559 | ############################################################################### |
| 560 | |
| 561 | fossil test-th-eval "styleHeader {Page Title Here}" |
| 562 | test th1-header-1 {$RESULT eq {TH_ERROR: repository unavailable}} |
| 563 | |
| 564 | ############################################################################### |
| 565 | |
| 566 | fossil test-th-eval --th-open-config "styleHeader {Page Title Here}" |
| 567 | test th1-header-2 {[regexp -- {<title>Fossil: Page Title Here</title>} $RESULT]} |
| 568 | |
| 569 | ############################################################################### |
| 570 | |
| 571 | fossil test-th-eval "styleFooter" |
| 572 | test th1-footer-1 {$RESULT eq {TH_ERROR: repository unavailable}} |
| 573 | |
| 574 | ############################################################################### |
| 575 | |
| 576 | fossil test-th-eval --th-open-config "styleFooter" |
| 577 | test th1-footer-2 {$RESULT eq {}} |
| 578 | |
| 579 | ############################################################################### |
| 580 | |
| 581 | fossil test-th-eval --th-open-config --th-force-cgi "styleHeader {}; styleFooter" |
| 582 | test th1-footer-3 {[regexp -- {</body></html>} $RESULT]} |
| 583 | |
| 584 | ############################################################################### |
| 585 | |
| 586 | fossil test-th-eval "getParameter" |
| 587 | test th1-get-parameter-1 {$RESULT eq \ |
| 588 | {TH_ERROR: wrong # args: should be "getParameter NAME ?DEFAULT?"}} |
| 589 | |
| 590 | ############################################################################### |
| 591 | |
| 592 | fossil test-th-eval "getParameter test1" |
| 593 | test th1-get-parameter-2 {$RESULT eq {}} |
| 594 | |
| 595 | ############################################################################### |
| 596 | |
| 597 | fossil test-th-eval "getParameter test1 defValue1" |
| 598 | test th1-get-parameter-3 {$RESULT eq {defValue1}} |
| 599 | |
| 600 | ############################################################################### |
| 601 | |
| 602 | fossil test-th-eval "setParameter" |
| 603 | test th1-set-parameter-1 {$RESULT eq \ |
| 604 | {TH_ERROR: wrong # args: should be "setParameter NAME VALUE"}} |
| 605 | |
| 606 | ############################################################################### |
| 607 | |
| 608 | fossil test-th-eval "setParameter test1 value1; getParameter test1" |
| 609 | test th1-set-parameter-2 {$RESULT eq {value1}} |
| 610 | |
| 611 | ############################################################################### |
| 612 | |
| 613 | fossil test-th-eval "setParameter test2 value2; getParameter test1" |
| 614 | test th1-set-parameter-3 {$RESULT eq {}} |
| 615 | |
| 616 | ############################################################################### |
| 617 | |
| 618 | fossil test-th-eval "setParameter test3 value3; getParameter test3" |
| 619 | test th1-set-parameter-4 {$RESULT eq {value3}} |
| 620 | |
| 621 | ############################################################################### |
| 622 | |
| 623 | fossil test-th-eval "setParameter test3 value3; getParameter test3 defValue3" |
| 624 | test th1-set-parameter-5 {$RESULT eq {value3}} |
| 625 | |
| 626 | ############################################################################### |
| 627 | |
| 628 | fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4" |
| 629 | test th1-set-parameter-6 {$RESULT eq {value5}} |
| 630 | |
| 631 | ############################################################################### |
| 632 | |
| 633 | fossil test-th-eval "setParameter test4 value4; setParameter test4 value5; getParameter test4 defValue4" |
| 634 | test th1-set-parameter-7 {$RESULT eq {value5}} |
| 635 |
+10
-4
| --- win/Makefile.dmc | ||
| +++ win/Makefile.dmc | ||
| @@ -28,13 +28,13 @@ | ||
| 28 | 28 | |
| 29 | 29 | SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS |
| 30 | 30 | |
| 31 | 31 | SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | 32 | |
| 33 | -SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c | |
| 33 | +SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c fusefs_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c | |
| 34 | 34 | |
| 35 | -OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O | |
| 35 | +OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | RC=$(DMDIR)\bin\rcc |
| 39 | 39 | RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__ |
| 40 | 40 | |
| @@ -48,11 +48,11 @@ | ||
| 48 | 48 | |
| 49 | 49 | $(OBJDIR)\fossil.res: $B\win\fossil.rc |
| 50 | 50 | $(RC) $(RCFLAGS) -o$@ $** |
| 51 | 51 | |
| 52 | 52 | $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res |
| 53 | - +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@ | |
| 53 | + +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo fusefs glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@ | |
| 54 | 54 | +echo fossil >> $@ |
| 55 | 55 | +echo fossil >> $@ |
| 56 | 56 | +echo $(LIBS) >> $@ |
| 57 | 57 | +echo. >> $@ |
| 58 | 58 | +echo fossil >> $@ |
| @@ -292,10 +292,16 @@ | ||
| 292 | 292 | $(OBJDIR)\finfo$O : finfo_.c finfo.h |
| 293 | 293 | $(TCC) -o$@ -c finfo_.c |
| 294 | 294 | |
| 295 | 295 | finfo_.c : $(SRCDIR)\finfo.c |
| 296 | 296 | +translate$E $** > $@ |
| 297 | + | |
| 298 | +$(OBJDIR)\fusefs$O : fusefs_.c fusefs.h | |
| 299 | + $(TCC) -o$@ -c fusefs_.c | |
| 300 | + | |
| 301 | +fusefs_.c : $(SRCDIR)\fusefs.c | |
| 302 | + +translate$E $** > $@ | |
| 297 | 303 | |
| 298 | 304 | $(OBJDIR)\glob$O : glob_.c glob.h |
| 299 | 305 | $(TCC) -o$@ -c glob_.c |
| 300 | 306 | |
| 301 | 307 | glob_.c : $(SRCDIR)\glob.c |
| @@ -774,7 +780,7 @@ | ||
| 774 | 780 | |
| 775 | 781 | zip_.c : $(SRCDIR)\zip.c |
| 776 | 782 | +translate$E $** > $@ |
| 777 | 783 | |
| 778 | 784 | headers: makeheaders$E page_index.h VERSION.h |
| 779 | - +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h | |
| 785 | + +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h fusefs_.c:fusefs.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h | |
| 780 | 786 | @copy /Y nul: headers |
| 781 | 787 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -28,13 +28,13 @@ | |
| 28 | |
| 29 | SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS |
| 30 | |
| 31 | SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | |
| 33 | SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c |
| 34 | |
| 35 | OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O |
| 36 | |
| 37 | |
| 38 | RC=$(DMDIR)\bin\rcc |
| 39 | RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__ |
| 40 | |
| @@ -48,11 +48,11 @@ | |
| 48 | |
| 49 | $(OBJDIR)\fossil.res: $B\win\fossil.rc |
| 50 | $(RC) $(RCFLAGS) -o$@ $** |
| 51 | |
| 52 | $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res |
| 53 | +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@ |
| 54 | +echo fossil >> $@ |
| 55 | +echo fossil >> $@ |
| 56 | +echo $(LIBS) >> $@ |
| 57 | +echo. >> $@ |
| 58 | +echo fossil >> $@ |
| @@ -292,10 +292,16 @@ | |
| 292 | $(OBJDIR)\finfo$O : finfo_.c finfo.h |
| 293 | $(TCC) -o$@ -c finfo_.c |
| 294 | |
| 295 | finfo_.c : $(SRCDIR)\finfo.c |
| 296 | +translate$E $** > $@ |
| 297 | |
| 298 | $(OBJDIR)\glob$O : glob_.c glob.h |
| 299 | $(TCC) -o$@ -c glob_.c |
| 300 | |
| 301 | glob_.c : $(SRCDIR)\glob.c |
| @@ -774,7 +780,7 @@ | |
| 774 | |
| 775 | zip_.c : $(SRCDIR)\zip.c |
| 776 | +translate$E $** > $@ |
| 777 | |
| 778 | headers: makeheaders$E page_index.h VERSION.h |
| 779 | +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h |
| 780 | @copy /Y nul: headers |
| 781 |
| --- win/Makefile.dmc | |
| +++ win/Makefile.dmc | |
| @@ -28,13 +28,13 @@ | |
| 28 | |
| 29 | SQLITE_OPTIONS = -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_ENABLE_LOCKING_STYLE=0 -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_FILE_FORMAT=4 -DSQLITE_OMIT_DEPRECATED -DSQLITE_ENABLE_EXPLAIN_COMMENTS |
| 30 | |
| 31 | SHELL_OPTIONS = -Dmain=sqlite3_shell -DSQLITE_OMIT_LOAD_EXTENSION=1 -DUSE_SYSTEM_SQLITE=$(USE_SYSTEM_SQLITE) -DSQLITE_SHELL_DBNAME_PROC=fossil_open -Daccess=file_access -Dgetenv=fossil_getenv -Dfopen=fossil_fopen |
| 32 | |
| 33 | SRC = add_.c allrepo_.c attach_.c bag_.c bisect_.c blob_.c branch_.c browse_.c cache_.c captcha_.c cgi_.c checkin_.c checkout_.c clearsign_.c clone_.c comformat_.c configure_.c content_.c db_.c delta_.c deltacmd_.c descendants_.c diff_.c diffcmd_.c doc_.c encode_.c event_.c export_.c file_.c finfo_.c fusefs_.c glob_.c graph_.c gzip_.c http_.c http_socket_.c http_ssl_.c http_transport_.c import_.c info_.c json_.c json_artifact_.c json_branch_.c json_config_.c json_diff_.c json_dir_.c json_finfo_.c json_login_.c json_query_.c json_report_.c json_status_.c json_tag_.c json_timeline_.c json_user_.c json_wiki_.c leaf_.c loadctrl_.c login_.c lookslike_.c main_.c manifest_.c markdown_.c markdown_html_.c md5_.c merge_.c merge3_.c moderate_.c name_.c path_.c pivot_.c popen_.c pqueue_.c printf_.c rebuild_.c regexp_.c report_.c rss_.c schema_.c search_.c setup_.c sha1_.c shun_.c skins_.c sqlcmd_.c stash_.c stat_.c style_.c sync_.c tag_.c tar_.c th_main_.c timeline_.c tkt_.c tktsetup_.c undo_.c unicode_.c update_.c url_.c user_.c utf8_.c util_.c verify_.c vfile_.c wiki_.c wikiformat_.c winfile_.c winhttp_.c wysiwyg_.c xfer_.c xfersetup_.c zip_.c |
| 34 | |
| 35 | OBJ = $(OBJDIR)\add$O $(OBJDIR)\allrepo$O $(OBJDIR)\attach$O $(OBJDIR)\bag$O $(OBJDIR)\bisect$O $(OBJDIR)\blob$O $(OBJDIR)\branch$O $(OBJDIR)\browse$O $(OBJDIR)\cache$O $(OBJDIR)\captcha$O $(OBJDIR)\cgi$O $(OBJDIR)\checkin$O $(OBJDIR)\checkout$O $(OBJDIR)\clearsign$O $(OBJDIR)\clone$O $(OBJDIR)\comformat$O $(OBJDIR)\configure$O $(OBJDIR)\content$O $(OBJDIR)\db$O $(OBJDIR)\delta$O $(OBJDIR)\deltacmd$O $(OBJDIR)\descendants$O $(OBJDIR)\diff$O $(OBJDIR)\diffcmd$O $(OBJDIR)\doc$O $(OBJDIR)\encode$O $(OBJDIR)\event$O $(OBJDIR)\export$O $(OBJDIR)\file$O $(OBJDIR)\finfo$O $(OBJDIR)\fusefs$O $(OBJDIR)\glob$O $(OBJDIR)\graph$O $(OBJDIR)\gzip$O $(OBJDIR)\http$O $(OBJDIR)\http_socket$O $(OBJDIR)\http_ssl$O $(OBJDIR)\http_transport$O $(OBJDIR)\import$O $(OBJDIR)\info$O $(OBJDIR)\json$O $(OBJDIR)\json_artifact$O $(OBJDIR)\json_branch$O $(OBJDIR)\json_config$O $(OBJDIR)\json_diff$O $(OBJDIR)\json_dir$O $(OBJDIR)\json_finfo$O $(OBJDIR)\json_login$O $(OBJDIR)\json_query$O $(OBJDIR)\json_report$O $(OBJDIR)\json_status$O $(OBJDIR)\json_tag$O $(OBJDIR)\json_timeline$O $(OBJDIR)\json_user$O $(OBJDIR)\json_wiki$O $(OBJDIR)\leaf$O $(OBJDIR)\loadctrl$O $(OBJDIR)\login$O $(OBJDIR)\lookslike$O $(OBJDIR)\main$O $(OBJDIR)\manifest$O $(OBJDIR)\markdown$O $(OBJDIR)\markdown_html$O $(OBJDIR)\md5$O $(OBJDIR)\merge$O $(OBJDIR)\merge3$O $(OBJDIR)\moderate$O $(OBJDIR)\name$O $(OBJDIR)\path$O $(OBJDIR)\pivot$O $(OBJDIR)\popen$O $(OBJDIR)\pqueue$O $(OBJDIR)\printf$O $(OBJDIR)\rebuild$O $(OBJDIR)\regexp$O $(OBJDIR)\report$O $(OBJDIR)\rss$O $(OBJDIR)\schema$O $(OBJDIR)\search$O $(OBJDIR)\setup$O $(OBJDIR)\sha1$O $(OBJDIR)\shun$O $(OBJDIR)\skins$O $(OBJDIR)\sqlcmd$O $(OBJDIR)\stash$O $(OBJDIR)\stat$O $(OBJDIR)\style$O $(OBJDIR)\sync$O $(OBJDIR)\tag$O $(OBJDIR)\tar$O $(OBJDIR)\th_main$O $(OBJDIR)\timeline$O $(OBJDIR)\tkt$O $(OBJDIR)\tktsetup$O $(OBJDIR)\undo$O $(OBJDIR)\unicode$O $(OBJDIR)\update$O $(OBJDIR)\url$O $(OBJDIR)\user$O $(OBJDIR)\utf8$O $(OBJDIR)\util$O $(OBJDIR)\verify$O $(OBJDIR)\vfile$O $(OBJDIR)\wiki$O $(OBJDIR)\wikiformat$O $(OBJDIR)\winfile$O $(OBJDIR)\winhttp$O $(OBJDIR)\wysiwyg$O $(OBJDIR)\xfer$O $(OBJDIR)\xfersetup$O $(OBJDIR)\zip$O $(OBJDIR)\shell$O $(OBJDIR)\sqlite3$O $(OBJDIR)\th$O $(OBJDIR)\th_lang$O |
| 36 | |
| 37 | |
| 38 | RC=$(DMDIR)\bin\rcc |
| 39 | RCFLAGS=-32 -w1 -I$(SRCDIR) /D__DMC__ |
| 40 | |
| @@ -48,11 +48,11 @@ | |
| 48 | |
| 49 | $(OBJDIR)\fossil.res: $B\win\fossil.rc |
| 50 | $(RC) $(RCFLAGS) -o$@ $** |
| 51 | |
| 52 | $(OBJDIR)\link: $B\win\Makefile.dmc $(OBJDIR)\fossil.res |
| 53 | +echo add allrepo attach bag bisect blob branch browse cache captcha cgi checkin checkout clearsign clone comformat configure content db delta deltacmd descendants diff diffcmd doc encode event export file finfo fusefs glob graph gzip http http_socket http_ssl http_transport import info json json_artifact json_branch json_config json_diff json_dir json_finfo json_login json_query json_report json_status json_tag json_timeline json_user json_wiki leaf loadctrl login lookslike main manifest markdown markdown_html md5 merge merge3 moderate name path pivot popen pqueue printf rebuild regexp report rss schema search setup sha1 shun skins sqlcmd stash stat style sync tag tar th_main timeline tkt tktsetup undo unicode update url user utf8 util verify vfile wiki wikiformat winfile winhttp wysiwyg xfer xfersetup zip shell sqlite3 th th_lang > $@ |
| 54 | +echo fossil >> $@ |
| 55 | +echo fossil >> $@ |
| 56 | +echo $(LIBS) >> $@ |
| 57 | +echo. >> $@ |
| 58 | +echo fossil >> $@ |
| @@ -292,10 +292,16 @@ | |
| 292 | $(OBJDIR)\finfo$O : finfo_.c finfo.h |
| 293 | $(TCC) -o$@ -c finfo_.c |
| 294 | |
| 295 | finfo_.c : $(SRCDIR)\finfo.c |
| 296 | +translate$E $** > $@ |
| 297 | |
| 298 | $(OBJDIR)\fusefs$O : fusefs_.c fusefs.h |
| 299 | $(TCC) -o$@ -c fusefs_.c |
| 300 | |
| 301 | fusefs_.c : $(SRCDIR)\fusefs.c |
| 302 | +translate$E $** > $@ |
| 303 | |
| 304 | $(OBJDIR)\glob$O : glob_.c glob.h |
| 305 | $(TCC) -o$@ -c glob_.c |
| 306 | |
| 307 | glob_.c : $(SRCDIR)\glob.c |
| @@ -774,7 +780,7 @@ | |
| 780 | |
| 781 | zip_.c : $(SRCDIR)\zip.c |
| 782 | +translate$E $** > $@ |
| 783 | |
| 784 | headers: makeheaders$E page_index.h VERSION.h |
| 785 | +makeheaders$E add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h bisect_.c:bisect.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h cache_.c:cache.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h fusefs_.c:fusefs.h glob_.c:glob.h graph_.c:graph.h gzip_.c:gzip.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h json_.c:json.h json_artifact_.c:json_artifact.h json_branch_.c:json_branch.h json_config_.c:json_config.h json_diff_.c:json_diff.h json_dir_.c:json_dir.h json_finfo_.c:json_finfo.h json_login_.c:json_login.h json_query_.c:json_query.h json_report_.c:json_report.h json_status_.c:json_status.h json_tag_.c:json_tag.h json_timeline_.c:json_timeline.h json_user_.c:json_user.h json_wiki_.c:json_wiki.h leaf_.c:leaf.h loadctrl_.c:loadctrl.h login_.c:login.h lookslike_.c:lookslike.h main_.c:main.h manifest_.c:manifest.h markdown_.c:markdown.h markdown_html_.c:markdown_html.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h moderate_.c:moderate.h name_.c:name.h path_.c:path.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h regexp_.c:regexp.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h sqlcmd_.c:sqlcmd.h stash_.c:stash.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h tar_.c:tar.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h unicode_.c:unicode.h update_.c:update.h url_.c:url.h user_.c:user.h utf8_.c:utf8.h util_.c:util.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winfile_.c:winfile.h winhttp_.c:winhttp.h wysiwyg_.c:wysiwyg.h xfer_.c:xfer.h xfersetup_.c:xfersetup.h zip_.c:zip.h $(SRCDIR)\sqlite3.h $(SRCDIR)\th.h VERSION.h $(SRCDIR)\cson_amalgamation.h |
| 786 | @copy /Y nul: headers |
| 787 |
+32
-1
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -47,10 +47,14 @@ | ||
| 47 | 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | 48 | |
| 49 | 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | 50 | # |
| 51 | 51 | # FOSSIL_ENABLE_SSL = 1 |
| 52 | + | |
| 53 | +#### Enable hooks for commands and web pages via TH1 | |
| 54 | +# | |
| 55 | +# FOSSIL_ENABLE_TH1_HOOKS = 1 | |
| 52 | 56 | |
| 53 | 57 | #### Enable scripting support via Tcl/Tk |
| 54 | 58 | # |
| 55 | 59 | # FOSSIL_ENABLE_TCL = 1 |
| 56 | 60 | |
| @@ -176,10 +180,16 @@ | ||
| 176 | 180 | # With HTTPS support |
| 177 | 181 | ifdef FOSSIL_ENABLE_SSL |
| 178 | 182 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 179 | 183 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 180 | 184 | endif |
| 185 | + | |
| 186 | +# With TH1 hook support | |
| 187 | +ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 188 | +TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 189 | +RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 190 | +endif | |
| 181 | 191 | |
| 182 | 192 | # With Tcl support |
| 183 | 193 | ifdef FOSSIL_ENABLE_TCL |
| 184 | 194 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 185 | 195 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | ||
| 251 | 261 | # |
| 252 | 262 | TCLSH = tclsh |
| 253 | 263 | |
| 254 | 264 | #### Nullsoft installer MakeNSIS location |
| 255 | 265 | # |
| 256 | -MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" | |
| 266 | +MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" | |
| 267 | + | |
| 268 | +#### Inno Setup executable location | |
| 269 | +# | |
| 270 | +INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" | |
| 257 | 271 | |
| 258 | 272 | #### Include a configuration file that can override any one of these settings. |
| 259 | 273 | # |
| 260 | 274 | -include config.w32 |
| 261 | 275 | |
| @@ -293,10 +307,11 @@ | ||
| 293 | 307 | $(SRCDIR)/encode.c \ |
| 294 | 308 | $(SRCDIR)/event.c \ |
| 295 | 309 | $(SRCDIR)/export.c \ |
| 296 | 310 | $(SRCDIR)/file.c \ |
| 297 | 311 | $(SRCDIR)/finfo.c \ |
| 312 | + $(SRCDIR)/fusefs.c \ | |
| 298 | 313 | $(SRCDIR)/glob.c \ |
| 299 | 314 | $(SRCDIR)/graph.c \ |
| 300 | 315 | $(SRCDIR)/gzip.c \ |
| 301 | 316 | $(SRCDIR)/http.c \ |
| 302 | 317 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | ||
| 405 | 420 | $(OBJDIR)/encode_.c \ |
| 406 | 421 | $(OBJDIR)/event_.c \ |
| 407 | 422 | $(OBJDIR)/export_.c \ |
| 408 | 423 | $(OBJDIR)/file_.c \ |
| 409 | 424 | $(OBJDIR)/finfo_.c \ |
| 425 | + $(OBJDIR)/fusefs_.c \ | |
| 410 | 426 | $(OBJDIR)/glob_.c \ |
| 411 | 427 | $(OBJDIR)/graph_.c \ |
| 412 | 428 | $(OBJDIR)/gzip_.c \ |
| 413 | 429 | $(OBJDIR)/http_.c \ |
| 414 | 430 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | ||
| 517 | 533 | $(OBJDIR)/encode.o \ |
| 518 | 534 | $(OBJDIR)/event.o \ |
| 519 | 535 | $(OBJDIR)/export.o \ |
| 520 | 536 | $(OBJDIR)/file.o \ |
| 521 | 537 | $(OBJDIR)/finfo.o \ |
| 538 | + $(OBJDIR)/fusefs.o \ | |
| 522 | 539 | $(OBJDIR)/glob.o \ |
| 523 | 540 | $(OBJDIR)/graph.o \ |
| 524 | 541 | $(OBJDIR)/gzip.o \ |
| 525 | 542 | $(OBJDIR)/http.o \ |
| 526 | 543 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | ||
| 612 | 629 | ifdef USE_WINDOWS |
| 613 | 630 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 614 | 631 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 615 | 632 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 616 | 633 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 634 | +CAT = type | |
| 617 | 635 | CP = copy |
| 618 | 636 | MV = copy |
| 619 | 637 | RM = del /Q |
| 620 | 638 | MKDIR = -mkdir |
| 621 | 639 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | ||
| 622 | 640 | else |
| 623 | 641 | TRANSLATE = $(OBJDIR)/translate |
| 624 | 642 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 625 | 643 | MKINDEX = $(OBJDIR)/mkindex |
| 626 | 644 | VERSION = $(OBJDIR)/version |
| 645 | +CAT = cat | |
| 627 | 646 | CP = cp |
| 628 | 647 | MV = mv |
| 629 | 648 | RM = rm -f |
| 630 | 649 | MKDIR = -mkdir -p |
| 631 | 650 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | ||
| 731 | 750 | endif |
| 732 | 751 | |
| 733 | 752 | setup: $(OBJDIR) $(APPNAME) |
| 734 | 753 | $(MAKENSIS) ./setup/fossil.nsi |
| 735 | 754 | |
| 755 | +innosetup: $(OBJDIR) $(APPNAME) | |
| 756 | + $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) | |
| 757 | + | |
| 736 | 758 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 737 | 759 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 738 | 760 | |
| 739 | 761 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 740 | 762 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | ||
| 765 | 787 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 766 | 788 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 767 | 789 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 768 | 790 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 769 | 791 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 792 | + $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \ | |
| 770 | 793 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 771 | 794 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 772 | 795 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 773 | 796 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 774 | 797 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | ||
| 1093 | 1116 | |
| 1094 | 1117 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1095 | 1118 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1096 | 1119 | |
| 1097 | 1120 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1121 | + | |
| 1122 | +$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate | |
| 1123 | + $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c | |
| 1124 | + | |
| 1125 | +$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h | |
| 1126 | + $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c | |
| 1127 | + | |
| 1128 | +$(OBJDIR)/fusefs.h: $(OBJDIR)/headers | |
| 1098 | 1129 | |
| 1099 | 1130 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1100 | 1131 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1101 | 1132 | |
| 1102 | 1133 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1103 | 1134 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -47,10 +47,14 @@ | |
| 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | # |
| 51 | # FOSSIL_ENABLE_SSL = 1 |
| 52 | |
| 53 | #### Enable scripting support via Tcl/Tk |
| 54 | # |
| 55 | # FOSSIL_ENABLE_TCL = 1 |
| 56 | |
| @@ -176,10 +180,16 @@ | |
| 176 | # With HTTPS support |
| 177 | ifdef FOSSIL_ENABLE_SSL |
| 178 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 179 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 180 | endif |
| 181 | |
| 182 | # With Tcl support |
| 183 | ifdef FOSSIL_ENABLE_TCL |
| 184 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 185 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | |
| 251 | # |
| 252 | TCLSH = tclsh |
| 253 | |
| 254 | #### Nullsoft installer MakeNSIS location |
| 255 | # |
| 256 | MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" |
| 257 | |
| 258 | #### Include a configuration file that can override any one of these settings. |
| 259 | # |
| 260 | -include config.w32 |
| 261 | |
| @@ -293,10 +307,11 @@ | |
| 293 | $(SRCDIR)/encode.c \ |
| 294 | $(SRCDIR)/event.c \ |
| 295 | $(SRCDIR)/export.c \ |
| 296 | $(SRCDIR)/file.c \ |
| 297 | $(SRCDIR)/finfo.c \ |
| 298 | $(SRCDIR)/glob.c \ |
| 299 | $(SRCDIR)/graph.c \ |
| 300 | $(SRCDIR)/gzip.c \ |
| 301 | $(SRCDIR)/http.c \ |
| 302 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | |
| 405 | $(OBJDIR)/encode_.c \ |
| 406 | $(OBJDIR)/event_.c \ |
| 407 | $(OBJDIR)/export_.c \ |
| 408 | $(OBJDIR)/file_.c \ |
| 409 | $(OBJDIR)/finfo_.c \ |
| 410 | $(OBJDIR)/glob_.c \ |
| 411 | $(OBJDIR)/graph_.c \ |
| 412 | $(OBJDIR)/gzip_.c \ |
| 413 | $(OBJDIR)/http_.c \ |
| 414 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | |
| 517 | $(OBJDIR)/encode.o \ |
| 518 | $(OBJDIR)/event.o \ |
| 519 | $(OBJDIR)/export.o \ |
| 520 | $(OBJDIR)/file.o \ |
| 521 | $(OBJDIR)/finfo.o \ |
| 522 | $(OBJDIR)/glob.o \ |
| 523 | $(OBJDIR)/graph.o \ |
| 524 | $(OBJDIR)/gzip.o \ |
| 525 | $(OBJDIR)/http.o \ |
| 526 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | |
| 612 | ifdef USE_WINDOWS |
| 613 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 614 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 615 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 616 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 617 | CP = copy |
| 618 | MV = copy |
| 619 | RM = del /Q |
| 620 | MKDIR = -mkdir |
| 621 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | |
| 622 | else |
| 623 | TRANSLATE = $(OBJDIR)/translate |
| 624 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 625 | MKINDEX = $(OBJDIR)/mkindex |
| 626 | VERSION = $(OBJDIR)/version |
| 627 | CP = cp |
| 628 | MV = mv |
| 629 | RM = rm -f |
| 630 | MKDIR = -mkdir -p |
| 631 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | |
| 731 | endif |
| 732 | |
| 733 | setup: $(OBJDIR) $(APPNAME) |
| 734 | $(MAKENSIS) ./setup/fossil.nsi |
| 735 | |
| 736 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 737 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 738 | |
| 739 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 740 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | |
| 765 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 766 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 767 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 768 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 769 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 770 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 771 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 772 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 773 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 774 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | |
| 1093 | |
| 1094 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1095 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1096 | |
| 1097 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1098 | |
| 1099 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1100 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1101 | |
| 1102 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1103 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -47,10 +47,14 @@ | |
| 47 | # FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | # |
| 51 | # FOSSIL_ENABLE_SSL = 1 |
| 52 | |
| 53 | #### Enable hooks for commands and web pages via TH1 |
| 54 | # |
| 55 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 56 | |
| 57 | #### Enable scripting support via Tcl/Tk |
| 58 | # |
| 59 | # FOSSIL_ENABLE_TCL = 1 |
| 60 | |
| @@ -176,10 +180,16 @@ | |
| 180 | # With HTTPS support |
| 181 | ifdef FOSSIL_ENABLE_SSL |
| 182 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 183 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 184 | endif |
| 185 | |
| 186 | # With TH1 hook support |
| 187 | ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 188 | TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 189 | RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 190 | endif |
| 191 | |
| 192 | # With Tcl support |
| 193 | ifdef FOSSIL_ENABLE_TCL |
| 194 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 195 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | |
| 261 | # |
| 262 | TCLSH = tclsh |
| 263 | |
| 264 | #### Nullsoft installer MakeNSIS location |
| 265 | # |
| 266 | MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" |
| 267 | |
| 268 | #### Inno Setup executable location |
| 269 | # |
| 270 | INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" |
| 271 | |
| 272 | #### Include a configuration file that can override any one of these settings. |
| 273 | # |
| 274 | -include config.w32 |
| 275 | |
| @@ -293,10 +307,11 @@ | |
| 307 | $(SRCDIR)/encode.c \ |
| 308 | $(SRCDIR)/event.c \ |
| 309 | $(SRCDIR)/export.c \ |
| 310 | $(SRCDIR)/file.c \ |
| 311 | $(SRCDIR)/finfo.c \ |
| 312 | $(SRCDIR)/fusefs.c \ |
| 313 | $(SRCDIR)/glob.c \ |
| 314 | $(SRCDIR)/graph.c \ |
| 315 | $(SRCDIR)/gzip.c \ |
| 316 | $(SRCDIR)/http.c \ |
| 317 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | |
| 420 | $(OBJDIR)/encode_.c \ |
| 421 | $(OBJDIR)/event_.c \ |
| 422 | $(OBJDIR)/export_.c \ |
| 423 | $(OBJDIR)/file_.c \ |
| 424 | $(OBJDIR)/finfo_.c \ |
| 425 | $(OBJDIR)/fusefs_.c \ |
| 426 | $(OBJDIR)/glob_.c \ |
| 427 | $(OBJDIR)/graph_.c \ |
| 428 | $(OBJDIR)/gzip_.c \ |
| 429 | $(OBJDIR)/http_.c \ |
| 430 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | |
| 533 | $(OBJDIR)/encode.o \ |
| 534 | $(OBJDIR)/event.o \ |
| 535 | $(OBJDIR)/export.o \ |
| 536 | $(OBJDIR)/file.o \ |
| 537 | $(OBJDIR)/finfo.o \ |
| 538 | $(OBJDIR)/fusefs.o \ |
| 539 | $(OBJDIR)/glob.o \ |
| 540 | $(OBJDIR)/graph.o \ |
| 541 | $(OBJDIR)/gzip.o \ |
| 542 | $(OBJDIR)/http.o \ |
| 543 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | |
| 629 | ifdef USE_WINDOWS |
| 630 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 631 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 632 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 633 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 634 | CAT = type |
| 635 | CP = copy |
| 636 | MV = copy |
| 637 | RM = del /Q |
| 638 | MKDIR = -mkdir |
| 639 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | |
| 640 | else |
| 641 | TRANSLATE = $(OBJDIR)/translate |
| 642 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 643 | MKINDEX = $(OBJDIR)/mkindex |
| 644 | VERSION = $(OBJDIR)/version |
| 645 | CAT = cat |
| 646 | CP = cp |
| 647 | MV = mv |
| 648 | RM = rm -f |
| 649 | MKDIR = -mkdir -p |
| 650 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | |
| 750 | endif |
| 751 | |
| 752 | setup: $(OBJDIR) $(APPNAME) |
| 753 | $(MAKENSIS) ./setup/fossil.nsi |
| 754 | |
| 755 | innosetup: $(OBJDIR) $(APPNAME) |
| 756 | $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) |
| 757 | |
| 758 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 759 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 760 | |
| 761 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 762 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | |
| 787 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 788 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 789 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 790 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 791 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 792 | $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \ |
| 793 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 794 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 795 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 796 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 797 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | |
| 1116 | |
| 1117 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1118 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1119 | |
| 1120 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1121 | |
| 1122 | $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate |
| 1123 | $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c |
| 1124 | |
| 1125 | $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h |
| 1126 | $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c |
| 1127 | |
| 1128 | $(OBJDIR)/fusefs.h: $(OBJDIR)/headers |
| 1129 | |
| 1130 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1131 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1132 | |
| 1133 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1134 |
+32
-1
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -47,10 +47,14 @@ | ||
| 47 | 47 | FOSSIL_ENABLE_JSON = 1 |
| 48 | 48 | |
| 49 | 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | 50 | # |
| 51 | 51 | FOSSIL_ENABLE_SSL = 1 |
| 52 | + | |
| 53 | +#### Enable hooks for commands and web pages via TH1 | |
| 54 | +# | |
| 55 | +FOSSIL_ENABLE_TH1_HOOKS = 1 | |
| 52 | 56 | |
| 53 | 57 | #### Enable scripting support via Tcl/Tk |
| 54 | 58 | # |
| 55 | 59 | FOSSIL_ENABLE_TCL = 1 |
| 56 | 60 | |
| @@ -176,10 +180,16 @@ | ||
| 176 | 180 | # With HTTPS support |
| 177 | 181 | ifdef FOSSIL_ENABLE_SSL |
| 178 | 182 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 179 | 183 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 180 | 184 | endif |
| 185 | + | |
| 186 | +# With TH1 hook support | |
| 187 | +ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 188 | +TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 189 | +RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 190 | +endif | |
| 181 | 191 | |
| 182 | 192 | # With Tcl support |
| 183 | 193 | ifdef FOSSIL_ENABLE_TCL |
| 184 | 194 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 185 | 195 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | ||
| 251 | 261 | # |
| 252 | 262 | TCLSH = tclsh |
| 253 | 263 | |
| 254 | 264 | #### Nullsoft installer MakeNSIS location |
| 255 | 265 | # |
| 256 | -MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" | |
| 266 | +MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" | |
| 267 | + | |
| 268 | +#### Inno Setup executable location | |
| 269 | +# | |
| 270 | +INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" | |
| 257 | 271 | |
| 258 | 272 | #### Include a configuration file that can override any one of these settings. |
| 259 | 273 | # |
| 260 | 274 | -include config.w32 |
| 261 | 275 | |
| @@ -293,10 +307,11 @@ | ||
| 293 | 307 | $(SRCDIR)/encode.c \ |
| 294 | 308 | $(SRCDIR)/event.c \ |
| 295 | 309 | $(SRCDIR)/export.c \ |
| 296 | 310 | $(SRCDIR)/file.c \ |
| 297 | 311 | $(SRCDIR)/finfo.c \ |
| 312 | + $(SRCDIR)/fusefs.c \ | |
| 298 | 313 | $(SRCDIR)/glob.c \ |
| 299 | 314 | $(SRCDIR)/graph.c \ |
| 300 | 315 | $(SRCDIR)/gzip.c \ |
| 301 | 316 | $(SRCDIR)/http.c \ |
| 302 | 317 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | ||
| 405 | 420 | $(OBJDIR)/encode_.c \ |
| 406 | 421 | $(OBJDIR)/event_.c \ |
| 407 | 422 | $(OBJDIR)/export_.c \ |
| 408 | 423 | $(OBJDIR)/file_.c \ |
| 409 | 424 | $(OBJDIR)/finfo_.c \ |
| 425 | + $(OBJDIR)/fusefs_.c \ | |
| 410 | 426 | $(OBJDIR)/glob_.c \ |
| 411 | 427 | $(OBJDIR)/graph_.c \ |
| 412 | 428 | $(OBJDIR)/gzip_.c \ |
| 413 | 429 | $(OBJDIR)/http_.c \ |
| 414 | 430 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | ||
| 517 | 533 | $(OBJDIR)/encode.o \ |
| 518 | 534 | $(OBJDIR)/event.o \ |
| 519 | 535 | $(OBJDIR)/export.o \ |
| 520 | 536 | $(OBJDIR)/file.o \ |
| 521 | 537 | $(OBJDIR)/finfo.o \ |
| 538 | + $(OBJDIR)/fusefs.o \ | |
| 522 | 539 | $(OBJDIR)/glob.o \ |
| 523 | 540 | $(OBJDIR)/graph.o \ |
| 524 | 541 | $(OBJDIR)/gzip.o \ |
| 525 | 542 | $(OBJDIR)/http.o \ |
| 526 | 543 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | ||
| 612 | 629 | ifdef USE_WINDOWS |
| 613 | 630 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 614 | 631 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 615 | 632 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 616 | 633 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 634 | +CAT = type | |
| 617 | 635 | CP = copy |
| 618 | 636 | MV = copy |
| 619 | 637 | RM = del /Q |
| 620 | 638 | MKDIR = -mkdir |
| 621 | 639 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | ||
| 622 | 640 | else |
| 623 | 641 | TRANSLATE = $(OBJDIR)/translate |
| 624 | 642 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 625 | 643 | MKINDEX = $(OBJDIR)/mkindex |
| 626 | 644 | VERSION = $(OBJDIR)/version |
| 645 | +CAT = cat | |
| 627 | 646 | CP = cp |
| 628 | 647 | MV = mv |
| 629 | 648 | RM = rm -f |
| 630 | 649 | MKDIR = -mkdir -p |
| 631 | 650 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | ||
| 731 | 750 | endif |
| 732 | 751 | |
| 733 | 752 | setup: $(OBJDIR) $(APPNAME) |
| 734 | 753 | $(MAKENSIS) ./setup/fossil.nsi |
| 735 | 754 | |
| 755 | +innosetup: $(OBJDIR) $(APPNAME) | |
| 756 | + $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) | |
| 757 | + | |
| 736 | 758 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 737 | 759 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 738 | 760 | |
| 739 | 761 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 740 | 762 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | ||
| 765 | 787 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 766 | 788 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 767 | 789 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 768 | 790 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 769 | 791 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 792 | + $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \ | |
| 770 | 793 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 771 | 794 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 772 | 795 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 773 | 796 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 774 | 797 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | ||
| 1093 | 1116 | |
| 1094 | 1117 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1095 | 1118 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1096 | 1119 | |
| 1097 | 1120 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1121 | + | |
| 1122 | +$(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate | |
| 1123 | + $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c | |
| 1124 | + | |
| 1125 | +$(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h | |
| 1126 | + $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c | |
| 1127 | + | |
| 1128 | +$(OBJDIR)/fusefs.h: $(OBJDIR)/headers | |
| 1098 | 1129 | |
| 1099 | 1130 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1100 | 1131 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1101 | 1132 | |
| 1102 | 1133 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1103 | 1134 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -47,10 +47,14 @@ | |
| 47 | FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | # |
| 51 | FOSSIL_ENABLE_SSL = 1 |
| 52 | |
| 53 | #### Enable scripting support via Tcl/Tk |
| 54 | # |
| 55 | FOSSIL_ENABLE_TCL = 1 |
| 56 | |
| @@ -176,10 +180,16 @@ | |
| 176 | # With HTTPS support |
| 177 | ifdef FOSSIL_ENABLE_SSL |
| 178 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 179 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 180 | endif |
| 181 | |
| 182 | # With Tcl support |
| 183 | ifdef FOSSIL_ENABLE_TCL |
| 184 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 185 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | |
| 251 | # |
| 252 | TCLSH = tclsh |
| 253 | |
| 254 | #### Nullsoft installer MakeNSIS location |
| 255 | # |
| 256 | MAKENSIS = "$(ProgramFiles)\NSIS\MakeNSIS.exe" |
| 257 | |
| 258 | #### Include a configuration file that can override any one of these settings. |
| 259 | # |
| 260 | -include config.w32 |
| 261 | |
| @@ -293,10 +307,11 @@ | |
| 293 | $(SRCDIR)/encode.c \ |
| 294 | $(SRCDIR)/event.c \ |
| 295 | $(SRCDIR)/export.c \ |
| 296 | $(SRCDIR)/file.c \ |
| 297 | $(SRCDIR)/finfo.c \ |
| 298 | $(SRCDIR)/glob.c \ |
| 299 | $(SRCDIR)/graph.c \ |
| 300 | $(SRCDIR)/gzip.c \ |
| 301 | $(SRCDIR)/http.c \ |
| 302 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | |
| 405 | $(OBJDIR)/encode_.c \ |
| 406 | $(OBJDIR)/event_.c \ |
| 407 | $(OBJDIR)/export_.c \ |
| 408 | $(OBJDIR)/file_.c \ |
| 409 | $(OBJDIR)/finfo_.c \ |
| 410 | $(OBJDIR)/glob_.c \ |
| 411 | $(OBJDIR)/graph_.c \ |
| 412 | $(OBJDIR)/gzip_.c \ |
| 413 | $(OBJDIR)/http_.c \ |
| 414 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | |
| 517 | $(OBJDIR)/encode.o \ |
| 518 | $(OBJDIR)/event.o \ |
| 519 | $(OBJDIR)/export.o \ |
| 520 | $(OBJDIR)/file.o \ |
| 521 | $(OBJDIR)/finfo.o \ |
| 522 | $(OBJDIR)/glob.o \ |
| 523 | $(OBJDIR)/graph.o \ |
| 524 | $(OBJDIR)/gzip.o \ |
| 525 | $(OBJDIR)/http.o \ |
| 526 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | |
| 612 | ifdef USE_WINDOWS |
| 613 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 614 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 615 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 616 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 617 | CP = copy |
| 618 | MV = copy |
| 619 | RM = del /Q |
| 620 | MKDIR = -mkdir |
| 621 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | |
| 622 | else |
| 623 | TRANSLATE = $(OBJDIR)/translate |
| 624 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 625 | MKINDEX = $(OBJDIR)/mkindex |
| 626 | VERSION = $(OBJDIR)/version |
| 627 | CP = cp |
| 628 | MV = mv |
| 629 | RM = rm -f |
| 630 | MKDIR = -mkdir -p |
| 631 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | |
| 731 | endif |
| 732 | |
| 733 | setup: $(OBJDIR) $(APPNAME) |
| 734 | $(MAKENSIS) ./setup/fossil.nsi |
| 735 | |
| 736 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 737 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 738 | |
| 739 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 740 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | |
| 765 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 766 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 767 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 768 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 769 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 770 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 771 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 772 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 773 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 774 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | |
| 1093 | |
| 1094 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1095 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1096 | |
| 1097 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1098 | |
| 1099 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1100 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1101 | |
| 1102 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1103 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -47,10 +47,14 @@ | |
| 47 | FOSSIL_ENABLE_JSON = 1 |
| 48 | |
| 49 | #### Enable HTTPS support via OpenSSL (links to libssl and libcrypto) |
| 50 | # |
| 51 | FOSSIL_ENABLE_SSL = 1 |
| 52 | |
| 53 | #### Enable hooks for commands and web pages via TH1 |
| 54 | # |
| 55 | FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 56 | |
| 57 | #### Enable scripting support via Tcl/Tk |
| 58 | # |
| 59 | FOSSIL_ENABLE_TCL = 1 |
| 60 | |
| @@ -176,10 +180,16 @@ | |
| 180 | # With HTTPS support |
| 181 | ifdef FOSSIL_ENABLE_SSL |
| 182 | TCC += -DFOSSIL_ENABLE_SSL=1 |
| 183 | RCC += -DFOSSIL_ENABLE_SSL=1 |
| 184 | endif |
| 185 | |
| 186 | # With TH1 hook support |
| 187 | ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 188 | TCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 189 | RCC += -DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 190 | endif |
| 191 | |
| 192 | # With Tcl support |
| 193 | ifdef FOSSIL_ENABLE_TCL |
| 194 | TCC += -DFOSSIL_ENABLE_TCL=1 |
| 195 | RCC += -DFOSSIL_ENABLE_TCL=1 |
| @@ -251,11 +261,15 @@ | |
| 261 | # |
| 262 | TCLSH = tclsh |
| 263 | |
| 264 | #### Nullsoft installer MakeNSIS location |
| 265 | # |
| 266 | MAKENSIS = "$(PROGRAMFILES)\NSIS\MakeNSIS.exe" |
| 267 | |
| 268 | #### Inno Setup executable location |
| 269 | # |
| 270 | INNOSETUP = "$(PROGRAMFILES)\Inno Setup 5\ISCC.exe" |
| 271 | |
| 272 | #### Include a configuration file that can override any one of these settings. |
| 273 | # |
| 274 | -include config.w32 |
| 275 | |
| @@ -293,10 +307,11 @@ | |
| 307 | $(SRCDIR)/encode.c \ |
| 308 | $(SRCDIR)/event.c \ |
| 309 | $(SRCDIR)/export.c \ |
| 310 | $(SRCDIR)/file.c \ |
| 311 | $(SRCDIR)/finfo.c \ |
| 312 | $(SRCDIR)/fusefs.c \ |
| 313 | $(SRCDIR)/glob.c \ |
| 314 | $(SRCDIR)/graph.c \ |
| 315 | $(SRCDIR)/gzip.c \ |
| 316 | $(SRCDIR)/http.c \ |
| 317 | $(SRCDIR)/http_socket.c \ |
| @@ -405,10 +420,11 @@ | |
| 420 | $(OBJDIR)/encode_.c \ |
| 421 | $(OBJDIR)/event_.c \ |
| 422 | $(OBJDIR)/export_.c \ |
| 423 | $(OBJDIR)/file_.c \ |
| 424 | $(OBJDIR)/finfo_.c \ |
| 425 | $(OBJDIR)/fusefs_.c \ |
| 426 | $(OBJDIR)/glob_.c \ |
| 427 | $(OBJDIR)/graph_.c \ |
| 428 | $(OBJDIR)/gzip_.c \ |
| 429 | $(OBJDIR)/http_.c \ |
| 430 | $(OBJDIR)/http_socket_.c \ |
| @@ -517,10 +533,11 @@ | |
| 533 | $(OBJDIR)/encode.o \ |
| 534 | $(OBJDIR)/event.o \ |
| 535 | $(OBJDIR)/export.o \ |
| 536 | $(OBJDIR)/file.o \ |
| 537 | $(OBJDIR)/finfo.o \ |
| 538 | $(OBJDIR)/fusefs.o \ |
| 539 | $(OBJDIR)/glob.o \ |
| 540 | $(OBJDIR)/graph.o \ |
| 541 | $(OBJDIR)/gzip.o \ |
| 542 | $(OBJDIR)/http.o \ |
| 543 | $(OBJDIR)/http_socket.o \ |
| @@ -612,10 +629,11 @@ | |
| 629 | ifdef USE_WINDOWS |
| 630 | TRANSLATE = $(subst /,\,$(OBJDIR)/translate) |
| 631 | MAKEHEADERS = $(subst /,\,$(OBJDIR)/makeheaders) |
| 632 | MKINDEX = $(subst /,\,$(OBJDIR)/mkindex) |
| 633 | VERSION = $(subst /,\,$(OBJDIR)/version) |
| 634 | CAT = type |
| 635 | CP = copy |
| 636 | MV = copy |
| 637 | RM = del /Q |
| 638 | MKDIR = -mkdir |
| 639 | RMDIR = rmdir /S /Q |
| @@ -622,10 +640,11 @@ | |
| 640 | else |
| 641 | TRANSLATE = $(OBJDIR)/translate |
| 642 | MAKEHEADERS = $(OBJDIR)/makeheaders |
| 643 | MKINDEX = $(OBJDIR)/mkindex |
| 644 | VERSION = $(OBJDIR)/version |
| 645 | CAT = cat |
| 646 | CP = cp |
| 647 | MV = mv |
| 648 | RM = rm -f |
| 649 | MKDIR = -mkdir -p |
| 650 | RMDIR = rm -rf |
| @@ -731,10 +750,13 @@ | |
| 750 | endif |
| 751 | |
| 752 | setup: $(OBJDIR) $(APPNAME) |
| 753 | $(MAKENSIS) ./setup/fossil.nsi |
| 754 | |
| 755 | innosetup: $(OBJDIR) $(APPNAME) |
| 756 | $(INNOSETUP) ./setup/fossil.iss -DAppVersion=$(shell $(CAT) ./VERSION) |
| 757 | |
| 758 | $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex |
| 759 | $(MKINDEX) $(TRANS_SRC) >$@ |
| 760 | |
| 761 | $(OBJDIR)/headers: $(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h |
| 762 | $(MAKEHEADERS) $(OBJDIR)/add_.c:$(OBJDIR)/add.h \ |
| @@ -765,10 +787,11 @@ | |
| 787 | $(OBJDIR)/encode_.c:$(OBJDIR)/encode.h \ |
| 788 | $(OBJDIR)/event_.c:$(OBJDIR)/event.h \ |
| 789 | $(OBJDIR)/export_.c:$(OBJDIR)/export.h \ |
| 790 | $(OBJDIR)/file_.c:$(OBJDIR)/file.h \ |
| 791 | $(OBJDIR)/finfo_.c:$(OBJDIR)/finfo.h \ |
| 792 | $(OBJDIR)/fusefs_.c:$(OBJDIR)/fusefs.h \ |
| 793 | $(OBJDIR)/glob_.c:$(OBJDIR)/glob.h \ |
| 794 | $(OBJDIR)/graph_.c:$(OBJDIR)/graph.h \ |
| 795 | $(OBJDIR)/gzip_.c:$(OBJDIR)/gzip.h \ |
| 796 | $(OBJDIR)/http_.c:$(OBJDIR)/http.h \ |
| 797 | $(OBJDIR)/http_socket_.c:$(OBJDIR)/http_socket.h \ |
| @@ -1093,10 +1116,18 @@ | |
| 1116 | |
| 1117 | $(OBJDIR)/finfo.o: $(OBJDIR)/finfo_.c $(OBJDIR)/finfo.h $(SRCDIR)/config.h |
| 1118 | $(XTCC) -o $(OBJDIR)/finfo.o -c $(OBJDIR)/finfo_.c |
| 1119 | |
| 1120 | $(OBJDIR)/finfo.h: $(OBJDIR)/headers |
| 1121 | |
| 1122 | $(OBJDIR)/fusefs_.c: $(SRCDIR)/fusefs.c $(OBJDIR)/translate |
| 1123 | $(TRANSLATE) $(SRCDIR)/fusefs.c >$(OBJDIR)/fusefs_.c |
| 1124 | |
| 1125 | $(OBJDIR)/fusefs.o: $(OBJDIR)/fusefs_.c $(OBJDIR)/fusefs.h $(SRCDIR)/config.h |
| 1126 | $(XTCC) -o $(OBJDIR)/fusefs.o -c $(OBJDIR)/fusefs_.c |
| 1127 | |
| 1128 | $(OBJDIR)/fusefs.h: $(OBJDIR)/headers |
| 1129 | |
| 1130 | $(OBJDIR)/glob_.c: $(SRCDIR)/glob.c $(OBJDIR)/translate |
| 1131 | $(TRANSLATE) $(SRCDIR)/glob.c >$(OBJDIR)/glob_.c |
| 1132 | |
| 1133 | $(OBJDIR)/glob.o: $(OBJDIR)/glob_.c $(OBJDIR)/glob.h $(SRCDIR)/config.h |
| 1134 |
+23
| --- win/Makefile.msc | ||
| +++ win/Makefile.msc | ||
| @@ -21,10 +21,13 @@ | ||
| 21 | 21 | # Uncomment to enable JSON API |
| 22 | 22 | # FOSSIL_ENABLE_JSON = 1 |
| 23 | 23 | |
| 24 | 24 | # Uncomment to enable SSL support |
| 25 | 25 | # FOSSIL_ENABLE_SSL = 1 |
| 26 | + | |
| 27 | +# Uncomment to enable TH1 hooks | |
| 28 | +# FOSSIL_ENABLE_TH1_HOOKS = 1 | |
| 26 | 29 | |
| 27 | 30 | # Uncomment to enable Tcl support |
| 28 | 31 | # FOSSIL_ENABLE_TCL = 1 |
| 29 | 32 | |
| 30 | 33 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -79,10 +82,15 @@ | ||
| 79 | 82 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 80 | 83 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 81 | 84 | LIBS = $(LIBS) $(SSLLIB) |
| 82 | 85 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 83 | 86 | !endif |
| 87 | + | |
| 88 | +!ifdef FOSSIL_ENABLE_TH1_HOOKS | |
| 89 | +TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 90 | +RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 | |
| 91 | +!endif | |
| 84 | 92 | |
| 85 | 93 | !ifdef FOSSIL_ENABLE_TCL |
| 86 | 94 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 87 | 95 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 88 | 96 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -136,10 +144,11 @@ | ||
| 136 | 144 | encode_.c \ |
| 137 | 145 | event_.c \ |
| 138 | 146 | export_.c \ |
| 139 | 147 | file_.c \ |
| 140 | 148 | finfo_.c \ |
| 149 | + fusefs_.c \ | |
| 141 | 150 | glob_.c \ |
| 142 | 151 | graph_.c \ |
| 143 | 152 | gzip_.c \ |
| 144 | 153 | http_.c \ |
| 145 | 154 | http_socket_.c \ |
| @@ -248,10 +257,11 @@ | ||
| 248 | 257 | $(OX)\encode$O \ |
| 249 | 258 | $(OX)\event$O \ |
| 250 | 259 | $(OX)\export$O \ |
| 251 | 260 | $(OX)\file$O \ |
| 252 | 261 | $(OX)\finfo$O \ |
| 262 | + $(OX)\fusefs$O \ | |
| 253 | 263 | $(OX)\glob$O \ |
| 254 | 264 | $(OX)\graph$O \ |
| 255 | 265 | $(OX)\gzip$O \ |
| 256 | 266 | $(OX)\http$O \ |
| 257 | 267 | $(OX)\http_socket$O \ |
| @@ -381,10 +391,11 @@ | ||
| 381 | 391 | echo $(OX)\encode.obj >> $@ |
| 382 | 392 | echo $(OX)\event.obj >> $@ |
| 383 | 393 | echo $(OX)\export.obj >> $@ |
| 384 | 394 | echo $(OX)\file.obj >> $@ |
| 385 | 395 | echo $(OX)\finfo.obj >> $@ |
| 396 | + echo $(OX)\fusefs.obj >> $@ | |
| 386 | 397 | echo $(OX)\glob.obj >> $@ |
| 387 | 398 | echo $(OX)\graph.obj >> $@ |
| 388 | 399 | echo $(OX)\gzip.obj >> $@ |
| 389 | 400 | echo $(OX)\http.obj >> $@ |
| 390 | 401 | echo $(OX)\http_socket.obj >> $@ |
| @@ -511,10 +522,11 @@ | ||
| 511 | 522 | clean: |
| 512 | 523 | -del $(OX)\*.obj |
| 513 | 524 | -del *.obj |
| 514 | 525 | -del *_.c |
| 515 | 526 | -del *.h |
| 527 | + -del *.ilk | |
| 516 | 528 | -del *.map |
| 517 | 529 | -del *.res |
| 518 | 530 | -del headers |
| 519 | 531 | -del linkopts |
| 520 | 532 | -del vc*.pdb |
| @@ -521,13 +533,17 @@ | ||
| 521 | 533 | |
| 522 | 534 | realclean: clean |
| 523 | 535 | -del $(APPNAME) |
| 524 | 536 | -del $(PDBNAME) |
| 525 | 537 | -del translate$E |
| 538 | + -del translate$P | |
| 526 | 539 | -del mkindex$E |
| 540 | + -del mkindex$P | |
| 527 | 541 | -del makeheaders$E |
| 542 | + -del makeheaders$P | |
| 528 | 543 | -del mkversion$E |
| 544 | + -del mkversion$P | |
| 529 | 545 | |
| 530 | 546 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 531 | 547 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 532 | 548 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 533 | 549 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| @@ -720,10 +736,16 @@ | ||
| 720 | 736 | $(OX)\finfo$O : finfo_.c finfo.h |
| 721 | 737 | $(TCC) /Fo$@ -c finfo_.c |
| 722 | 738 | |
| 723 | 739 | finfo_.c : $(SRCDIR)\finfo.c |
| 724 | 740 | translate$E $** > $@ |
| 741 | + | |
| 742 | +$(OX)\fusefs$O : fusefs_.c fusefs.h | |
| 743 | + $(TCC) /Fo$@ -c fusefs_.c | |
| 744 | + | |
| 745 | +fusefs_.c : $(SRCDIR)\fusefs.c | |
| 746 | + translate$E $** > $@ | |
| 725 | 747 | |
| 726 | 748 | $(OX)\glob$O : glob_.c glob.h |
| 727 | 749 | $(TCC) /Fo$@ -c glob_.c |
| 728 | 750 | |
| 729 | 751 | glob_.c : $(SRCDIR)\glob.c |
| @@ -1235,10 +1257,11 @@ | ||
| 1235 | 1257 | encode_.c:encode.h \ |
| 1236 | 1258 | event_.c:event.h \ |
| 1237 | 1259 | export_.c:export.h \ |
| 1238 | 1260 | file_.c:file.h \ |
| 1239 | 1261 | finfo_.c:finfo.h \ |
| 1262 | + fusefs_.c:fusefs.h \ | |
| 1240 | 1263 | glob_.c:glob.h \ |
| 1241 | 1264 | graph_.c:graph.h \ |
| 1242 | 1265 | gzip_.c:gzip.h \ |
| 1243 | 1266 | http_.c:http.h \ |
| 1244 | 1267 | http_socket_.c:http_socket.h \ |
| 1245 | 1268 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -21,10 +21,13 @@ | |
| 21 | # Uncomment to enable JSON API |
| 22 | # FOSSIL_ENABLE_JSON = 1 |
| 23 | |
| 24 | # Uncomment to enable SSL support |
| 25 | # FOSSIL_ENABLE_SSL = 1 |
| 26 | |
| 27 | # Uncomment to enable Tcl support |
| 28 | # FOSSIL_ENABLE_TCL = 1 |
| 29 | |
| 30 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -79,10 +82,15 @@ | |
| 79 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 80 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 81 | LIBS = $(LIBS) $(SSLLIB) |
| 82 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 83 | !endif |
| 84 | |
| 85 | !ifdef FOSSIL_ENABLE_TCL |
| 86 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 87 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 88 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -136,10 +144,11 @@ | |
| 136 | encode_.c \ |
| 137 | event_.c \ |
| 138 | export_.c \ |
| 139 | file_.c \ |
| 140 | finfo_.c \ |
| 141 | glob_.c \ |
| 142 | graph_.c \ |
| 143 | gzip_.c \ |
| 144 | http_.c \ |
| 145 | http_socket_.c \ |
| @@ -248,10 +257,11 @@ | |
| 248 | $(OX)\encode$O \ |
| 249 | $(OX)\event$O \ |
| 250 | $(OX)\export$O \ |
| 251 | $(OX)\file$O \ |
| 252 | $(OX)\finfo$O \ |
| 253 | $(OX)\glob$O \ |
| 254 | $(OX)\graph$O \ |
| 255 | $(OX)\gzip$O \ |
| 256 | $(OX)\http$O \ |
| 257 | $(OX)\http_socket$O \ |
| @@ -381,10 +391,11 @@ | |
| 381 | echo $(OX)\encode.obj >> $@ |
| 382 | echo $(OX)\event.obj >> $@ |
| 383 | echo $(OX)\export.obj >> $@ |
| 384 | echo $(OX)\file.obj >> $@ |
| 385 | echo $(OX)\finfo.obj >> $@ |
| 386 | echo $(OX)\glob.obj >> $@ |
| 387 | echo $(OX)\graph.obj >> $@ |
| 388 | echo $(OX)\gzip.obj >> $@ |
| 389 | echo $(OX)\http.obj >> $@ |
| 390 | echo $(OX)\http_socket.obj >> $@ |
| @@ -511,10 +522,11 @@ | |
| 511 | clean: |
| 512 | -del $(OX)\*.obj |
| 513 | -del *.obj |
| 514 | -del *_.c |
| 515 | -del *.h |
| 516 | -del *.map |
| 517 | -del *.res |
| 518 | -del headers |
| 519 | -del linkopts |
| 520 | -del vc*.pdb |
| @@ -521,13 +533,17 @@ | |
| 521 | |
| 522 | realclean: clean |
| 523 | -del $(APPNAME) |
| 524 | -del $(PDBNAME) |
| 525 | -del translate$E |
| 526 | -del mkindex$E |
| 527 | -del makeheaders$E |
| 528 | -del mkversion$E |
| 529 | |
| 530 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 531 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 532 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 533 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| @@ -720,10 +736,16 @@ | |
| 720 | $(OX)\finfo$O : finfo_.c finfo.h |
| 721 | $(TCC) /Fo$@ -c finfo_.c |
| 722 | |
| 723 | finfo_.c : $(SRCDIR)\finfo.c |
| 724 | translate$E $** > $@ |
| 725 | |
| 726 | $(OX)\glob$O : glob_.c glob.h |
| 727 | $(TCC) /Fo$@ -c glob_.c |
| 728 | |
| 729 | glob_.c : $(SRCDIR)\glob.c |
| @@ -1235,10 +1257,11 @@ | |
| 1235 | encode_.c:encode.h \ |
| 1236 | event_.c:event.h \ |
| 1237 | export_.c:export.h \ |
| 1238 | file_.c:file.h \ |
| 1239 | finfo_.c:finfo.h \ |
| 1240 | glob_.c:glob.h \ |
| 1241 | graph_.c:graph.h \ |
| 1242 | gzip_.c:gzip.h \ |
| 1243 | http_.c:http.h \ |
| 1244 | http_socket_.c:http_socket.h \ |
| 1245 |
| --- win/Makefile.msc | |
| +++ win/Makefile.msc | |
| @@ -21,10 +21,13 @@ | |
| 21 | # Uncomment to enable JSON API |
| 22 | # FOSSIL_ENABLE_JSON = 1 |
| 23 | |
| 24 | # Uncomment to enable SSL support |
| 25 | # FOSSIL_ENABLE_SSL = 1 |
| 26 | |
| 27 | # Uncomment to enable TH1 hooks |
| 28 | # FOSSIL_ENABLE_TH1_HOOKS = 1 |
| 29 | |
| 30 | # Uncomment to enable Tcl support |
| 31 | # FOSSIL_ENABLE_TCL = 1 |
| 32 | |
| 33 | !ifdef FOSSIL_ENABLE_SSL |
| @@ -79,10 +82,15 @@ | |
| 82 | TCC = $(TCC) /DFOSSIL_ENABLE_SSL=1 |
| 83 | RCC = $(RCC) /DFOSSIL_ENABLE_SSL=1 |
| 84 | LIBS = $(LIBS) $(SSLLIB) |
| 85 | LIBDIR = $(LIBDIR) /LIBPATH:$(SSLLIBDIR) |
| 86 | !endif |
| 87 | |
| 88 | !ifdef FOSSIL_ENABLE_TH1_HOOKS |
| 89 | TCC = $(TCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 90 | RCC = $(RCC) /DFOSSIL_ENABLE_TH1_HOOKS=1 |
| 91 | !endif |
| 92 | |
| 93 | !ifdef FOSSIL_ENABLE_TCL |
| 94 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL=1 |
| 95 | RCC = $(RCC) /DFOSSIL_ENABLE_TCL=1 |
| 96 | TCC = $(TCC) /DFOSSIL_ENABLE_TCL_STUBS=1 |
| @@ -136,10 +144,11 @@ | |
| 144 | encode_.c \ |
| 145 | event_.c \ |
| 146 | export_.c \ |
| 147 | file_.c \ |
| 148 | finfo_.c \ |
| 149 | fusefs_.c \ |
| 150 | glob_.c \ |
| 151 | graph_.c \ |
| 152 | gzip_.c \ |
| 153 | http_.c \ |
| 154 | http_socket_.c \ |
| @@ -248,10 +257,11 @@ | |
| 257 | $(OX)\encode$O \ |
| 258 | $(OX)\event$O \ |
| 259 | $(OX)\export$O \ |
| 260 | $(OX)\file$O \ |
| 261 | $(OX)\finfo$O \ |
| 262 | $(OX)\fusefs$O \ |
| 263 | $(OX)\glob$O \ |
| 264 | $(OX)\graph$O \ |
| 265 | $(OX)\gzip$O \ |
| 266 | $(OX)\http$O \ |
| 267 | $(OX)\http_socket$O \ |
| @@ -381,10 +391,11 @@ | |
| 391 | echo $(OX)\encode.obj >> $@ |
| 392 | echo $(OX)\event.obj >> $@ |
| 393 | echo $(OX)\export.obj >> $@ |
| 394 | echo $(OX)\file.obj >> $@ |
| 395 | echo $(OX)\finfo.obj >> $@ |
| 396 | echo $(OX)\fusefs.obj >> $@ |
| 397 | echo $(OX)\glob.obj >> $@ |
| 398 | echo $(OX)\graph.obj >> $@ |
| 399 | echo $(OX)\gzip.obj >> $@ |
| 400 | echo $(OX)\http.obj >> $@ |
| 401 | echo $(OX)\http_socket.obj >> $@ |
| @@ -511,10 +522,11 @@ | |
| 522 | clean: |
| 523 | -del $(OX)\*.obj |
| 524 | -del *.obj |
| 525 | -del *_.c |
| 526 | -del *.h |
| 527 | -del *.ilk |
| 528 | -del *.map |
| 529 | -del *.res |
| 530 | -del headers |
| 531 | -del linkopts |
| 532 | -del vc*.pdb |
| @@ -521,13 +533,17 @@ | |
| 533 | |
| 534 | realclean: clean |
| 535 | -del $(APPNAME) |
| 536 | -del $(PDBNAME) |
| 537 | -del translate$E |
| 538 | -del translate$P |
| 539 | -del mkindex$E |
| 540 | -del mkindex$P |
| 541 | -del makeheaders$E |
| 542 | -del makeheaders$P |
| 543 | -del mkversion$E |
| 544 | -del mkversion$P |
| 545 | |
| 546 | $(OBJDIR)\json$O : $(SRCDIR)\json_detail.h |
| 547 | $(OBJDIR)\json_artifact$O : $(SRCDIR)\json_detail.h |
| 548 | $(OBJDIR)\json_branch$O : $(SRCDIR)\json_detail.h |
| 549 | $(OBJDIR)\json_config$O : $(SRCDIR)\json_detail.h |
| @@ -720,10 +736,16 @@ | |
| 736 | $(OX)\finfo$O : finfo_.c finfo.h |
| 737 | $(TCC) /Fo$@ -c finfo_.c |
| 738 | |
| 739 | finfo_.c : $(SRCDIR)\finfo.c |
| 740 | translate$E $** > $@ |
| 741 | |
| 742 | $(OX)\fusefs$O : fusefs_.c fusefs.h |
| 743 | $(TCC) /Fo$@ -c fusefs_.c |
| 744 | |
| 745 | fusefs_.c : $(SRCDIR)\fusefs.c |
| 746 | translate$E $** > $@ |
| 747 | |
| 748 | $(OX)\glob$O : glob_.c glob.h |
| 749 | $(TCC) /Fo$@ -c glob_.c |
| 750 | |
| 751 | glob_.c : $(SRCDIR)\glob.c |
| @@ -1235,10 +1257,11 @@ | |
| 1257 | encode_.c:encode.h \ |
| 1258 | event_.c:event.h \ |
| 1259 | export_.c:export.h \ |
| 1260 | file_.c:file.h \ |
| 1261 | finfo_.c:finfo.h \ |
| 1262 | fusefs_.c:fusefs.h \ |
| 1263 | glob_.c:glob.h \ |
| 1264 | graph_.c:graph.h \ |
| 1265 | gzip_.c:gzip.h \ |
| 1266 | http_.c:http.h \ |
| 1267 | http_socket_.c:http_socket.h \ |
| 1268 |
+5
| --- win/fossil.rc | ||
| +++ win/fossil.rc | ||
| @@ -101,10 +101,15 @@ | ||
| 101 | 101 | VALUE "CommandLineIsUnicode", "Yes\0" |
| 102 | 102 | #endif /* defined(BROKEN_MINGW_CMDLINE) */ |
| 103 | 103 | #if defined(FOSSIL_ENABLE_SSL) |
| 104 | 104 | VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0" |
| 105 | 105 | #endif /* defined(FOSSIL_ENABLE_SSL) */ |
| 106 | +#if defined(FOSSIL_ENABLE_TH1_HOOKS) | |
| 107 | + VALUE "Th1Hooks", "Yes\0" | |
| 108 | +#else | |
| 109 | + VALUE "Th1Hooks", "No\0" | |
| 110 | +#endif | |
| 106 | 111 | #if defined(FOSSIL_ENABLE_TCL) |
| 107 | 112 | VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0" |
| 108 | 113 | #if defined(USE_TCL_STUBS) |
| 109 | 114 | VALUE "UseTclStubsEnabled", "Yes\0" |
| 110 | 115 | #else |
| 111 | 116 |
| --- win/fossil.rc | |
| +++ win/fossil.rc | |
| @@ -101,10 +101,15 @@ | |
| 101 | VALUE "CommandLineIsUnicode", "Yes\0" |
| 102 | #endif /* defined(BROKEN_MINGW_CMDLINE) */ |
| 103 | #if defined(FOSSIL_ENABLE_SSL) |
| 104 | VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0" |
| 105 | #endif /* defined(FOSSIL_ENABLE_SSL) */ |
| 106 | #if defined(FOSSIL_ENABLE_TCL) |
| 107 | VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0" |
| 108 | #if defined(USE_TCL_STUBS) |
| 109 | VALUE "UseTclStubsEnabled", "Yes\0" |
| 110 | #else |
| 111 |
| --- win/fossil.rc | |
| +++ win/fossil.rc | |
| @@ -101,10 +101,15 @@ | |
| 101 | VALUE "CommandLineIsUnicode", "Yes\0" |
| 102 | #endif /* defined(BROKEN_MINGW_CMDLINE) */ |
| 103 | #if defined(FOSSIL_ENABLE_SSL) |
| 104 | VALUE "SslEnabled", "Yes, " OPENSSL_VERSION_TEXT "\0" |
| 105 | #endif /* defined(FOSSIL_ENABLE_SSL) */ |
| 106 | #if defined(FOSSIL_ENABLE_TH1_HOOKS) |
| 107 | VALUE "Th1Hooks", "Yes\0" |
| 108 | #else |
| 109 | VALUE "Th1Hooks", "No\0" |
| 110 | #endif |
| 111 | #if defined(FOSSIL_ENABLE_TCL) |
| 112 | VALUE "TclEnabled", "Yes, Tcl " TCL_PATCH_LEVEL "\0" |
| 113 | #if defined(USE_TCL_STUBS) |
| 114 | VALUE "UseTclStubsEnabled", "Yes\0" |
| 115 | #else |
| 116 |
+7
| --- www/changes.wiki | ||
| +++ www/changes.wiki | ||
| @@ -1,7 +1,14 @@ | ||
| 1 | 1 | <title>Change Log</title> |
| 2 | 2 | |
| 3 | +<h2>Changes For Version 1.30 (as yet unreleased)</h2> | |
| 4 | + * Add setting to control the number of times autosync will be tried before | |
| 5 | + returning an error. | |
| 6 | + * Add the "fossil fusefs DIRECTORY" command that mounts a Fuse Filesystem | |
| 7 | + at the given DIRECTORY and populates it with read-only copies of all | |
| 8 | + historical check-ins. This only works on systems that support FuseFS. | |
| 9 | + | |
| 3 | 10 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 4 | 11 | * Add the ability to display content, diffs and annotations for UTF16 |
| 5 | 12 | text files in the web interface. |
| 6 | 13 | * Add the "SaveAs..." and "Invert" buttons |
| 7 | 14 | to the graphical diff display that results |
| 8 | 15 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,7 +1,14 @@ | |
| 1 | <title>Change Log</title> |
| 2 | |
| 3 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 4 | * Add the ability to display content, diffs and annotations for UTF16 |
| 5 | text files in the web interface. |
| 6 | * Add the "SaveAs..." and "Invert" buttons |
| 7 | to the graphical diff display that results |
| 8 |
| --- www/changes.wiki | |
| +++ www/changes.wiki | |
| @@ -1,7 +1,14 @@ | |
| 1 | <title>Change Log</title> |
| 2 | |
| 3 | <h2>Changes For Version 1.30 (as yet unreleased)</h2> |
| 4 | * Add setting to control the number of times autosync will be tried before |
| 5 | returning an error. |
| 6 | * Add the "fossil fusefs DIRECTORY" command that mounts a Fuse Filesystem |
| 7 | at the given DIRECTORY and populates it with read-only copies of all |
| 8 | historical check-ins. This only works on systems that support FuseFS. |
| 9 | |
| 10 | <h2>Changes For Version 1.29 (2014-06-12)</h2> |
| 11 | * Add the ability to display content, diffs and annotations for UTF16 |
| 12 | text files in the web interface. |
| 13 | * Add the "SaveAs..." and "Invert" buttons |
| 14 | to the graphical diff display that results |
| 15 |